Nodes/Avatar Graph/Combine Points
ComfyUI Node

Combine Points

Merging SAM click-prompts into one prompt string

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Combine Points
    • SAM_PROMPTS

    A supporting node for Avatar Graph's SAM-based segmentation step, part of avatech.ai's pack for building rigged, interactive avatars from a flat character image inside ComfyUI. It sits alongside SAM MultiLayer - the node the README describes as letting you "directly select and create multiple image segment output" - and its job is to gather multiple segmentation prompts into the single JSON string SAM actually consumes.

    A quick honest note on the schema

    This node's info_schema shows no inputs at all, static or otherwise - just a single output. That's unusual, but it fits a pattern seen elsewhere in packs with heavy custom frontend UI: the actual point-and-click prompting happens through JavaScript widgets drawn directly on the node's canvas preview (you click on the image to drop a point), not through standard Python-declared node inputs that a schema dump can see. So rather than guess at inputs that aren't documented anywhere in the schema, the honest description is: this node's real interface is the click-to-add-a-point interaction in the ComfyUI canvas itself, and the schema only tells you what comes out the other end.

    What comes out

    The single output is SAM_PROMPTS, typed as a plain STRING. Given this pack's SAM workflow - clicking points and boxes on a character image to carve out segments - this is almost certainly the serialized JSON collection of those prompts, in the shape SAM MultiLayer's own image_prompts_json field expects. In practice you're not meant to construct this by hand; it's built for you as you click, and this node's role is to consolidate however many individual points you've placed into the one string the SAM node reads.

    Installing it

    ComfyUI Manager: search avatar-graph-comfyui. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/avatechai/avatar-graph-comfyui
    cd avatar-graph-comfyui && python -m pip install -r requirements.txt
    

    This node doesn't depend on bpy the way the pack's mesh-manipulation nodes do, but it ships as part of a pack that's built entirely around Blender's Python module, and the pack as a whole is pinned to Python 3.10.x because of it. So it's still going into a dedicated environment - a conda env pinned to 3.10 on Mac/Linux, or the README's prebuilt Windows Python 3.10 ComfyUI zip - rather than whatever newer Python your main ComfyUI already runs. If you're specifically using the SAM segmentation step this node supports, make sure the sam_vit_h_4b8939.pth checkpoint (Meta's original ViT-H SAM weights, roughly 2.4GB) is downloaded - ComfyUI Manager should offer it, or grab it manually if not.

    Troubleshooting

    If your character image isn't segmenting the way you expect, the issue is more often the click-prompts feeding into this node than the node itself - a low-resolution source image or ambiguous regions (a closed mouth, for instance) make it genuinely hard for SAM to distinguish what you're pointing at, which shows up downstream as a bad or missing segment regardless of how this combining step behaves. Because this node's interface is UI-driven rather than field-driven, there's not much to misconfigure here directly; if SAM_PROMPTS comes out empty, the more useful thing to check is whether any points were actually placed on the image in the first place.

    Categoryimage

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    SAM_PROMPTSSTRING