Image H264 Compression (mtb)
Add controllable H.264 artifacts to images for LTX video
- image
- IMAGE
This one sounds backwards: a node whose whole job is to degrade your image with H.264 compression on purpose. Image H264 Compression (mtb) runs your image through the H.264 video codec at a compression level you choose and hands back the slightly-crushed result. You'd normally spend effort avoiding compression artifacts - so why add them?
Because some video models expect them. This node was recommended by the creators of LTX Video (shared over Banodoco's Discord, per the node's own notes) as a way to condition input frames so they match the compressed look the model was trained on. Feeding LTXV a too-clean image could sit off-distribution; nudging it toward codec-realistic input helped. That's the niche. The author is also refreshingly honest right in the node description: it's "not really needed with the latest version of LTXVideo." So treat it as a targeted tool for a specific (and possibly now-dated) LTX workflow, not a general-purpose node.
It lives in MTB Nodes (comfy_mtb) by melMass; the original code is credited to mix (XmYx).
How it works
It encodes the image with H.264 at a target CRF (Constant Rate Factor) - the same quality dial video encoders use - then decodes it back to an image. The round-trip through the codec bakes in exactly the kind of blocking, banding, and detail loss you'd get from a compressed video frame. Lower CRF means higher quality and lighter artifacts; higher CRF means heavier compression and more visible degradation. Because it's really running the H.264 codec, it relies on ffmpeg being available.
The inputs and outputs that matter
image- the image (or batch) to compress.crf(default 23, range 0–51) - the compression amount, and the only knob that matters. This is the standard H.264 scale: 0 is lossless, 23 is the common "visually fine" default, and 51 is maximally crushed. Lower = cleaner, higher = more artifacts. If you want a subtle codec-realistic touch, stay near the low-to-mid 20s; push higher only if you specifically want obvious degradation.
Output is a single IMAGE - the compressed-then-decoded frame, ready to feed into your LTX (or other) pipeline as conditioning input.
How to install it
ComfyUI Manager: search MTB Nodes, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb
then restart. Because this node actually invokes the H.264 codec, it needs ffmpeg installed and on your PATH. If ffmpeg isn't present, the node can't encode and will error - that's the main install prerequisite here, unlike the pack's pure-Python utilities.
Common issues & troubleshooting
Encoder / ffmpeg errors. The most likely failure is a missing or unreachable ffmpeg. Install ffmpeg and make sure it's on your system PATH, then restart ComfyUI. If the node imports but fails at run time complaining about an encoder, that's the cause.
You probably don't need it anymore. Worth repeating because the author says it: newer LTX Video versions don't require this pre-compression step. If you're following a recent LTXV tutorial and this node isn't in it, that's expected - don't add it "just in case." Reach for it only if a specific older workflow calls for it or you're deliberately going for a compressed look.
No visible change at low CRF. At CRF near 0 the image is essentially lossless, so you won't see much. If you're trying to see the effect, push CRF up into the 30s–40s; if you're conditioning LTX, a moderate value is the point and heavy artifacts aren't the goal.
Using it as a creative "lo-fi" filter. It works for that - crank CRF for a deliberately compressed, VHS-ish degradation - just know that's off-label. Its reason for existing is model conditioning, not stylization.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The input image tensor to be compressed and decompressed. | |
| crf | INT | 230–51 | Constant Rate Factor for h264 encoding (lower values mean higher quality). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |