aboutsummaryrefslogtreecommitdiffstats
path: root/modules/shared.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-10-07 07:17:52 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-10-07 07:17:52 +0000
commitbad7cb29cecac51c5c0f39afec332b007ed73133 (patch)
tree4d042c9fd673bcf110b0ac746db8205ce16c9bae /modules/shared.py
parent2995107fa24cfd72b0a991e18271dcde148c2807 (diff)
downloadstable-diffusion-webui-gfx803-bad7cb29cecac51c5c0f39afec332b007ed73133.tar.gz
stable-diffusion-webui-gfx803-bad7cb29cecac51c5c0f39afec332b007ed73133.tar.bz2
stable-diffusion-webui-gfx803-bad7cb29cecac51c5c0f39afec332b007ed73133.zip
added support for hypernetworks (???)
Diffstat (limited to 'modules/shared.py')
-rw-r--r--modules/shared.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/shared.py b/modules/shared.py
index 25bb6e6c..879d8424 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -13,7 +13,7 @@ import modules.memmon
import modules.sd_models
import modules.styles
import modules.devices as devices
-from modules import sd_samplers
+from modules import sd_samplers, hypernetwork
from modules.paths import models_path, script_path, sd_path
sd_model_file = os.path.join(script_path, 'model.ckpt')
@@ -76,6 +76,12 @@ parallel_processing_allowed = not cmd_opts.lowvram and not cmd_opts.medvram
config_filename = cmd_opts.ui_settings_file
+hypernetworks = hypernetwork.load_hypernetworks(os.path.join(models_path, 'hypernetworks'))
+
+
+def selected_hypernetwork():
+ return hypernetworks.get(opts.sd_hypernetwork, None)
+
class State:
interrupted = False
@@ -206,6 +212,7 @@ options_templates.update(options_section(('system', "System"), {
options_templates.update(options_section(('sd', "Stable Diffusion"), {
"sd_model_checkpoint": OptionInfo(None, "Stable Diffusion checkpoint", gr.Dropdown, lambda: {"choices": modules.sd_models.checkpoint_tiles()}),
+ "sd_hypernetwork": OptionInfo("None", "Stable Diffusion finetune hypernetwork", gr.Dropdown, lambda: {"choices": ["None"] + [x for x in hypernetworks.keys()]}),
"img2img_color_correction": OptionInfo(False, "Apply color correction to img2img results to match original colors."),
"save_images_before_color_correction": OptionInfo(False, "Save a copy of image before applying color correction to img2img results"),
"img2img_fix_steps": OptionInfo(False, "With img2img, do exactly the amount of steps the slider specifies (normally you'd do less with less denoising)."),