diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-16 05:33:47 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-16 05:33:47 +0000 |
commit | b153ebe3b679854e7314a6d33a038f9f0cc0c233 (patch) | |
tree | 7089ba49979120f3f604c0e3197517468d5015bd /modules | |
parent | 37638370032892c03734f511eb5935be370ba56f (diff) | |
download | stable-diffusion-webui-gfx803-b153ebe3b679854e7314a6d33a038f9f0cc0c233.tar.gz stable-diffusion-webui-gfx803-b153ebe3b679854e7314a6d33a038f9f0cc0c233.tar.bz2 stable-diffusion-webui-gfx803-b153ebe3b679854e7314a6d33a038f9f0cc0c233.zip |
fix loopback color correction to store color_correction info for initial image and use that instead of extracting from previous image in a loop #481 #541
Diffstat (limited to 'modules')
-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 9b53d210..71a9c6f5 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -445,7 +445,9 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing): latent_mask = self.latent_mask if self.latent_mask is not None else self.image_mask
- self.color_corrections = []
+ add_color_corrections = opts.img2img_color_correction and self.color_corrections is None
+ if add_color_corrections:
+ self.color_corrections = []
imgs = []
for img in self.init_images:
image = img.convert("RGB")
@@ -467,7 +469,7 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing): if self.inpainting_fill != 1:
image = fill(image, latent_mask)
- if opts.img2img_color_correction:
+ if add_color_corrections:
self.color_corrections.append(setup_color_correction(image))
image = np.array(image).astype(np.float32) / 255.0
|