Skip to content

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

@bkpaine1

Description

@bkpaine1

Custom Node Testing

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:

# Before:
.float().numpy()

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

One-liner patch:

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

!!! 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugUser is reporting a bug. This should be tested.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions