Nodes/Atlas Camera/Atlas Constrained Solve
ComfyUI Node

Atlas Constrained Solve

Hand the solver your vanishing points and scale

By mikejamesvfx·Created 3 months ago·Updated a day ago· 1
Atlas Constrained Solve
  • image
  • ATLAS_SOLVE
constraints_json{}
focal_length_mm0.00
sensor_width_mm36.00

The standard AtlasInput solve figures out the camera from the image alone - vanishing points, horizon, the works. Usually that's great. But when the automatic guess is wrong, or when you know the geometry and want the camera to conform to it, Atlas Constrained Solve is the guided alternative: you hand it a JSON of line constraints and scale constraints, and it solves the camera subject to them. Think of it as the "I know better than the auto-solve" button, expressed as data instead of hoping.

What the constraints mean

The constraints_json input takes a dict with two keys:

  • line_groups - groups of image-space lines that you're asserting are parallel (or share a vanishing point) in the world. This is classic single-point / multi-point perspective: if you can trace the roof lines, the road edges, the building sides, you're giving the solver the perspective structure it needs to pin the orientation and focal length.
  • scale_constraints - known real-world measurements, the same idea as the scale-reference cascade but hand-written. A known wall height, a door, a car - anything that fixes the metric scale.

Where does the JSON come from? The Atlas UI draws and exports it, or you hand-craft it. The node just parses and runs.

The intrinsics hint

Two optional floats let you stop the solver from guessing the lens entirely:

  • focal_length_mm - the lens focal length. Default 0 (auto); set it when you know it.
  • sensor_width_mm - the sensor width. Default 36 (full-frame). If you set a focal length, the solver uses the two together as a real intrinsics hint instead of a learned prior's estimate.

These are the same numbers you'd get from a camera RAW's EXIF via AtlasLoadRAW - this node is the manual, "I read the EXIF myself" route. The combination is what makes the constrained solve metric: real lines for orientation, real lens numbers for focal, real measurements for scale.

The honest framing

This is a deterministic geometric solve - the pack's "vanishing-point" tier, which wants [vision] (numpy + OpenCV) for line detection if you're deriving lines automatically. If your image is AI-generated and has no clean straight edges converging to consistent vanishing points, the learned GeoCalib prior (AtlasLearnedSolveFromImage) is the more robust alternative - that's the pack's documented answer to "constrained solve fails on dreamy images." And note the category: it lives in 01 · Input & Camera (not advanced), so the pack treats it as a first-class way into a solve, not an afterthought.

Input is image + constraints_json; output is a single ATLAS_SOLVE ready to feed the viewport, the layer stack, or the exporters. Install is the pack's clone-and-go; the [vision] extra for automatic line detection, [neural] only if you want the learned-prior fallback.

CategoryAtlas/01 · Input & Camera

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
constraints_jsonSTRING{}Atlas constraints dict with line_groups and scale_constraints
focal_length_mmoptFLOAT0.00
sensor_width_mmoptFLOAT36.00

Outputs (1)

NameTypeDescription
ATLAS_SOLVEATLAS_SOLVE