Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComfyUI Video Save Node

A custom ComfyUI node that saves video outputs as H.264 .mp4 files with unique naming and returns the file path as a string.

Features

  • 🎥 Saves video tensors as H.264 encoded .mp4 files
  • 🔢 Generates unique filenames with timestamp and UUID
  • 📁 Configurable output directory
  • ⚙️ Adjustable quality settings (CRF 0-51)
  • 🎬 Configurable frame rate
  • 📝 Returns full file path as string output
  • 🔄 Automatic tensor format detection and conversion
  • ⚡ Optional FFmpeg re-encoding for better compression

Installation

  1. Copy the comfyui_video_save_node folder to your ComfyUI custom_nodes directory:

    cp -r comfyui_video_save_node /path/to/ComfyUI/custom_nodes/
  2. Install the required Python dependencies:

    cd /path/to/ComfyUI/custom_nodes/comfyui_video_save_node
    pip install -r requirements.txt
  3. (Optional but recommended) Install FFmpeg for better H.264 encoding:

    • macOS: brew install ffmpeg
    • Ubuntu: sudo apt install ffmpeg
    • Windows: Download from FFmpeg website
  4. Restart ComfyUI

Usage

  1. Add the "Save Video (H.264)" node to your workflow
  2. Connect a video output from another node (e.g., VEO3 API node) to the video input
  3. Configure the parameters:
    • filename_prefix: Prefix for the output filename (default: "video_output")
    • fps: Frame rate for the output video (default: 30)
    • quality: H.264 CRF quality, lower = better quality (default: 23)
    • output_dir: Optional custom output directory (uses ComfyUI output folder by default)
  4. The node will output the full file path as a string

Output Format

The node generates filenames in the format:

{filename_prefix}_{timestamp}_{unique_id}.mp4

Example: video_output_20241213_143022_a1b2c3d4.mp4

Node Parameters

Parameter Type Default Description
video VIDEO - Input video tensor from previous nodes
filename_prefix STRING "video_output" Prefix for the output filename
fps INT 30 Frame rate (1-120)
quality INT 23 H.264 CRF quality (0-51, lower = better)
output_dir STRING "" Optional custom output directory

Output

Output Type Description
file_path STRING Full path to the saved video file

Technical Details

  • The node automatically detects and converts various video tensor formats
  • Supports both batch and single video tensors
  • Normalizes pixel values to 0-255 range
  • Handles RGB/BGR conversion for OpenCV compatibility
  • Uses OpenCV for initial encoding, with optional FFmpeg re-encoding
  • Generates unique filenames to prevent overwrites

Troubleshooting

  • "Invalid or empty video tensor": Ensure the input video tensor is valid and not empty
  • FFmpeg errors: FFmpeg is optional; the node will fall back to OpenCV encoding
  • File permission errors: Ensure ComfyUI has write permissions to the output directory

License

This project is open source. Feel free to modify and distribute.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages