Skip to content

Commit f26d301

Browse files
committed
fix ldm uncond pipeline
1 parent c691bb2 commit f26d301

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/diffusers/pipelines/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ def __call__(
6363
# 4. set current image to prev_image: x_t -> x_t-1
6464
image = pred_prev_image + variance
6565

66-
# scale and decode image with vae
67-
image = 1 / 0.18215 * image
66+
# decode image with vae
6867
image = self.vqvae.decode(image)
69-
image = torch.clamp((image + 1.0) / 2.0, min=0.0, max=1.0)
70-
7168
return image

tests/test_modeling_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,9 @@ def test_ldm_uncond(self):
11591159
image_slice = image[0, -1, -3:, -3:].cpu()
11601160

11611161
assert image.shape == (1, 3, 256, 256)
1162-
expected_slice = torch.tensor([0.5025, 0.4121, 0.3851, 0.4806, 0.3996, 0.3745, 0.4839, 0.4559, 0.4293])
1162+
expected_slice = torch.tensor(
1163+
[-0.1202, -0.1005, -0.0635, -0.0520, -0.1282, -0.0838, -0.0981, -0.1318, -0.1106]
1164+
)
11631165
assert (image_slice.flatten() - expected_slice).abs().max() < 1e-2
11641166

11651167
def test_module_from_pipeline(self):

0 commit comments

Comments
 (0)