aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-10-22 22:06:54 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-10-22 22:06:54 +0300
commitca5a9e79dc28eeaa3a161427a82e34703bf15765 (patch)
tree672b40c3487576b2bf431286363e7abb45e3d6d7
parentbe748e8b086bd9834d08bdd9160649a5e7700af7 (diff)
fix for img2img color correction in a batch #3218
-rw-r--r--modules/processing.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/processing.py b/modules/processing.py
index 27c669b0..b1877b80 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -403,8 +403,6 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
if (len(prompts) == 0):
break
- #uc = p.sd_model.get_learned_conditioning(len(prompts) * [p.negative_prompt])
- #c = p.sd_model.get_learned_conditioning(prompts)
with devices.autocast():
uc = prompt_parser.get_learned_conditioning(shared.sd_model, len(prompts) * [p.negative_prompt], p.steps)
c = prompt_parser.get_multicond_learned_conditioning(shared.sd_model, prompts, p.steps)
@@ -716,6 +714,10 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
batch_images = np.expand_dims(imgs[0], axis=0).repeat(self.batch_size, axis=0)
if self.overlay_images is not None:
self.overlay_images = self.overlay_images * self.batch_size
+
+ if self.color_corrections is not None and len(self.color_corrections) == 1:
+ self.color_corrections = self.color_corrections * self.batch_size
+
elif len(imgs) <= self.batch_size:
self.batch_size = len(imgs)
batch_images = np.array(imgs)