From e16862571de9dbf1ef47dec4d72cd9941062501e Mon Sep 17 00:00:00 2001 From: Johannes Stelzer Date: Mon, 8 Jan 2024 16:09:28 +0100 Subject: [PATCH] fix in sdxl --- diffusers_holder.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/diffusers_holder.py b/diffusers_holder.py index 6e6ce25..6d78b3e 100644 --- a/diffusers_holder.py +++ b/diffusers_holder.py @@ -695,10 +695,7 @@ class DiffusersHolder(): # 8. Denoising loop for i, t in enumerate(timesteps): # Set the right starting latents - if i < idx_start: - list_latents_out.append(None) - continue - elif i == idx_start: + if i == idx_start: latents = latents_start.clone() # Mix latents for crossfeeding @@ -706,6 +703,11 @@ class DiffusersHolder(): latents_mixtarget = list_latents_mixing[i - 1].clone() latents = interpolate_spherical(latents, latents_mixtarget, list_mixing_coeffs[i]) + # Write latents out and skip + if i < idx_start: + list_latents_out.append(latents) + continue + # expand the latents if we are doing classifier free guidance latent_model_input = torch.cat([latents] * 2)# if do_classifier_free_guidance else latents # Always scale latents