Nodes/comfyui-loadheicimage/Load Image (HEIC)
ComfyUI Node

Load Image (HEIC)

Drop iPhone Photos Straight Into ComfyUI — No PNG Detour

By esp-dev·Created 8 months ago·Updated 8 months ago· 0
Load Image (HEIC)
    • IMAGE
    • MASK
    image

    Every photo your iPhone shoots is a .heic, and ComfyUI's built-in Load Image node can't read it. So the moment you want to img2img your own phone shots, run them through IPAdapter, or prep a LoRA dataset, you hit the wall: convert a hundred files to PNG first. Load Image (HEIC) - class name LoadImagePlusHEIC - is the node that makes that detour unnecessary.

    What it actually is

    It's a drop-in replacement for core ComfyUI's Load Image. Same dropdown, same two outputs, same job: pick a file from your input/ folder and turn it into a tensor the rest of your graph can eat. The only real difference is that its file list also includes .heic and .heif, and it can actually decode them. If you never touch HEIC files, this node is pointless - use the built-in. If your reference images come off a modern phone, this is the one you reach for.

    How it works

    Server-side, the node is basically core Load Image's load_image logic with one extra step: before opening the file it calls pillow_heif.register_heif_opener(), which teaches Pillow to decode HEIC. That's the whole trick, and it's why the only real dependency is pillow-heif (plus Pillow >= 10). Everything else it inherits from the core node: it applies EXIF transpose so your phone's rotation comes out right, pulls the alpha channel into a mask, and even batches multi-frame files. Its IS_CHANGED hashes the file contents, so overwriting the image in input/ re-runs the graph instead of serving you a stale cached result.

    The interesting part is the frontend. Browsers can't render HEIC natively, so the bundled JS extension registers a /heic_preview route that decodes the file server-side and serves a PNG preview, and it rewrites the node's image URLs to hit that route. It also intercepts drag-and-drop, because otherwise dropping a .heic onto the canvas makes ComfyUI try to load it as a workflow JSON and you get the dreaded "Unable to find workflow..." toast.

    Inputs and outputs

    One input to care about: image, a dropdown of everything in ComfyUI's input/ folder (with an upload button). Outputs are IMAGE and MASK - wire IMAGE into a VAE Encode, IPAdapter, ControlNet, or any img2img entry point, exactly like you would from a normal Load Image.

    Install

    Easiest is ComfyUI Manager - search "Load HEIC Image" and install. Otherwise:

    cd ComfyUI/custom_nodes
    git clone https://github.com/esp-dev/comfyui-loadheicimage
    cd comfyui-loadheicimage
    pip install -r requirements.txt
    

    Then restart ComfyUI. The requirements are light - pillow and pillow-heif - no models, no CUDA tricks, nothing to download.

    Where people get burned

    • The file-picker upload is broken for HEIC. ComfyUI's "Choose file to upload" path filters to standard image extensions, and even though the extension patches the file input's accept attribute, the upload still doesn't carry. Workaround, straight from the README: drag and drop instead.
    • Drop onto the node, not the canvas. The extension intercepts .heic/.heif drops, but only if the frontend routes the drop to it. Select the Load Image (HEIC) node first, then drop - that's the reliable path.
    • Missing pillow-heif? You'll get a clear runtime error telling you to pip install pillow-heif, which is about as friendly as a ComfyUI error gets.

    For a one-off conversion, mogrify -format png *.heic is still a fine answer. For anyone who feeds phone photos into workflows regularly, this thin, MIT-licensed node removes a step you'll never miss.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK