Get Prompt
Dump your workflow as API JSON from inside ComfyUI — Get Prompt
Get Prompt is a debugging-and-scripting node: it takes the workflow you've built and dumps it as the exact JSON that ComfyUI's HTTP API expects, either to the console or to a file. It's the "show me what you're actually going to send" button for people who drive ComfyUI programmatically.
ComfyUI's frontend and its API speak the same prompt format - the graph you draw is serialized to a JSON prompt that gets POSTed to /prompt. Normally that serialization happens invisibly when you hit Queue. Get Prompt makes it visible: it deep-copies your prompt, deletes itself from the copy so you don't dump a node that shouldn't exist, and prints the result. The api_prompt toggle picks between print to console (JSON goes to the terminal where you launched ComfyUI) and save to file (writes prompt.json to the output directory). You then take that JSON and send it straight at the API from a script.
How it works
The node is an output node - no return sockets, marked OUTPUT_NODE in the pack. It reads the PROMPT and UNIQUE_ID hidden inputs that ComfyUI injects into every node, then:
- Deep-copies the prompt (the comment in the code is blunt about why: "changing the original will mess the prompt execution").
- Deletes itself from the copy.
- Strips the widget inputs off any
RequestInputsnode, keeping only thevaluesfield - which is the pack's hook for building requestable API workflows. - Prints
{"prompt": ...}to console or writes it toprompt.json.
That last RequestInputs step is the interesting bit: RequestInputs is the pack's node for marking which values your script should be able to change, and Get Prompt is designed to produce a clean request template from it. It's a self-contained little API workflow toolkit.
Inputs
api_prompt- an enum with two choices: "print to console" (default) or "save to file".
No outputs. You place it, set the mode, run the graph, and go read your terminal or the output folder.
Install
Ships in bmad4ever/comfyui_bmad_nodes. Via ComfyUI Manager, search "comfyui_bmad_nodes" ("Bmad Nodes"), install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_bmad_nodes
cd comfyui_bmad_nodes
pip install -r requirements.txt
Restart ComfyUI afterward. No model files.
Common issues
The author is upfront that this is barebones - the README explicitly says the API nodes aren't documented because "there are better, more comprehensive" API solutions out there. So expect rough edges. The save to file path is marked with a TODO in the source: it always writes to prompt.json in the output folder and will overwrite an existing file, no timestamp. If you're dumping multiple workflows, save to console or rename between runs. And remember the dump only covers what's connected to the graph at queue time - bypassed nodes are excluded, which is usually what you want but can surprise you if you forgot one was muted.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| api_prompt | COMBO | print to console | 2 options: print to console, save to file |
Outputs (0)
No outputs