Nodes/ComfyTV/Split Parts
ComfyUI Node

Split Parts

Turn One Image Into Its Pieces With SAM3

By jtydhr88·Created 3 months ago·Updated about 17 hours ago· 725
Split Parts
  • image
  • images
  • image
force_run_token0
project_id
parent_output_id0
workflowSAM3 Points & Boxes
parts_data
main_prompt
selected_index1
custom_params{}

You've generated a great product shot, and now you want the logo on a separate layer from the strap, from the buckle - each as its own transparent PNG, ready for a layered editor. That's the job ComfyTV's Split Parts stage exists for: it runs a segmentation workflow and returns one transparent-background image per part, under ComfyTV/Image.

Under the hood it drives SAM3 - Meta's Segment Anything 3, the open-vocabulary version that segments from points, boxes, or text. The stage ships two workflows, selectable in the workflow dropdown:

  • SAM3 Points & Boxes (default) - you draw point groups and boxes directly on the node's image card. The stage runs once per point-group and once for all boxes, and parts_data (hidden JSON of those prompts in source-pixel coordinates) is what carries your drawing to the model.
  • SAM3 Text - instead of clicking, type a concept in main_prompt ("strap", "buckle", "logo") and the open-vocabulary model segments every instance it finds.

Feed the source through the optional image input and you get two outputs: images (the COMFYTV_IMAGES batch - one transparent PNG per part) and image (a single pick; the selected_index field is the 1-indexed thumbnail pick). The parts then flow into the 2D layer editor for reassembly.

The model file you'll need

SAM3 nodes are ComfyUI core (comfy_extras/nodes_sam3.py), so no extra node pack - but the model itself has to be downloaded once:

# place in ComfyUI/models/checkpoints/
# sam3.1_multiplex_fp16.safetensors
# https://huggingface.co/Comfy-Org/sam3.1

One real gotcha, and it's a Windows one: SAM3's nodes can pull in Triton, which is a well-known obstacle on Windows. If the workflow errors with a Triton/compile message, that's the culprit, not your setup. The text workflow also needs a prompt, or the stage errors with its own message: "Split Parts needs a prompt: click/box the parts to separate on the card, or type a concept (text workflow)."

Install

With ComfyTV:

cd ComfyUI/custom_nodes
git clone https://github.com/jtydhr88/ComfyTV

Restart ComfyUI; under ComfyTV → Image. ComfyUI Manager: search "ComfyTV". Desktop/macOS: clone into the running instance's absolute custom_nodes (startup-log path), fix any ComfyTV/ComfyTV/ nesting, full backend restart.

Troubleshooting

  • Parts come out with black backgrounds, not transparency. The docs flag this exact binding gotcha: the workflow writes alpha = 1 - mask, so put an InvertMask in front of the mask when compositing SAM masks to transparency.
  • Nothing segments. If you drew points/boxes and it still errors, you likely need the prompt path too - or the model file is missing from ComfyUI/models/checkpoints/ (first-run check).
  • Windows/Triton errors. SAM3's Triton dependency is the known obstacle; that's a platform issue, not a ComfyTV bug.
CategoryComfyTV/Image

Inputs (9)

NameTypeDefaultDescription
force_run_tokenINT00–2147483647Internal — bumped on Run to invalidate ComfyUI's input cache.
project_idSTRINGInternal — populated by the projectStore on the frontend.
parent_output_idINT00–2147483647Internal — lineage parent set by spawn handlers on the frontend.
workflowCOMBOSAM3 Points & BoxesWhich segmentation workflow to run.
parts_dataSTRINGInternal — JSON of the part prompts drawn on the card (point groups and boxes, in source-image pixel coords).
main_promptSTRING
selected_indexINT11–999Internal — 1-indexed cell pick for image-batch stages. Driven by clicking a thumbnail in the node's output grid.
custom_paramsSTRING{}Internal — JSON of user-defined parameter attachments/values for this node.
imageoptCOMFYTV_IMAGE

Outputs (2)

NameTypeDescription
imagesCOMFYTV_IMAGES
imageCOMFYTV_IMAGE