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

NAIA Request Random Prompt (with Seed)

Random prompts that respect your seed — the bridge node I'd actually reach for

By DNT-LAB·Created 5 months ago·Updated 4 months ago· 1
NAIA Request Random Prompt (with Seed)
    • prompt
    • negative_prompt
    • width
    • height
    seed0
    prompt
    override_prompttrue
    negative_prompt
    override_negativetrue
    width1024
    override_widthtrue
    height1024
    override_heighttrue
    host127.0.0.1
    port7243

    Here's the thing nobody tells you about the main random-prompt node: it re-rolls every single run, and it's always dirty, so it drags the cache down with it. If you lock your seed trying to reproduce an image you liked, you get a new prompt anyway, and the image is gone. This node, NAIA Request Random Prompt (with Seed), fixes exactly that by making the NAIA request behave like every other seed-driven value in ComfyUI: same seed → same prompt, new seed → new roll.

    It's the stripped-down sibling. Where the main node gives you the full Prompt Engineering override surface, this one drops all of that - use_naia_settings is locked to true, so it always uses NAIA's desktop settings as-is. What you get instead is a seed input and the four override toggles. If all you want is "roll me a fresh Danbooru prompt per run, tied to my seed," this is the cleanest node in the pack.

    How it works

    The mechanism is the interesting part. Instead of the always-rerun float("NaN") trick, this node's IS_CHANGED returns a hash of every relevant input - seed, prompt, negative, width, height, their override toggles, host, port. ComfyUI compares that hash between runs, so:

    • Seed unchanged, nothing else touched → hash matches → the node doesn't re-execute, NAIA isn't called, and the previous run's prompt, negative, and resolution are reused. Full native caching, no wasted request.
    • Seed changed (or Randomize rolls it) → hash differs → it fires one POST /api/comfyui/random and pulls a brand-new prompt.

    So the seed isn't just parked on the node as decoration - it is the re-roll trigger. Lock the seed and you can keep iterating on sampler settings against the same prompt; randomize it and every queue is a surprise.

    Inputs and outputs

    The seed input is a plain INT (0 to 2⁶⁴−1), the same range as the KSampler's. prompt / negative_prompt / width / height are your fallback values, used when the matching override_* toggle is off. Each toggle defaults to true, meaning NAIA's fetched value wins - flip override_width off, for instance, and you keep a fixed 1024×1024 while the prompt still rolls.

    Outputs are the standard four: prompt, negative_prompt (strings), width, height (ints). prompt → positive CLIP Text Encode via Convert Widget to Input; width/height → EmptyLatentImage. The usual negative advice applies - NAIA's negative is static, so you'll typically leave override_negative off and type your own.

    Install

    Same pack, same story - no models, two tiny deps:

    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 search comfyui-naia-bridge / naia in ComfyUI Manager. Needs NAIA 2.0 with the sync-API patch, Web Session on, and a search run first.

    One honest caveat

    Because this node uses NAIA's desktop settings and doesn't expose the preprocessing/pre-post widgets, you're trading the main node's per-request control for seed sanity. If you need use_naia_settings=false style overrides, you want NAIA Request Random Prompt instead. But for the most common use - "roll me prompts, let me reproduce them" - this is the one I'd reach for. It's the only node in the bridge that plays nicely with ComfyUI's cache instead of fighting it.

    CategoryNAIA Bridge/API

    Inputs (11)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000시드 값이 동일하면 이전 프롬프트를 재사용(캐싱)하고, 값이 변경되면 NAIA에서 새 랜덤 프롬프트를 요청합니다.
    promptSTRINGoverride_prompt가 off일 때 출력될 프롬프트입니다.
    override_promptBOOLEANtruetrue (기본): NAIA에서 가져온 프롬프트로 덮어씁니다. false: 입력받은 prompt를 그대로 출력합니다.
    negative_promptSTRINGoverride_negative가 off일 때 출력될 네거티브 프롬프트입니다.
    override_negativeBOOLEANtruetrue (기본): NAIA에서 가져온 네거티브 프롬프트로 덮어씁니다. false: 입력받은 negative_prompt를 그대로 출력합니다.
    widthINT102464–8192override_width가 off일 때 출력될 이미지 가로 크기입니다.
    override_widthBOOLEANtruetrue (기본): NAIA에서 가져온 추천 width로 덮어씁니다. false: 입력받은 width를 그대로 출력합니다.
    heightINT102464–8192override_height가 off일 때 출력될 이미지 세로 크기입니다.
    override_heightBOOLEANtruetrue (기본): NAIA에서 가져온 추천 height로 덮어씁니다. false: 입력받은 height를 그대로 출력합니다.
    hostSTRING127.0.0.1NAIA Remote API 호스트 (기본 127.0.0.1).
    portINT72431–65535NAIA Remote API 포트 (기본 7243).

    Outputs (4)

    NameTypeDescription
    promptSTRING
    negative_promptSTRING
    widthINT
    heightINT