Skip to content

Commit 830a9d1

Browse files
[fix] pipeline_unclip generator (huggingface#1751)
* [fix] pipeline_unclip generator pass generator to all schedulers * fix fast tests test data
1 parent 2dcf64b commit 830a9d1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/diffusers/pipelines/unclip/pipeline_unclip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def __call__(
292292

293293
# compute the previous noisy sample x_t -> x_t-1
294294
decoder_latents = self.decoder_scheduler.step(
295-
noise_pred, t, decoder_latents, prev_timestep=prev_timestep
295+
noise_pred, t, decoder_latents, prev_timestep=prev_timestep, generator=generator
296296
).prev_sample
297297

298298
decoder_latents = decoder_latents.clamp(-1, 1)
@@ -348,7 +348,7 @@ def __call__(
348348

349349
# compute the previous noisy sample x_t -> x_t-1
350350
super_res_latents = self.super_res_scheduler.step(
351-
noise_pred, t, super_res_latents, prev_timestep=prev_timestep
351+
noise_pred, t, super_res_latents, prev_timestep=prev_timestep, generator=generator
352352
).prev_sample
353353

354354
image = super_res_latents

tests/pipelines/unclip/test_unclip.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,15 @@ def test_unclip(self):
233233

234234
expected_slice = np.array(
235235
[
236-
0.0009,
236+
0.0011,
237+
0.0002,
238+
0.9962,
239+
0.9940,
240+
0.0002,
237241
0.9997,
238242
0.0003,
239-
0.9991,
240-
0.9967,
241-
0.0003,
242-
0.9997,
243-
0.0003,
244-
0.0004,
243+
0.9987,
244+
0.9989,
245245
]
246246
)
247247

@@ -261,7 +261,7 @@ def tearDown(self):
261261
def test_unclip_karlo(self):
262262
expected_image = load_numpy(
263263
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
264-
"/karlo_v1_alpha/horse.npy"
264+
"/unclip/karlo_v1_alpha_horse.npy"
265265
)
266266

267267
pipeline = UnCLIPPipeline.from_pretrained("kakaobrain/karlo-v1-alpha")

0 commit comments

Comments
 (0)