mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-29 07:22:12 +03:00
🎨 fix xl playground device (#8550)
* 🎨 fix xl playground device * 🎨 run `make fix-copies` * 🎨 run `make fix-copies` * edit xl_controlnet_img2img file * edit playground img2img test slow * Update tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_img2img.py --------- Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
This commit is contained in:
@@ -949,8 +949,8 @@ class StableDiffusionXLControlNetImg2ImgPipeline(
|
||||
|
||||
init_latents = init_latents.to(dtype)
|
||||
if latents_mean is not None and latents_std is not None:
|
||||
latents_mean = latents_mean.to(device=self.device, dtype=dtype)
|
||||
latents_std = latents_std.to(device=self.device, dtype=dtype)
|
||||
latents_mean = latents_mean.to(device=device, dtype=dtype)
|
||||
latents_std = latents_std.to(device=device, dtype=dtype)
|
||||
init_latents = (init_latents - latents_mean) * self.vae.config.scaling_factor / latents_std
|
||||
else:
|
||||
init_latents = self.vae.config.scaling_factor * init_latents
|
||||
|
||||
@@ -723,8 +723,8 @@ class StableDiffusionXLImg2ImgPipeline(
|
||||
|
||||
init_latents = init_latents.to(dtype)
|
||||
if latents_mean is not None and latents_std is not None:
|
||||
latents_mean = latents_mean.to(device=self.device, dtype=dtype)
|
||||
latents_std = latents_std.to(device=self.device, dtype=dtype)
|
||||
latents_mean = latents_mean.to(device=device, dtype=dtype)
|
||||
latents_std = latents_std.to(device=device, dtype=dtype)
|
||||
init_latents = (init_latents - latents_mean) * self.vae.config.scaling_factor / latents_std
|
||||
else:
|
||||
init_latents = self.vae.config.scaling_factor * init_latents
|
||||
|
||||
Reference in New Issue
Block a user