Nodes/ComfyUI_StarNodes/⭐ Star Video Compressor
ComfyUI Node

⭐ Star Video Compressor

Star Video Compressor — squeeze video to fit Discord's 10 MB wall

By Starnodes2024·Created 2 years ago·Updated 2 days ago· 106
⭐ Star Video Compressor
  • video
  • video_native
  • images
  • audio
  • Filenames
  • info
quality60
formatvideo/h264-mp4
presetmedium
filename_prefixStarVideo
target_size_mb0.0
video_path
frame_rate30.00
save_audiotrue
save_outputtrue
drop_first_frames0
drop_last_frames0

You generated a great video, exported it, and Discord told you the file is too big. It's the most common way a happy AI-video session ends, and the standard advice - "just re-encode it in handbrake" - means leaving ComfyUI. Star Video Compressor keeps it all in the graph: it re-encodes your video to a chosen quality or a target file size, with H.264, H.265, VP9, AV1, GIF, WebP and more, entirely standalone. No Video Helper Suite required.

How it works

It accepts video three ways: the video socket from the pack's Star Video Loader (a STAR_FILENAMES reference), a direct file path in video_path, or an images IMAGE batch that it encodes and compresses in one step (using frame_rate - and the docs suggest right-clicking the frame_rate widget to convert it to an input and wiring the loader's fps output). Everything routes through FFmpeg under the hood, which the pack pulls in via imageio-ffmpeg.

Two compression modes, and the priority is explicit:

  • target_size_mb - set this above 0 and it wins: the node calculates the bitrate from the duration and does two-pass encoding where supported to land the file at your target. This is the Discord mode: set it to 9.5 and forget about quality sliders.
  • quality (0–100, default 60) - a plain CRF-style quality control, used only when target_size_mb is 0.

Extra controls worth knowing: preset trades encode time against file size at the same quality; drop_first_frames / drop_last_frames trim frames off either end (and shift/trim any audio to stay in sync - nice for shaving the silent lead-in off a clip); save_audio muxes the audio in; save_output picks output vs temp folder. filename_prefix may include subfolders like discord/my_clip.

Outputs

Filenames (STAR_FILENAMES) - the resulting file reference you can pass to other Star video nodes or the joiner - plus info (STRING) with a summary. There's also an inline preview so you can watch the result without leaving the canvas.

Installing

Part of StarNodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Starnodes2024/ComfyUI_StarNodes
cd ComfyUI_StarNodes
pip install -r requirements.txt

Restart, search star under ⭐StarNodes/Video. ComfyUI Manager users: search "Starnodes".

Gotchas

If a format shows up but fails at runtime, it's almost always a missing FFmpeg encoder in your build - AV1 (video/av1-mp4) is the one most likely to be absent on a stock imageio-ffmpeg build, so H.264 (video/h264-mp4) is the safest default. And the two-pass size mode is slower than a quality-mode encode - worth it when you absolutely need to fit a limit, pointless when you don't. save_audio is on by default, so a silent-gen video gains a silent track; if that bothers downstream players, flip it off.

Category⭐StarNodes/Video

Inputs (15)

NameTypeDefaultDescription
qualityINT600–100Compression quality (0 = smallest file, 100 = best quality). IGNORED when target_size_mb is greater than 0.
formatCOMBOvideo/h264-mp411 options: video/h264-mp4, video/h265-mp4, video/vp9-webm, video/av1-mp4, video/h264-mkv, video/h265-mkv, +5
presetCOMBOmediumEncoder speed vs efficiency. Slower = smaller file at the same quality, but takes longer.
filename_prefixSTRINGStarVideoOutput filename. May contain subfolders, e.g. 'discord/my_clip' - missing folders are created inside the ComfyUI output folder.
target_size_mbFLOAT0.00–1000000Desired output size in MiB. 0 = off (quality slider is used). When > 0 this WINS over the quality slider: the bitrate is calculated from the duration (two-pass where supported).
video_pathSTRINGOptional: direct path to a video file (absolute, or relative to the ComfyUI input folder). Used only when no 'video', 'video_native', or 'images' input is connected.
frame_rateFLOAT30.001–240Only used when compressing an IMAGE batch. Tip: right-click the node to convert this widget into an input and connect the loader's fps output.
save_audioBOOLEANtrue
save_outputBOOLEANtrueTrue = ComfyUI output folder, False = temp folder.
drop_first_framesINT00–1000Skip this many frames from the start of the output (e.g. 10 = the output starts at frame 11). 0 = off. Any connected/embedded audio is shifted by the same amount to stay in sync.
drop_last_framesINT00–1000Cut this many frames from the end of the output (e.g. 10 = the last 10 frames are removed). 0 = off. Works together with drop_first_frames. Any connected/embedded audio is trimmed to match so it stays in sync.
videooptSTAR_FILENAMESVideo file(s) from the 'Star Video Loader' node.
video_nativeoptVIDEONative ComfyUI VIDEO input (e.g. from CreateVideo, SaveVideo, or the Star Video Loader's video_native output).
imagesoptIMAGEAlternative: encode + compress an image batch directly (uses frame_rate).
audiooptAUDIOOptional external audio track (ComfyUI core audio, e.g. from the 'LoadAudio' node or the Star Video Loader).

Outputs (2)

NameTypeDescription
FilenamesSTAR_FILENAMES
infoSTRING