Comfy-Org/ComfyUI · error · ValueError

apply_sky_clip=True requires a sky tensor in the da3_geometr

Error message

apply_sky_clip=True requires a sky tensor in the da3_geometry input, but none is present. Run with Mono/Metric models or set apply_sky_clip=False.

What it means

DA3 geometry decode node raises this when output is 'depth'/'depth_colored' with apply_sky_clip enabled, but the da3_geometry dict contains no 'sky' key. Sky-aware clipping needs a sky-probability map, which is only produced by Mono/Metric models; geometry from other models lacks it.

Source

Thrown at comfy_extras/nodes_depth_anything_3.py:421

                        io.Boolean.Input("colored", default=False, tooltip="Apply the Turbo colormap to the sky mask."),
                    ]),
                    io.DynamicCombo.Option("confidence", [
                        io.Boolean.Input("colored", default=False, tooltip="Apply the Turbo colormap to the confidence map."),
                    ]),
                ]),
            ],
            outputs=[io.Image.Output()],
        )

    @classmethod
    def execute(cls, da3_geometry, output) -> io.NodeOutput:
        output_val = output["output"]

        if output_val in ("depth", "depth_colored"):
            normalization = output["normalization"]
            apply_sky_clip = output["apply_sky_clip"]
            if apply_sky_clip and "sky" not in da3_geometry:
                raise ValueError(
                    "apply_sky_clip=True requires a sky tensor in the da3_geometry input, but none is present. "
                    "Run with Mono/Metric models or set apply_sky_clip=False."
                )
            depth = da3_geometry["depth"]
            sky = da3_geometry.get("sky")
            if apply_sky_clip and sky is not None:
                depth = torch.stack([
                    da3_preprocess.apply_sky_aware_clip(depth[i], sky[i])
                    for i in range(depth.shape[0])
                ], dim=0)
            grey = cls._depth_to_image(depth, sky, normalization)  # (B,H,W,3) greyscale
            result = _turbo(grey[..., 0]) if output_val == "depth_colored" else grey

        elif output_val == "sky_mask":
            if "sky" not in da3_geometry:
                raise ValueError("geometry has no sky output; run with Mono/Metric models.")
            sky = da3_geometry["sky"]
            if output["colored"]:

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Set apply_sky_clip=False in the output input of the decode node.
  2. Or switch the upstream DA3 model to a Mono/Metric checkpoint, whose geometry includes 'sky'.
Defensive patterns

Strategy: validation

Validate before calling

apply_sky_clip = output['apply_sky_clip'] and ('sky' in da3_geometry)
if output['apply_sky_clip'] and 'sky' not in da3_geometry:
    logging.warning('sky missing in geometry; disabling apply_sky_clip')

Type guard

def geometry_has_sky(geo: dict) -> bool:
    return 'sky' in geo

Prevention

When it happens

Trigger: Running a Small/Base (non-sky) DA3 model upstream, then requesting depth output with apply_sky_clip=True in the output widget. The check is a simple 'sky' not in da3_geometry membership test.

Common situations: Reusing an output configuration tuned for a Mono model after switching to Small/Base; enabling sky clip by default in shared workflows; deep-reciprocal-driving variants that skip sky output.

Related errors


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