aboutsummaryrefslogtreecommitdiffstats
path: root/modules/shared.py
diff options
context:
space:
mode:
authorGerschel <Gerschel_Payne@hotmail.com>2023-02-06 16:18:04 +0000
committerGerschel <Gerschel_Payne@hotmail.com>2023-02-06 16:18:04 +0000
commit5d483bf307c766aee97caec857d414946fad47db (patch)
tree500535fbebe327de651d9878b98d7024a8578079 /modules/shared.py
parentea9bd9fc7409109adcd61b897abc2c8881161256 (diff)
downloadstable-diffusion-webui-gfx803-5d483bf307c766aee97caec857d414946fad47db.tar.gz
stable-diffusion-webui-gfx803-5d483bf307c766aee97caec857d414946fad47db.tar.bz2
stable-diffusion-webui-gfx803-5d483bf307c766aee97caec857d414946fad47db.zip
aspect ratio for dim's; sliders adjust by ratio
Default choices added to settings in user interface section Choices are editable by user User selects from dropdown. When you move one slider, the other adjusts according to the ratio chosen. Vice versa for the other slider. Number fields for changes work as well. For disabling ratio, an unlock pad "🔓" is available as a default. This string can be changed to anything to serve as a disable, as long as there is no colon ":". Ratios are entered in this format, floats or ints with a colon "1:1". The string is split at the colon, parses left and right as floats to perform the math.
Diffstat (limited to 'modules/shared.py')
-rw-r--r--modules/shared.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/shared.py b/modules/shared.py
index 79fbf724..ead7be36 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -139,6 +139,19 @@ ui_reorder_categories = [
"scripts",
]
+aspect_ratio_defaults = [
+ "🔓"
+ "1:1",
+ "1:2",
+ "2:1",
+ "2:3",
+ "3:2",
+ "4:3",
+ "5:4",
+ "9:16",
+ "16:9",
+]
+
cmd_opts.disable_extension_access = (cmd_opts.share or cmd_opts.listen or cmd_opts.server_name) and not cmd_opts.enable_insecure_extension_access
devices.device, devices.device_interrogate, devices.device_gfpgan, devices.device_esrgan, devices.device_codeformer = \
@@ -456,6 +469,7 @@ options_templates.update(options_section(('ui', "User interface"), {
"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}),
"quicksettings": OptionInfo("sd_model_checkpoint", "Quicksettings list"),
"ui_reorder": OptionInfo(", ".join(ui_reorder_categories), "txt2img/img2img UI item order"),
+ "aspect_ratios": OptionInfo(", ".join(aspect_ratio_defaults), "txt2img/img2img aspect ratios"),
"ui_extra_networks_tab_reorder": OptionInfo("", "Extra networks tab order"),
"localization": OptionInfo("None", "Localization (requires restart)", gr.Dropdown, lambda: {"choices": ["None"] + list(localization.localizations.keys())}, refresh=lambda: localization.list_localizations(cmd_opts.localizations_dir)),
}))