🎬 Compress Video
Your ComfyUI render is 400 MB. This node squashes it to a target size
- images
- audio
- images
- audio
- fps
- video_path
You finally got that Wan or LTX clip looking right, saved the mp4, and it's 400 MB. Discord caps files at 10 MB unless you pay them money. Email's a joke. Now what?
Meet 🎬 Compress Video (VideoCompressor) from the Verolelb/ComfyUI-VideoCompressor pack - a small FFmpeg wrapper that sits at the end of your video workflow and re-encodes whatever you feed it down to a target file size, so you don't have to babysit a command line or guess bitrates by hand. It's not glamorous, but if you ship video around it's the kind of node you forget you installed until the moment you need it.
How it works
The node is pretty simple under the hood: it dumps your image batch to temp PNGs, runs FFmpeg to build a clean intermediate video, then re-encodes that with your chosen codec. That double-encode is worth knowing about - you're going through libx264 twice, so the output won't be pixel-identical to your source, just very close. Fine for sharing; don't use it to archive your masters.
What actually matters is the two modes. Set target_mb to anything above 0 and it computes a bitrate from (target MB Ă— 8192) / duration, subtracts ~128k for audio, and runs a proper 2-pass encode to land near that size. Leave target_mb at 0 - the default, watch out - and it ignores size entirely and does a single-pass CRF quality encode instead. That default trips people up, because the node is called "compressor" so they assume it's targeting a size when it's actually in quality mode.
FFmpeg itself is a hard system requirement here. It's not a pip dependency; the node shells out to the ffmpeg binary on your PATH. Install it with brew install ffmpeg on macOS, sudo apt install ffmpeg on Debian/Ubuntu, or grab a build from gyan.dev on Windows and add bin to PATH. Everything in requirements.txt (numpy, Pillow, scipy) is already present in a stock ComfyUI, so the pack itself adds no Python dependencies and downloads no model files.
The inputs that matter
- images - your image batch, straight out of a Video Combine or VHS-style save node.
- target_mb - the final size you want, in megabytes. 8 or 10 for Discord depending on your server's upload tier. If you set this, 2-pass kicks in.
- crf - quality, used only when
target_mbis 0. Lower = better/bigger; 18–23 is the sane range, 23 is the default. - codec -
libx264(H.264, universally playable, your default),libx265(better compression, slower, and half the devices in your house won't play it), or theh264_nvenc/hevc_nvencGPU options if you have an NVIDIA card. - preset - speed/compression tradeoff.
fastis a fine default. - audio (optional) - feed an AUDIO signal to keep sound; it gets muxed in as 128k AAC.
Outputs
The one you care about is video_path - a plain string pointing at ComfyUI/output/compressed_videos/render_<timestamp>.mp4. The node also passes your images, audio, and fps straight through, so you can keep building downstream without breaking the chain.
Install
Easiest route is ComfyUI Manager: search "Video Compressor" and hit install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Verolelb/ComfyUI-VideoCompressor
Restart ComfyUI and the node shows up under 🎥 Video Utils. Remember the FFmpeg requirement above - that's the actual install step that bites people, not the git clone.
Where people get burned
ffmpegnot found. The node doesn't ship it. If you get an error that the command doesn't exist, the binary isn't on your PATH - the #1 failure with this pack.target_mbset to 0. You think you're targeting 8 MB, you're actually getting an uncontrolled CRF encode that might come out at 60 MB. Set it and actually run.- GPU codec + x264 preset. That preset dropdown (
ultrafast→veryslow) is libx264's vocabulary. If you pickh264_nvencand also pickultrafastorveryslow, FFmpeg won't know what to do - stick to the middle of the list (fast/medium/slow) for NVIDIA codecs. The node even switches CRF to-cqfor NVENC, which shows the author thought about it, but the preset list wasn't trimmed to match. - Output file surprise. It's not next to your render - it's in
output/compressed_videos/, named by timestamp.
Is this the best video tool in ComfyUI? No - it's a one-job node, and if you're doing serious video you'd want something like VideoHelperSuite for encoding control. But for "make this clip small enough to send," it's dead simple: connect frames, pick a size, get an mp4 that fits. No API keys, no models - just FFmpeg and one honest bit of math. If your biggest video problem is "the file is too big to share," this is the node you reach for.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| fps | FLOAT | 24.001–120 | — |
| target_mb | FLOAT | 0.00–10000 | — |
| crf | INT | 230–51 | — |
| codec | COMBO | libx264 | 4 options: libx264, libx265, h264_nvenc, hevc_nvenc |
| preset | COMBO | fast | 9 options: ultrafast, superfast, veryfast, faster, fast, medium, +3 |
| audioopt | AUDIO | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| audio | AUDIO | — |
| fps | FLOAT | — |
| video_path | STRING | — |