Nodes/Sphere-Light-Render-ComfyUI/πŸ“· Sphere Light β€” Photo (EXIF)
ComfyUI Node

πŸ“· Sphere Light β€” Photo (EXIF)

Recreate the exact light of a real photo β€” straight from its EXIF

By eric-venti-seedsΒ·Created 2 months agoΒ·Updated 22 days agoΒ· 38
πŸ“· Sphere Light β€” Photo (EXIF)
    • image
    • latitude
    • longitude
    • city
    • year
    • month
    • day
    • hour
    • minute
    • heading
    β—„imageβ–Ύβ–Ί
    β—„latitude0.0000β–Ί
    β—„longitude0.0000β–Ί
    β—„cityβ–Ί
    β—„year2025β–Ί
    β—„month6β–Ί
    β—„day21β–Ί
    β—„hour12β–Ί
    β—„minute0β–Ί
    β—„heading0.00β–Ί

    You have a photo. Maybe it's a shot you took, or a reference you're trying to match. You want a generated image under the same light - same sun position, same time of day, same camera angle relative to the light. Normally you'd eyeball it and hope. This node instead reads the photo's EXIF metadata - GPS position, compass heading, capture time - and hands those values to the Sun nodes, which then light the reference sphere the way the sun actually was when and where that photo was taken.

    It's the cleverest node in the Sphere Light pack (the other three - Manual, Sun City, Sun Coords - all render the same kind of reference sphere for the Sun-Direction LoRA on Flux 2 Klein). The photo node is what makes the whole thing feel like magic: you pick an image and the light of the past comes out the other end.

    How it works

    The EXIF parsing happens in your browser, not in Python. When you pick an image in the node, a small dependency-free EXIF reader (js/exif.js) pulls out the GPS coordinates, the compass heading (GPSImgDirection), and the capture date/time, and writes them onto the node's widgets. A status line shows what it found. Then you wire those values into a Sun node (the widgets match the Sun nodes' input names exactly, so the wires line up cleanly) and the sphere gets lit by real astronomy.

    The photo itself also comes out as an IMAGE output, so the node can double as a Load Image replacement for ordinary photos - with one caveat: no MASK output.

    The inputs and outputs

    The image input is an upload widget like any Load Image. The other inputs - latitude, longitude, city, year, month, day, hour, minute, heading - are widgets the browser fills in, and they're the outputs too. All nine come out as typed values (FLOAT for lat/lon/heading, STRING for city, INT for the date parts), plus the image output. Wire lat/lon, heading, and time into a Sun node and the sphere follows the real sun.

    Where people get burned: phones only record GPSImgDirection when the compass was actually active, so a lot of photos have GPS and a timestamp but no heading. Tags the photo doesn't carry are simply left alone - the widget keeps its old value, so type the correction by hand. Also, the browser parser reads JPEG, PNG (eXIf chunk), and WebP; HEIC is not supported (ComfyUI can't decode it either), so convert iPhone shots first.

    Install

    ComfyUI Manager (search Sphere Light Render) or:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/eric-venti-seeds/Sphere-Light-Render-ComfyUI.git
    

    Restart, and grab the Sun-Direction LoRA from HuggingFace (Sun-Direction-Lora-Flux2Klein9B / ...Klein4B) - the sphere is only useful once the LoRA is in your Klein workflow. No other dependencies; this pack has none beyond what ComfyUI ships.

    The caveat that comes with the cleverness

    Because the EXIF read and the sphere render both happen in the browser, the whole driven-from-a-photo pipeline needs an open ComfyUI browser tab. Headless or API runs reuse the last-saved widget values instead of re-reading the photo. Same story as the rest of the pack: the resolved values get baked into the workflow JSON (100–400 KB extra per node), which is normal here. For interactive work - pick a photo, watch the sphere match the light - it's easily the best node in the pack.

    Categoryrender/3d

    Inputs (10)

    NameTypeDefaultDescription
    imageCOMBOThe photo whose EXIF supplies the values below.
    latitudeFLOAT0.0000-90–90From EXIF GPS; degrees north (negative = south).
    longitudeFLOAT0.0000-180–180From EXIF GPS; degrees east (negative = west).
    citySTRINGNearest listed city to the photo's GPS position.
    yearINT20251–9999β€”
    monthINT61–12β€”
    dayINT211–31β€”
    hourINT120–23β€”
    minuteINT00–59β€”
    headingFLOAT0.000–360From EXIF GPSImgDirection; degrees clockwise from North.

    Outputs (10)

    NameTypeDescription
    imageIMAGEβ€”
    latitudeFLOATβ€”
    longitudeFLOATβ€”
    citySTRINGβ€”
    yearINTβ€”
    monthINTβ€”
    dayINTβ€”
    hourINTβ€”
    minuteINTβ€”
    headingFLOATβ€”