Add AMD GPU compatibility fix for tensor device mismatches #275
+53
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AMD GPU Compatibility Fix for WanVideoWrapper
Description
This PR adds AMD GPU compatibility to ComfyUI-WanVideoWrapper by addressing tensor device mismatch issues that occur specifically on AMD GPUs running PyTorch with ROCm.
Issue
Users with AMD GPUs encounter the following error when running the WanVideoImageClipEncode node:
This occurs because the ROCm backend is less forgiving than CUDA when handling operations between tensors on different devices.
Solution
This PR adds a minimal, non-intrusive patch that:
Testing
Tested on an AMD Radeon RX 7900 XTX GPU with PyTorch 2.4.0+rocm6.3.4.
Changes
amd_fix.pywith AMD-specific tensor device handling__init__.pyto load the fixImpact