SAM and GroundingDINO, Now Inside ComfyUI Nodes
Brings text-driven image segmentation from the Stable Diffusion Web UI ecosystem into ComfyUI node graphs.

What it does
This project is a ComfyUI adaptation of the sd-webui-segment-anything pipeline. It wires GroundingDINO and the Segment Anything Model (SAM) into ComfyUI’s node graph, letting you generate masks by describing objects with plain text instead of clicking coordinates. The author states that output remains consistent with the original Web UI version for identical inputs.
The interesting bit The value is less about reinventing segmentation and more about translating a proven Stable Diffusion workflow into ComfyUI’s modular, node-based environment. It turns a text description into a segmentation mask that downstream nodes can consume.
Key highlights
- Supports multiple SAM variants, including the heavyweight
sam_vit_h, lightersam_vit_b, and the 39 MBmobile_sam. - GroundingDINO models (
SwinTandSwinB) provide the text-to-bounding-box bridge. - Models can auto-download on first use, or you can stage them manually.
- Includes
bert-base-uncasedintegration via thetransformerslibrary for text encoding.
Caveats
- The README explicitly notes that only the “most core functionalities” have been implemented so far, implying the feature set is currently narrower than the original Web UI version.
Verdict Worth a look if you are already invested in ComfyUI and need text-driven masking for inpainting or compositing. Skip it if you are happy using the original Automatic1111 extension or need a fully mature feature set today.
Frequently asked
- What is storyicon/comfyui_segment_anything?
- Brings text-driven image segmentation from the Stable Diffusion Web UI ecosystem into ComfyUI node graphs.
- Is comfyui_segment_anything open source?
- Yes — storyicon/comfyui_segment_anything is open source, released under the Apache-2.0 license.
- What language is comfyui_segment_anything written in?
- storyicon/comfyui_segment_anything is primarily written in Python.
- How popular is comfyui_segment_anything?
- storyicon/comfyui_segment_anything has 1.1k stars on GitHub.
- Where can I find comfyui_segment_anything?
- storyicon/comfyui_segment_anything is on GitHub at https://github.com/storyicon/comfyui_segment_anything.