Nodes/ComfyUI NAIA 2.0 Bridge/NAIA Check Health
ComfyUI Node

NAIA Check Health

A health check that won't crash your workflow

By DNT-LAB·Created 5 months ago·Updated 4 months ago· 1
NAIA Check Health
    • ok
    • status_json
    host127.0.0.1
    port7243

    The other nodes in this bridge fail with red errors when NAIA is unreachable. NAIA Check Health is the polite one: it pings NAIA's Remote Web API and reports back ok: true/false plus the server's JSON response - and it never raises, even when NAIA is completely off. That makes it the diagnostic node, but more interestingly, it makes it a gate: you can condition a workflow on whether the NAIA server is actually there.

    How it works

    Dead simple under the hood. It issues a GET /api/comfyui/health to http://host:port with a 5-second timeout, and returns two values:

    • ok (BOOLEAN) - true if the request succeeded and NAIA's response claims it's fine (ok in the payload), false otherwise.
    • status_json (STRING) - the full server response, serialized. When something's wrong, it's {"ok": false, "error": "<reason>"} - which is handy because the error text tells you why (connection refused, timeout, whatever). If requests isn't installed it even catches that and returns it as a JSON error instead of crashing.

    That no-raise design is the whole point. Every error path - connection refused, timeout, non-JSON response, missing library - is caught and converted into ok=false plus a string you can read. Nothing ever throws.

    Inputs

    Only two: host (default 127.0.0.1) and port (default 7243). If NAIA runs on another machine, point it there. There's nothing else to configure, which is the right size for a node this small.

    Two ways to use it

    Diagnosis. Wire it into a workflow, run it, and read status_json with Show Text or rgthree's Display String. Five seconds and you know whether the problem is NAIA being off, Web Session being disabled, or a wrong port - the three usual suspects.

    Gating. Because ok is a real BOOLEAN and it doesn't raise, you can feed it into a switch or a logic node: "if NAIA is healthy, run the random-prompt branch; otherwise use my fallback prompt." That turns this from a debug toy into a reliability device - a workflow that degrades gracefully instead of hard-stopping the moment NAIA isn't running. This is the one use where the no-raise behavior genuinely matters, since a normal node would just kill the run.

    Install

    Same pack, same steps, no models:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DNT-LAB/comfyui-naia-bridge.git
    cd comfyui-naia-bridge
    pip install -r requirements.txt
    

    Or ComfyUI Manager → search comfyui-naia-bridge / naia. Deps are just websocket-client and requests. Note it needs NAIA with the ComfyUI sync-API patch - the /api/comfyui/health endpoint is part of that patch, so stock NAIA will report ok=false even while running.

    Where it fits

    If you're just starting with the bridge, skip this node until something breaks - the error messages on the other nodes are usually clear enough. But once you have a workflow that depends on NAIA and you want it to not die at 2am when NAIA auto-updated and forgot to start, this is the node you keep in there. Small, honest, and it can't hurt you.

    CategoryNAIA Bridge/API

    Inputs (2)

    NameTypeDefaultDescription
    hostSTRING127.0.0.1NAIA Remote API 호스트 (기본 127.0.0.1).
    portINT72431–65535NAIA Remote API 포트 (기본 7243).

    Outputs (2)

    NameTypeDescription
    okBOOLEAN
    status_jsonSTRING