Nodes/comfyui-easyapi-nodes/Load Image To Base64
ComfyUI Node

Load Image To Base64

Grab a local test image as base64, ready for your API

By lldacing·Created 3 years ago·Updated 8 months ago· 96
Load Image To Base64
    • base64Images
    • IMAGE
    • MASK
    image

    Most "convert to base64" nodes in this pack run at the end of a workflow - you generate something, then hand it back to whoever called your API as a base64 string. Load Image To Base64 is the odd one out: it runs at the start. Point it at a file already sitting in ComfyUI's input folder and it hands you that file's base64 string directly, alongside a normally-loaded IMAGE and MASK. It's a shortcut for building test payloads and example API requests without leaving ComfyUI to base64-encode a file by hand.

    How it works

    Every base64-producing node in this pack shares the same convention, stated plainly in the pack's own README: it's also an output node. The base64 string doesn't just sit on a wire - it rides along in the run's websocket message under a base64Images key, with a matching base64Type, the same channel ComfyUI's API uses to hand results back to a real caller. So running this node standalone doubles as a way to see exactly what shape of payload your actual API consumers are going to receive.

    The inputs and outputs that matter

    • image - a dropdown of whatever's already sitting in your ComfyUI input/ folder, the same picker the built-in LoadImage node uses.
    • base64Images (STRING) - the encoded string.
    • IMAGE and MASK - the same file loaded normally, so you can compare the base64 round-trip against the source without wiring up extra nodes.

    How to install it

    Via ComfyUI Manager: search comfyui-easyapi-nodes, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lldacing/comfyui-easyapi-nodes.git
    cd comfyui-easyapi-nodes
    pip install -r requirements.txt
    

    Restart ComfyUI. No models involved.

    Common issues & troubleshooting

    Watch your memory on long-running instances. The pack's README is direct about this: base64 strings are long, and they sit in ComfyUI's execution history in memory. The default history cap is 10,000 entries - leave that at default on a busy or long-lived instance and you're quietly accumulating megabytes of base64 per run until something runs out of memory. There's a setting for it: Settings → [EasyApi] Maximum History Size - turn it down if you're using base64 nodes regularly, and there's a matching [EasyApi] Auto Open Sub Menu / fuzzy-search pair of settings nearby if you're navigating this pack's menu a lot.

    Empty dropdown, missing file. This node only sees files already inside ComfyUI's input/ folder - it doesn't take a raw filesystem path. Drop the image in there first and refresh if it's not showing up in the picker.

    Don't confuse it with Base64ToImage. That's a different node in this pack (the one the Copy EasyAi menu trick auto-substitutes for LoadImage when exporting an API-format workflow) - it goes the other direction, taking a base64 string in and producing an image, rather than loading a local file and encoding it out.

    CategoryEasyApi/Image

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (3)

    NameTypeDescription
    base64ImagesSTRING
    IMAGEIMAGE
    MASKMASK