ComfyUI Node

CPA PartReport

Checking What Your Shift-Click Actually Grabbed

By rik-python·Created about a month ago·Updated 9 days ago· 50
CPA PartReport
  • mask
    ◄token►

    The alt-click and shift-click gestures in the Comfy Pro Alpha Generator are the difference between a tool that works on tidy plates and one that works on the shots you actually get. Alt-click cuts a part - someone else's hand on your subject's shoulder. Shift-click adds one - a hand SAM 3 missed, a held prop you want in the same matte.

    Both gestures are a lie until you can see what they selected. CPA PartReport is the node that makes them visible: one mask in, one preview image out to the picker.

    What it does

    mask is a single-frame mask - the result of a SAM 3 point segmentation from your click. token is a string that names the file and comes back in the payload.

    It takes the first frame of the mask batch, thresholds it at 0.5, writes a black-and-white PNG to ComfyUI/temp/comfy_pro_alpha_detect/part_<token>.png, and returns the UI payload comfy_pro_alpha_part containing the token and the file reference. The picker draws that as an overlay so you can see exactly which pixels your click claimed before you commit to tracking them across a 250-frame shot.

    No outputs. No IMAGE, no MASK, nothing to wire downstream - the node's product is the preview, and the actual decision lives in the generator's picks JSON.

    Why it earns its place

    Because a bad add-click is expensive and silent. Tracking runs forward from the frame you made the click on, so if you shift-click a hand at frame 40 and SAM 3 decides you meant the whole arm plus a slice of the door behind it, you find out four minutes later when the matte has a door in it. Seeing the part mask first turns that into a one-second correction.

    The pack's own troubleshooting leans on this constantly. Ghosted fingers over the subject? Cut the other person's hand on the first frame it appears. The subject's arm around a friend disappearing? Add it on a frame where it touches. Grey gaps between curls? That's the hair guide, not a click. Every one of those instructions assumes you can see what a click selected, which is this node.

    Two rules from the README that are worth internalising while we're here: add and cut on the first frame the part appears, because tracking only goes forward; and Ctrl-click removes a marker, so a wrong click costs you a Ctrl-click, not a re-render.

    Sibling, and how to tell them apart

    CPA DetectReport is the same idea for the Find/Detect path: multiple subjects on one frame, boxes plus mask thumbnails, named det_<token>_<i>.png. Both write into the same temp/comfy_pro_alpha_detect folder, both emit a UI payload instead of a tensor, and both are hidden from the node menu. The difference is one-mask-versus-many, and which gesture triggered them.

    If you're debugging a picker that shows nothing, that shared temp folder is the place to look: if the PNGs are appearing in ComfyUI/temp/comfy_pro_alpha_detect/ but no overlay shows in the node, the backend is fine and the front-end script is stale - reload the browser tab.

    Install

    Part of the pack, nothing extra:

    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
    

    It's flagged deprecated so it stays out of node search - the pack registers its internal stages that way, and every one of them still runs. You'll see CPA PartReport in an expanded graph, on the branch that only executes when the picker asks for a part preview.

    The honest limit

    This node previews a single-frame segmentation. It does not tell you whether SAM 3 will hold that part across the shot - that's what the track does, and the way you check it is Preview 49 frames. So the workflow is: click, look at the part preview, preview 49 frames, look at the alpha, then commit to the full shot. Skipping the middle step is how people end up rendering 250 frames of a matte that drifts at frame 120.

    CategoryComfy Compositing/internal

    Inputs (2)

    NameTypeDefaultDescription
    maskMASK—
    tokenSTRING—

    Outputs (0)

    No outputs