Nodes/civitai-comfy-nodes/Civitai Prompt Enhancement
ComfyUI Node

Civitai Prompt Enhancement

An LLM that writes prompts the way each model actually wants them

By civitai·Created 2 months ago·Updated about a month ago· 42
Civitai Prompt Enhancement
  • images
  • api_config
  • issues
  • recommendations
  • enhanced_prompt
  • enhanced_negative_prompt
  • workflow_id
  • raw_json
ecosystem
prompt
negative_prompt
temperature0.00
instruction

Prompt enhancement is one of those jobs that sounds like a gimmick until you've typed "a red car" into a model and gotten a red blob. This node does it the smart way: it's ecosystem-aware. You tell it you're targeting sdxl or flux or ltx2, and the LLM rewrites your rough idea into the shape that ecosystem's encoder actually understands - tag soup for SD, natural language for Flux, structured shot descriptions for video. That per-ecosystem knowledge is the whole point, and it's the thing most generic enhancers get wrong.

How it works

This is the Text family's API path, straight from the Civitai Orchestration API. Your prompt goes up to Civitai's LLM, comes back as an enhanced version. What makes it interesting is what it returns - not just a rewritten prompt, but a small structured report:

  • enhanced_prompt - the main output, wire this into your generator's prompt box.
  • enhanced_negative_prompt - the matching negative, when you fed one in.
  • issues - what the model flagged as weak in your original (vague subject, missing style, etc.).
  • recommendations - suggestions beyond the rewrite.

The issues and recommendations strings are honestly the sleeper feature. They make the node a teaching tool: run a prompt through it, read why it called your prompt weak, and your next prompt is better even without the enhancement.

Inputs that matter

  • ecosystem (required) - the target, e.g. sd1, sdxl, flux, ltx2. This drives everything; get it right or the rewrite is wrong-shaped.
  • prompt (required) - your rough idea.
  • negative_prompt - optional, gets enhanced too.
  • temperature - 0 default here, tooltip says it defaults to 0.7 if left at 0; higher = more creative/looser.
  • instruction - this is where you steer it: "expand to 77 tokens," "keep it under 20 words." Exactly the right knob to have.
  • images - optional IMAGE input for the VLM path: the model can look at a reference image and write a prompt describing subject, style, lighting. The tooltip carries the caveat - it only works if the per-ecosystem prompt-analysis model is a vision-capable LLM; non-VLM models silently ignore the images. So wire images in, but don't assume they were used.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/civitai/civitai-comfy-nodes.git
pip install -r civitai-comfy-nodes/requirements.txt

Or ComfyUI Manager → "Civitai Comfy Nodes" → Install → restart. Authenticate, and each call costs a little Buzz.

Gotchas

The KB's prompt-enhancement section is the map here: the community's loud default is a local, uncensored LLM, because enhancement is exactly the job where people don't want a filter. This node is the API path - filtered, metered, and if you're near any content boundary, it's Civitai's policy doing the refusing. For SFW work, its ecosystem-awareness makes it more useful than a generic local model that doesn't know SD1 wants tags. And it's early preview, so expect the occasional weird rewrite; check issues/recommendations before trusting the output, and remember the same caution that applies to every LLM in the graph: a generated prompt can drift from what you meant, so chain it tightly and review - the best enhancer is one you treat as a draft.

CategoryCivitai/Text

Inputs (7)

NameTypeDefaultDescription
ecosystemSTRINGThe target ecosystem (e.g., "sd1", "sdxl", "flux", "ltx2").
promptSTRINGThe user's prompt to analyze and enhance.
negative_promptoptSTRINGOptional negative prompt to analyze and enhance.
temperatureoptFLOAT0.000–1LLM temperature for enhancement creativity (0.0–1.0). Defaults to 0.7.
instructionoptSTRINGOptional instruction to guide how the prompt is enhanced (e.g., "expand to 77 tokens", "keep it under 20 words").
imagesoptIMAGEOptional reference images for the prompt enhancement model to consider when enhancing the prompt (subject, style, lighting, composition, color palette). Accepts URLs, data URIs, raw base64, or AIR strings. Requires the per-ecosystem prompt-analysis model to be a vision-capable LLM (configured via IPromptAnalysisGrain.SetConfigurationAsync) — non-VLM models will silently ignore the images.
api_configoptCIVITAI_CONFIGOptional Civitai Auth connection; defaults to CIVITAI_API_TOKEN or stored OAuth login.

Outputs (6)

NameTypeDescription
issuesSTRING
recommendationsSTRING
enhanced_promptSTRING
enhanced_negative_promptSTRING
workflow_idSTRING
raw_jsonSTRING