- 目录路径
- 文件总数
FxAiPromptManager is a prompt library backed by plain .txt files on disk, with a management UI built in. The idea: instead of pasting the same prompt into a text widget a hundred times, you keep a folder of prompts as files, manage them from a browser panel, and let the graph point at a folder by name. It's the same "files are the source of truth" philosophy as the sidecar-caption convention in training workflows (image-io-metadata.md) - files you can edit by hand, sync, and version, rather than state trapped inside a workflow JSON.
The backend is a small REST API the pack registers on ComfyUI's server. There's GET /fxai/prompt/list (list the .txt files in a folder), POST /fxai/prompt/save_manual (write a prompt to a file), and GET /fxai/prompt/delete (remove one). The front-end panel in the 凤希AI menu calls those, and the node itself is just the read-side handle. Its single required input is 目录 (folder name, default sucai), and it resolves that against a fixed root: ComfyUI/fxai/prompts/<目录>/. So with the default, your prompts live in ComfyUI/fxai/prompts/sucai/ as *.txt. The optional 刷新标记 (refresh marker) input forces it to re-scan - hook a counter up to it if you're adding files mid-batch.
The two outputs are the useful bit: 目录路径 (the absolute path to the resolved folder, as a STRING) and 文件总数 (how many .txt files are in there, as an INT). Neither gives you the prompt text itself - the actual prompt-reading is done by the pack's companion node FxAiLoadPromptByIndex, which takes this folder path and an index and returns the file's contents. If you only wire up this node and wonder why no prompt appears, that's why: this one is the librarian, the loader node is the checkout desk.
The source also has real security thinking baked in - path resolution goes through a safe_path_join that blocks directory traversal, and filenames get scrubbed of illegal characters before saving. Good to see in a node that writes files from HTTP requests.
Gotchas: the default folder is sucai (Chinese for "material/asset"), so if your ComfyUI is English-only that's just a name, not a bug. And because the node scans a directory, files you add with the panel won't show up in the count until the node re-runs. It's under 凤希AI/提示词, installs with the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit
or ComfyUI Manager → search "fxai-toolkit", then restart. If you batch-produce and re-use prompts constantly, a folder-based library beats retyping every time.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| 目录 | STRING | sucai | — |
| 刷新标记opt | INT | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 目录路径 | STRING | — |
| 文件总数 | INT | — |