Comfy Pro Alpha Generator: click one person in a shot and get a native 4K alpha matte with hair-level edges in ComfyUI

Comfy Pro Alpha GeneratorFree, open source (GPL-3.0; runs locally)

Comfy Pro Alpha Generator is a free, open-source ComfyUI node by VFX compositor Rikin Patel that pulls a matte of one chosen person from a video. SAM 3 picks and tracks the subject and LTX-2.5's alpha-gen IC-LoRA draws the edge, so single hair strands survive, at native 4K and with 12 GB of VRAM.

What it does

Load a plate, click your subject and preview 49 frames. SAM 3 tracks the person you clicked, the other people are inpainted out of a temporary copy of the plate, and LTX-2.5 alpha-gen draws the edge of the one person left; you get a 16-bit alpha plus a clean premultiplied comp, EXR in and out, with the plate's frame numbers kept. On plates bigger than 1920x1088 it runs LTX again on native-resolution tiles along the subject's edge, so 4K strands are real rather than a 1080p matte scaled up. An overlap mode uses three LTX passes plus Depth Anything V2 to decide who is in front when people cross, and a final step removes the old background colour from the hair edges.

Results and limits

On the author's 247-frame test plate of three children with their arms around each other, matting only the middle child, the edge matched LTX's own generative hair at 88.7%, against 45.0% for a SAM 3 + ViTMatte pipeline and 29.4% for a plain SAM 3 mask (LTX is the reference, which the README notes favours LTX-based methods). On an RTX 5090 a 49-frame 4K preview with native edges took about 9 minutes and a 242-frame 4K shot about 58 minutes, peaking at 97 GB of RAM.

Worth knowing

Needs ComfyUI 0.38 or newer, the ComfyUI-SAM3 and ComfyUI-LTXVideo node packs, an NVIDIA GPU with 12 GB+ VRAM and about 28 GB of models; with 16 to 48 GB of RAM keep the models on an NVMe SSD so ComfyUI streams them from disk. Version 0.5.5 (27 October) moved the code to GPL-3.0, with a paid licence for closed-source products. LTX-2.5 and its IC-LoRAs stay under the LTX-2.x Community License (companies with $10M+ annual revenue need a paid licence) and SAM 3 under Meta's SAM License. Native 4K edges are turned off where people overlap, and fully hidden subjects can break tracking.

Read the primary source >

More coverage

Related entries

< Back to all entries