Skip to content

Commit 6b91ca6

Browse files
committed
bugfix
1 parent d471f11 commit 6b91ca6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ def invert(
12591259
# Derive epsilon from model output before regularizing to IID standard normal
12601260
var_epsilon = self.get_epsilon(var, latent_model_input.detach(), t)
12611261

1262-
l_kld = self.kl_divergence(var_epsilon)
1262+
l_kld = kl_divergence(var_epsilon)
12631263
l_kld.backward()
12641264

12651265
grad = var.grad.detach()
@@ -1472,7 +1472,7 @@ def __call__(
14721472
f"`image_latents` must have batch size {batch_size} with latent images from {len(timesteps)} timesteps, "
14731473
f"but has batch size {image_latents.shape[0]} with latent images from {image_latents.shape[1]} timesteps."
14741474
)
1475-
image_latents = image_latents.transpose(0, 1).unsqueeze(1).repeat(1, num_images_per_prompt, 1, 1, 1, 1)
1475+
image_latents = image_latents.transpose(0, 1).repeat_interleave(num_images_per_prompt, dim=1)
14761476
image_latents = image_latents.to(device=device, dtype=prompt_embeds.dtype)
14771477

14781478
# 7. Prepare extra step kwargs. TODO: Logic should ideally just be moved out of the pipeline

0 commit comments

Comments
 (0)