Nodes/ComfyUI NAIA 2.0 Bridge/NAIA Read Prompt Engineering
ComfyUI Node

NAIA Read Prompt Engineering

Snoop NAIA's Prompt Engineering settings from inside ComfyUI

By DNT-LAB·Created 5 months ago·Updated 4 months ago· 1
NAIA Read Prompt Engineering
    • pre_prompt
    • post_prompt
    • auto_hide
    • preprocessing_json
    • preset_list
    • current_preset
    host127.0.0.1
    port7243

    Every node in this bridge can send things to NAIA. This one is a read-only spy: NAIA Read Prompt Engineering pulls the current Prompt Engineering state out of NAIA's desktop UI and dumps it onto the canvas as six string outputs. It doesn't change anything - it just tells you what NAIA is currently set to, which makes it the debug and copy-paste companion to the override widgets on NAIA Request Random Prompt.

    When is that useful? The concrete case: the main node's use_naia_settings=false override is all-or-nothing. If you want to override just one preprocessing option but keep the rest of NAIA's carefully-tuned setup, you can't - flip the switch and every unspecified field becomes empty/OFF. This node is the workaround the README points to: read NAIA's current state, copy the values into the Request Random widget, then flip the override. You get your one-field tweak on top of a faithful copy of the rest.

    How it works

    Same WebSocket plumbing as NAIA Prompt Fetch (WS) - a singleton client on ws://127.0.0.1:7243/ws - but instead of the prompt stream it subscribes to NAIA's module-state messages and looks up the prompt_engineering module. The node waits up to 5 seconds for that state, and if there's no response it raises rather than returning garbage. Since it's a read of live state, it also uses the always-rerun IS_CHANGED NaN trick so you always get a fresh snapshot.

    The six outputs

    • pre_prompt, post_prompt, auto_hide - the three text fields from NAIA's Prompt Engineering panel. Exactly the strings you'd copy into the matching override widgets.
    • preprocessing_json - the 15 preprocessing options (remove_author, remove_clothes, e621_auto_boost, all of them) as a formatted JSON blob. It's designed to be copyable into the Request Random node's dropdowns if you want to replicate NAIA's preprocessing state.
    • preset_list - the available Prompt Engineering preset names, one per line.
    • current_preset - the name of the preset NAIA currently has selected.

    Everything is a STRING, so the natural way to look at it is a text-display node - Show Text (ComfyUI-Custom-Scripts) or rgthree's Display String - hanging off the outputs you care about. There's no point wiring these into your generation pipeline; this node is for your eyes, not the graph.

    Install

    It's in the same pack, so the steps are identical:

    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. Deps are websocket-client and requests, no models. Needs NAIA 2.0 running with Web Session enabled.

    Honest take

    This is a niche-of-a-niche node. If you never use NAIA's override widgets, you'll never need it. But the moment you hit the all-or-nothing wall - "I just want to strip remove_author, not rebuild everything" - it's the only node in the pack that can hand you the exact values to preserve. Keep it wired to a Show Text in your debug workflows and delete it when you're done.

    CategoryNAIA Bridge/Engineering

    Inputs (2)

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

    Outputs (6)

    NameTypeDescription
    pre_promptSTRING
    post_promptSTRING
    auto_hideSTRING
    preprocessing_jsonSTRING
    preset_listSTRING
    current_presetSTRING