فهرست منبع

Merge pull request #14598 from AUTOMATIC1111/fix-txt2img_upscale

hires button, fix seeds
AUTOMATIC1111 1 سال پیش
والد
کامیت
85bf2eb441
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      modules/txt2img.py

+ 4 - 1
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)
     geninfo = json.loads(generation_info)
     all_seeds = geninfo["all_seeds"]
     all_seeds = geninfo["all_seeds"]
+    all_subseeds = geninfo["all_subseeds"]
 
 
     image_info = gallery[gallery_index] if 0 <= gallery_index < len(gallery) else gallery[0]
     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)
     p.firstpass_image = infotext_utils.image_from_url_text(image_info)
 
 
     gallery_index_from_end = len(gallery) - gallery_index
     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]
     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):
     with closing(p):
         processed = modules.scripts.scripts_txt2img.run(p, *p.script_args)
         processed = modules.scripts.scripts_txt2img.run(p, *p.script_args)