Hunyuan Prompt Rewriter (DeepSeek)
The LLM that turns 'dog running' into a full prompt
- rewritten_prompt
"Hunyuan Prompt Rewriter (DeepSeek)" is a standalone node that expands a plain prompt into a professional image prompt using an LLM - and the name is a lie in the best way: it doesn't need DeepSeek at all. It works with any OpenAI-compatible API. You set a key, type "dog running," and get back something like "An energetic brown and white border collie running across a sun-drenched meadow filled with wildflowers, motion blur on legs showing speed, golden hour lighting, shallow depth of field, professional photography, high detail, 8k quality" - that example is straight from the README.
The trick is that it uses Tencent's official HunyuanImage-3.0 system prompts for the rewriting, so the output is tuned to what HunyuanImage-3.0 actually rewards: objective, structured, physics-consistent descriptions (the model is autoregressive with no negative prompts, so your prompt has to carry the whole message). This node is the standalone version of the enable_prompt_rewrite toggle that's built into the generate nodes - same engine, but you can rewrite a prompt and feed it to anything.
How it works
Two inputs: prompt (what you actually want) and rewrite_style:
- en_recaption - structured, detail-rich rewrite. Objective, present-tense, wrapped in
<recaption>tags. The default, and usually all you need. - en_think_recaption - a two-phase version: the model reasons (
<think>), then produces the final prompt (<recaption>). More thorough, slower, costs more tokens. - none - pass the prompt through untouched.
There's also an optional manual_seed for reproducible rewrites (only sent if nonzero; harmless if the API ignores it). Output is a single rewritten_prompt STRING - wire it into a Generate node's prompt input, a text encoder, or anything that takes a string.
Setting it up
The node reads its API config from api_config.ini in the pack's folder (copy api_config.ini.example to api_config.ini and add your key) or from environment variables HUNYUAN_API_KEY and HUNYUAN_API_URL. Defaults are DeepSeek's endpoint and model, but the file is a plain OpenAI-compatible config, so any endpoint works - OpenAI, Claude via a proxy, or a local LLM through LM Studio or Ollama.
[API]
api_key = sk-your-key-here
api_url = https://api.deepseek.com/v1/chat/completions
model_name = deepseek-chat
Install the pack the usual way:
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Comfy_HunyuanImage3
cd Comfy_HunyuanImage3
pip install -r requirements.txt
Restart ComfyUI (or use ComfyUI Manager, search "Comfy_HunyuanImage3").
The honest caveats
It needs a paid API key - the README is explicit that this is optional and the nodes work fine without it. If no key is configured, the node logs a warning and returns your prompt unchanged, which is a graceful failure you'll want to know about so you don't wonder why nothing changed. And it's worth remembering this is the one piece of the pack that calls an external API: everything else is fully local. The config file also holds your key in plaintext, so treat the pack folder accordingly - and if you use a local model via Ollama/LM Studio, you can have the same rewriting with zero cloud cost, just slower.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A serene landscape | — |
| rewrite_style | COMBO | en_recaption | 3 options: en_recaption, en_think_recaption, none |
| manual_seedopt | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| rewritten_prompt | STRING | — |