Reference only

SAM and GroundingDINO failures: separate code, checkpoints and extensions

Identify the implementation required by the node before replacing segmentation packages or checkpoints.

Identify the implementation before changing files

The original Segment Anything project installs the segment_anything code separately from its checkpoints. Its example selects both a model type (such as vit_h, vit_l or vit_b) and a matching checkpoint. SAM 2 is a separate codebase with its own checkpoints; SAM 2.1 checkpoints require current SAM 2 code. GroundingDINO has its own installation, config and checkpoint. A third-party ComfyUI node may wrap any of these, so record the node repository and revision before following an upstream command. Do not treat similarly named models or files as interchangeable.

Separate Python imports, weights and native extensions

Use the Python interpreter that starts the affected ComfyUI instance. Record the exact missing module or loader error, node revision, Python and Torch versions, project variant, model config/type and checkpoint origin. A missing segment_anything or groundingdino module points first to code installation or the node's import path; a checkpoint load failure calls for a model/config match. Some nodes vendor dependencies, so absence of a pip distribution record alone does not prove the module is unavailable.

groundingdino._C is GroundingDINO's compiled extension, not a SAM checkpoint. GroundingDINO's README warns that a missing CUDA_HOME can lead to a CPU-only build and documents NameError: name '_C' is not defined after an incorrect install. Preserve the first build or native-load error and check the project's platform instructions before rebuilding in a recoverable environment copy. Changing weight paths cannot repair that extension. SAM 2 documents a separate custom CUDA extension for optional post-processing; its build warning does not, by itself, prove all SAM 2 inference is unavailable. Do not apply that exception to GroundingDINO's _C failure.

python -m pip show torch torchvision
python -c "import sys, platform; print(sys.executable); print(sys.version); print(platform.machine())"

Verify the original node with a small input

After checking the trusted code and matching config/checkpoint pair, test the affected detection or segmentation node with a small non-private image. Inspect the returned mask dimensions/type and downstream connections. Change one component at a time and retain the original error plus the result. Where node or platform support is unknown, say so rather than installing an unidentified wheel or presenting another user's screenshot as a local test.

Sources reviewed 2026-09-26. No local package install, extension build, checkpoint load, workflow or GPU run was performed.

Didn't solve it?

Check the next possible cause

The same symptom can come from a different cause. Work through these related entries in order.

  1. Fix cv2 imports without stacking OpenCV distributionsNo module named cv2Identify the installed OpenCV flavor before investigating missing modules or native-library loading.
  2. MMCV installation and missing-operator errors: check the build combinationNo module named mmcvDistinguish full and lite distributions, source-build failures and runtime extension loading.
Paste your full log into the error finder

Was this page helpful?

Anonymous. Only a yes/no counter is stored; no account, IP address or device details.

Sources & references

2026-09-26 English source review of original SAM, GroundingDINO and SAM 2 repositories; no local install, build, checkpoint, workflow or GPU reproduction.

01Segment Anything upstream READMESource checked: 2026-09-2602GroundingDINO upstream READMESource checked: 2026-09-2603SAM 2 upstream READMESource checked: 2026-09-26

Report an issue · 23f32f22-e165-5755-9f9f-61add37f001e