@@ -137,3 +137,14 @@ class UpscalerScuNET(modules.upscaler.Upscaler):
model=model.to(device)
returnmodel
defon_ui_settings():
importgradioasgr
frommodulesimportshared
shared.opts.add_option("SCUNET_tile",shared.OptionInfo(256,"Tile size for SCUNET upscalers.",gr.Slider,{"minimum":0,"maximum":512,"step":16},section=('upscaling',"Upscaling")).info("0 = no tiling"))
shared.opts.add_option("SCUNET_tile_overlap",shared.OptionInfo(8,"Tile overlap for SCUNET upscalers.",gr.Slider,{"minimum":0,"maximum":64,"step":1},section=('upscaling',"Upscaling")).info("Low values = visible seam"))
"save_mask_composite":OptionInfo(False,"For inpainting, save a masked composite"),
"jpeg_quality":OptionInfo(80,"Quality for saved jpeg images",gr.Slider,{"minimum":1,"maximum":100,"step":1}),
"webp_lossless":OptionInfo(False,"Use lossless compression for webp images"),
"export_for_4chan":OptionInfo(True,"If the saved image file size is above the limit, or its either width or height are above the limit, save a downscaled copy as JPG"),
"export_for_4chan":OptionInfo(True,"Save copy of large images as JPG").info("if the file size is above the limit, or either width or height are above the limit"),
"img_downscale_threshold":OptionInfo(4.0,"File size limit for the above option, MB",gr.Number),
"target_side_length":OptionInfo(4000,"Width/height limit for the above option, in pixels",gr.Number),
"img_max_size_mp":OptionInfo(200,"Maximum image size, in megapixels",gr.Number),
"ESRGAN_tile":OptionInfo(192,"Tile size for ESRGAN upscalers. 0 = no tiling.",gr.Slider,{"minimum":0,"maximum":512,"step":16}),
"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()}),
"ESRGAN_tile":OptionInfo(192,"Tile size for ESRGAN upscalers.",gr.Slider,{"minimum":0,"maximum":512,"step":16}).info("0 = no tiling"),
"ESRGAN_tile_overlap":OptionInfo(8,"Tile overlap for ESRGAN upscalers.",gr.Slider,{"minimum":0,"maximum":48,"step":1}).info("Low values = visible seam"),
"realesrgan_enabled_models":OptionInfo(["R-ESRGAN 4x+","R-ESRGAN 4x+ Anime6B"],"Select which Real-ESRGAN models to show in the web UI.",gr.CheckboxGroup,lambda:{"choices":shared_items.realesrgan_models_names()}),
"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}),
"sd_vae":OptionInfo("Automatic","SD VAE",gr.Dropdown,lambda:{"choices":shared_items.sd_vae_items()},refresh=shared_items.refresh_vae_list).info("choose VAE model: Automatic = use one with same filename as checkpoint; None = use VAE from checkpoint"),
"sd_vae_as_default":OptionInfo(True,"Ignore selected VAE for stable diffusion checkpoints that have their own .vae.pt next to them"),
"initial_noise_multiplier":OptionInfo(1.0,"Noise multiplier for img2img",gr.Slider,{"minimum":0.5,"maximum":1.5,"step":0.01}),
"img2img_color_correction":OptionInfo(False,"Apply color correction to img2img results to match original colors."),
"img2img_fix_steps":OptionInfo(False,"With img2img, do exactly the amount of steps the slider specifies (normally you'd do less with less denoising)."),
"img2img_fix_steps":OptionInfo(False,"With img2img, do exactly the amount of steps the slider specifies.").info("normally you'd do less with less denoising"),
"img2img_background_color":OptionInfo("#ffffff","With img2img, fill image's transparent parts with this color.",ui_components.FormColorPicker,{}),
"enable_quantization":OptionInfo(False,"Enable quantization in K samplers for sharper and cleaner results. This may change existing seeds. Requires restart to apply."),
"enable_emphasis":OptionInfo(True,"Emphasis: use (text) to make model pay more attention to text and [text] to make it pay less attention"),
"enable_emphasis":OptionInfo(True,"Enable emphasis").info("use (text) to make model pay more attention to text and [text] to make it pay less attention"),
"enable_batch_seeds":OptionInfo(True,"Make K-diffusion samplers produce same images in a batch as when making a single image"),
"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,"Prompt word wrap length limit",gr.Slider,{"minimum":0,"maximum":74,"step":1}).info("in tokens - for texts shorter than specified, if they don't fit into 75 token limit, move them to the next 75 token chunk"),
"CLIP_stop_at_last_layers":OptionInfo(1,"Clip skip",gr.Slider,{"minimum":1,"maximum":12,"step":1}).link("wiki","https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#clip-skip").info("ignore last layers of CLIP nrtwork; 1 ignores none, 2 ignores one layer"),
"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"]}),
"randn_source":OptionInfo("GPU","Random number generator source.",gr.Radio,{"choices":["GPU","CPU"]}).info("changes seeds drastically; use CPU to produce the same picture across different vidocard vendors"),
"interrogate_keep_models_in_memory":OptionInfo(False,"Interrogate: keep models in VRAM"),
"interrogate_return_ranks":OptionInfo(False,"Interrogate: include ranks of model tags matches in results (Has no effect on caption-based interrogators)."),
"interrogate_clip_num_beams":OptionInfo(1,"Interrogate: num_beams for BLIP",gr.Slider,{"minimum":1,"maximum":16,"step":1}),
"extra_networks_default_view":OptionInfo("cards","Default view for Extra Networks",gr.Dropdown,{"choices":["cards","thumbs"]}),
"extra_networks_default_multiplier":OptionInfo(1.0,"Multiplier for extra networks",gr.Slider,{"minimum":0.0,"maximum":1.0,"step":0.01}),
"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_add_text_separator":OptionInfo(" ","Extra text to add before <...> when adding extra network to prompt"),
"extra_networks_card_width":OptionInfo(0,"Card width for Extra Networks").info("in pixels"),
"extra_networks_card_height":OptionInfo(0,"Card height for Extra Networks").info("in pixels"),
"extra_networks_add_text_separator":OptionInfo(" ","Extra networks separator").info("extra text to add before <...> when adding extra network to prompt"),
"sd_hypernetwork":OptionInfo("None","Add hypernetwork to prompt",gr.Dropdown,lambda:{"choices":["None",*hypernetworks]},refresh=reload_hypernetworks),
"js_modal_lightbox_gamepad":OptionInfo(True,"Navigate image viewer with gamepad"),
"js_modal_lightbox_gamepad_repeat":OptionInfo(250,"Gamepad repeat period, in milliseconds"),
"show_progress_in_title":OptionInfo(True,"Show generation progress in window title."),
"samplers_in_dropdown":OptionInfo(True,"Use dropdown for sampler selection instead of radio group"),
"dimensions_and_batch_together":OptionInfo(True,"Show Width/Height and Batch sliders in same row"),
"samplers_in_dropdown":OptionInfo(True,"Use dropdown for sampler selection instead of radio group").needs_restart(),
"dimensions_and_batch_together":OptionInfo(True,"Show Width/Height and Batch sliders in same row").needs_restart(),
"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_delimiters":OptionInfo(".,\\/!?%^*;:{}=`~()","Ctrl+up/down word delimiters"),
"quicksettings_list":OptionInfo(["sd_model_checkpoint"],"Quicksettings list",ui_components.DropdownMulti,lambda:{"choices":list(opts.data_labels.keys())}).js("info","settingsHintsShowQuicksettings").info("setting entries that appear at the top of page rather than in settings tab").needs_restart(),
"show_progress_grid":OptionInfo(True,"Show previews of all images generated in a batch as a grid"),
"show_progress_every_n_steps":OptionInfo(10,"Show new live preview image every N sampling steps. Set to -1 to show after completion of batch.",gr.Slider,{"minimum":-1,"maximum":32,"step":1}),
"show_progress_every_n_steps":OptionInfo(10,"Live preview display period",gr.Slider,{"minimum":-1,"maximum":32,"step":1}).info("in sampling steps - show new live preview image every N sampling steps; -1 = only show after completion of batch"),
"show_progress_type":OptionInfo("Approx NN","Live preview method",gr.Radio,{"choices":["Full","Approx NN","Approx cheap"]}).info("Full = slow but pretty; Approx NN = fast but low quality; Approx cheap = super fast but terrible otherwise"),
"hide_samplers":OptionInfo([],"Hide samplers in user interface (requires restart)",gr.CheckboxGroup,lambda:{"choices":[x.nameforxinlist_samplers()]}),
"eta_ddim":OptionInfo(0.0,"eta (noise multiplier) for DDIM",gr.Slider,{"minimum":0.0,"maximum":1.0,"step":0.01}),
"eta_ancestral":OptionInfo(1.0,"eta (noise multiplier) for ancestral samplers",gr.Slider,{"minimum":0.0,"maximum":1.0,"step":0.01}),
"hide_samplers":OptionInfo([],"Hide samplers in user interface",gr.CheckboxGroup,lambda:{"choices":[x.nameforxinlist_samplers()]}).needs_restart(),
"eta_ddim":OptionInfo(0.0,"Eta for DDIM",gr.Slider,{"minimum":0.0,"maximum":1.0,"step":0.01}).info("noise multiplier; higher = more unperdictable results"),
"eta_ancestral":OptionInfo(1.0,"Eta for ancestral samplers",gr.Slider,{"minimum":0.0,"maximum":1.0,"step":0.01}).info("noise multiplier; applies to Euler a and other samplers that have a in them"),
"ddim_discretize":OptionInfo('uniform',"img2img DDIM discretize",gr.Radio,{"choices":['uniform','quad']}),
'eta_noise_seed_delta':OptionInfo(0,"Eta noise seed delta",gr.Number,{"precision":0}).info("ENSD; does not improve anything, just produces different results for ancestral samplers - only useful for reproducing images"),