Skip to content

Commit 384fcac

Browse files
[Stable Diffusion] Hotfix (#299)
1 parent 0b1a843 commit 384fcac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/diffusers/schedulers/scheduling_pndm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ def set_timesteps(self, num_inference_steps, offset=0):
110110
# produce better results. When using PNDM with `self.config.skip_prk_steps` the implementation
111111
# is based on crowsonkb's PLMS sampler implementation: https://github.com/CompVis/latent-diffusion/pull/51
112112
self.prk_timesteps = np.array([])
113-
self.plms_timesteps = (self._timesteps[:-1] + self._timesteps[-2:-1] + self._timesteps[-1:])[::-1].copy()
113+
self.plms_timesteps = np.concatenate([self._timesteps[:-1], self._timesteps[-2:-1], self._timesteps[-1:]])[
114+
::-1
115+
].copy()
114116
else:
115117
prk_timesteps = np.array(self._timesteps[-self.pndm_order :]).repeat(2) + np.tile(
116118
np.array([0, self.config.num_train_timesteps // num_inference_steps // 2]), self.pndm_order

0 commit comments

Comments
 (0)