Nodes/Atlas Camera/Atlas Scene Scale πŸ“
ComfyUI Node

Atlas Scene Scale πŸ“

Stop hand-tuning ground-plane metres on every new plate

By mikejamesvfxΒ·Created 2 months agoΒ·Updated a day agoΒ· 1
Atlas Scene Scale πŸ“
  • depth
  • ground_width_m
  • ground_depth_m
  • ground_offset_z
  • sky_distance_m
  • median_m
  • p99_m
  • report
β—„ground_width_x3.0β–Ί
β—„ground_depth_x6.0β–Ί
β—„ground_offset_x-1.5β–Ί
β—„sky_distance_x1.8β–Ί
β—„min_spread0.15β–Ί

Every 2.5D projection scene ends up with the same two filler pieces: a ground plane and a sky card. They're the only things standing in for the hole that sky exclusion leaves behind, and their sizes are in metres - which means a set of numbers you tuned by eye on one plate is wrong on the next. The author measured it: across 31 plates, median scene distance ran from 0.95 m to 586 m. The same 50Γ—100 m ground is a wall looming in front of one subject and a postage stamp under another.

Atlas Scene Scale πŸ“ is the fix for that drudgery. Feed it the scene's depth map and it measures the scene and emits support-geometry sizes in proportion to what's actually in front of the camera.

Where the numbers come from

The defaults aren't arbitrary - they're one artist's hand-tuned judgement, generalised. Someone tuned a ground by eye on a plate whose median distance was 17.0 m and arrived at 50Γ—100 m with the plane pushed 25 m back, and a sky card at 300 m. Expressed as multiples of what the scene actually measures, that's 2.94Γ— median for width, 5.88Γ— for depth, βˆ’1.47Γ— for the offset, and 1.79Γ— the P99 depth for the sky card. The node's defaults are those ratios, so any plate - large or small - gets a plane in the same proportion. Deeper than wide on purpose: the ground exists to be travelled into.

Note it measures the depth map, not geometry. Primitives carry dimensions and a transform but no vertices; the depth map is per-pixel forward distance, which is what "how far away is this scene" actually means. And if your depth is non-metric (a relative estimator), it's reported and still used - the ratios stay right even when the metres are arbitrary, and a plane in the right proportion to a scene of unknown scale is exactly as useful as that scene is.

The inputs that matter

  • depth - required, an ATLAS_DEPTH_MAP. Everything else is optional.

The five multiplier knobs (ground_width_x, ground_depth_x, ground_offset_x, sky_distance_x) are the tuning surface if you don't like the defaults - each is a multiple of the scene's median or P99 distance rather than an absolute metre value, so they transfer between plates. min_spread (default 0.15) is the safety valve: it refuses to derive sizes when the scene has less relative depth spread than that, because a failed solve parks everything at one distance and a "median" taken from that is a confident number describing nothing. Set it to 0 only if you really want numbers regardless.

The outputs

Seven sockets: ground_width_m, ground_depth_m, ground_offset_z, sky_distance_m - the sizes you'd feed a ground-plane / sky-card builder - plus median_m and p99_m so you can see what the scene actually measured, and a report string. Wire those first four into whatever node builds the primitives (the plane and card), or read them off the report and dial the numbers in yourself.

Installing

It's a small node inside the bigger atlas-camera pack:

cd <ComfyUI>/custom_nodes
git clone https://github.com/mikejamesvfx/atlas-camera.git

Restart ComfyUI, and it shows under the Atlas menu in the orient-and-scale tier. No extra dependencies for this node - the depth map feeding it comes from whatever depth node you already run, and the maths here is pure numpy.

Gotchas

Garbage in, confident-looking numbers out. The min_spread guard is your friend - if your depth solve failed or your plate is a wall of one distance, the node will refuse rather than hand you a median-based plane that means nothing. That refusal is a feature; don't paper over it by zeroing the threshold. And remember the output is scene scale, not a finished scene - you still have to build the plane and card with those numbers and project your plate onto them.

CategoryAtlas/02 Β· Orient & Scale

Inputs (6)

NameTypeDefaultDescription
depthATLAS_DEPTH_MAPβ€”
ground_width_xoptFLOAT3.00.1–50Ground width as a multiple of MEDIAN scene distance. 3.0 reproduces the hand-tuned 50 m on a plate measuring 17 m.
ground_depth_xoptFLOAT6.00.1–100Ground depth as a multiple of median scene distance. 6.0 reproduces the hand-tuned 100 m. Deeper than wide on purpose: the plane exists to be travelled INTO.
ground_offset_xoptFLOAT-1.5-20–20Ground offset_z as a multiple of median distance. NEGATIVE pushes the plane away from camera; -1.5 reproduces the hand-tuned -25 m.
sky_distance_xoptFLOAT1.80.1–20Sky card distance as a multiple of the P99 depth, so the card sits beyond essentially all real geometry rather than through it. 1.8 reproduces the hand-tuned 300 m.
min_spreadoptFLOAT0.150–5Refuse to derive sizes when the scene has less relative depth spread than this. A failed solve puts everything at one distance β€” measured 0.05 on one plate β€” and a median taken from that is a confident number describing nothing. 0 = never refuse.

Outputs (7)

NameTypeDescription
ground_width_mFLOATβ€”
ground_depth_mFLOATβ€”
ground_offset_zFLOATβ€”
sky_distance_mFLOATβ€”
median_mFLOATβ€”
p99_mFLOATβ€”
reportSTRINGβ€”