🎈LG_CreateAndSaveVideo
Turn a stack of frames into an mp4 and get the file path back
- images
- audio
- file_path
ComfyUI can generate frames till the cows come home; getting them into an actual video file is a separate step. LG_CreateAndSaveVideo is that step: feed it an IMAGE batch and an fps, and it writes an H.264 mp4 to your output folder, optionally with an audio track, then hands you back the file path as a string. The string output is the underrated part - you can wire it into the pack's LG_ConcatVideoFiles to glue segments together, or into any other node that wants a filename.
It's one of the video/output helpers in Comfyui-LG_GroupExecutor, LAOGOU-666's small utility pack. No Python deps beyond ComfyUI itself, but it does lean on ComfyUI's newer comfy_api video machinery, and that's the one version-sensitivity to know about.
How it works
The node imports VideoFromComponents from ComfyUI's comfy_api (it tries the latest namespace first, then falls back to the older one - if both imports fail on a very old ComfyUI, the node breaks at import time). It packs your images plus optional audio into a VideoComponents object with the given fps, then writes an MP4 with H.264 and folder_paths.get_save_image_path naming (so video/segment becomes video/segment_00001_.mp4 style output). Workflow metadata is embedded in the file unless you run ComfyUI with --disable-metadata.
Inputs & outputs
- images (IMAGE) - your frames, in order.
- fps (FLOAT, 1–120, default 30) - frame rate of the output.
- filename_prefix (STRING, default
video/segment) - output path under the output folder. - audio (optional AUDIO) - muxed into the video.
Output: file_path (STRING) - the absolute path of the written mp4.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui-LG_GroupExecutor
or ComfyUI Manager → "Comfyui-LG_GroupExecutor", then restart.
Gotchas
- Needs a reasonably recent ComfyUI. This uses
comfy_api's video types, which are newer than the classicVHS_VideoCombineapproach. On an older install the import itself fails - update ComfyUI before debugging anything else. - It's a save node, not a preview node. The mp4 goes to the output folder and stays there; there's no temp-file trickery here.
- fps is a float but behaves like an int for most uses - set 24, 30, or 60 and you're fine.
- Pair it with
LG_ConcatVideoFilesto stitch the returned segments into one longer file.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| fps | FLOAT | 301–120 | — |
| filename_prefix | STRING | video/segment | — |
| audioopt | AUDIO | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| file_path | STRING | — |