Nodes/fxai-toolkit/凤希AI - 视频生成
ComfyUI Node

凤希AI - 视频生成

Turn your generated frames into an actual mp4 on disk

By fxai666·Created 4 months ago·Updated 3 days ago· 35
凤希AI - 视频生成
  • 图片序列
  • 音频
  • 图片序列
  • 视频文件路径
  • 保存目录
目录sucai
帧率FPS24
视频序号0

FxAiVideoGenerator ("凤希AI - 视频生成") is where the pack's "generate segments, then render them" loop actually writes video to disk. You feed it an IMAGE tensor (your generated frames), it encodes them to an mp4 with ffmpeg, optionally muxes an audio track, and hands back the file path. Every other video node in this pack either feeds this one or consumes its output.

What it does and how

The mechanism is worth knowing because it explains the gotchas. The node doesn't use a Python video library - it pipes raw RGB frames straight into ffmpeg's stdin, which encodes libx264 at CRF 17 with the slow preset and yuv420p pixel format (that last one matters: it's the format that plays everywhere, including phones and browsers). If you pass an AUDIO tensor, it's converted to a temp WAV and muxed as AAC at 192k. Output lands in ComfyUI/fxai/video/<目录>/ as NNN.mp4 - zero-padded, auto-numbered to the next free slot unless you pin 视频序号.

Here's the subtle bit: the node strips the last frame before encoding. img_np[:total_len - 1]. That's not a bug - it's the pack's transition convention. The last frame of each segment is treated as continuity glue for the next loop iteration (the V2+ generators formalize this as 过渡帧数), so it never makes it into the video file itself. If you're wiring frames into this node manually, remember it eats one.

The inputs and outputs that matter

  • 图片序列 - IMAGE, your frames. The only required data input.
  • 帧率FPS - INT, default 24.
  • 目录 - STRING, default "sucai". The subdirectory under fxai/video/.
  • 视频序号 - INT, default 0. 0 isn't auto-numbering - the auto-number path only kicks in for negative values in later versions. Here, 0 means it will try to write 000.mp4, which the get_last_number collision logic actually rescues by bumping to the next free slot. Don't stress about it; the pack keeps you from clobbering files.
  • 音频 - optional AUDIO socket.

Outputs: 图片序列 (echoes the frames back for chaining), 视频文件路径 (STRING - wire this into FxAiVideoPreview), 保存目录 (STRING).

The big gotcha: silent ffmpeg failure

The node suppresses ffmpeg's stderr completely. If ffmpeg isn't installed, or the command dies, you get back an empty string path and no error message - just a console line. Your workflow will happily continue on an empty path and the preview shows nothing. The fix is easy but easy to miss: ffmpeg -version in a terminal. If that fails, install ffmpeg and make sure it's on PATH before you blame this node.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit

Restart ComfyUI, or use ComfyUI Manager and search "fxai-toolkit". No requirements.txt - the pack auto-installs soundfile/psutil; this node needs system ffmpeg, nothing else. It's the V1 of four generations - the V2/V3/V4 articles cover why the later ones exist, but if you just need "frames in, mp4 out," this one is already complete.

Category凤希AI/视频

Inputs (5)

NameTypeDefaultDescription
图片序列IMAGE
目录STRINGsucai
帧率FPSINT24
视频序号INT0
音频optAUDIO

Outputs (3)

NameTypeDescription
图片序列IMAGE
视频文件路径STRING
保存目录STRING