# kijai/ComfyUI-segment-anything-2

ComfyUI nodes to use segment-anything-2

Repository: https://github.com/kijai/ComfyUI-segment-anything-2
Canonical: https://ross.abutalabs.com/products/comfyui-segment-anything-2
Language: Python
License: Apache-2.0
License Family: permissive
Last push: 2025-09-28T08:35:30+00:00

## Health v2 (maintenance only)
Score: 43/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 44, release rhythm 35, longevity 54
- inputs: {"age_days": 764, "days_push": 339, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1214, forks 86 (observed 2026-08-28T04:04:00.876813+00:00)

## What it is
A set of ComfyUI custom nodes that bring Meta's Segment Anything 2 (SAM2) models into ComfyUI workflows for promptable image and video segmentation. SAM2 weights are automatically downloaded from Hugging Face in safetensors format into the ComfyUI models/sam2 directory, and generated masks can feed downstream nodes for inpainting or compositing.

## Use cases
- use segment anything 2 inside ComfyUI
- generate segmentation masks for images in ComfyUI workflows
- segment and track objects across video frames in ComfyUI
- create masks for inpainting in stable diffusion pipelines
- automatically cut out subjects from images or videos
- run SAM2 models locally with automatic weight downloads

## When to choose
- You already work in ComfyUI and want SAM2 segmentation as drop-in nodes in your node graph
- You need promptable image or video segmentation masks to drive inpainting, compositing, or other downstream nodes
- You want safetensors SAM2 weights managed automatically rather than converting checkpoints yourself

## When to avoid
- You need a standalone segmentation library or CLI outside ComfyUI - use the original facebookresearch/segment-anything-2 instead
- You need production-hardened tooling - the README marks the project as work in progress and for testing
- You rely on built-in mask postprocessing that requires CUDA extension compilation, which is currently disabled in these nodes

## Facets
- artifact type: plugin
- maturity: active
- function: computer-vision, image-processing, video-processing, machine-learning
- domain: computer-vision, image-processing, machine-learning
- platform: python, cross-platform
- tags: comfyui, comfyui-custom-nodes, segment-anything-2, sam2, image-segmentation, video-segmentation, mask-generation, promptable-segmentation, safetensors, inpainting-masks, video, desktop, gpu

## Member repositories
- kijai/ComfyUI-segment-anything-2 (main) score 43

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:00.876813+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:17:29.777582+00:00, confidence not recorded.
  - readme: https://github.com/kijai/ComfyUI-segment-anything-2 (fetched 2026-08-28T04:04:00.876813+00:00, sha cbfc0b652e03)
- Data as of 2026-08-30T08:39:29.467469+00:00.
