Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1669,17 +1669,20 @@ class LEditsPPPipelineStableDiffusionXL(
|
|
1669 |
t_to_idx = {int(v): k for k, v in enumerate(timesteps)}
|
1670 |
xts = torch.zeros(size=variance_noise_shape, device=self.device, dtype=negative_prompt_embeds.dtype)
|
1671 |
|
|
|
1672 |
for t in reversed(timesteps):
|
1673 |
idx = num_inversion_steps - t_to_idx[int(t)] - 1
|
1674 |
noise = randn_tensor(shape=x0.shape, generator=generator, device=self.device, dtype=x0.dtype)
|
1675 |
xts[idx] = self.scheduler.add_noise(x0, noise, t.unsqueeze(0))
|
1676 |
xts = torch.cat([x0.unsqueeze(0), xts], dim=0)
|
1677 |
-
|
|
|
1678 |
# noise maps
|
1679 |
zs = torch.zeros(size=variance_noise_shape, device=self.device, dtype=negative_prompt_embeds.dtype)
|
1680 |
|
1681 |
self.scheduler.set_timesteps(len(self.scheduler.timesteps))
|
1682 |
|
|
|
1683 |
for t in self.progress_bar(timesteps):
|
1684 |
idx = num_inversion_steps - t_to_idx[int(t)] - 1
|
1685 |
# 1. predict noise residual
|
@@ -1711,6 +1714,7 @@ class LEditsPPPipelineStableDiffusionXL(
|
|
1711 |
|
1712 |
# correction to avoid error accumulation
|
1713 |
xts[idx] = xtm1_corrected
|
|
|
1714 |
|
1715 |
self.init_latents = xts[-1]
|
1716 |
zs = zs.flip(0)
|
|
|
1669 |
t_to_idx = {int(v): k for k, v in enumerate(timesteps)}
|
1670 |
xts = torch.zeros(size=variance_noise_shape, device=self.device, dtype=negative_prompt_embeds.dtype)
|
1671 |
|
1672 |
+
print("pre loop 1")
|
1673 |
for t in reversed(timesteps):
|
1674 |
idx = num_inversion_steps - t_to_idx[int(t)] - 1
|
1675 |
noise = randn_tensor(shape=x0.shape, generator=generator, device=self.device, dtype=x0.dtype)
|
1676 |
xts[idx] = self.scheduler.add_noise(x0, noise, t.unsqueeze(0))
|
1677 |
xts = torch.cat([x0.unsqueeze(0), xts], dim=0)
|
1678 |
+
print("post loop 1")
|
1679 |
+
|
1680 |
# noise maps
|
1681 |
zs = torch.zeros(size=variance_noise_shape, device=self.device, dtype=negative_prompt_embeds.dtype)
|
1682 |
|
1683 |
self.scheduler.set_timesteps(len(self.scheduler.timesteps))
|
1684 |
|
1685 |
+
print("pre loop 2")
|
1686 |
for t in self.progress_bar(timesteps):
|
1687 |
idx = num_inversion_steps - t_to_idx[int(t)] - 1
|
1688 |
# 1. predict noise residual
|
|
|
1714 |
|
1715 |
# correction to avoid error accumulation
|
1716 |
xts[idx] = xtm1_corrected
|
1717 |
+
print("post loop 2")
|
1718 |
|
1719 |
self.init_latents = xts[-1]
|
1720 |
zs = zs.flip(0)
|