diff --git a/src/diffusers/modular_pipelines/minimax_h3/decoders.py b/src/diffusers/modular_pipelines/minimax_h3/decoders.py index 44e9b2034f11..ed2266a3d481 100644 --- a/src/diffusers/modular_pipelines/minimax_h3/decoders.py +++ b/src/diffusers/modular_pipelines/minimax_h3/decoders.py @@ -184,7 +184,7 @@ def __call__(self, components: MiniMaxH3ModularPipeline, state: PipelineState) - latents_std = torch.tensor(components.vae.config.latents_std, device=device).view(1, -1, 1, 1, 1) latents = block_state.latents * latents_std + latents_mean - with torch.autocast(device_type=device.type, dtype=torch.float16, enabled=device.type == "cuda"): + with torch.autocast(device_type=device.type, dtype=torch.float16, enabled=device.type != "cpu"): video = components.vae.decode(latents, return_dict=False)[0] pixel_mean = torch.tensor(components.pixel_mean, device=device).view(1, -1, 1, 1, 1) pixel_std = torch.tensor(components.pixel_std, device=device).view(1, -1, 1, 1, 1) diff --git a/src/diffusers/pipelines/wan/pipeline_wan_animate.py b/src/diffusers/pipelines/wan/pipeline_wan_animate.py index a923219a7550..c2416243f111 100644 --- a/src/diffusers/pipelines/wan/pipeline_wan_animate.py +++ b/src/diffusers/pipelines/wan/pipeline_wan_animate.py @@ -465,8 +465,10 @@ def get_i2v_mask( mask_len: int = 1, mask_pixel_values: torch.Tensor | None = None, dtype: torch.dtype | None = None, - device: str | torch.device = "cuda", + device: str | torch.device | None = None, ) -> torch.Tensor: + device = device or self._execution_device + # mask_pixel_values shape (if supplied): [B, C = 1, T, latent_h, latent_w] if mask_pixel_values is None: mask_lat_size = torch.zeros(