Nodes/ComfyUI NAIA 2.0 Bridge/NAIA Request Random Prompt (with Override)
ComfyUI Node

NAIA Request Random Prompt (with Override)

Random prompts with a kill switch — override any field, or bypass NAIA entirely

By DNT-LAB·Created 5 months ago·Updated 4 months ago· 1
NAIA Request Random Prompt (with Override)
    • prompt
    • negative_prompt
    • width
    • height
    use_naia_bridgetrue
    prompt
    override_prompttrue
    negative_prompt
    override_negativetrue
    width1024
    override_widthtrue
    height1024
    override_heighttrue
    use_naia_settingstrue
    pre_prompt
    post_prompt
    auto_hide
    remove_authorskip
    remove_work_titleskip
    remove_character_nameskip
    remove_character_featuresskip
    remove_clothesskip
    remove_colorskip
    remove_location_and_background_colorskip
    remove_expressionskip
    remove_pose_actionskip
    remove_meta_tagsskip
    remove_object_tagsskip
    remove_noise_tagsskip
    e621_auto_boostskip
    danbooru_auto_weightskip
    tag_implication_compressionskip
    host127.0.0.1
    port7243

    The main NAIA Request Random Prompt node has one annoying property: it's all-in. You wire it up, it re-rolls a prompt on every run, and if you ever want a fixed prompt or a fixed resolution you either re-wire the graph or type over the output. This variant, NAIA Request Random Prompt (with Override), is the same engine with a set of switches so you can decide, field by field, whether NAIA's answer wins or your typed input does.

    Think of it as the main node plus a bypass lane. You get all the same prompt-engineering override widgets (use_naia_settings, pre_prompt, post_prompt, auto_hide, the 15 preprocessing dropdowns, host/port), but the outputs are now per-field decision points instead of a package deal.

    The switches that matter

    • use_naia_bridge - the master switch. true (default): normal operation, NAIA is called and the prompt re-rolls each run. false: the node never touches the NAIA server and just passes through the four values you fed it (prompt, negative_prompt, width, height). Better still, in bypass mode it uses a real hash-based IS_CHANGED instead of the always-dirty NaN trick, so if your inputs don't change, ComfyUI's cache holds and the node doesn't re-run at all. That's a genuinely nice touch - it makes this node a drop-in "manual/auto" switch for a whole branch of your graph.
    • override_prompt / override_negative / override_width / override_height - the per-field versions of the same idea. With the bridge on, each toggle decides whether NAIA's freshly-fetched value replaces what you typed. true = NAIA wins, false = your widget value (or an upstream connection) wins. So you can roll random prompts but lock the resolution to 1024×1024, or roll a random size but keep your own negative. Mix and match without rewiring anything.

    The prompt, negative_prompt, width, height inputs are just typed values (or linked inputs) that act as the fallback whenever the corresponding override is off. Width/height are clamped 64–8192 in steps of 8.

    Outputs

    Same four as the main node: prompt, negative_prompt (strings) and width, height (ints). They feed the same places - prompt into a positive CLIP Text Encode via Convert Widget to Input, width/height into EmptyLatentImage. The same advice applies: NAIA's negative is a static value from its UI, so usually leave override_negative alone and type your own.

    Install and prerequisites

    Same pack as the rest of the bridge:

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

    Deps are just websocket-client and requests; no models. You need NAIA 2.0 with the ComfyUI sync-API patch and Web Session enabled, and a search run first so there's a result set to draw from.

    When to pick this over the plain node

    Honestly? Only when you need the bypass. If you just want random prompts every run, the plain NAIA Request Random Prompt is simpler and has the same engine. But if you're building one workflow that sometimes rolls prompts and sometimes runs a fixed batch - say, a generator graph you also use for reproducibility - this node replaces what would otherwise be two graphs or a lot of manual bypassing. That cache-preserving bypass is the reason it exists, and it's the reason I'd pick it over manually toggling nodes.

    CategoryNAIA Bridge/API

    Inputs (30)

    NameTypeDefaultDescription
    use_naia_bridgeBOOLEANtruetrue (기본): NAIA Bridge를 사용하여 랜덤 프롬프트 및 해상도를 동기 요청하며, 매 실행마다 캐싱을 깨뜨립니다. false: NAIA Bridge를 통하지 않고 아래의 prompt, negative_prompt, width, height 입력값을 그대로 통과시킵니다. 값이 변하지 않았다면 ComfyUI의 실행 캐싱이 깨지지 않고 유지됩니다.
    promptSTRINGuse_naia_bridge가 off이거나 override_prompt가 off일 때 출력될 프롬프트입니다.
    override_promptBOOLEANtruetrue (기본): NAIA에서 가져온 프롬프트로 덮어씁니다. false: 입력받은 prompt를 그대로 출력합니다.
    negative_promptSTRINGuse_naia_bridge가 off이거나 override_negative가 off일 때 출력될 네거티브 프롬프트입니다.
    override_negativeBOOLEANtruetrue (기본): NAIA에서 가져온 네거티브 프롬프트로 덮어씁니다. false: 입력받은 negative_prompt를 그대로 출력합니다.
    widthINT102464–8192use_naia_bridge가 off이거나 override_width가 off일 때 출력될 이미지 가로 크기입니다.
    override_widthBOOLEANtruetrue (기본): NAIA에서 가져온 추천 width로 덮어씁니다. false: 입력받은 width를 그대로 출력합니다.
    heightINT102464–8192use_naia_bridge가 off이거나 override_height가 off일 때 출력될 이미지 세로 크기입니다.
    override_heightBOOLEANtruetrue (기본): NAIA에서 가져온 추천 height로 덮어씁니다. false: 입력받은 height를 그대로 출력합니다.
    use_naia_settingsBOOLEANtruetrue (기본): NAIA 데스크톱 앱의 Prompt Engineering 설정을 그대로 사용. 아래 pre_prompt / post_prompt / auto_hide / remove_* 위젯은 무시됨. false: 아래 위젯 값들을 NAIA로 전송해 이번 요청에 한해 override. NAIA 데스크톱 UI는 불변. all-or-nothing 규약 (미지정 필드는 빈 값/OFF).
    pre_promptSTRINGNAIA P.Eng의 '선행 프롬프트(pre_prompt)' 덮어쓰기.
    post_promptSTRINGNAIA P.Eng의 '후행 프롬프트(post_prompt)' 덮어쓰기.
    auto_hideSTRINGNAIA P.Eng의 '자동 숨김(auto_hide)' 덮어쓰기.
    remove_authorCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_work_titleCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_character_nameCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_character_featuresCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_clothesCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_colorCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_location_and_background_colorCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_expressionCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_pose_actionCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_meta_tagsCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_object_tagsCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    remove_noise_tagsCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    e621_auto_boostCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    danbooru_auto_weightCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    tag_implication_compressionCOMBOskip• skip: 이 키를 NAIA로 안 보냄 (NAIA에서 OFF로 해석됨 = 태그 유지) • on: 이 카테고리 태그 제거 • off: 이 카테고리 태그 유지 (명시적)
    hostSTRING127.0.0.1NAIA Remote API 호스트. NAIA가 같은 PC에서 실행되면 기본값 그대로 사용. 다른 PC에서 돌리는 경우만 IP 변경.
    portINT72431–65535NAIA Remote API 포트. NAIA Settings > Web Session에서 설정한 포트와 일치해야 함. 기본값 7243.

    Outputs (4)

    NameTypeDescription
    promptSTRING
    negative_promptSTRING
    widthINT
    heightINT