API_PromptHelper☀
Type a half-formed idea, get back a prompt a model will actually obey
- text
Most people write bad image prompts - too vague, too much vibe language, too little structure. API_PromptHelper is the DashuaiTools answer: a text-in, text-out node that sends your raw idea to an LLM along with a long, opinionated system prompt and gets back a prompt that's actually shaped for a text-to-image model. Unlike its sibling API_caption, there's no image involved. This is pure prompt polishing.
What the default instruction actually does
The custom_instruction field ships with a genuinely well-written system prompt, and it's worth reading before you replace it. It tells the model to:
- Preserve the immutable core - subject, quantity, action, state, any named IP, colors, text.
- Reason out a concrete visual solution when the request isn't a direct scene description.
- Add composition, lighting, material texture, color scheme, and depth.
- Transcribe any text that should appear in the image inside double quotes, describing its font and layout.
- Never use meta-labels like "8K" or "masterpiece," and output only the final prompt.
That's the difference between this node and a generic "write me a prompt" call - the default instruction is doing prompt-engineering work you'd otherwise have to argue with a model about.
Inputs
- api_type / api_url / API_Key / model_name - the same provider plumbing as
API_caption(Siliconflow, T8zhenzhen, OpenRouter, or Other). Default model here isPro/moonshotai/Kimi-K2.6, a text LLM. - custom_instruction - the system prompt; replace it with your own if you want a different flavor.
- prompt - your raw input.
- output_language - Chinese or English.
- thinking_mode, temperature, max_tokens, noise_seed - the shared knobs. Same retry-and-strip-
<think>handling as the other API nodes.
Output: text, your polished prompt.
When to use it
This is the node for "I have a vibe but no prompt." It's also handy for the iterative loop where you take a generated image's caption, feed it back in, and refine toward a specific style. The one thing it won't do is fix bad model behavior - a polished prompt still gets fed to whatever sampler and checkpoint you're using.
Gotchas
- Same paid-API caveat as its sibling. Every run costs tokens; the 258
max_tokensdefault keeps each call cheap. - The default instruction is English, aimed at a specific aesthetic. It's tuned for "faithful to intent, no metaphor, no filler" output. If you want tag-style or Danbooru output, write your own
custom_instruction- the default will fight you. - Key hygiene. The API key rides in the workflow JSON.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Hasasasa/ComfyUI_DashuaiTools
cd ComfyUI_DashuaiTools
pip install -r requirements.txt
then restart ComfyUI, or grab it via ComfyUI Manager. Needs requests, declared by the pack.
If you've ever stared at a blank prompt box, this is the node that turns "something moody with neon" into a structured, usable prompt.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| api_type | COMBO | Siliconflow | 4 options: Siliconflow, T8zhenzhen, OpenRouter, Other |
| api_url | STRING | <url> | — |
| API_Key | STRING | <your_key> | — |
| model_name | STRING | Pro/moonshotai/Kimi-K2.6 | — |
| custom_instruction | STRING | You are a visionary artist trapped in a logical cage. Your mind is filled with poetry and distant visions, but your hands, without any control, only want to convert the user's prompt words into an ultimate visual description that is faithful to the original intention, rich in details, aesthetically pleasing, and directly usable by the text-to-image model. Any ambiguity or metaphor will make you feel uncomfortable. Your workflow strictly follows a logical sequence: First, you will analyze and identify the unchangeable core elements in the user's prompt words: subject, quantity, action, state, as well as any specified IP names, colors, texts, etc. These are the fundamental elements that you must absolutely preserve. Then, you will determine if the prompt requires "generative reasoning". When the user's request is not a direct scene description but requires the conception of a solution (such as "what is the answer", "further design", or showing "how to solve the problem") then you must first conceive a complete, specific, and visualizable solution in your mind. This solution will be the basis for your subsequent description. Then, once the core image is established (whether directly from the user or through your reasoning), you will inject professional-level aesthetics and realistic details into it. This includes clear composition, setting the lighting atmosphere, describing the material texture, defining the color scheme, and constructing a three-dimensional space with depth. Finally, the precise processing of all text elements is a crucial step. You must transcribe exactly all the text that you want to appear in the final image and must enclose these text contents within double quotation marks (""), as a clear generation instruction. If the image belongs to a design type such as a poster, menu, or UI, you need to describe completely all the text content it contains and detail its font and layout. Similarly, if there are words on items such as signs, road signs, or screens in the image, you must also specify their content, describe their position, size, and material. Further, if you add elements with text during the reasoning and conception process (such as charts, solution steps, etc.), all the text in them must also follow the same detailed description and quotation rules. If there are no words that need to be generated in the image, you will focus entirely on the expansion of purely visual details. Your final description must be objective and concrete. It is strictly prohibited to use metaphors, emotional rhetoric, or any meta-labels or drawing instructions such as "8K", "masterpiece", etc. Only strictly output the final modified prompt, do not output any other content. | — |
| prompt | STRING | — | |
| output_language | COMBO | Chinese | 2 options: Chinese, English |
| thinking_mode | BOOLEAN | false | — |
| temperature | FLOAT | 0.500–2 | — |
| max_tokens | INT | 258125–4096 | — |
| noise_seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |