aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorw-e-w <40751091+w-e-w@users.noreply.github.com>2024-01-06 21:41:29 +0900
committerw-e-w <40751091+w-e-w@users.noreply.github.com>2024-01-10 01:56:44 +0900
commit4d9f2c3ec8e791b9c354292c4333fc85b8f8d740 (patch)
tree3510f5ec02fa18d1658ce69adadca7c26efbae45 /modules
parentb00b429477f8962001ddb556b9d543c5dcf34418 (diff)
update p.seed and p.subseed
Diffstat (limited to 'modules')
-rw-r--r--modules/txt2img.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/txt2img.py b/modules/txt2img.py
index c4cc12d2..d22a1f31 100644
--- a/modules/txt2img.py
+++ b/modules/txt2img.py
@@ -67,13 +67,16 @@ def txt2img_upscale(id_task: str, request: gr.Request, gallery, gallery_index, g
geninfo = json.loads(generation_info)
all_seeds = geninfo["all_seeds"]
+ all_subseeds = geninfo["all_subseeds"]
image_info = gallery[gallery_index] if 0 <= gallery_index < len(gallery) else gallery[0]
p.firstpass_image = infotext_utils.image_from_url_text(image_info)
gallery_index_from_end = len(gallery) - gallery_index
seed = all_seeds[-gallery_index_from_end if gallery_index_from_end < len(all_seeds) + 1 else 0]
- p.script_args = modules.scripts.scripts_txt2img.set_named_arg(p.script_args, 'ScriptSeed', 'seed', seed)
+ subseed = all_subseeds[-gallery_index_from_end if gallery_index_from_end < len(all_seeds) + 1 else 0]
+ p.seed = seed
+ p.subseed = subseed
with closing(p):
processed = modules.scripts.scripts_txt2img.run(p, *p.script_args)