fix prompts-from-file batch save metadata misalignment

The script concatenated each per-line result's images and infotexts INCLUDING the per-line grid, while all_seeds/all_prompts hold only real images and the final Processed gets index_of_first_image=0. With batch count > 1 the interleaved grids shift every index, so the manual save button writes neighboring images' metadata and filenames (and indexes past the end of infotexts for the last image). Slice each per-line result from proc.index_of_first_image so grids never enter the combined result and all lists stay 1:1 with the gallery. Fixes #2385.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
QualiaRain
2026-06-11 02:56:36 -04:00
parent d38feefebd
commit d361705280
+2 -2
View File
@@ -148,8 +148,8 @@ class PromptsFromFileScript(scripts_manager.Script):
all_seeds += proc.all_seeds
all_prompts += proc.all_prompts
all_negative += proc.all_negative_prompts
images += proc.images
infotexts += proc.infotexts
images += proc.images[proc.index_of_first_image:]
infotexts += proc.infotexts[proc.index_of_first_image:]
if state.interrupted:
break
return get_processed(p, images, p.seed, "", all_prompts=all_prompts, all_seeds=all_seeds, all_negative_prompts=all_negative, infotexts=infotexts)