ComfyUI node cuts out people with one click, down to 4K hair detail (SAM3 + LTX-2.5)
The open-source "Comfy Pro Alpha Generator" node combines SAM3 and LTX-2.5 alpha-gen to cut out a clicked person with hair-accurate edges. It runs in ComfyUI from 12 GB VRAM and delivers a 16-bit alpha plus a clean composite, even in native 4K.

What it's about
The "Comfy Pro Alpha Generator" is an open-source node for ComfyUI (the graphical interface for local image and video AI) by Rikin Patel (Comfy Compositing). It solves a classic VFX problem: isolating a single person from a video scene ("roto"), including fine hair. You click the person, the system tracks them through the video, and it delivers a 16-bit alpha (a transparency mask) plus a clean, premultiplied composite. The node is an entry in Comfy Org's "Open Source Higgsfield" contest and uses open weights only. Current version: 0.5.5. License: GPL-3.0.
The problem and the idea
There are two existing approaches, and each only does half the job:
| Approach | Selects subject | Edge quality |
|---|---|---|
| LTX-2.5 alpha-gen (generative) | no | hair-accurate |
| SAM3 / ONYX-style (discriminative) | yes | soft, strands get lost |
| Comfy Pro Alpha Generator | yes | hair-accurate |
LTX-2.5 alpha-gen renders hair remarkably well, but it mattes every main person in the frame and you can't tell it which one. SAM3 (a segmentation model that tracks arbitrary objects) selects precisely but produces soft edges. The node combines both: SAM3 decides what, LTX decides how the edge looks.
How it works
You can't tell LTX whom to matte, so the node changes what LTX sees. SAM3 finds all the other people, and they are removed from a copy of the scene with an inpainted background. A flat color fill doesn't work, because LTX reads it as a semi-transparent object. LTX then mattes the remaining person on its own.
Further steps, according to the README:
- Where people touch, LTX returns 1.0 on both sides. Within about 15 px of that contact, the node uses a stabilized ViTMatte edge instead.
- Parts that LTX doesn't recognize as the main subject (a parked car, for example) are filled in by ViTMatte.
- LTX renders 49 frames at once, so edges stay steady. Long scenes are processed in overlapping, cross-faded chunks. SAM3/ViTMatte outputs are smoothed with optical flow.
- At launch, the node builds a ComfyUI graph. Every stage is cached, so switching between Fast/Best or between preview and full render reuses existing results.
You can also type a word as the subject (dog, red car, bike) or click on anything. Similar objects are excluded automatically, such as the white dog out of four dogs, or the bike without its rider.
New in v0.5
Native 4K (v14): LTX works at 1920x1088. For larger frames, the node additionally renders half-overlapping 1920x1088 tiles along the subject's edge, so 4K strands are real rather than an upscaled 1080p mask. Tested with UHD 4K, DCI 4K and 2K. On an RTX 5090 with long, fine hair:
| UHD 4K scene | 1080p upscaled | Native 4K (default) |
|---|---|---|
| 49-frame preview | approx. 4 min, 20 GB RAM | approx. 9 min, 24 GB RAM |
| 242 frames | 19 min, 73 GB RAM | 58 min, 97 GB RAM |
The gain is biggest for individual strands, flyaways and fur. Thick hair (braids) benefits little. Where the subject touches other people, the 1080p result is intentionally kept.
Clean edge color (v15): Soft edges still carry the color of the original background (sky, grass), which shows up as a halo over a new background. The node reconstructs the subject's own color and saves a premultiplied composite as rgba_ files. The alpha stays unchanged. "Quick" (default) pushes color outward from 2 px inside, similar to Nuke's EdgeExtend. In testing, the background share in the edge dropped from 0.159 to 0.056. "Perfect" additionally uses LTX-2.5 Clean Plate (which removes people and rebuilds the background) and subtracts it out, falling back to Quick where that isn't reliable. At 4K, the background share fell by 41%.
Overlap mode (v13): When hands, arms or hair of other people cross the subject, three LTX passes run (whole scene, subject, all others) plus a depth model (Depth Anything V2 Small, 99 MB) that decides who is in front. In a synthetic test, the overlap error fell from 105.6 to 21.5. The cost: about 4.7 instead of 4 minutes for the 49-frame preview.
Measurements
Tested on a 247-frame scene with three children, with only the middle one matted:
| Method | Edge detail | Flicker vs. LTX |
|---|---|---|
| SAM3 mask | 29.4% | 2.6x |
| ONYX-style (SAM3 + ViTMatte) | 45.0% | 1.7x |
| ONYX-style + stabilization | 46.1% | 0.5x |
| Comfy Pro Alpha Generator | 88.7% | 1.2x |
| Overlap mode | 90.3% | 1.9x |
Important: both metrics use LTX as the reference and therefore favor LTX-based methods. The author admits this himself. The stabilized ViTMatte variant flickers less because it is smooth and has no strands. "ONYX-style" is a re-creation of the published pipeline of ONYX Ai Matte v3. The commercial plugin itself was not tested.
Usage
The node guides you through three steps: load the plate, click the subject, render. For corrections, Alt-click cuts a part out, Shift-click adds one, and Ctrl-click removes markers. Start with a 49-frame preview, then run the full clip. Output: 16-bit PNG or half-float EXR. EXR input and output are supported, and frame numbers are preserved. Modes: Best (2 LTX passes), Fast (1 pass, about half the time) and Overlap. After a run, QC badges show flicker, detail match and LTX coverage. Technically, LTX runs with int8 attention (Comfy Kitchen), which cuts sampling time from 5.09 to 3.25 s/step. A 13 GB text encoder isn't needed, because the empty-prompt conditioning ships with the node.
What you need to try it
- A graphics card with at least 12 GB VRAM (per the README) and 16 GB RAM or more.
- At 4K you need much more RAM: 24 GB for the preview and around 97 GB for 242 frames. For long shots there is disk streaming, which the author says roughly halves the requirement.
- A current ComfyUI (0.38+), the ComfyUI-SAM3 and ComfyUI-LTXVideo nodes, and the models. You must accept two Lightricks licenses on Hugging Face.
- The timings come from an RTX 5090. Smaller cards will take longer. The source says nothing about Mac, CPU or Colab.
Our take
The node is a pragmatic way to make a generative model controllable: you only show it what to matte. For compositing beginners and VFX hobbyists with a local GPU, it's exciting, because it produces hair-fine cutouts without a green screen. On the critical side: the quality numbers are self-measured with LTX as the reference, on a single test scene, and independent comparisons are missing. Overlap mode increases flicker, and 4K is compute- and memory-hungry. The GPL-3.0 license applies to the node. The LTX models have their own license terms.
Sources
- Reddit: lokale Modelle & Bild-KI github.com
Ask the AI assistant
Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.
The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.
Comments
What do you think? Already tried it? Write it here, no sign-up needed.
Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.