Commit Graph

237 Commits

Author SHA1 Message Date
Qualzz
5d1558f2b4
Concept library improvements (#1314)
* corrupted pngs handling

* hide search label

* clear cache button
2022-09-25 20:23:19 +01:00
Chris Heald
c7e126f6f8
Updates for the v2 trainer
* Restore --config. This will be useful when you have an init config
  that you don't want overwritten.
* Cache the individual transformed images in TextualInversionDataset.
  This gains speed by avoiding reading and reprocessing the image each
  time it's used for training.
* Turn on no_grad for inference and clean up tensors during
  checkpointing. This reduces memory usage slightly.
* Set the sample output size to 384x384. We just need them large enough
  for manual evaluation, and this gains us a decent chunk of speed.
* (breaking change) Custom templates are now semicolon-delineated.
  Additionally, custom templates are properly passed through to
  TextualInversionDataset to generate input_ids for your images. Using
  custom templates which accurately describe your input images seems to
  improve training fidelity.
* Cache autoencoding of image pixel data. This substantially increases
  the speed of training, upwards of 40% for me.
* Clean up a little bit of cruft.
2022-09-25 13:21:24 +01:00
hlky
0d79243e45
fix diffusers_textual_inversion_2.py conflicts step 1 2022-09-25 13:20:17 +01:00
ZeroCool940711
a1fff59a73 Fixed "device" not being on server_state. 2022-09-25 03:55:16 -07:00
ZeroCool940711
47df4681ee Reduced the folder name a bit more to help with long paths on windows. 2022-09-25 01:44:34 -07:00
ZeroCool940711
4e34a987e1 Added customizable value for the concepts per page option on the concepts library tab. 2022-09-25 01:17:14 -07:00
ZeroCool940711
7084e94bdf Moved the model to server_state instead of session_state so it can be shared between multiple sessions, tabs and users as long as the streamlit server is running. 2022-09-25 00:03:05 -07:00
ZeroCool940711
86505f16ed Moved the pipe model to server_state instead of session_state so it can be shared between multiple sessions, tabs and users as long as the streamlit server is running. 2022-09-24 23:28:02 -07:00
ZeroCool940711
7c24e6f620 Moved the models as well as other static parameters to the server_state instead of session_state. 2022-09-24 23:23:55 -07:00
ZeroCool
a64f9a22b0
Merge branch 'dev' into img2img-esrgan-fix 2022-09-24 18:26:54 -07:00
ZeroCool940711
d7d0ad97c3 Changed some PIL stuff to use resampling to avoid some warnings on the console 2022-09-24 18:06:24 -07:00
ZeroCool940711
9c12a6a322 Changed the search bar text_input widget to have a label as its not allowed to be empty on streamlit 1.13.0 and will give a warning and possible an error later. 2022-09-24 18:05:08 -07:00
ZeroCool940711
b8b9df717a Removed some unused functions and code so we can upgrade streamlit to version 1.13.0. 2022-09-24 18:04:21 -07:00
Seacant
bb029225d6 Fixed Streamlit bug where RealESRGAN seemed broke
There was a safety check where RealESRGAN and loopback
were not allowed to be on at the same time to prevent
rapidly growing images (I think, at least) which was
causing confusion in the UI since there was no indication
this wasn't allowed. Using ESRGAN just on the final iteration
should be safe, so this commit enables that.
2022-09-25 01:01:25 +00:00
ZeroCool940711
23070de38d Added info text to let the user now that the other setting pages are still under construction. 2022-09-24 17:18:29 -07:00
ZeroCool940711
3816b28d2c Fixed error with CustomModel_available not being in session_state after the Settings page change. 2022-09-24 15:27:09 -07:00
ZeroCool940711
0f9f7c382b First implementation of the Settings page. 2022-09-24 05:30:16 -07:00
ZeroCool940711
37b2090844 Added message to tell user that the textual inversion page is under construction instead of having it empty. 2022-09-24 05:28:54 -07:00
ZeroCool940711
d584fa28eb Added condition to make sure the userconfig_streamlit.yaml file is created if it doesnt exist. 2022-09-24 05:19:13 -07:00
ZeroCool940711
6a7de2066f Removed script from before the code split that is no longer needed. 2022-09-24 05:15:18 -07:00
ZeroCool940711
9b73f463cf - Added function to convert bytes to a human readable string.
- Added basic implementation of "enable_minimal_memory_usage".
2022-09-24 05:11:33 -07:00
ZeroCool940711
1c459bce53 - Added individual titles on the browser tab for each page.
- Added basic url for each page to the address bar for browser history.
2022-09-23 22:07:50 -07:00
ZeroCool940711
8cf8d3f03a Added simple function to allows to change the title of the app dynamically instead of only doing it once per app, this could be useful for setting the title on specific pages and making it appear on the browser history. 2022-09-23 21:19:50 -07:00
xaedes
70acb61c21
remove wrong arguments from save_sample call (#1290)
fixes #1258
2022-09-24 01:29:12 +01:00
Qualzz
6ae84c6c3a
better library browser (#1281)
* better library browser

* removed debug prints
2022-09-24 00:20:51 +01:00
hlky
f6215a5bb1
remove unused scripts 2022-09-23 15:31:07 +01:00
hlky
8b4464a706
Add periodic checkpointing
Update diffusers_textual_inversion_2.py
2022-09-23 15:29:08 +01:00
Colton
f0be43d7df
Send the image grid to the front end if generated for a prompt matrix (#1200) 2022-09-23 14:32:36 +03:00
Qualzz
75eac9c5c0
moved pagination logic before the rendering of the component (#1268) 2022-09-22 23:09:42 +03:00
ZeroCool940711
e49699a65e Basic code for the streamlit textual inversion page. 2022-09-22 01:44:35 -07:00
ZeroCool940711
889256d26e Improved the script that downloads the concepts library from huggingface in case someone wants to use it. 2022-09-22 00:02:44 -07:00
ZeroCool940711
3cd91bde82 The denoising_strength slider on img2img is now customizable using the config file. 2022-09-21 14:58:49 -07:00
ZeroCool940711
2c7b22a540 The Find Noise Steps slider om img2img can now be customizable from the config file. 2022-09-21 00:39:27 -07:00
ZeroCool940711
e874a2d6a7 Added condition to check if the concepts library folder exist and if not tell the user where to download the concepts from. 2022-09-20 22:15:49 -07:00
ZeroCool940711
8584205e11 Added implementation of the Concepts Library tab made by @Qualzz. 2022-09-20 21:06:00 -07:00
ZeroCool940711
f99657241d Fixed the image not been decoded in txt2vid if the Update Image Preview options was not checked. 2022-09-20 17:07:38 -07:00
hlky
ba84d28da2
txt2vid fix enumerate(... max_frames)) -> enumerate(... num_steps)) 2022-09-20 14:00:08 +01:00
Thomas Mello
3705f296c6
fix: division by zero, inefficient preview check (#1230) 2022-09-19 21:05:18 +03:00
hlky
c6bf0d2ecb
Update diffusers_textual_inversion_2.py 2022-09-19 14:49:00 +01:00
hlky
91c0d0f20b
Create diffusers_textual_inversion_2.py 2022-09-19 13:09:45 +01:00
ZeroCool940711
56ae22eb53 - Improved optimized mode for txt2img, it should be able to generate high resolution images using less VRAM than before.
- Improved txt2vid so its now possible to generate high resolution images with less VRAM than before.
- Added condition to ensure that the pipe model from txt2vid is removed from memory when switching from the txt2vid tab to txt2img and viceversa.
2022-09-19 00:02:21 -07:00
ZeroCool940711
1d9ef57802 Fixed the filename of the video generated at the end of a txt2vid generation, it was saved as test.mp before but now its saved as seed_prompt.mp4 with the seed and prompt form the generation. 2022-09-18 18:29:19 -07:00
ZeroCool940711
a7d7955721 GFPGAN can now be used on the txt2vid tab. 2022-09-18 15:17:02 -07:00
ZeroCool940711
db0eb80728 Fixed typo on the sd-concepts-library path. 2022-09-18 14:20:13 -07:00
ZeroCool940711
1b1f784a76 Every slider min, max and step values as well as its default value is now configurable through the config file. 2022-09-18 11:11:23 -07:00
ZeroCool940711
fdd0c38ac2 Added missing sd_concept_library.py file. 2022-09-18 09:15:05 -07:00
hlky
6f4a1d8a41
slider_steps and slider_bounds in defaults config
slider_steps and slider_bounds in defaults config
2022-09-18 12:23:51 +01:00
Thomas Mello
afe954d4e9 Merge remote-tracking branch 'upstream/dev' into the-merge 2022-09-18 13:03:19 +03:00
Dekker3D
56b91b8bdc
Streamlit txt2img page settings now follow defaults (#1195)
* Some options on the Streamlit txt2img page now follow the defaults from the relevant config files.

* Fixed a copy-paste gone wrong in my previous commit.

* st.session_state["defaults"] fix

Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
2022-09-18 10:39:30 +01:00
protoplm
e4d82f4e84
Used loaded_model state variable in .yaml generation (#1196)
Used loaded_model state variable in .yaml generation
2022-09-18 10:34:37 +01:00
Thomas Mello
148c41826b Merge branch 'dev' into the-merge
# Conflicts:
#	.gitignore
#	README.md
#	configs/webui/webui_streamlit.yaml
#	environment.yaml
#	frontend/css/streamlit.main.css
#	frontend/frontend.py
#	scripts/webui_streamlit.py
2022-09-18 12:31:17 +03:00
hlky
4680975ae1
st.session_state["defaults"] fix 2022-09-18 09:57:33 +01:00
hlky
745e1cc2e1
Temporarily hide sd_concept_library due to missing layout() 2022-09-18 04:21:35 +01:00
ZeroCool940711
997eb12733 Basic implementation for the Concept Library tab made by cloning the Home tab. 2022-09-17 19:02:40 -07:00
ZeroCool940711
cd4396d1da Added option to enable enable_attention_slicing and enable_minimal_memory_usage, this for now only works on txt2vid which uses diffusers. 2022-09-17 16:49:42 -07:00
ZeroCool940711
c35e5804c2 Added a config option to use embeddings from the huggingface stable diffusion concept library. 2022-09-17 15:25:55 -07:00
Chris Heald
27c8134547 Display the final image before running postprocessing, and don't preview when i=0 2022-09-16 18:25:08 -07:00
Chris Heald
d53643822d Collect images for final display
This is a collection of several changes to enhance image display:

* When using GFPGAN or RealESRGAN, only the final output will be
  displayed.
* In batch>1 mode, each final image will be collected into an image grid
  for display
* The image is constrained to a reasonable size to ensure that batch
  grids of RealESRGAN'd images don't end up spitting out a massive image
  that the browser then has to handle.
* Additionally, the progress bar indicator is updated as each image is
  post-processed.
2022-09-16 17:39:46 -07:00
ZeroCool
419f3f9474
Merge branch 'dev' into fix-preview-error 2022-09-16 16:36:55 -07:00
Chris Heald
0cf3d1b0ef When early terminating, generation_callback gets invoked but st.session_state is empty. When this happens, just bail. 2022-09-16 16:29:10 -07:00
ZeroCool
ac99b657d2
Merge pull request #1187 from cheald/enable-batch-preview
When running a batch with preview turned on, produce a grid of previe…
2022-09-16 16:27:43 -07:00
Chris Heald
c1ab63c284 When running a batch with preview turned on, produce a grid of preview images 2022-09-16 16:12:52 -07:00
Chris Heald
d22cf56395
Don't attempt mask restoration when there is no mask given (#1186) 2022-09-16 23:56:09 +03:00
hlky
b856a91ec8
allow webp uploads to img2img tab #991 2022-09-16 20:55:58 +01:00
bryanlyon
b5462536f8
Fixed decimal prompt weights without leading digit (#1182)
The regex was not accounting properly for prompt weights that didn't begin with a leading number such as .5 or .1 and was instead splitting those off into their own prompt which got everything all screwed up.

For example, the prompt string of "Fruit:1 grapes:-.5" should parse as
[('Fruit', 1.0), ('grapes', -.5)]
but was being incorrectly parsed as
[('Fruit', 1.0), ('grapes', 1.0), ('-.5', 1.0)]

This fixes that by making the regex properly catch decimals.
2022-09-16 20:42:41 +01:00
xaedes
4efe62b31a
add missing argument to GoBig sample function, fixes #1183 (#1184) 2022-09-16 20:40:30 +01:00
ZeroCool940711
ef2da42489 - Bumped the version of diffusers used on the txt2vid tab to be now v0.3.0.
- Added initial file for the textual inversion tab.
2022-09-16 11:50:22 -07:00
Charles Galant
d293073e67 Enable negative prompts on streamlit 2022-09-16 13:25:25 -04:00
ZeroCool
9a6b2173a5
Merge branch 'dev' into gallery-fixes 2022-09-16 04:21:58 -07:00
ZeroCool
e65b8d0b8a
Merge branch 'dev' into fix-find-noise 2022-09-16 04:15:11 -07:00
ZeroCool940711
0645c7cf64 - Increased the max value for the width and height sliders on the txt2img tab.
- Fixed a leftover line from removing the home tab.
2022-09-15 17:18:36 -07:00
ZeroCool940711
88ae534693 Fixed a missing import on the ModelManager script. 2022-09-15 14:27:13 -07:00
ZeroCool940711
eb545c1229 Removed the Home tab until the gallery is fixed. 2022-09-15 14:23:09 -07:00
Chris Heald
51a973929c Fix invalid invocation of find_noise_for_image 2022-09-15 12:48:35 -07:00
Chris Heald
d2f339061b Fix the gallery back/next buttons and add a refresh button 2022-09-15 12:45:45 -07:00
Chris Heald
8a25dcc332 Fix errors rendering galleries when there are not enough images to render 2022-09-15 11:06:56 -07:00
ZeroCool940711
4068d804ad - Added the Home tab made by @devilismyfriend
- Added gallery tab on txt2img.
2022-09-15 06:29:41 -07:00
ZeroCool940711
d93065bb95 Added streamlit_nested_layout component as dependency and imported on the webui_streamli.py file to allow us to use nested columns and expanders. 2022-09-15 03:48:55 -07:00
protoplm
6a19a73388 Fixed update_preview_frequency and update_preview using defaults from
webui_streamlit.yaml instead of state variables from UI.
2022-09-14 23:03:55 -04:00
protoplm
ca6fb326f3 Formatted tabs as spaces 2022-09-14 20:17:07 -04:00
protoplm
4f7adcaf42 Corrected breaking issues introduced in #1136 to txt2img and
made state variables consistent with img2img.

Fixed a bug where switching models after running would not reload
the used model.
2022-09-14 19:59:53 -04:00
ZeroCool940711
3e6a8cc185 Small fix to the custom model list. 2022-09-14 15:18:37 -07:00
ZeroCool940711
02fe63acb2 Added custom models list to the txt2img tab. 2022-09-14 14:48:13 -07:00
cobryan05
81f58d58d0
Re-merge #611 - View/Cancel in-progress diffusions (#796)
* JobManager: Re-merge #611

PR #611 seems to have got lost in the shuffle after
the transition to 'dev'.

This commit re-merges the feature branch. This adds
support for viewing preview images as the image
generates, as well as cancelling in-progress images
and a couple fixes and clean-ups.

* JobManager: Clear jobs that fail to start

Sometimes if a job fails to start it will get stuck in the active job
list. This commit ensures that jobs that raise exceptions are cleared,
and also adds a start timer to clear out jobs that fail to start
within a reasonable amount of time.
2022-09-14 23:48:56 +03:00
ZeroCool940711
3675b566a4 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	scripts/img2img.py
#	scripts/sd_utils.py
#	scripts/txt2img.py
2022-09-14 11:39:21 -07:00
ZeroCool940711
dbbed38c8c - Fixed max_frame not being properly used and instead sampling_steps was the variable being use.
- Fixed several issues with wrong variable being used on multiple places.
- Addd option to toggle some extra option from the config file for when the model is loading on the txt2vid tab.
2022-09-14 11:34:24 -07:00
ZeroCool940711
4c46633572 Fixed defaults not being loaded correctly or missing in some places. 2022-09-14 09:26:23 -07:00
Thomas Mello
8df0b1a26d temp disable nvml support for multiple gpus 2022-09-14 18:41:42 +03:00
Thomas Mello
ede81bdc5c fix: [streamlit] optimization mode 2022-09-14 18:22:24 +03:00
ZeroCool940711
ed1ebc129c Modified the way the defaults settings are loaded from the config file so we only load them on the webui_strealit.py file and use st.session_state to access them from anywhere else, this makes it so the config can be modified externally like before the code split and the changes will be updated on next rerun of the UI. 2022-09-14 06:40:56 -07:00
ZeroCool
df2c3188c2
Merge branch 'sd-webui:dev' into dev 2022-09-14 06:03:18 -07:00
ZeroCool940711
6a79ea930b Removed condition to check if the defaults are in the st.session_state dictionary, this is not needed and would cause issues with it not being reloaded when the user changes something on it. 2022-09-14 05:58:01 -07:00
unnamedplugins
6ce25a8e0f Merge branch 'dev' of github.com:sd-webui/stable-diffusion-webui into dev 2022-09-14 08:48:21 -04:00
ZeroCool940711
9246692072 Moved defaults to the webui_streamlit.py file and fixed some imports. 2022-09-14 04:19:24 -07:00
ZeroCool940711
1afc89e0d1 Made the defaults settings from the config file be stored inside st.session_state to avoid loading it multiple times when calling the "sd_utils.py" file from other modules. 2022-09-14 03:48:29 -07:00
ZeroCool940711
ef6b39ab6d Fixed the info message on the txt2img tab not showing the info but just showing the text "Done" 2022-09-14 03:20:19 -07:00
ZeroCool940711
d2b3900647 Fixed some imports. 2022-09-14 02:52:02 -07:00
ZeroCool940711
374b144e77 - Added the functions to load the optimized models, this "should" make it so optimized and turbo mode work now but needs to be tested more.
- Added function to load LDSR.
2022-09-14 02:46:01 -07:00
ZeroCool940711
2e684f948f Removed the "find_noise_for_image.py" and "matched_noise.py" scripts as their content is now part of "sd_utils.py" 2022-09-14 02:02:11 -07:00
ZeroCool940711
71be8f09f2 Forgot to call the layout() for the Model Manager tab after the import so it was not been used and the tab was shown as empty. 2022-09-13 23:02:16 -07:00