Skip to content

Commit

Permalink
fix img2img batch error when "Show original image" is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ototadana committed Aug 24, 2023
1 parent 5a900ec commit f39af51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/use_cases/image_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ def __init__(self, workflow: WorkflowManager) -> None:
self.workflow = workflow

def proc_images(self, o: StableDiffusionProcessing, res: Processed, option: Option):
edited_images, all_seeds, all_prompts, infotexts = [], [], [], []
edited_images, all_seeds, all_prompts, all_negative_prompts, infotexts = [], [], [], [], []
seed_index = 0
subseed_index = 0

self.__extend_infos(res.all_prompts, len(res.images))
self.__extend_infos(res.all_negative_prompts, len(res.images))
self.__extend_infos(res.all_seeds, len(res.images))
self.__extend_infos(res.infotexts, len(res.images))

Expand All @@ -62,6 +63,7 @@ def proc_images(self, o: StableDiffusionProcessing, res: Processed, option: Opti
edited_images.extend(proc.images)
all_seeds.extend(proc.all_seeds)
all_prompts.extend(proc.all_prompts)
all_negative_prompts.extend(proc.all_negative_prompts)
infotexts.extend(proc.infotexts)

if res.index_of_first_image == 1:
Expand All @@ -73,11 +75,13 @@ def proc_images(self, o: StableDiffusionProcessing, res: Processed, option: Opti
res.infotexts.extend(infotexts)
res.all_seeds.extend(all_seeds)
res.all_prompts.extend(all_prompts)
res.all_negative_prompts.extend(all_negative_prompts)
else:
res.images = edited_images
res.infotexts = infotexts
res.all_seeds = all_seeds
res.all_prompts = all_prompts
res.all_negative_prompts = all_negative_prompts

return res

Expand Down

0 comments on commit f39af51

Please sign in to comment.