ComfyUI Node

CPA NativeIsolate

The 4K Version of Painting Everyone Else Out

By rik-python·Created about a month ago·Updated 9 days ago· 50
CPA NativeIsolate
  • plate
  • selection
  • others
  • isolated
◄grow12►
◄blur12.00►
◄start0►

CPA NativeIsolate is CPA Isolate with one added problem: the masks it's given were measured at 1080p, and the plate it has to paint is 4K.

If you've read the Isolate article, you know the trick - paint every other subject out with inpainted background so LTX sees exactly one person. On a plate bigger than 1920x1088 the pack runs that whole decision-making process on a proxy, because LTX alpha-gen is tuned for 1920x1088 and a 4K render would be slow and no more accurate. Then, for the edges, it goes back to native resolution: cut the plate into overlapping 1920x1088 tiles, render the tiles that touch the subject's outline, merge the strands back into the proxy matte.

Those native tile passes need an isolated plate at native resolution. That's this node.

What it does

Same idea as Isolate, different plumbing. plate is the native-resolution images, selection and others are the proxy-sized masks, start offsets into the plate. For each frame it resizes both masks up to the plate's dimensions with bilinear interpolation, then runs the identical paint routine: dilate others by grow, intersect with 1 - selection, build a hole mask, Telea-inpaint at quarter resolution, blur, composite the reconstruction under the paint.

The defaults are doubled relative to the 1080p node - grow 12, blur 12 instead of 6 and 6 - because a pixel at 4K is half the angular size it is at 1080p. The pack's native-edges code computes it more precisely as round(6 * scale) where scale is native-width over proxy-width, so the paint covers the same physical distance on the frame. If you hand-wire this node for a 6K plate with the defaults, your paint ring is a bit tight.

Output is isolated, uint8, native size. It feeds the tile passes; you never see it unless you're debugging.

Why a separate node instead of a parameter

Memory, again, and the same reasoning that shapes the rest of this pack's internals. If the proxy masks were scaled to native resolution and cached as their own node output, you'd be holding a stack of 4K masks - and a 4K float32 mask stack is not a rounding error, it's most of a machine. Fusing "scale the masks up" with "paint the plate" means neither the upscaled masks nor the intermediate isolation buffers ever become cached objects. One frame in flight, then gone.

The docstring puts it in the pack's own words: the node is fused so that no native-resolution mask stacks are cached.

Where it sits

CPA NativeEdges expands at run time - it only knows which tiles it needs after SAM 3 has tracked the subject - and it builds one of these plus an LTX pass per selected tile. Each tile gets its own chunked render, its own CPA TileGuide, its own CPA DecodeStitch. All of it hidden inside one switch on the main node labelled native-resolution edges (v14), which is on by default and greyed out on plates of 1080p or less.

Like every /internal node here, it's flagged deprecated so it stays out of the node menu, and you'll only meet it in an expanded graph.

Install

Part of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/rik-python/ComfyUI-Comfy-Pro-Alpha-Generator.git
pip install -r ComfyUI-Comfy-Pro-Alpha-Generator/requirements.txt

Restart ComfyUI afterwards. The tile path needs ComfyUI 0.38+ (it calls LTXAddVideoICLoRAGuide from core's LTX support) and ComfyUI-LTXVideo.

When it's the wrong tool

On a plate that's only slightly over 1080p - 2K, 2048x1080 - the extra detail is marginal against the full tile cost. The README says to switch native edges off there, and it's right; you get the 1080p matte scaled up, 2–3x faster, and you won't see the difference on anything but single strands.

And the same limitation as its 1080p sibling, inherited: where the subject touches another person, the native tile result is deliberately thrown away in favour of the proxy. A tile only sees part of the frame, so it makes worse big decisions about who is in front of whom. Native edges give you strands; they don't give you a better crossing.

CategoryComfy Compositing/internal

Inputs (6)

NameTypeDefaultDescription
plateIMAGE—
selectionMASK—
othersMASK—
growINT12—
blurFLOAT12.00—
startINT0—

Outputs (1)

NameTypeDescription
isolatedIMAGE—