Focal PX to MM
Pixel focal to real-lens millimeters, so your 3D camera makes sense
- focal_mm
- focal_str
Depth Pro hands you a focal length in pixels. Your 3D software thinks in millimeters. Those two numbers do not talk to each other until someone does the conversion, and this node is that someone. It exists to close the gap between "what the model estimated" and "what you can type into a Blender camera."
The math is the README's own formula: focal_mm = focal_px * sensor_mm / sensor_px. You take the pixel focal, multiply by the sensor's physical width in millimeters, divide by the sensor's width in pixels. The sensor size in pixels is the long edge of your image - max(image_width, image_height) - because that's how the pixel focal was defined.
Inputs
- focal_px (FLOAT, default 1000) - the focal in pixels. Wire this from Depth Pro's
focal_avgoutput and you've got the whole pipeline: model estimates focal → convert → camera. - sensor_mm (FLOAT, default 24.576) - your sensor's physical width in millimeters. The default is a common full-frame sensor width, and it's the same default the sibling conversion nodes use, so everything stays consistent. Change it only if you know your camera rig's actual sensor.
- image_width and image_height (INT) - the image dimensions, used to find the long edge. The quirky default of height 1 doesn't bite you as long as width is the long side, but set both to your real resolution to be safe.
Outputs: focal_mm (FLOAT) and focal_str (STRING), the same value formatted to two decimals for display or text nodes.
Why this matters for parallax work
This is the node that turns Depth Pro from a depth generator into a camera-rig builder. Metric depth in meters plus a focal in millimeters is everything you need to place a virtual camera and project the image along the Z axis - which is exactly what parallax workflows like the community's Depth Pro + Depth Flow setups do. Without the conversion you're guessing at the lens, and a wrong lens means the whole projection is subtly warped.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Depth-Pro
or find ComfyUI-Depth-Pro in ComfyUI Manager, install, restart. Nothing extra to download for this node - the only dependency cost is the model that Depth Pro itself loads on first run.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| focal_px | FLOAT | 1000.00 | — |
| sensor_mm | FLOAT | 24.576 | — |
| image_width | INT | 1024 | — |
| image_height | INT | 1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| focal_mm | FLOAT | — |
| focal_str | STRING | — |