aboutsummaryrefslogtreecommitdiffstats
path: root/modules/generation_parameters_copypaste.py
diff options
context:
space:
mode:
authorCodeHatchling <steve@codehatch.com>2023-12-05 03:38:13 +0000
committerCodeHatchling <steve@codehatch.com>2023-12-05 03:38:13 +0000
commit38864816fa8c83d079a49f94674ca3dede9dcaad (patch)
treedfd1b97ad7c5c66ffc5c8641c6e7cc635441e82b /modules/generation_parameters_copypaste.py
parent49bbf1140731036875573bb7c44aa7e74623c856 (diff)
parent22e23dbf29b0bbc807daa57318c31145f8dd0774 (diff)
downloadstable-diffusion-webui-gfx803-38864816fa8c83d079a49f94674ca3dede9dcaad.tar.gz
stable-diffusion-webui-gfx803-38864816fa8c83d079a49f94674ca3dede9dcaad.tar.bz2
stable-diffusion-webui-gfx803-38864816fa8c83d079a49f94674ca3dede9dcaad.zip
Merge remote-tracking branch 'origin2/dev' into soft-inpainting
# Conflicts: # modules/processing.py
Diffstat (limited to 'modules/generation_parameters_copypaste.py')
-rw-r--r--modules/generation_parameters_copypaste.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/generation_parameters_copypaste.py b/modules/generation_parameters_copypaste.py
index 0a606515..4efe53e0 100644
--- a/modules/generation_parameters_copypaste.py
+++ b/modules/generation_parameters_copypaste.py
@@ -1,3 +1,4 @@
+from __future__ import annotations
import base64
import io
import json
@@ -15,9 +16,6 @@ re_imagesize = re.compile(r"^(\d+)x(\d+)$")
re_hypernet_hash = re.compile("\(([0-9a-f]+)\)$")
type_of_gr_update = type(gr.update())
-paste_fields = {}
-registered_param_bindings = []
-
class ParamBinding:
def __init__(self, paste_button, tabname, source_text_component=None, source_image_component=None, source_tabname=None, override_settings_component=None, paste_field_names=None):
@@ -30,6 +28,10 @@ class ParamBinding:
self.paste_field_names = paste_field_names or []
+paste_fields: dict[str, dict] = {}
+registered_param_bindings: list[ParamBinding] = []
+
+
def reset():
paste_fields.clear()
registered_param_bindings.clear()
@@ -113,7 +115,6 @@ def register_paste_params_button(binding: ParamBinding):
def connect_paste_params_buttons():
- binding: ParamBinding
for binding in registered_param_bindings:
destination_image_component = paste_fields[binding.tabname]["init_img"]
fields = paste_fields[binding.tabname]["fields"]
@@ -313,6 +314,9 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
if "VAE Decoder" not in res:
res["VAE Decoder"] = "Full"
+ skip = set(shared.opts.infotext_skip_pasting)
+ res = {k: v for k, v in res.items() if k not in skip}
+
return res
@@ -443,3 +447,4 @@ def connect_paste(button, paste_fields, input_comp, override_settings_component,
outputs=[],
show_progress=False,
)
+