Conversation
The `get_i2v_mask` method had a hardcoded `device="cuda"` default, which crashes on non-CUDA accelerators (Ascend NPU, etc.) with "Torch not compiled with CUDA enabled" when called without an explicit device argument. Change the default to None and resolve via `self._execution_device`, matching the pattern used across other pipeline methods. Verified on Ascend 910B NPU: torch.zeros(device="cuda") crashes, fix with device-agnostic resolution creates tensors on the correct device.
|
Hi @li-lizhe, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Please note that PRs without a linked issue are likely to be automatically closed 10 days after this notice. Once the PR links an issue (or gets the |
|
This PR has been automatically closed because it does not link an issue and the reminder above was not addressed within 10 days. If this PR is still relevant, please link the issue it fixes (e.g. We are experimenting with this process to keep the review queue manageable, and it will sometimes get it wrong. If you think this PR should stay open, please just say so here and we will reopen it — no need to justify it at length. Thanks again for contributing, and sorry for the noise if we closed this by mistake! |
|
Superseded by #14883 — same commit, unchanged content. Context: the issue-link reminder bot auto-closed this PR on 2026-09-25 because it had no linked issue, and GitHub refuses to reopen it (REST |
Fixes #14881
Description: Fix the
get_i2v_maskmethod'sdevice="cuda"default parameter which causes a crash on non-CUDA accelerators (Ascend NPU, Intel XPU, Apple MPS, etc.) when called without an explicit device argument.Change:
devicefrom"cuda"toNonedevice = device or self._execution_deviceat the function topprepare_reference_image_latents,encode_image, and other pipeline methodsVerification on Ascend 910B NPU (torch 2.14.0a0 + torch_npu):
torch.zeros(1, device="cuda")crashes withAssertionError: Torch not compiled with CUDA enableddevice = device or self._execution_deviceresolves tonpu:0, tensor created successfully on NPUScope note (see #14881): the two in-tree call sites in this file already pass
deviceexplicitly, so this is a latent default / API-hygiene fix rather than a fix for a currently-failing in-tree path. The same CUDA default also exists in the module-level helperget_i2v_maskatsrc/diffusers/modular_pipelines/wan_animate_2/encoders.py:84- happy to extend this PR to cover that one too if maintainers prefer.