Comfy-Org / Comfy-Org/ComfyUI

AMD: Audio tensor not moved to CPU before numpy conversion in SaveVideo

Open
#11,785 0 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

**Environment:**
- OS: Ubuntu 25.10
- GPU: AMD Strix Halo APU (gfx1151) - Radeon 8060S
- PyTorch: 2.11.0a0+rocm7.11.0a20260106 (TheROCk nightly)
- ComfyUI: 0.8.2

**Problem:**
When using LTX-2 audio-video generation on AMD, SaveVideo crashes with:
```
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
```

**Location:**
`comfy_api/latest/_input_impl/video_types.py` line 377

**Cause:**
Audio tensor from `LTXVAudioVAEDecode` stays on GPU. The code calls `.numpy()` without `.cpu()` first. This works on NVIDIA (likely due to different memory handling) but crashes on AMD.

**Fix:**
```python
# Before:
.float().numpy()

# After:
.float().cpu().numpy()
```

**One-liner patch:**
```bash
sed -i 's/\.float()\.numpy()/.float().cpu().numpy()/g' ~/ComfyUI/comfy_api/latest/_input_impl/video_types.py
```

This is standard practice - tensors should always be moved to CPU before numpy conversion. Happy to submit a PR if helpful.

**Full AMD setup guide:** https://github.com/bkpaine1/AMD-Strix-Halo-AI-Guide

### Actual Behavior

Voice fails to render with video

### Steps to Reproduce

Just run on an AMD

### Debug Logs

```powershell
!!! Exception during processing !!! can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
Traceback (most recent call last):
File "/home/amd/ComfyUI/execution.py", line 518, in execute
```

### Other

Please fix

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.