Nodes/Prompt Translator & Enhancer/Prompt Translator & Enhancer From Model (Multi→EN)
ComfyUI Node

Prompt Translator & Enhancer From Model (Multi→EN)

Prompt Enhancer From Model

By ezetojo·Created 7 months ago·Updated 6 months ago· 0
Prompt Translator & Enhancer From Model (Multi→EN)
  • llm_model
  • enhanced_prompt
  • original_prompt
prompt
enhancement_leveldetailed
max_tokens256
temperature0.70
seed-1

Once the pack is set up, this is the node you reach for daily. Prompt Translator & Enhancer From Model (Multi→EN) doesn't load anything itself - it takes the model already loaded by LoadLLMModel as an input and just does the job: take your prompt in any language the model understands, translate it to English, and enhance it into comma-separated tags for your checkpoint. Because the model is already in memory, running it is fast, and one loaded model can feed several of these nodes at once.

How it works

Your prompt goes into a chat completion against the loaded GGUF model, with a system prompt chosen by enhancement_level. The clever part is how hard the node constrains the output. The system prompts demand "only comma-separated English tags, nothing else" and explicitly ban reasoning; a post-processor then strips <think> blocks and stray chain-of-thought, removes Output:/English: prefixes, de-duplicates tags, and caps the list at 50. This matters more than it sounds. Let a chat model free-run and it hands you "Here is your enhanced prompt: ..." plus its internal monologue - and all of it lands in your conditioning as literal tokens. This node is built to keep that out.

The inputs that matter

  • llm_model - not a dropdown, a wire. Comes from LoadLLMModel; no loader upstream means no output.
  • prompt - your rough idea, in any language the model supports. Spanish, French, Japanese - whatever your model is good at.
  • enhancement_level - basic, detailed, or creative:
    • basic - translate, plus minimal quality tags.
    • detailed - translate and enrich with lighting, camera, composition, quality. The default, and a solid place to start.
    • creative - translate with art-director flavor: styles, effects, interpretation. Explicitly told not to repeat tags.
  • max_tokens - output cap, default 256 (up to 1024). Tags eat tokens fast; if rewrites keep coming back cut off mid-word, raise it.
  • temperature - default 0.7. Lower is more literal, higher is more invention.
  • seed - default -1, meaning random. Set a fixed seed to get reproducible rewrites.

Outputs

Two strings. enhanced_prompt is the whole point - wire it into CLIP Text Encode ahead of your sampler. original_prompt passes your input through untouched, which is handy for a side-by-side comparison or just keeping your source text in the graph.

Install and gotchas

Same pack, one install: search "Prompt Translator & Enhancer" in ComfyUI Manager, or clone the repo into custom_nodes. You need LoadLLMModel upstream, so both nodes must be present.

  • The model stays resident as long as the graph holds it. Speed costs you VRAM - that's the deal, and it's why you don't run the all-in-one node in the same graph.
  • seed = -1 means every run is different. If you're chasing a specific rewrite, set it.
  • If a run comes back empty, the console tells the story: the node falls back to a raw text completion for base (non-Instruct) models when the chat path fails, and it logs the reason either way. Read the [PromptEnhancer/Debug] lines.

One thing worth knowing before you blame the node: the quality ceiling here is the model, not the code. An 8B instruct model is a convenience that removes the blank-page problem - it's not a ghostwriter. Treat its output as a draft and you'll get along fine.

CategoryLLM/Prompt Enhancement

Inputs (6)

NameTypeDefaultDescription
llm_modelLLM_MODEL
promptSTRING
enhancement_levelCOMBOdetailed3 options: basic, detailed, creative
max_tokensINT25632–1024
temperatureFLOAT0.700–2
seedINT-1-1–2147483647

Outputs (2)

NameTypeDescription
enhanced_promptSTRING
original_promptSTRING