NAIA Request Random Prompt (with Seed)
Random prompts that respect your seed — the bridge node I'd actually reach for
- prompt
- negative_prompt
- width
- height
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/randomand 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.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | 시드 값이 동일하면 이전 프롬프트를 재사용(캐싱)하고, 값이 변경되면 NAIA에서 새 랜덤 프롬프트를 요청합니다. |
| prompt | STRING | override_prompt가 off일 때 출력될 프롬프트입니다. | |
| override_prompt | BOOLEAN | true | true (기본): NAIA에서 가져온 프롬프트로 덮어씁니다. false: 입력받은 prompt를 그대로 출력합니다. |
| negative_prompt | STRING | override_negative가 off일 때 출력될 네거티브 프롬프트입니다. | |
| override_negative | BOOLEAN | true | true (기본): NAIA에서 가져온 네거티브 프롬프트로 덮어씁니다. false: 입력받은 negative_prompt를 그대로 출력합니다. |
| width | INT | 102464–8192 | override_width가 off일 때 출력될 이미지 가로 크기입니다. |
| override_width | BOOLEAN | true | true (기본): NAIA에서 가져온 추천 width로 덮어씁니다. false: 입력받은 width를 그대로 출력합니다. |
| height | INT | 102464–8192 | override_height가 off일 때 출력될 이미지 세로 크기입니다. |
| override_height | BOOLEAN | true | true (기본): NAIA에서 가져온 추천 height로 덮어씁니다. false: 입력받은 height를 그대로 출력합니다. |
| host | STRING | 127.0.0.1 | NAIA Remote API 호스트 (기본 127.0.0.1). |
| port | INT | 72431–65535 | NAIA Remote API 포트 (기본 7243). |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| negative_prompt | STRING | — |
| width | INT | — |
| height | INT | — |