Skip to content

Commit

Permalink
Fix the incorrect output of sdxl inpaint (#1737)
Browse files Browse the repository at this point in the history
Signed-off-by: yuanwu <[email protected]>
  • Loading branch information
yuanwu2017 authored Feb 5, 2025
1 parent df43900 commit 997f04d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,6 @@ def __call__(
t1 = t0

self._num_timesteps = len(timesteps)
if hasattr(self.scheduler, "set_begin_index"):
self.scheduler.set_begin_index()

hb_profiler = HabanaProfile(
warmup=profiling_warmup_steps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,6 @@ def denoising_value_valid(dnv):
).to(device=device, dtype=latents.dtype)

self._num_timesteps = len(timesteps)
if hasattr(self.scheduler, "set_begin_index"):
self.scheduler.set_begin_index()

# 8.3 Denoising loop
throughput_warmup_steps = kwargs.get("throughput_warmup_steps", 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,6 @@ def denoising_value_valid(dnv):
).to(device=device, dtype=latents.dtype)

self._num_timesteps = len(timesteps)
if hasattr(self.scheduler, "set_begin_index"):
self.scheduler.set_begin_index()

outputs = {
"images": [],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_diffusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3645,7 +3645,7 @@ def test_stable_diffusion_xl_img2img_euler(self):

self.assertEqual(image.shape, (1, 32, 32, 3))

expected_slice = np.array([0.4925, 0.5007, 0.6594, 0.5544, 0.4423, 0.5585, 0.4643, 0.5444, 0.5376])
expected_slice = np.array([0.4664, 0.4886, 0.4403, 0.6902, 0.5592, 0.4534, 0.5931, 0.5951, 0.5224])
self.assertLess(np.abs(image_slice.flatten() - expected_slice).max(), 1e-2)


Expand Down

0 comments on commit 997f04d

Please sign in to comment.