diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-22 19:06:54 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-22 19:06:54 +0000 |
commit | ca5a9e79dc28eeaa3a161427a82e34703bf15765 (patch) | |
tree | 672b40c3487576b2bf431286363e7abb45e3d6d7 /modules/processing.py | |
parent | be748e8b086bd9834d08bdd9160649a5e7700af7 (diff) | |
download | stable-diffusion-webui-gfx803-ca5a9e79dc28eeaa3a161427a82e34703bf15765.tar.gz stable-diffusion-webui-gfx803-ca5a9e79dc28eeaa3a161427a82e34703bf15765.tar.bz2 stable-diffusion-webui-gfx803-ca5a9e79dc28eeaa3a161427a82e34703bf15765.zip |
fix for img2img color correction in a batch #3218
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 6 |
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)
|