aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_samplers_timesteps.py
diff options
context:
space:
mode:
authorcatboxanon <122327233+catboxanon@users.noreply.github.com>2023-08-15 06:19:19 +0000
committercatboxanon <122327233+catboxanon@users.noreply.github.com>2023-08-15 06:19:19 +0000
commit371b24b17c1cf98c9068a4b585b93cc1610702dc (patch)
treeef4c2c97359f03bb5e8b93ffb0244e427532a4a9 /modules/sd_samplers_timesteps.py
parentf23e5ce2daad86d891a5ecdf3f3bad43d7a09c1a (diff)
downloadstable-diffusion-webui-gfx803-371b24b17c1cf98c9068a4b585b93cc1610702dc.tar.gz
stable-diffusion-webui-gfx803-371b24b17c1cf98c9068a4b585b93cc1610702dc.tar.bz2
stable-diffusion-webui-gfx803-371b24b17c1cf98c9068a4b585b93cc1610702dc.zip
Add extra img2img noise
Diffstat (limited to 'modules/sd_samplers_timesteps.py')
-rw-r--r--modules/sd_samplers_timesteps.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/sd_samplers_timesteps.py b/modules/sd_samplers_timesteps.py
index c1f534ed..670e2151 100644
--- a/modules/sd_samplers_timesteps.py
+++ b/modules/sd_samplers_timesteps.py
@@ -103,6 +103,10 @@ class CompVisSampler(sd_samplers_common.Sampler):
xi = x * sqrt_alpha_cumprod + noise * sqrt_one_minus_alpha_cumprod
+ if opts.img2img_extra_noise > 0:
+ p.extra_generation_params["Extra noise"] = opts.img2img_extra_noise
+ xi += noise * opts.img2img_extra_noise * sqrt_alpha_cumprod
+
extra_params_kwargs = self.initialize(p)
parameters = inspect.signature(self.func).parameters