* add support for saving init images in img2img, and record their hashes in infotext for reproducability
* automatically select current word when adjusting weight with ctrl+up/down
* add dropdowns for X/Y/Z plot
* setting: Stable Diffusion/Random number generator source: makes it possible to make images generated from a given manual seed consistent across different GPUs
* support Gradio's theme API
* use TCMalloc on Linux by default; possible fix for memory leaks
* (optimization) option to remove negative conditioning at low sigma values #9177
* embed model merge metadata in .safetensors file
* extension settings backup/restore feature #9169
* add "resize by" and "resize to" tabs to img2img
* add option "keep original size" to textual inversion images preprocess
* image viewer scrolling via analog stick
* button to restore the progress from session lost / tab reload
### Minor:
* gradio bumped to 3.28.1
* in extra tab, change extras "scale to" to sliders
* add labels to tool buttons to make it possible to hide them
* add tiled inference support for ScuNET
* add branch support for extension installation
* change linux installation script to insall into current directory rather than /home/username
* sort textual inversion embeddings by name (case insensitive)
* allow styles.csv to be symlinked or mounted in docker
* remove the "do not add watermark to images" option
* make selected tab configurable with UI config
* extra networks UI in now fixed height and scrollable
* add disable_tls_verify arg for use with self-signed certs
### Extensions:
* Add reload callback
* add is_hr_pass field for processing
### Bug Fixes:
* fix broken batch image processing on 'Extras/Batch Process' tab
* add "None" option to extra networks dropdowns
* fix FileExistsError for CLIP Interrogator
* fix /sdapi/v1/txt2img endpoint not working on Linux #9319
* fix disappearing live previews and progressbar during slow tasks
* fix fullscreen image view not working properly in some cases
* prevent alwayson_scripts args param resizing script_arg list when they are inserted in it
* fix prompt schedule for second order samplers
* fix image mask/composite for weird resolutions #9628
* use correct images for previews when using AND (see #9491)
* one broken image in img2img batch won't stop all processing
* fix image orientation bug in train/preprocess
* fix Ngrok recreating tunnels every reload
* fix --realesrgan-models-path and --ldsr-models-path not working
* fix --skip-install not working
* outpainting Mk2 & Poorman should use the SAMPLE file format to save images, not GRID file format
* do not fail all Loras if some have failed to load when making a picture
@@ -100,7 +100,7 @@ Alternatively, use online services (like Google Colab):
...
@@ -100,7 +100,7 @@ Alternatively, use online services (like Google Colab):
-[List of Online Services](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Online-Services)
-[List of Online Services](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Online-Services)
### Automatic Installation on Windows
### Automatic Installation on Windows
1. Install [Python 3.10.6](https://www.python.org/downloads/windows/), checking "Add Python to PATH".
1. Install [Python 3.10.6](https://www.python.org/downloads/release/python-3106/)(Newer version of Python does not support torch), checking "Add Python to PATH".
"sd_lora":shared.OptionInfo("None","Add Lora to prompt",gr.Dropdown,lambda:{"choices":[""]+[xforxinlora.available_loras]},refresh=lora.list_available_loras),
"sd_lora":shared.OptionInfo("None","Add Lora to prompt",gr.Dropdown,lambda:{"choices":["None"]+[xforxinlora.available_loras]},refresh=lora.list_available_loras),
"\u{1f4cb}":"Apply selected styles to current prompt",
"\u{1f4cb}":"Apply selected styles to current prompt",
"\u{1f4d2}":"Paste available values into the field",
"\u{1f4d2}":"Paste available values into the field",
"\u{1f3b4}":"Show/hide extra networks",
"\u{1f3b4}":"Show/hide extra networks",
"\u{1f300}":"Restore progress",
"Inpaint a part of image":"Draw a mask over an image, and the script will regenerate the masked area with content according to prompt",
"Inpaint a part of image":"Draw a mask over an image, and the script will regenerate the masked area with content according to prompt",
"SD upscale":"Upscale image normally, split result into tiles, improve each tile using img2img, merge whole image back",
"SD upscale":"Upscale image normally, split result into tiles, improve each tile using img2img, merge whole image back",
...
@@ -65,8 +66,8 @@ titles = {
...
@@ -65,8 +66,8 @@ titles = {
"Interrogate":"Reconstruct prompt from existing image and put it into the prompt field.",
"Interrogate":"Reconstruct prompt from existing image and put it into the prompt field.",
"Images filename pattern":"Use following tags to define how filenames for images are chosen: [steps], [cfg], [prompt_hash], [prompt], [prompt_no_styles], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [model_name], [prompt_words], [date], [datetime], [datetime<Format>], [datetime<Format><Time Zone>], [job_timestamp]; leave empty for default.",
"Images filename pattern":"Use following tags to define how filenames for images are chosen: [steps], [cfg], [clip_skip], [batch_number], [generation_number], [prompt_hash], [prompt], [prompt_no_styles], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [model_name], [prompt_words], [date], [datetime], [datetime<Format>], [datetime<Format><Time Zone>], [job_timestamp], [hasprompt<prompt1|default><prompt2>..]; leave empty for default.",
"Directory name pattern":"Use following tags to define how subdirectories for images and grids are chosen: [steps], [cfg],[prompt_hash], [prompt], [prompt_no_styles], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [model_name], [prompt_words], [date], [datetime], [datetime<Format>], [datetime<Format><Time Zone>], [job_timestamp]; leave empty for default.",
"Directory name pattern":"Use following tags to define how subdirectories for images and grids are chosen: [steps], [cfg], [clip_skip], [batch_number], [generation_number], [prompt_hash], [prompt], [prompt_no_styles], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [model_name], [prompt_words], [date], [datetime], [datetime<Format>], [datetime<Format><Time Zone>], [job_timestamp], [hasprompt<prompt1|default><prompt2>..]; leave empty for default.",
"Max prompt words":"Set the maximum number of words to be used in the [prompt_words] option; ATTENTION: If the words are too long, they may exceed the maximum length of the file path that the system can handle",
"Max prompt words":"Set the maximum number of words to be used in the [prompt_words] option; ATTENTION: If the words are too long, they may exceed the maximum length of the file path that the system can handle",
"Loopback":"Performs img2img processing multiple times. Output images are used as input for the next loop.",
"Loopback":"Performs img2img processing multiple times. Output images are used as input for the next loop.",
...
@@ -85,7 +86,6 @@ titles = {
...
@@ -85,7 +86,6 @@ titles = {
"vram":"Torch active: Peak amount of VRAM used by Torch during generation, excluding cached data.\nTorch reserved: Peak amount of VRAM allocated by Torch, including all active and cached data.\nSys VRAM: Peak amount of VRAM allocation across all applications / total GPU VRAM (peak utilization%).",
"vram":"Torch active: Peak amount of VRAM used by Torch during generation, excluding cached data.\nTorch reserved: Peak amount of VRAM allocated by Torch, including all active and cached data.\nSys VRAM: Peak amount of VRAM allocation across all applications / total GPU VRAM (peak utilization%).",
"Eta noise seed delta":"If this values is non-zero, it will be added to seed and used to initialize RNG for noises when using samplers with Eta. You can use this to produce even more variation of images, or you can use this to match images of other software if you know what you are doing.",
"Eta noise seed delta":"If this values is non-zero, it will be added to seed and used to initialize RNG for noises when using samplers with Eta. You can use this to produce even more variation of images, or you can use this to match images of other software if you know what you are doing.",
"Do not add watermark to images":"If this option is enabled, watermark will not be added to created images. Warning: if you do not add watermark, you may be behaving in an unethical manner.",
"Filename word regex":"This regular expression will be used extract words from filename, and they will be joined using the option below into label text used for training. Leave empty to keep filename text as it is.",
"Filename word regex":"This regular expression will be used extract words from filename, and they will be joined using the option below into label text used for training. Leave empty to keep filename text as it is.",
"Filename join string":"This string will be used to join split words into a single line if the option above is enabled.",
"Filename join string":"This string will be used to join split words into a single line if the option above is enabled.",
...
@@ -111,7 +111,8 @@ titles = {
...
@@ -111,7 +111,8 @@ titles = {
"Resize height to":"Resizes image to this height. If 0, height is inferred from either of two nearby sliders.",
"Resize height to":"Resizes image to this height. If 0, height is inferred from either of two nearby sliders.",
"Multiplier for extra networks":"When adding extra network such as Hypernetwork or Lora to prompt, use this multiplier for it.",
"Multiplier for extra networks":"When adding extra network such as Hypernetwork or Lora to prompt, use this multiplier for it.",
"Discard weights with matching name":"Regular expression; if weights's name matches it, the weights is not written to the resulting checkpoint. Use ^model_ema to discard EMA weights.",
"Discard weights with matching name":"Regular expression; if weights's name matches it, the weights is not written to the resulting checkpoint. Use ^model_ema to discard EMA weights.",
"Extra networks tab order":"Comma-separated list of tab names; tabs listed here will appear in the extra networks UI first and in order lsited."
"Extra networks tab order":"Comma-separated list of tab names; tabs listed here will appear in the extra networks UI first and in order lsited.",
"Negative Guidance minimum sigma":"Skip negative prompt for steps where image is already mostly denoised; the higher this value, the more skips there will be; provides increased performance in exchange for minor quality reduction."
print("Installation of xformers is not supported in this version of Python.")
print("Installation of xformers is not supported in this version of Python.")
print("You can also check this and build manually: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers#building-xformers-on-windows-by-duckness")
print("You can also check this and build manually: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers#building-xformers-on-windows-by-duckness")
@@ -95,6 +95,7 @@ parser.add_argument("--cors-allow-origins", type=str, help="Allowed CORS origin(
...
@@ -95,6 +95,7 @@ parser.add_argument("--cors-allow-origins", type=str, help="Allowed CORS origin(
parser.add_argument("--cors-allow-origins-regex",type=str,help="Allowed CORS origin(s) in the form of a single regular expression",default=None)
parser.add_argument("--cors-allow-origins-regex",type=str,help="Allowed CORS origin(s) in the form of a single regular expression",default=None)
parser.add_argument("--tls-keyfile",type=str,help="Partially enables TLS, requires --tls-certfile to fully function",default=None)
parser.add_argument("--tls-keyfile",type=str,help="Partially enables TLS, requires --tls-certfile to fully function",default=None)
parser.add_argument("--tls-certfile",type=str,help="Partially enables TLS, requires --tls-keyfile to fully function",default=None)
parser.add_argument("--tls-certfile",type=str,help="Partially enables TLS, requires --tls-keyfile to fully function",default=None)
parser.add_argument("--disable-tls-verify",action="store_false",help="When passed, enables the use of self-signed certificates.",default=None)
parser.add_argument("--server-name",type=str,help="Sets hostname of server",default=None)
parser.add_argument("--server-name",type=str,help="Sets hostname of server",default=None)
parser.add_argument("--gradio-queue",action='store_true',help="does not do anything",default=True)
parser.add_argument("--gradio-queue",action='store_true',help="does not do anything",default=True)
parser.add_argument("--no-gradio-queue",action='store_true',help="Disables gradio queue; causes the webpage to use http requests instead of websockets; was the defaul in earlier versions")
parser.add_argument("--no-gradio-queue",action='store_true',help="Disables gradio queue; causes the webpage to use http requests instead of websockets; was the defaul in earlier versions")
"ESRGAN_tile_overlap":OptionInfo(8,"Tile overlap, in pixels for ESRGAN upscalers. Low values = visible seam.",gr.Slider,{"minimum":0,"maximum":48,"step":1}),
"ESRGAN_tile_overlap":OptionInfo(8,"Tile overlap, in pixels for ESRGAN upscalers. Low values = visible seam.",gr.Slider,{"minimum":0,"maximum":48,"step":1}),
"realesrgan_enabled_models":OptionInfo(["R-ESRGAN 4x+","R-ESRGAN 4x+ Anime6B"],"Select which Real-ESRGAN models to show in the web UI. (Requires restart)",gr.CheckboxGroup,lambda:{"choices":shared_items.realesrgan_models_names()}),
"realesrgan_enabled_models":OptionInfo(["R-ESRGAN 4x+","R-ESRGAN 4x+ Anime6B"],"Select which Real-ESRGAN models to show in the web UI. (Requires restart)",gr.CheckboxGroup,lambda:{"choices":shared_items.realesrgan_models_names()}),
"upscaler_for_img2img":OptionInfo(None,"Upscaler for img2img",gr.Dropdown,lambda:{"choices":[x.nameforxinsd_upscalers]}),
"upscaler_for_img2img":OptionInfo(None,"Upscaler for img2img",gr.Dropdown,lambda:{"choices":[x.nameforxinsd_upscalers]}),
"SCUNET_tile":OptionInfo(256,"Tile size for SCUNET upscalers. 0 = no tiling.",gr.Slider,{"minimum":0,"maximum":512,"step":16}),
"SCUNET_tile_overlap":OptionInfo(8,"Tile overlap, in pixels for SCUNET upscalers. Low values = visible seam.",gr.Slider,{"minimum":0,"maximum":64,"step":1}),
"comma_padding_backtrack":OptionInfo(20,"Increase coherency by padding from the last comma within n tokens when using more than 75 tokens",gr.Slider,{"minimum":0,"maximum":74,"step":1}),
"comma_padding_backtrack":OptionInfo(20,"Increase coherency by padding from the last comma within n tokens when using more than 75 tokens",gr.Slider,{"minimum":0,"maximum":74,"step":1}),
"upcast_attn":OptionInfo(False,"Upcast cross attention layer to float32"),
"upcast_attn":OptionInfo(False,"Upcast cross attention layer to float32"),
"randn_source":OptionInfo("GPU","Random number generator source. Changes seeds drastically. Use CPU to produce the same picture across different vidocard vendors.",gr.Radio,{"choices":["GPU","CPU"]}),
"use_old_karras_scheduler_sigmas":OptionInfo(False,"Use old karras scheduler sigmas (0.1 to 10)."),
"use_old_karras_scheduler_sigmas":OptionInfo(False,"Use old karras scheduler sigmas (0.1 to 10)."),
"no_dpmpp_sde_batch_determinism":OptionInfo(False,"Do not make DPM++ SDE deterministic across different batch sizes."),
"no_dpmpp_sde_batch_determinism":OptionInfo(False,"Do not make DPM++ SDE deterministic across different batch sizes."),
"use_old_hires_fix_width_height":OptionInfo(False,"For hires fix, use width/height sliders to set final resolution rather than first pass (disables Upscale by, Resize width/height to)."),
"use_old_hires_fix_width_height":OptionInfo(False,"For hires fix, use width/height sliders to set final resolution rather than first pass (disables Upscale by, Resize width/height to)."),
"dont_fix_second_order_samplers_schedule":OptionInfo(False,"Do not fix prompt schedule for second order samplers."),
"extra_networks_card_width":OptionInfo(0,"Card width for Extra Networks (px)"),
"extra_networks_card_width":OptionInfo(0,"Card width for Extra Networks (px)"),
"extra_networks_card_height":OptionInfo(0,"Card height for Extra Networks (px)"),
"extra_networks_card_height":OptionInfo(0,"Card height for Extra Networks (px)"),
"extra_networks_add_text_separator":OptionInfo(" ","Extra text to add before <...> when adding extra network to prompt"),
"extra_networks_add_text_separator":OptionInfo(" ","Extra text to add before <...> when adding extra network to prompt"),
"sd_hypernetwork":OptionInfo("None","Add hypernetwork to prompt",gr.Dropdown,lambda:{"choices":[""]+[xforxinhypernetworks.keys()]},refresh=reload_hypernetworks),
"sd_hypernetwork":OptionInfo("None","Add hypernetwork to prompt",gr.Dropdown,lambda:{"choices":["None"]+[xforxinhypernetworks.keys()]},refresh=reload_hypernetworks),
"dimensions_and_batch_together":OptionInfo(True,"Show Width/Height and Batch sliders in same row"),
"dimensions_and_batch_together":OptionInfo(True,"Show Width/Height and Batch sliders in same row"),
"keyedit_precision_attention":OptionInfo(0.1,"Ctrl+up/down precision when editing (attention:1.1)",gr.Slider,{"minimum":0.01,"maximum":0.2,"step":0.001}),
"keyedit_precision_attention":OptionInfo(0.1,"Ctrl+up/down precision when editing (attention:1.1)",gr.Slider,{"minimum":0.01,"maximum":0.2,"step":0.001}),
"keyedit_precision_extra":OptionInfo(0.05,"Ctrl+up/down precision when editing <extra networks:0.9>",gr.Slider,{"minimum":0.01,"maximum":0.2,"step":0.001}),
"keyedit_precision_extra":OptionInfo(0.05,"Ctrl+up/down precision when editing <extra networks:0.9>",gr.Slider,{"minimum":0.01,"maximum":0.2,"step":0.001}),
"keyedit_delimiters":OptionInfo(".,\/!?%^*;:{}=`~()","Ctrl+up/down word delimiters"),
"disabled_extensions":OptionInfo([],"Disable these extensions"),
"disabled_extensions":OptionInfo([],"Disable these extensions"),
"disable_all_extensions":OptionInfo("none","Disable all extensions (preserves the list of disabled extensions)",gr.Radio,{"choices":["none","extra","all"]}),
"disable_all_extensions":OptionInfo("none","Disable all extensions (preserves the list of disabled extensions)",gr.Radio,{"choices":["none","extra","all"]}),
"restore_config_state_file":OptionInfo("","Config state file to restore from, under 'config-states/' folder"),
"sd_checkpoint_hash":OptionInfo("","SHA256 hash of the current checkpoint"),
"sd_checkpoint_hash":OptionInfo("","SHA256 hash of the current checkpoint"),
returnf"resize: from <span class='resolution'>{p.width}x{p.height}</span> to <span class='resolution'>{p.hr_resize_x or p.hr_upscale_to_x}x{p.hr_resize_y or p.hr_upscale_to_y}</span>"
returnf"resize: from <span class='resolution'>{p.width}x{p.height}</span> to <span class='resolution'>{p.hr_resize_x or p.hr_upscale_to_x}x{p.hr_resize_y or p.hr_upscale_to_y}</span>"
defresize_from_to_html(width,height,scale_by):
target_width=int(width*scale_by)
target_height=int(height*scale_by)
ifnottarget_widthornottarget_height:
return"no image selected"
returnf"resize: from <span class='resolution'>{width}x{height}</span> to <span class='resolution'>{target_width}x{target_height}</span>"
init_img=gr.Image(label="Image for img2img",elem_id="img2img_image",show_label=False,source="upload",interactive=True,type="pil",tool="editor",image_mode="RGBA").style(height=480)
init_img=gr.Image(label="Image for img2img",elem_id="img2img_image",show_label=False,source="upload",interactive=True,type="pil",tool="editor",image_mode="RGBA").style(height=480)
new_hypernetwork_layer_structure=gr.Textbox("1, 2, 1",label="Enter hypernetwork layer structure",placeholder="1st and last digit must be 1. ex:'1, 2, 1'",elem_id="train_new_hypernetwork_layer_structure")
new_hypernetwork_layer_structure=gr.Textbox("1, 2, 1",label="Enter hypernetwork layer structure",placeholder="1st and last digit must be 1. ex:'1, 2, 1'",elem_id="train_new_hypernetwork_layer_structure")
gr.HTML(value="<p style='margin-bottom: 0.7em'>Train an embedding or Hypernetwork; you must specify a directory with a set of 1:1 ratio images <a href=\"https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Textual-Inversion\" style=\"font-weight:bold;\">[wiki]</a></p>")
gr.HTML(value="<p style='margin-bottom: 0.7em'>Train an embedding or Hypernetwork; you must specify a directory with a set of 1:1 ratio images <a href=\"https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Textual-Inversion\" style=\"font-weight:bold;\">[wiki]</a></p>")
reload_script_bodies=gr.Button(value='Reload custom script bodies (No ui updates, No restart)',variant='secondary',elem_id="settings_reload_script_bodies")
reload_script_bodies=gr.Button(value='Reload custom script bodies (No ui updates, No restart)',variant='secondary',elem_id="settings_reload_script_bodies")
...
@@ -1487,7 +1574,7 @@ def create_ui():
...
@@ -1487,7 +1574,7 @@ def create_ui():
unload_sd_model=gr.Button(value='Unload SD checkpoint to free VRAM',elem_id="sett_unload_sd_model")
unload_sd_model=gr.Button(value='Unload SD checkpoint to free VRAM',elem_id="sett_unload_sd_model")
reload_sd_model=gr.Button(value='Reload the last SD checkpoint back into VRAM',elem_id="sett_reload_sd_model")
reload_sd_model=gr.Button(value='Reload the last SD checkpoint back into VRAM',elem_id="sett_reload_sd_model")
available_extensions_index=gr.Text(value="https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui-extensions/master/index.json",label="Extension index URL").style(container=False)
available_extensions_index=gr.Text(value="https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui-extensions/master/index.json",label="Extension index URL").style(container=False)
config_restore_type=gr.Radio(label="State to restore",choices=["extensions","webui","both"],value="extensions",elem_id="extension_backup_restore_type")
withgr.TabItem('Batch from Directory',elem_id="extras_batch_directory_tab")astab_batch_dir:
withgr.TabItem('Batch from Directory',id="batch_from_directory",elem_id="extras_batch_directory_tab")astab_batch_dir:
extras_batch_input_dir=gr.Textbox(label="Input directory",**shared.hide_dirs,placeholder="A directory on the same machine where the server is running.",elem_id="extras_batch_input_dir")
extras_batch_input_dir=gr.Textbox(label="Input directory",**shared.hide_dirs,placeholder="A directory on the same machine where the server is running.",elem_id="extras_batch_input_dir")
extras_batch_output_dir=gr.Textbox(label="Output directory",**shared.hide_dirs,placeholder="Leave blank to save images to the default path.",elem_id="extras_batch_output_dir")
extras_batch_output_dir=gr.Textbox(label="Output directory",**shared.hide_dirs,placeholder="Leave blank to save images to the default path.",elem_id="extras_batch_output_dir")
show_extras_results=gr.Checkbox(label='Show result images',value=True,elem_id="extras_show_extras_results")
show_extras_results=gr.Checkbox(label='Show result images',value=True,elem_id="extras_show_extras_results")