Nodes/ComfyUI_Fill-Nodes/FL API Base64 Image Loader
ComfyUI Node

FL API Base64 Image Loader

The entry point for a hosted ComfyUI app

By filliptm·Created 3 years ago·Updated about 15 hours ago· 628
FL API Base64 Image Loader
    • image
    • width
    • height
    • job_id
    • user_id
    • category
    base64_string
    job_id
    user_id
    category
    resize_width0
    resize_height0
    maintain_aspect_ratiotrue
    auto_clean_base64true

    Most ComfyUI nodes assume you're loading an image from disk. If you're building an actual product on top of ComfyUI - a web app, a mobile client, anything where a user's image arrives over HTTP as a base64 string rather than a file on the server - you need something that decodes that string into a real IMAGE tensor, and ideally keeps track of whose request it was. That's what FL_API_Base64_ImageLoader does, and it's clearly built as one half of a request/response pair with its sibling, FL_API_ImageSaver, at the output end of the same pack.

    How it works

    You hand it a base64 string. It strips a data:image/...;base64, prefix if one's present (that's auto_clean_base64, on by default - most browser FileReader / canvas exports include that prefix, and this saves you from having to strip it client-side), decodes the bytes, and converts to a standard ComfyUI image tensor. Optionally it resizes on the way in. Alongside the image, it threads three plain strings - job_id, user_id, category - straight through to its outputs, unchanged, so the rest of your graph (and eventually FL_API_ImageSaver at the end) knows which request this image belongs to without you having to re-wire that metadata separately.

    The inputs and outputs that matter

    Required: base64_string (multiline text field - this is where the encoded image goes), and the three tracking strings job_id, user_id, category. None of these are validated for format or uniqueness by the node itself - that's your application's job upstream; the node just carries whatever you give it.

    Optional: resize_width/resize_height (0–8192, step 8, default 0 - 0 on either axis means "don't resize that dimension"), maintain_aspect_ratio (default true - resize proportionally instead of stretching), and auto_clean_base64 (default true, described above).

    Outputs: image (the decoded tensor, wire this into your workflow like any other image), width/height (INT, the final dimensions after any resize), and job_id/user_id/category passed straight through - grab these downstream and feed them into FL_API_ImageSaver so the saved output lands in the matching job/user/category folder.

    How to install it

    ComfyUI Manager: search ComfyUI_Fill-Nodes, install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
    

    then restart. This specific node needs nothing beyond PIL and Python's base64 module - no downloads, no API keys. Fill-Nodes as a whole is a large pack with a lot of optional AI-API integrations (OpenAI, Gemini, Fal.ai, Google Cloud, Hugging Face), so expect a longer-than-usual list of optional-dependency notices in the console at startup. That's normal for this pack; it doesn't mean the API-tool nodes specifically are broken.

    Common issues & troubleshooting

    Decoding fails outright. Almost always a malformed or truncated base64 string on the way in - check the client actually sent the full encoded payload, and that nothing upstream (a proxy, a logging middleware) is mangling multiline text fields. auto_clean_base64 handles the common data:image/png;base64, prefix case; if your client is sending something more unusual (e.g. URL-encoded base64), strip that client-side first.

    Image comes out at the wrong size. Remember resize_width/resize_height at 0 means "don't touch that axis" - if you set only one of the two and expect proportional scaling on both, you'll get an unexpected result unless maintain_aspect_ratio is doing what you think. Set both explicitly if you want a fixed target size.

    Job tracking breaks downstream. This node doesn't enforce that job_id is unique or that user_id/category match any real record - if your app relies on those being valid, validate them before they ever reach this node. If you need more structured, typed job metadata than three plain strings, this pack's Kartel nodes (FL_KartelJobInput) decode a richer payload - worth a look if a base64 image plus three strings isn't enough for your integration.

    Category🏵️Fill Nodes/API Tools

    Inputs (8)

    NameTypeDefaultDescription
    base64_stringSTRING
    job_idSTRING
    user_idSTRING
    categorySTRING
    resize_widthoptINT00–8192
    resize_heightoptINT00–8192
    maintain_aspect_ratiooptBOOLEANtrue
    auto_clean_base64optBOOLEANtrue

    Outputs (6)

    NameTypeDescription
    imageIMAGE
    widthINT
    heightINT
    job_idSTRING
    user_idSTRING
    categorySTRING