Nodes/ComfyUI-Sharp/Load Image with EXIF (Focal Length)
ComfyUI Node

Load Image with EXIF (Focal Length)

Stop guessing focal length, read it off the photo

By PozzettiAndrea·Created 8 months ago·Updated 2 months ago· 358
Load Image with EXIF (Focal Length)
    • image
    • mask
    • focal_length_mm
    image
    default_focal_mm30.0

    This is the stock Load Image node with one extra trick: it also reads the camera's focal length straight out of the file's EXIF metadata and hands it back out as its own number, ready to plug into SHARP's Predict nodes. It exists because SHARP (the Apple model this whole pack wraps, turning a single photo into 3D Gaussians) needs to know roughly what lens took the shot to correctly work out how far away things actually are - and manually eyeballing a focal length is exactly the kind of guesswork you'd rather skip if the file already has the answer sitting in its metadata.

    Why focal length matters here

    Get the focal length wrong and the picture still looks fine, but the depth SHARP predicts from it comes out stretched or squashed - the reconstructed 3D geometry drifts even though nothing about the input image itself changed. Real camera and phone photos almost always carry this in EXIF as a 35mm-equivalent value. This node is the shortcut: load the photo and get the number in the same step, instead of doing it as two separate operations.

    The inputs and outputs that matter

    • image (required, COMBO) - the file picker, identical to the standard loader.
    • default_focal_mm (optional, default 30, range 1–500) - what gets emitted when the file has no usable EXIF focal length. This is the fallback, not a guess it makes from the pixels - if EXIF is missing, you get this number back, full stop.

    Three outputs: image and mask are the same pair the stock loader gives you (this node is a drop-in replacement, so it keeps that shape). The one that matters is focal_length_mm (FLOAT) - wire it directly into SharpPredict, SharpPredictForeground, SharpPredictDepth, SharpPredictMetricDepth, or SharpPredictGaussianAttrs's focal_length_mm input, and those nodes will use the real value instead of their own generic 30mm default.

    Installing it

    Part of the ComfyUI-Sharp pack - no separate install. Manager: search "Sharp," install the highest version (try nightly if that build acts up), or Manager → Install via Git URL with https://github.com/PozzettiAndrea/ComfyUI-Sharp.git. Manual: git clone into custom_nodes, then pip install -r requirements.txt --upgrade and python install.py, restart.

    Common issues

    The one thing worth knowing before you rely on this node: EXIF gets stripped constantly, and silently. Screenshots never had it. Most messaging apps and social platforms strip it on upload or re-save. A photo you downloaded rather than shot yourself is a coin flip. When that happens, this node doesn't error - it just quietly falls back to default_focal_mm and your workflow keeps running, which means a bad reconstruction can slip through without an obvious cause. If your SHARP output looks warped in depth for no obvious reason, check what this node actually emitted on focal_length_mm before you start second-guessing the model.

    One more thing worth flagging: this node is built for the single-photo workflow. If you're doing panorama work with SamplePanorama or SharpPanoramaCubeSplit further downstream, those nodes hand SHARP real camera intrinsics directly, and any intrinsics input wired into a Predict node overrides focal_length_mm entirely - so this node's output becomes irrelevant the moment you're inside that pipeline. It's specifically for the "single photo, no other camera info" case the README calls Workflow 2.

    CategorySHARP

    Inputs (2)

    NameTypeDefaultDescription
    imageCOMBO17 options: actual_pano_from_real_life.jpg, bas_relief.png, beach.jpg, breads.jpg, bridge.jpg, bunny_cake.jpg, +11
    default_focal_mmoptFLOAT30.01–500Default focal length (35mm equiv) if not found in EXIF

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    focal_length_mmFLOAT