Save AMD Video
Save video with the AMD audio bug already fixed
- video
Here's a node that's exactly what its name says: it saves a video to your ComfyUI output directory, with a specific AMD GPU bug patched out. If you don't have an AMD GPU, this is just a regular Save Video node with extra steps. If you do - specifically if you've ever seen a crash or silent corruption when saving a video with audio on an AMD card - this is the node that exists because that bug was real and somebody got tired of it.
The mechanism is worth understanding because it's the pack's cleverest bit of engineering. ComfyUI's video saving code has a line that moves an audio waveform tensor to CPU via .float().numpy(). On AMD/ROCm, that tensor can still be on the GPU when .numpy() is called, and numpy can't touch a GPU tensor - so you get a crash, or worse, audio that quietly doesn't make it into the file. The pack's amd_tools.py patches ComfyUI's own video_types.py at runtime: it wraps the save function and, if the audio waveform is a torch tensor on a non-CPU device, moves it to CPU first. One .cpu() call. That's the entire fix - but it's the difference between video-with-audio saving and not saving on ROCm systems.
Inputs, all required:
video- the VIDEO tensor to save. This is the pack's VIDEO type, so wire it from a video-producing node (in this pack's world, typically a Replicate video model's output).filename_prefix(default "video/ComfyUI") - where it lands in the output directory. The default gives yououtput/video/ComfyUI_xxxxx.mp4style names.format- auto or mp4.autopicks based on the container and defaults are sane; forcemp4if you need to be sure.codec- auto or h264. Again,autousually does the right thing; force h264 when a downstream tool is picky about codecs.
It's an output node with no return values - it writes the file and finishes the branch. Nothing to wire onward.
Install is the pack standard - ComfyUI Manager (search ComfyUI-API-DockerCPU), or:
cd ComfyUI/custom_nodes
git clone https://github.com/trustypangolin/ComfyUI-API-DockerCPU
cd ComfyUI-API-DockerCPU
pip install -r requirements.txt
No API token needed - this is one of the pack's few purely-local nodes. Restart ComfyUI and it appears under 🎨 DockerCPU API/Utilities.
The honest caveats: this node patches ComfyUI internals (comfy_api's video module), and the patch applies at runtime when you use the node. If ComfyUI updates and changes that module's structure, the patch can silently fail - the code catches exceptions and just prints a warning, meaning you'd get an unpatched Save Video in disguise. And for non-AMD setups it genuinely buys you nothing over ComfyUI's built-in save. Also worth knowing: because the pack is designed for CPU-only VMs where all generation is offloaded to APIs, most of the time this node is saving video that a Replicate or fal model produced - which is exactly when the AMD audio path can bite, since the video arrives with audio that has to be written back out. If that's your setup, this is the node to end the pipeline with.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| video | VIDEO | The video to save. | |
| filename_prefix | STRING | video/ComfyUI | The prefix for the file to save. |
| format | COMBO | auto | The format to save the video as. |
| codec | COMBO | auto | The codec to use for the video. |
Outputs (0)
No outputs