Update sd_samplers_kdiffusion.py

This commit is contained in:
laksjdjf 2023-02-24 14:04:23 +09:00 committed by GitHub
parent 327186b484
commit 9a1435946c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,11 +101,13 @@ class CFGDenoiser(torch.nn.Module):
sigma_in = torch.cat([torch.stack([sigma[i] for _ in range(n)]) for i, n in enumerate(repeats)] + [sigma] + [sigma]) sigma_in = torch.cat([torch.stack([sigma[i] for _ in range(n)]) for i, n in enumerate(repeats)] + [sigma] + [sigma])
image_cond_in = torch.cat([torch.stack([image_cond[i] for _ in range(n)]) for i, n in enumerate(repeats)] + [image_cond] + [torch.zeros_like(self.init_latent)]) image_cond_in = torch.cat([torch.stack([image_cond[i] for _ in range(n)]) for i, n in enumerate(repeats)] + [image_cond] + [torch.zeros_like(self.init_latent)])
denoiser_params = CFGDenoiserParams(x_in, image_cond_in, sigma_in, state.sampling_step, state.sampling_steps) denoiser_params = CFGDenoiserParams(x_in, image_cond_in, sigma_in, state.sampling_step, state.sampling_steps, tensor, uncond)
cfg_denoiser_callback(denoiser_params) cfg_denoiser_callback(denoiser_params)
x_in = denoiser_params.x x_in = denoiser_params.x
image_cond_in = denoiser_params.image_cond image_cond_in = denoiser_params.image_cond
sigma_in = denoiser_params.sigma sigma_in = denoiser_params.sigma
tensor = denoiser_params.tensor
uncond = denoiser_params.uncond
if tensor.shape[1] == uncond.shape[1]: if tensor.shape[1] == uncond.shape[1]:
if not is_edit_model: if not is_edit_model: