⭐ Star Video Compressor
Star Video Compressor — squeeze video to fit Discord's 10 MB wall
- video
- video_native
- images
- audio
- Filenames
- info
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 whentarget_size_mbis 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.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| quality | INT | 600–100 | Compression quality (0 = smallest file, 100 = best quality). IGNORED when target_size_mb is greater than 0. |
| format | COMBO | video/h264-mp4 | 11 options: video/h264-mp4, video/h265-mp4, video/vp9-webm, video/av1-mp4, video/h264-mkv, video/h265-mkv, +5 |
| preset | COMBO | medium | Encoder speed vs efficiency. Slower = smaller file at the same quality, but takes longer. |
| filename_prefix | STRING | StarVideo | Output filename. May contain subfolders, e.g. 'discord/my_clip' - missing folders are created inside the ComfyUI output folder. |
| target_size_mb | FLOAT | 0.00–1000000 | Desired 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_path | STRING | Optional: 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_rate | FLOAT | 30.001–240 | Only 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_audio | BOOLEAN | true | — |
| save_output | BOOLEAN | true | True = ComfyUI output folder, False = temp folder. |
| drop_first_frames | INT | 00–1000 | Skip 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_frames | INT | 00–1000 | Cut 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. |
| videoopt | STAR_FILENAMES | Video file(s) from the 'Star Video Loader' node. | |
| video_nativeopt | VIDEO | Native ComfyUI VIDEO input (e.g. from CreateVideo, SaveVideo, or the Star Video Loader's video_native output). | |
| imagesopt | IMAGE | Alternative: encode + compress an image batch directly (uses frame_rate). | |
| audioopt | AUDIO | Optional external audio track (ComfyUI core audio, e.g. from the 'LoadAudio' node or the Star Video Loader). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Filenames | STAR_FILENAMES | — |
| info | STRING | — |