Nodes/ComfyUI NAIA 2.0 Bridge/NAIA Prompt Fetch (WebSocket)
ComfyUI Node

NAIA Prompt Fetch (WebSocket)

Mirror whatever prompt is on NAIA's screen, live

By DNT-LAB·Created 5 months ago·Updated 4 months ago· 1
NAIA Prompt Fetch (WebSocket)
    • prompt
    • negative_prompt
    host127.0.0.1
    port7243

    The random-prompt nodes in this pack are slot machines - they ask NAIA for something new every time. NAIA Prompt Fetch (WebSocket) is the opposite: it's a mirror. It reads whatever prompt NAIA is currently showing in its main UI and hands it to ComfyUI as-is. No random draw, no generation, no override. You edit the prompt in NAIA, hit Queue in ComfyUI, and that exact text flows into your graph.

    This is the node you want when NAIA isn't a prompt generator but your prompt editor. If you've built up your Prompt Engineering presets and wildcard setup in NAIA and you want ComfyUI's samplers and upscalers to render that, this is the handoff. You're basically saying: NAIA owns the prompt, ComfyUI owns the pixels.

    How it works

    The name gives away the mechanism. When the node first runs, it spins up a WebSocket client that connects to ws://127.0.0.1:7243/ws and subscribes to NAIA's prompt stream. NAIA pushes a prompt_sync message whenever the prompt in its UI changes, and the client caches the latest one in a background thread. The node just reads that cache. The client is a singleton per host/port and auto-reconnects every couple of seconds if the connection drops, so it survives NAIA restarting.

    Two consequences worth knowing:

    • The first run is slow. There's no warm cache yet, so the node waits up to 7 seconds for the first prompt_sync. The README reports a real-world ~3 seconds; it's a one-time cost.
    • It fails loudly, on purpose. If NAIA is off or Web Session isn't enabled, the node raises and your workflow stops with a red error. That's deliberate - unlike the health-check node, this one's job is to deliver real data, so it won't silently hand you an empty prompt.

    Inputs and outputs

    Just host (default 127.0.0.1) and port (default 7243). Leave them unless NAIA lives on another machine.

    Two string outputs: prompt and negative_prompt - the current positive and negative from NAIA's UI, at the moment you run. Wire prompt into a positive CLIP Text Encode's text input (right-click the widget → Convert Widget to Input first). The negative_prompt output is worth wiring only if you actively maintain NAIA's negative - otherwise it's just re-importing a string you could type yourself.

    Install

    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. Only deps are websocket-client and requests; no models to download. Needs NAIA 2.0 with Web Session enabled.

    When this bites

    If the node errors with a "prompt_sync message not received" message, it means the WebSocket connected but NAIA never sent a prompt update - usually on a fresh connection. The README's fix: trigger any prompt edit or random generation in NAIA's main UI once, then re-run. That primes the cache. After that it's a passive mirror, which is exactly the point - it's the quietest node in the pack, and that's a feature.

    CategoryNAIA Bridge/Prompt

    Inputs (2)

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

    Outputs (2)

    NameTypeDescription
    promptSTRING
    negative_promptSTRING