From d3617052806e1a04bb29a4d084f7df6396c45864 Mon Sep 17 00:00:00 2001 From: QualiaRain <44004657+QualiaRain@users.noreply.github.com> Date: Thu, 11 Jun 2026 02:56:36 -0400 Subject: [PATCH] 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 --- scripts/prompts_from_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py index 64474be6a..3b5548b60 100644 --- a/scripts/prompts_from_file.py +++ b/scripts/prompts_from_file.py @@ -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)