凤希AI - 多行提示词
One node, a stack of prompts, and a counter to walk them
- 提示词
FxAiMultiLinePrompt (凤希AI - 多行提示词) is the in-graph prompt list: you paste a JSON array of prompts into lines_data, feed an index into 当前索引, and it hands back the selected prompt as a string - wrapped with a shared prefix and suffix if you want them. It's the manual, always-editable alternative to loading prompts from files (that's FxAiLoadPromptByIndex's job), and it's the node you reach for when your storyboard is short, changes often, and you don't want to manage a folder of .txt files to prove a point.
The mechanism is barely worth explaining: parse lines_data as a JSON array of strings, pick 当前索引 % total (yes, it wraps - index 5 on a 3-line list gives you line 2, so a looping counter can run forever without crashing), and build 通用提示词 + line + 尾部通用提示词. Those two optional wraps are the subtle feature: put your global style or character anchor in 通用提示词 once, keep your per-shot variety in the list, and add a shared negative-ish tail via 尾部通用提示词 - then every output is consistently anchored without you repeating yourself in each line. Both are forceInput, so you can feed them from another node and change the anchor mid-run.
Inputs: lines_data (a JSON array as a multiline string, default []), 当前索引 (force-input INT), 通用提示词 and 尾部通用提示词 (optional). Output: 提示词 (STRING), ready for a text encoder. If the list is empty or the JSON is malformed it returns just 通用提示词 + 尾部通用提示词 instead of erroring - which is a decent fallback but also means a typo'd JSON silently produces an empty prompt, the classic "why is my output blank" gotcha. The node also uses IS_CHANGED returning a nonce so changes to the list re-trigger the graph reliably.
Install: ComfyUI Manager → search "fxai-toolkit", or cd ComfyUI/custom_nodes && git clone https://github.com/fxai666/fxai-toolkit, restart. Pack auto-installs soundfile/psutil; FFmpeg wanted for audio paths but irrelevant here. Chinese labels (提示词 = prompt), 凤希AI builds for a Chinese-speaking community (QQ 775649071, Bilibili).
Where it earns its keep: in a loop. Drive 当前索引 from a segment counter and this one node hands every shot of a multi-scene render its own prompt. The trap is JSON syntax - double quotes, commas, no trailing garbage - because a parse failure is silent. Keep the list valid and this is one of the most reliable prompt nodes in the pack.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| lines_data | STRING | [] | — |
| 当前索引 | INT | 0 | — |
| 通用提示词opt | STRING | — | |
| 尾部通用提示词opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 提示词 | STRING | — |