You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING : Always backup your file before you make change
You need two step to make small edits using a text editor. Follow these steps:
First Step,
Edit the file with the name "sampling.py" you can found at : "[Your Installation folder]\stable-diffusion-webui-directml\repositories\k-diffusion\k_diffusion\sampling.py"
Copy and paste the code below at the end of the line and save :
@torch.no_grad()
def sample_lcm(model, x, sigmas, extra_args=None, callback=None, disable=None, noise_sampler=None):
extra_args = {} if extra_args is None else extra_args
noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler
s_in = x.new_ones([x.shape[0]])
for i in trange(len(sigmas) - 1, disable=disable):
denoised = model(x, sigmas[i] * s_in, **extra_args)
if callback is not None:
callback({'x': x, 'i': i, 'sigma': sigmas[i], 'sigma_hat': sigmas[i], 'denoised': denoised})
x = denoised
if sigmas[i + 1] > 0:
x += sigmas[i + 1] * noise_sampler(sigmas[i], sigmas[i + 1])
return x
The second step is edit the file with the name "sd_samplers_kdiffusion.py" found here: "[Your Installation folder]\stable-diffusion-webui-directml\modules\sd_samplers_kdiffusion.py"
On line 39 add code below to (before the "]") and save the file:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
WARNING : Always backup your file before you make change
You need two step to make small edits using a text editor. Follow these steps:
Edit the file with the name "sampling.py" you can found at : "[Your Installation folder]\stable-diffusion-webui-directml\repositories\k-diffusion\k_diffusion\sampling.py"
Copy and paste the code below at the end of the line and save :
On line 39 add code below to (before the "]") and save the file:
('LCM Sampler', 'sample_lcm', ['lcm'], {}),
Fist Step Images :


Second Step Images :


Result Images :

Images generated with LCM :



Sampling Method : LCM Sampler
Sampling Steps : 6
CFG Scale : 1.5
W/H : 512x712, 512x512, 600x800
Model : Realistic_LCM_BY_Stable_Yogi
IMG2IMG Upscaler : SD Upscale 4X R-ESRGAN4+
My System :
Windows 10
XFX Radeon RX 6600 8GB
RAM 32GB
@lshqqytiger Can you check the code, optimized the code and make available for the next update? Thank you
Beta Was this translation helpful? Give feedback.
All reactions