aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_samplers_timesteps.py
diff options
context:
space:
mode:
authorcatboxanon <122327233+catboxanon@users.noreply.github.com>2023-08-17 01:45:19 +0000
committercatboxanon <122327233+catboxanon@users.noreply.github.com>2023-08-17 01:45:19 +0000
commit254be4eeb259fd3bd2452250fca1bd278fa248ff (patch)
treeee2516493e330a9b91c8d0193749f2bc39a5705f /modules/sd_samplers_timesteps.py
parent541ef9247cfe8785c12f7142ad02cd5310fc5925 (diff)
downloadstable-diffusion-webui-gfx803-254be4eeb259fd3bd2452250fca1bd278fa248ff.tar.gz
stable-diffusion-webui-gfx803-254be4eeb259fd3bd2452250fca1bd278fa248ff.tar.bz2
stable-diffusion-webui-gfx803-254be4eeb259fd3bd2452250fca1bd278fa248ff.zip
Add extra noise callback
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 68aea454..7a6cbd46 100644
--- a/modules/sd_samplers_timesteps.py
+++ b/modules/sd_samplers_timesteps.py
@@ -3,6 +3,7 @@ import inspect
import sys
from modules import devices, sd_samplers_common, sd_samplers_timesteps_impl
from modules.sd_samplers_cfg_denoiser import CFGDenoiser
+from modules.script_callbacks import ExtraNoiseParams, extra_noise_callback
from modules.shared import opts
import modules.shared as shared
@@ -106,6 +107,9 @@ class CompVisSampler(sd_samplers_common.Sampler):
if opts.img2img_extra_noise > 0:
p.extra_generation_params["Extra noise"] = opts.img2img_extra_noise
+ extra_noise_params = ExtraNoiseParams(noise, x)
+ extra_noise_callback(extra_noise_params)
+ noise = extra_noise_params.noise
xi += noise * opts.img2img_extra_noise * sqrt_alpha_cumprod
extra_params_kwargs = self.initialize(p)