diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-12-03 07:19:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-03 07:19:51 +0000 |
commit | c9a2cfdf2a53d37c2de1908423e4f548088667ef (patch) | |
tree | eabdca1b7665e0ee00f130e9f8544ffd23e474a2 /modules/generation_parameters_copypaste.py | |
parent | 39541d7725bc42f456a604b07c50aba503a5a09a (diff) | |
parent | 5cd5a672f7889dcc018c3873ec557d645ebe35d0 (diff) | |
download | stable-diffusion-webui-gfx803-c9a2cfdf2a53d37c2de1908423e4f548088667ef.tar.gz stable-diffusion-webui-gfx803-c9a2cfdf2a53d37c2de1908423e4f548088667ef.tar.bz2 stable-diffusion-webui-gfx803-c9a2cfdf2a53d37c2de1908423e4f548088667ef.zip |
Merge branch 'master' into racecond_fix
Diffstat (limited to 'modules/generation_parameters_copypaste.py')
-rw-r--r-- | modules/generation_parameters_copypaste.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/generation_parameters_copypaste.py b/modules/generation_parameters_copypaste.py index 985ec95e..44fe1a6c 100644 --- a/modules/generation_parameters_copypaste.py +++ b/modules/generation_parameters_copypaste.py @@ -2,6 +2,8 @@ import base64 import io
import os
import re
+from pathlib import Path
+
import gradio as gr
from modules.shared import script_path
from modules import shared
@@ -35,9 +37,8 @@ def quote(text): def image_from_url_text(filedata):
if type(filedata) == dict and filedata["is_file"]:
filename = filedata["name"]
- tempdir = os.path.normpath(tempfile.gettempdir())
- normfn = os.path.normpath(filename)
- assert normfn.startswith(tempdir), 'trying to open image file not in temporary directory'
+ is_in_right_dir = any(Path(temp_dir).resolve() in Path(filename).resolve().parents for temp_dir in shared.demo.temp_dirs)
+ assert is_in_right_dir, 'trying to open image file outside of allowed directories'
return Image.open(filename)
@@ -73,7 +74,9 @@ def integrate_settings_paste_fields(component_dict): 'sd_hypernetwork': 'Hypernet',
'sd_hypernetwork_strength': 'Hypernet strength',
'CLIP_stop_at_last_layers': 'Clip skip',
+ 'inpainting_mask_weight': 'Conditional mask weight',
'sd_model_checkpoint': 'Model hash',
+ 'eta_noise_seed_delta': 'ENSD',
}
settings_paste_fields = [
(component_dict[k], lambda d, k=k, v=v: ui.apply_setting(k, d.get(v, None)))
@@ -181,6 +184,10 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model else:
res[k] = v
+ # Missing CLIP skip means it was set to 1 (the default)
+ if "Clip skip" not in res:
+ res["Clip skip"] = "1"
+
return res
|