Nodes/Atlas Camera/Atlas Bounded Band πŸ“
ComfyUI Node

Atlas Bounded Band πŸ“

Stop monocular depth from 'banana-ing' your foreground

By mikejamesvfxΒ·Created 3 months agoΒ·Updated a day agoΒ· 1
Atlas Bounded Band πŸ“
  • solve
  • depth
  • foreground_mask
  • band_split
  • cutoff_m
  • report
β—„extrude_multiplier2.00β–Ί
β—„near_pct5β–Ί
β—„far_pct95β–Ί

Here's a classic single-photo failure mode: monocular depth "bananas" a foreground subject. The statue or building or foreground ridge gets a relief mesh that extrudes far past where the object actually ends - the depth model has no idea where the back of the thing is, so it just keeps going. Atlas Bounded Band πŸ“ exists to clip that. It measures the foreground's own metric depth extent and returns one ATLAS_BAND_SPLIT that bounds the relief layer at a sensible distance, with the background card falling in behind it.

The mechanism

The node takes the foreground's segmentation mask and looks at the metric depth underneath it. It computes:

  • near = near_pct-th percentile of the foreground pixels' depth (default 5% - robust against a few stray near pixels)
  • far = far_pct-th percentile (default 95%)
  • W = far βˆ’ near, the subject's front-to-back width
  • cutoff = near + extrude_multiplier Γ— W (default multiplier 2)

So the relief is allowed to extrude back at most twice its own width before being clipped - a "the object can't be deeper than twice as deep as it is thick" rule. Set extrude_multiplier to 0 and it clips at the near edge. The percentile defaults make it resilient to a mask that includes a bit of sky or a stray close pixel.

Wiring it up

The node emits ONE band_split object, and the intended wiring is into both clean-plate layers of a foreground/background split:

  • foreground layer (band_side=foreground) β†’ clipped to [0, cutoff]: relief stops where the subject should stop, no runaway extrusion.
  • background layer (band_side=background) β†’ [cutoff, +inf]: the card sits at the median depth of everything beyond the cutoff, pushed back so the dolly gets real parallax.

Because the split is an absolute distance (split_m), both layers resolve the identical boundary regardless of their own pixel populations - no band drift, no extra reference masks. That's the design win over percentile-based splits.

Inputs: solve, depth, and foreground_mask (the subject segmentation - a SAM3 mask works great) are required. Outputs: band_split, cutoff_m (handy for logging or wiring into a check), and report with the measured numbers.

The honest limits

This needs metric depth, which means the [neural] extra and a solved focal length - without them the node fails soft, emitting an unclipped sentinel plus a report explaining why, so your foreground relief just stays unbounded instead of vanishing. It's also a heuristic: a 2Γ— width bound is a guess, not physics. A foreground object that's genuinely long front-to-back (a bridge, a colonnade) deserves a bigger multiplier; a shallow object facing you head-on wants a smaller one. But as a single knob that tames the banana, it does exactly what it promises. Install is the pack's clone-and-go plus [neural].

CategoryAtlas/03 Β· Depth

Inputs (6)

NameTypeDefaultDescription
solveATLAS_SOLVEβ€”
depthATLAS_DEPTH_MAPβ€”
foreground_maskMASKβ€”
extrude_multiplieroptFLOAT2.000–20cutoff = near + this Γ— (foreground depth extent W). 2.0 = the relief may extrude back at most twice its own front-to-back width before being clipped. 0 = clip at the near edge.
near_pctoptFLOAT50–100Percentile of the foreground pixels' metric depth taken as the subject's NEAR edge (robust to a few stray near pixels).
far_pctoptFLOAT950–100Percentile taken as the subject's FAR edge. W = P(far_pct) βˆ’ P(near_pct).

Outputs (3)

NameTypeDescription
band_splitATLAS_BAND_SPLITβ€”
cutoff_mFLOATβ€”
reportSTRINGβ€”