Skip to content

Commit 3601c30

Browse files
committed
Update ONNX Pipelines to use np.float64 instead of np.float
Numpy 1.24 had removed the "float" scalar alias as it was depricated in v1.20. https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations https://numpy.org/devdocs/release/1.24.0-notes.html#expired-deprecations
1 parent 4125756 commit 3601c30

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def __call__(
247247
# set timesteps
248248
self.scheduler.set_timesteps(num_inference_steps)
249249

250-
latents = latents * np.float(self.scheduler.init_noise_sigma)
250+
latents = latents * np.float64(self.scheduler.init_noise_sigma)
251251

252252
# prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
253253
# eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.

src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def __call__(
398398
self.scheduler.set_timesteps(num_inference_steps)
399399

400400
# scale the initial noise by the standard deviation required by the scheduler
401-
latents = latents * np.float(self.scheduler.init_noise_sigma)
401+
latents = latents * np.float64(self.scheduler.init_noise_sigma)
402402

403403
# prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
404404
# eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.

0 commit comments

Comments
 (0)