Nodes/KIE.ai Nodes Next/Base64 File Upload
ComfyUI Node

Base64 File Upload

The node you need less often than you think

By felipederosilva·Created about a month ago·Updated a day ago· 3
Base64 File Upload
    • raw_json
    • first_url
    • task_id
    ◄timeout_seconds1200►
    ◄expert_override_json{}►

    KIE.ai Nodes Next has a trick that spoils you: connect a IMAGE, VIDEO or AUDIO socket to a model node and the pack quietly uploads your media to KIE, takes the URL it gets back, and drops it into the request body. You never paste a URL, never touch a JSON blob, never think about the upload step. This node is what that upload step looks like when you want to do it deliberately.

    It's the pack's node for KIE's /api/file-base64-upload endpoint - the sibling of the streaming upload route the pack uses internally for your connected media. Same destination, different packaging: base64 carries the bytes inside the JSON body instead of streaming them as multipart form data, which is the format you want when the client has no file handle to hand over, and the format you don't want when the file is large.

    Inputs and outputs

    Honestly, look at the input list and you'll see the catch immediately. There's no file field. There's no images socket, no path widget. Just timeout_seconds (30–7200, default 1200) and expert_override_json.

    That's not an oversight, it's the shape of the source docs. KIE publishes this endpoint's page with no request schema in it, so the pack's node factory - which builds each node from the documented request example and parameter metadata - has nothing to turn into widgets. The author's own tooltip on the override field says it exactly: "Expert-only payload overrides for APIs whose documentation has no request schema yet." So you fill the payload yourself, as a JSON object, and the node posts it.

    Outputs follow the pack's common signature: raw_json (the whole response, pretty-printed), first_url (the first http(s) URL the pack's result parser finds in that response - for an upload call, that's the uploaded file's own URL), and task_id (empty for a call that isn't a generation job).

    Wiring it: first_url into whatever wants a URL as text, and raw_json into a text/preview node when you need to see the full response shape. If you're doing any of this, you're already deep enough to read the docs page first - and KIE's docs URL for it is one dropdown away in KIE • Inspect API Definition (Advanced).

    When it's actually worth using

    Two legitimate cases. First, upload once and reuse: if five tasks all reference the same reference image or the same audio bed, uploading it a single time and threading the URL into the other nodes is fewer moving parts than letting each node re-upload the same batch. Second, debugging: when a model node fails on media you're sure is fine, isolating "does KIE accept this file at all?" from "does KIE like this file for this task?" is a real diagnostic step.

    Beyond that? The streaming path the pack uses inside its model nodes avoids base64's ~33% size inflation for a reason. If you find yourself hand-building an upload payload to get an image into a Seedance node, step back - that's what the socket is for.

    Install and setup

    Same as every node in the pack. ComfyUI Manager → search KIE.ai Nodes Next (publisher id felipeosilva) → install. If Manager comes up empty, the README's registry publishing is still described as prepared rather than done, so clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
    pip install -r ComfyUI-KIE-Nodes-Next/requirements.txt
    

    Restart ComfyUI. Dependencies are requests, Pillow, numpy, PyYAML; there are no model files to fetch, because nothing runs locally. Then set the key once: Settings → KIE.ai Nodes Next → Connection → Paste / replace KIE.ai API key. It's validated against KIE before it replaces a saved key, the frontend only ever sees a masked fingerprint, and the full key stays out of your workflow JSON. Servers and headless installs can use the KIE_API_KEY environment variable instead - it takes priority.

    Gotchas

    Invalid JSON is the first wall. The override field is parsed as a JSON object, so a trailing comma or a single-quoted string throws before anything leaves your machine. Paste from something that formats JSON.

    Uploads still touch your credit balance and your data leaves the machine. KIE is a paid API; this is a hosted-file path, not a local library. That's the deal with any API node in this ecosystem - you trade a per-call meter and your inputs going to a third party for a capability that isn't on your disk.

    A 1200-second default timeout is enormously generous for an upload. If this call is hanging, it's almost always a key or network problem, not a slow file, and nothing in the node validates the key for you beyond the Settings test. Lower the timeout so failures surface while you're still watching.

    CategoryKIE Next/Utility

    Inputs (2)

    NameTypeDefaultDescription
    timeout_secondsoptINT120030–7200—
    expert_override_jsonoptSTRING{}Expert-only payload overrides for APIs whose documentation has no request schema yet.

    Outputs (3)

    NameTypeDescription
    raw_jsonSTRING—
    first_urlSTRING—
    task_idSTRING—