aboutsummaryrefslogtreecommitdiffstats
path: root/modules/shared_options.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2024-02-11 06:39:51 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2024-02-11 06:39:51 +0000
commite2b19900ec37ef517d8175a7d86c1925ca9f9e91 (patch)
tree6fac89794a1a953e42f782c3649b4826dda2332f /modules/shared_options.py
parent3732cf2f97be873f17b735221cca177f056bd478 (diff)
downloadstable-diffusion-webui-gfx803-e2b19900ec37ef517d8175a7d86c1925ca9f9e91.tar.gz
stable-diffusion-webui-gfx803-e2b19900ec37ef517d8175a7d86c1925ca9f9e91.tar.bz2
stable-diffusion-webui-gfx803-e2b19900ec37ef517d8175a7d86c1925ca9f9e91.zip
add infotext entry for emphasis; put emphasis into a separate file, add an option to parse but still ignore emphasis
Diffstat (limited to 'modules/shared_options.py')
-rw-r--r--modules/shared_options.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/shared_options.py b/modules/shared_options.py
index 417a42b2..ba6d731d 100644
--- a/modules/shared_options.py
+++ b/modules/shared_options.py
@@ -1,7 +1,7 @@
import os
import gradio as gr
-from modules import localization, ui_components, shared_items, shared, interrogate, shared_gradio_themes, util
+from modules import localization, ui_components, shared_items, shared, interrogate, shared_gradio_themes, util, sd_emphasis
from modules.paths_internal import models_path, script_path, data_path, sd_configs_path, sd_default_config, sd_model_file, default_sd_model_file, extensions_dir, extensions_builtin_dir, default_output_dir # noqa: F401
from modules.shared_cmd_options import cmd_opts
from modules.options import options_section, OptionInfo, OptionHTML, categories
@@ -154,8 +154,7 @@ options_templates.update(options_section(('sd', "Stable Diffusion", "sd"), {
"sd_checkpoint_cache": OptionInfo(0, "Checkpoints to cache in RAM", gr.Slider, {"minimum": 0, "maximum": 10, "step": 1}).info("obsolete; set to 0 and use the two settings above instead"),
"sd_unet": OptionInfo("Automatic", "SD Unet", gr.Dropdown, lambda: {"choices": shared_items.sd_unet_items()}, refresh=shared_items.refresh_unet_list).info("choose Unet model: Automatic = use one with same filename as checkpoint; None = use Unet from checkpoint"),
"enable_quantization": OptionInfo(False, "Enable quantization in K samplers for sharper and cleaner results. This may change existing seeds").needs_reload_ui(),
- "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"),
- "disable_normalize_embeddings": OptionInfo(False, "Disable normalize embeddings").info("Do not normalize embeddings after calculating emphasis. It can be expected to be effective in preventing artifacts in SDXL."),
+ "emphasis": OptionInfo("Original", "Emphasis mode", gr.Radio, lambda: {"choices": [x.name for x in sd_emphasis.options]}, infotext="Emphasis").info("makes it possible to make model to pay (more:1.1) or (less:0.9) attention to text when you use the syntax in prompt; " + sd_emphasis.get_options_descriptions()),
"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, "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}, infotext="Clip skip").link("wiki", "https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#clip-skip").info("ignore last layers of CLIP network; 1 ignores none, 2 ignores one layer"),