Comfy-Org/ComfyUI · error · ValueError

DA3GeometryToPointCloud produced zero points after filtering

Error message

DA3GeometryToPointCloud produced zero points after filtering. Try lowering confidence_threshold or disabling use_sky_mask.

What it means

DA3 point-cloud node raises this when, after applying the validity mask (confidence >= threshold, non-sky when use_sky_mask, finite positive depth) and optional downsampling, zero points remain. It is the point-cloud analogue of the empty-mesh error 874.

Source

Thrown at comfy_extras/nodes_depth_anything_3.py:656

        pts_flat = points_gltf.reshape(-1, 3)[mask.reshape(-1)]

        colors_flat = None
        if "image" in da3_geometry:
            img = da3_geometry["image"][batch_index]     # (H, W, 3)
            if downsample > 1:
                img = img[::downsample, ::downsample]
            colors_flat = img.reshape(-1, 3)[mask.reshape(-1)]

        conf_flat = None
        if "confidence" in da3_geometry:
            conf = da3_geometry["confidence"][batch_index]   # (H, W)
            if downsample > 1:
                conf = conf[::downsample, ::downsample]
            conf_flat = conf.reshape(-1)[mask.reshape(-1)]

        if pts_flat.shape[0] == 0:
            raise ValueError(
                "DA3GeometryToPointCloud produced zero points after filtering. "
                "Try lowering confidence_threshold or disabling use_sky_mask."
            )

        return io.NodeOutput({
            "points": pts_flat,
            "colors": colors_flat,
            "confidence": conf_flat,
        })


class DA3Extension(ComfyExtension):
    @override
    async def get_node_list(self) -> list[type[io.ComfyNode]]:
        return [
            LoadDA3Model,
            DA3Inference,
            DA3Render,

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Lower confidence_threshold (or set it to 0 to disable confidence filtering).
  2. Disable use_sky_mask.
  3. Reduce downsample if the mask already removes most pixels.
  4. Check that the depth map has finite positive values at all.
Defensive patterns

Strategy: fallback

Validate before calling

mask = torch.isfinite(depth) & (depth > 0)
if 'confidence' in da3_geometry:
    mask &= da3_geometry['confidence'][batch_index] >= confidence_threshold
if use_sky_mask and 'sky' in da3_geometry:
    mask &= da3_geometry['sky'][batch_index] < 0.5
if mask.sum() == 0:
    raise ValueError('filters reject all points; lower confidence_threshold or disable use_sky_mask')

Try / catch

try:
    cloud = build_pointcloud(geometry, batch_index, 0.5, True, 1)
except ValueError as e:
    if 'zero points' in str(e):
        cloud = build_pointcloud(geometry, batch_index, 0.0, False, 1)  # retry unfiltered
    else:
        raise

Prevention

When it happens

Trigger: confidence_threshold set near/above the map's maximum; use_sky_mask=True on an all-sky image; aggressive downsample combined with strict thresholds; depth entirely invalid.

Common situations: Landscape/sky images with sky masking on; low-confidence model outputs; thresholds copied from a different model variant.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/f74d61533772b5c0. Report an issue: GitHub.