Commit Graph

392 Commits

Author SHA1 Message Date
Lucas Czernohorsky
f630ee5c90 draggable number input component small fixes and visual improvements.
fixed drag being blocked by "press enter to apply" text.
2022-10-20 11:39:09 +02:00
ZeroCool940711
2fc7a8817f Added placeholder for the API Server. 2022-10-19 19:55:34 -07:00
ZeroCool940711
5a23cb2aae Few other fixes for missing imports. 2022-10-19 12:44:56 -07:00
ZeroCool940711
aa85b25f65 Added reraise and logger catch to the settings layout function. 2022-10-19 11:18:06 -07:00
ZeroCool940711
7a2376a590 Fixed a weird error with collections.abc not being found some times, this is most likely related to one of the libraries we use but to fix it temporarily we need to import it before anything else. 2022-10-19 11:17:20 -07:00
ZeroCool940711
345ea8623f Added implementation made by @NaMJaG for key phrase suggestions under the prompt. 2022-10-19 07:56:36 -07:00
hlky
5236d859e5
img2img cfg_scale value 2022-10-19 14:49:03 +01:00
ZeroCool940711
528d95085f Removed some backslashes to comply with codefactor as they are redundant. 2022-10-18 05:54:14 -07:00
ZeroCool940711
908aa0647c Added version control and management for the user and defaults config file. 2022-10-18 05:49:30 -07:00
ZeroCool940711
774073c8c3 Changed CFG scale to be a number_input instead of a slider. 2022-10-17 18:02:51 -07:00
ZeroCool940711
27c13fb625 Improved logging for img2txt. 2022-10-17 15:59:29 -07:00
ZeroCool940711
e524f690b9 Moved the logger.py file again to the scripts folder instead of bein on its own folder. 2022-10-17 15:59:15 -07:00
ZeroCool940711
f893e85b5c Added hydrus_api library which will be used to query hydrus for tags. 2022-10-17 05:11:01 -07:00
ZeroCool940711
68a8fc26d6 Added reraise option for loguru. 2022-10-17 05:10:06 -07:00
ZeroCool940711
ef0b5f4c3e Added reraise option for loguru. 2022-10-17 05:09:47 -07:00
Divided by Zer0
2ea0e6b7d8 logger improvements 2022-10-16 01:59:39 +02:00
Divided by Zer0
974743fbcc logger import 2022-10-16 01:38:36 +02:00
ZeroCool940711
b8d634455b Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	scripts/sd_utils.py
#	scripts/txt2img.py
2022-10-15 15:41:16 -07:00
ZeroCool940711
d3e22998af Added option to run the generation using Stable Horde instead of the local GPU. 2022-10-15 15:37:04 -07:00
ZeroCool940711
c509a961cb Removed decorest. 2022-10-15 09:32:15 -07:00
ZeroCool940711
2fcad23c77 Replaced most if not all print statements with loguru to make the console output easier to understand and just look better overall. 2022-10-15 09:32:15 -07:00
ZeroCool940711
03ab7c0716 Added threading support for the horde bridge. 2022-10-15 09:32:15 -07:00
ZeroCool940711
9901b15948 Added logger using loguru from the logger.py.
- From now on it will create a folder called "logs" with the current time on each launch and then save a log file with anything we want to log there including exceptions from streamlit.
2022-10-15 09:32:15 -07:00
ZeroCool940711
5b728ce803 Fixed logger.level() error when using the logger module with streamlit. It was getting loaded twice and so giving some errors because of this. 2022-10-15 09:32:15 -07:00
ZeroCool940711
1513632063 Forced page rerun when hitting the reset button on the Settings page. 2022-10-15 09:32:15 -07:00
ZeroCool940711
bd03ad4671 Added some defaults to txt2img when we execute it on run_bridge so it doenst save any image from the horde to our hard drive. 2022-10-15 09:32:15 -07:00
ZeroCool940711
94084b2104 Removed decorest. 2022-10-15 09:29:38 -07:00
ZeroCool940711
e7106a052d Replaced most if not all print statements with loguru to make the console output easier to understand and just look better overall. 2022-10-15 05:34:07 -07:00
ZeroCool940711
1e1bf226a4 Added threading support for the horde bridge. 2022-10-15 04:13:38 -07:00
ZeroCool940711
ed0d6b1968 Added logger using loguru from the logger.py.
- From now on it will create a folder called "logs" with the current time on each launch and then save a log file with anything we want to log there including exceptions from streamlit.
2022-10-15 04:12:55 -07:00
ZeroCool940711
764a43270e Fixed logger.level() error when using the logger module with streamlit. It was getting loaded twice and so giving some errors because of this. 2022-10-15 02:17:31 -07:00
ZeroCool940711
d92dfb897e Forced page rerun when hitting the reset button on the Settings page. 2022-10-15 02:05:30 -07:00
ZeroCool940711
5703941398 Added some defaults to txt2img when we execute it on run_bridge so it doenst save any image from the horde to our hard drive. 2022-10-15 00:09:20 -07:00
Divided by Zer0
28cbaf1499 verbsotiy 2022-10-14 23:27:37 +02:00
Divided by Zer0
2641ff60a8 wip 2022-10-14 22:41:59 +02:00
Divided by Zer0
d11eac1c4f indent 2022-10-14 22:31:16 +02:00
Divided by Zer0
616d586acf wip 2022-10-14 22:27:56 +02:00
ZeroCool940711
8d2cf46fbc Added first implementation to support the stable horde bridge on the streamlit version. 2022-10-14 12:09:47 -07:00
ZeroCool940711
a74d9685ff Fixed issue when hydralit was not enabled. 2022-10-12 12:58:40 -07:00
ZeroCool940711
863082cc0f Disabled the hydralit loader for full page when first opened. 2022-10-12 12:00:06 -07:00
ZeroCool940711
3cb9b62130 Added config option to enable or disable hydralit. 2022-10-12 11:03:59 -07:00
ZeroCool940711
ffdcbb4504 Fixed issue with the do_loop option after it was removed. 2022-10-12 00:08:38 -07:00
ZeroCool940711
67f4c27ea2 Improved hot reloading for some model options like optimized and float16. 2022-10-11 22:33:28 -07:00
ZeroCool940711
1cc22b0984 Add option to select between lerp and slerp in txt2vid 2022-10-11 22:33:28 -07:00
MechanoPixel
2215a3b403
Skip WebUI prompt if --bridge passed, Detailed error messages if bridgeData.py fails to load (#1483)
# Description

Please include:
- [x] relevant motivation
- [x] a summary of the change
- [ ] which issue is fixed.
- [x] any additional dependencies that are required for this change.

Fixes a small typo of "Bridg" in horde_bridge.sh
Makes webui.sh skip asking for StreamLit/Gradio if --bridge is passed
More detailed error messages if bridgeData.py is missing/malformed
(previously it would only say no bridgeData found, which caused
confusion when bridgeData did exist but was incorrectly formatted)

# Checklist:

- [x] I have changed the base branch to `dev`
- [x] I have performed a self-review of my own code
- [x] I have commented my code in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation

Co-authored-by: mechanopixel <takatarumc@gmail.com>
2022-10-11 13:23:04 +03:00
ZeroCool940711
1bc6c9b6db You can now change the optimized mode, float16 and no_half options without having to restart the app. 2022-10-10 20:45:37 -07:00
ZeroCool940711
e235a2fd76 Fixed the beta start and beta end format. It was been converted to int by number_input instead of using text_input. 2022-10-10 03:46:16 -07:00
ZeroCool940711
3adca938f1 Added exception handling for the model args option as it can sometimes not work properly and throw an error. 2022-10-09 15:40:07 -07:00
ZeroCool940711
84479d88b8 Changed the prompt text_input for a text_area and made it similar in size to the text input. 2022-10-09 03:21:06 -07:00
ZeroCool940711
fe6e72fde7 Added save_video_on_stop option to the Settings page, this option is used to save the txt2vid generated video to disk when we hit the stop button mid generation. 2022-10-07 23:49:19 -07:00
ZeroCool940711
63b2ff22c6 Added the ability to save the video during mid generation when we hit the stop button.
- Fixed GFPGAN not working on txt2vid.
2022-10-07 23:49:19 -07:00
ZeroCool940711
ac2d348f04 Fixed "expected scalar type Half but found Float" on txt2vid. 2022-10-07 20:32:02 -07:00
ZeroCool940711
55b39b53bc Changed some more text_input to number_input and made sure they return the right value type. 2022-10-07 17:57:06 -07:00
ZeroCool940711
45976077c0 Changed the image preview frequency field to only allow positive values. 2022-10-07 16:59:29 -07:00
ZeroCool940711
e95385e27e Fixed use of multiple spaces after some operators. 2022-10-06 23:45:55 -07:00
cstueckrath
c8740fadb4
fix type error 2022-10-07 08:12:28 +02:00
ZeroCool940711
ad94cc17a6 Changed some more text_input to number_input. 2022-10-06 02:08:29 -07:00
ZeroCool940711
321b110a75 Changed img2img st.slider to st.number_input as its easier to use and more flexible than a slider. 2022-10-06 01:46:41 -07:00
ZeroCool940711
c60626d076 Changed Settings st.slider as well as some st.text_input to st.number_input. 2022-10-06 01:46:24 -07:00
ZeroCool940711
f415dad27e Changed txt2img st.slider to st.number_input as its easier to use and more flexible than a slider. 2022-10-06 01:45:47 -07:00
ZeroCool940711
2fa1b07d6f Changed txt2vid st.slider to st.number_input as its easier to use and more flexible than a slider. 2022-10-06 01:45:24 -07:00
ZeroCool940711
fd2cdd60e2 Added extra models back to img2txt. 2022-10-05 23:48:32 -07:00
ZeroCool940711
27a3e8de89 Fixed hard coded separators. 2022-10-05 23:48:18 -07:00
ZeroCool940711
a4b7efe04d Walk the directory for GFPGAN so we can also get the older models in case we have more than one, this allow us to compare multiple versions to see how they perform against each other. 2022-10-05 23:47:58 -07:00
ZeroCool940711
173d527979 Force model availability, if inside a condition they will only be checked once so in order to see new models you would need to restart streamlit. 2022-10-05 23:47:05 -07:00
hlky
c2f1970e6b
convert pt embed to bin 2022-10-06 02:40:36 +01:00
Kasiya13
24509a647e
Settings and defaults for upscaling (#1435)
-Changes wording on Memory Monitor to not alarm users (happened a few
times)
-Adds config settings "use_upscaling" and "upscaling_method" to settings
menu, were already in yaml
2022-10-05 22:23:31 +03:00
Thomas Mello
1b59570773
fix: LDSR loading (#1433) 2022-10-05 20:50:05 +03:00
Divided by Zer0
fe9fb596e5
Adds more NSFW controls to the horde worker (#1426)
Allows worker to specify a word blacklist which it will refuse to pickup

Allows the worker to specify a word censorlist, against which it will
always apply the NSFW filter, even if the worker accepts NSFW.

Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
Co-authored-by: lukas5450 <46075099+lukas5450@users.noreply.github.com>
Co-authored-by: JamDon2 <hello@jamdon2.dev>
2022-10-05 13:55:04 +01:00
hlky
c1e97c8bcc
img2txt speed + vram issues 2022-10-05 05:31:20 +01:00
hlky
cd700692eb
KeyError: 'pipe' 2022-10-05 05:29:10 +01:00
hlky
b650c162e6
src->models 2022-10-05 01:03:06 +01:00
hlky
8cef7c8762
requests instead of wget
weird bug with wget for some urls because it can't detect the filename, even though we provide a filename
2022-10-04 23:08:24 +01:00
hlky
3851fcc537
model manager
model manager
2022-10-04 19:39:52 +01:00
ZeroCool940711
b28784d163 Merge remote-tracking branch 'origin/dev' into dev 2022-10-04 09:04:41 -07:00
hlky
4208ad00bc
Update img2txt.py
// is not a comment
2022-10-04 11:43:36 +01:00
Divided by Zer0
e33d093fa8
Added batch/shell script to explicitly start the stable horde bridge (#1413)
So that people can start it from the file browser/explorer
2022-10-04 11:07:09 +01:00
ZeroCool940711
d89b019b72 Models from the Model Manager are now stored inside the config file. This allow us to have them as global variables inside streamlit and have them unified in a single place. 2022-10-03 13:14:49 -07:00
ZeroCool940711
01ec29b641 Merge remote-tracking branch 'origin/dev' into dev 2022-10-03 08:58:45 -07:00
ZeroCool940711
3b104987bb Fixed error when selecting LDSR without GFPGAN enabled. 2022-10-03 08:58:37 -07:00
Divided by Zer0
9ec4b672a2
Fix infinite loop on bridge mode when seed == 0 (#1406)
The bridge will keep looping on the same generation because the
evaluation of "while not seed" will always be False when seed is 0 (or
00000000 etc)

This fixes this. Also allows to request more verbosity on the webui
command

Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
Co-authored-by: lukas5450 <46075099+lukas5450@users.noreply.github.com>
2022-10-03 09:26:26 +01:00
ZeroCool940711
c3b43dc836 Added LDSR to model manager. 2022-10-02 21:57:26 -07:00
ZeroCool940711
2a078d5657 Fixed missing keys on first run, it seems related to server_state doing a rerun in the background on first run which changes the first session_state initialization, this causes it to be empty until the second run. 2022-10-02 21:50:24 -07:00
ZeroCool940711
f866ffdad4 Fixed multiple settings and default values not working properly. 2022-10-02 21:25:41 -07:00
ZeroCool940711
393a695aef Fixed LDSR, now it should work both txt2img and img2img 2022-10-02 20:26:01 -07:00
ZeroCool940711
f5254de10a Merge remote-tracking branch 'origin/dev' into dev 2022-10-02 13:43:37 -07:00
hlky
0050d54a1a default=false 2022-10-02 21:20:46 +01:00
ZeroCool940711
0f648e808a Merge remote-tracking branch 'origin/dev' into dev 2022-10-02 13:14:16 -07:00
ZeroCool940711
7354c901d2 Fixed LDSR not working on txt2img and img2img.
- Removed the checkbox to disable the preview image, instead users should increase the frequency at which it is displayed if they have performance issues, after a certain point it no longer affects performance.
2022-10-02 13:10:17 -07:00
xaedes
a88cf2a22c
Add metadata to scn2img intermediate image output (#1386)
# Description

Intermediate image saving in scn2img tries to save metadata which is not
set. This results in warning thrown in console: "Couldn't find metadata
on image", originally reported by @codedealer in
https://github.com/sd-webui/stable-diffusion-webui/pull/1179#pullrequestreview-1120015859

Metadata for intermediate images is added to fix the warning.

Following metadata is written:
- "prompt" contains the representation of the SceneObject corresponding
to the intermediate image
- "seed" contains the seed at the start of the function that generated
this intermediate image
- "width" and "height" contain the size of the image.

To get the seed at the start of the render function without using it, a
class SeedGenerator is added and used instead of the python generator
functions.

Fixes warning thrown in console: "> Couldn't find metadata on image",
originally reported by @codedealer in
https://github.com/sd-webui/stable-diffusion-webui/pull/1179#pullrequestreview-1120015859

# Checklist:

- [x] I have changed the base branch to `dev`
- [x] I have performed a self-review of my own code
- [x] I have commented my code in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
2022-10-02 20:56:49 +01:00
Divided by Zer0
bb8850b9dd
Allows passing args to webui.sh and webui.cmd (#1385)
This change helps with starting the stable horde bridge, without having
to change the relauncher.py every time. It also allows one to start
multiple bridges (for multiple GPUs) by passing the `-n` argument to the
.cmd/.sh
2022-10-02 19:24:23 +01:00
Alejandro Gil
fdf600b49a
Merge branch 'sd-webui:dev' into dev 2022-10-02 11:00:24 -07:00
ZeroCool940711
e950720f9e Updated the model manager with the new locations and models links. 2022-10-02 10:59:20 -07:00
xaedes
33b896d0cb
Scene-to-Image Prompt Layering System (#1179)
# Summary of the change

- new Scene-to-Image tab
- new scn2img function
- functions for loading and running monocular_depth_estimation with
tensorflow

# Description

(relevant motivation, which issue is fixed)

Related to discussion #925

> Would it be possible to have a layers system where we could do have
foreground, mid, and background objects which relate to one another and
share the style? So we could say generate a landscape, one another layer
generate a castle, and on another layer generate a crowd of people.

To make this work I made a prompt-based layering system in a new
"Scene-to-Image" tab.
You write a a multi-line prompt that looks like markdown, where each
section declares one layer.
It is hierarchical, so each layer can have their own child layers.

Examples: https://imgur.com/a/eUxd5qn
![](https://i.imgur.com/L61w00Q.png)

In the frontend you can find a brief documentation for the syntax,
examples and reference for the various arguments.

Here a short summary:

Sections with "prompt" and child layers are img2img, without child
layers they are txt2img.
Without "prompt" they are just images, useful for mask selection, image
composition, etc.
Images can be initialized with "color", resized with "resize" and their
position specified with "pos".
Rotation and rotation center are "rotation" and "center". 

Mask can automatically be selected by color or by estimated depth based
on https://huggingface.co/spaces/atsantiago/Monocular_Depth_Filter.

![](https://i.imgur.com/8rMHWmZ.png)

# Additional dependencies that are required for this change

For mask selection by monocular depth estimation tensorflow is required
and the model must be cloned to ./src/monocular_depth_estimation/
Changes in environment.yaml:
- einops>=0.3.0
- tensorflow>=2.10.0 

Einops must be allowed to be newer for tensorflow to work.

# Checklist:

- [x] I have changed the base branch to `dev`
- [x] I have performed a self-review of my own code
- [x] I have commented my code in hard-to-understand areas
- [x] I have made corresponding changes to the documentation

Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
2022-10-02 18:23:37 +01:00
Divided by Zer0
5853f3e1a1
Stable Horde bridge (#1204)
# Adds the bridge code which when enabled turns the webui into a
headless [Stable Horde](https://stablehorde.net) instance

It adds a few new command-line args to be able to pass variables to the
bridge, as well as the possibility to set it via a variables files
`bridgeData.py`.

To start the bridge, one needs to add the `--bridge` argument to their
relauncher.py as well as any horde vars they want to specify.

On top of that this adds the loguru module as well as my tuned loguru
config. This provides a much nicer logging output and provides the
capability to save output to files for issue reports etc. For now only
the bridge is utilizing the nice format, but once it's merged, you can
start replacing `print()` with `logger.xxx()` where appropriate

To make the bridge work, I've had to add defaults to txt2img but this
should not affect anything.


# Checklist:

- [ x ] I have changed the base branch to `dev`
- [ x ] I have performed a self-review of my own code
- [ x ] I have commented my code in hard-to-understand areas
- [ x ] I have made corresponding changes to the documentation

Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
Co-authored-by: Thomas Mello <work.mello@gmail.com>
Co-authored-by: Joshua Kimsey <jkimsey95@gmail.com>
Co-authored-by: ZeroCool <ZeroCool940711@users.noreply.github.com>
2022-10-02 18:22:27 +01:00
ZeroCool940711
4e0511dbac Changed the default output folder to be shorter. 2022-10-02 09:46:30 -07:00
ZeroCool940711
91957dab34 Fixed GFPGAN upscaling at the end of the generation as well as doing the face restoratin.
- Added default values to some functions arguments to make them optional.
2022-10-02 07:54:56 -07:00
ZeroCool940711
02432b4b39 Improved the Settings page layout and code structure. 2022-10-02 06:59:29 -07:00
Joshua Kimsey
61f0281dac
Merge branch 'dev' into expand-settings-page 2022-10-02 04:25:11 -04:00
Joshua Kimsey
802355b683 Finished Adding Settings Components
Repetitive Actions Are Repetitive
2022-10-02 04:24:50 -04:00