Nodes/comfyui_AcademiaSD/Academia SD Prompt Enhancer ✨
ComfyUI Node

Academia SD Prompt Enhancer ✨

An LLM prompt enhancer that costs you zero extra VRAM

By AcademiaSD·Created about a year ago·Updated 2 days ago· 86
Academia SD Prompt Enhancer ✨
  • clip
  • image
  • prompt
  • negative_prompt
  • aspect_ratio
◄templateqwen_image_rewriter.md►
◄negative_templateqwen_image_negative.md►
◄temperature0.70►
◄seed0►
◄max_length1024►
◄prompt►
◄negative_prompt►
◄width—►
◄height—►
◄positive—►

The trick: no second model

Every other prompt enhancer in ComfyUI charges you the same way: an API key with a cloud round-trip, or a second LLM downloading into VRAM next to the diffusion model - which is why the good ones ship unload/reload choreography.

This one borrows what you already loaded. If your workflow is a Qwen-Image-Edit or Qwen Image 2.1 stack, you already have a Qwen3-VL text encoder in the graph, and a vision-language model can write as well as encode. The node takes that encoder as its clip input, hands it a chat-formatted instruction plus your rough idea (and your reference image, if you're feeding one), and calls generation on it. No Ollama, no token bill, no extra download.

The honest reason to care: it's exactly as uncensored as your encoder is, and about as creative as a mid-size VLM. It removes the blank page. It is not a writer.

How it works

The instructions live in .md files next to the pack, in enhancer_templates/, not in Python - so retouching the prompt style doesn't mean touching code. Two ship: qwen_image_rewriter.md and qwen_image_negative.md. The rewriter is a long, prescriptive spec: split the brief into what the user fixed and what they left open, pick a ratio from the subject, write one long English paragraph describing the finished frame as seen, and return one JSON object with rewritten_prompt, edit_instruction and wh_ratio.

Two details are worth stealing even if you never install the pack. It treats <image1>-style reference tags as fixed - they survive verbatim, attached to whatever they name. And when the request is an edit, the instruction goes in its own field and the node pastes it in front of the description; if the tags your request named went missing along the way, it prepends your original prompt so nothing you asked for evaporates.

The chat template is built by hand, ending in an empty <think> block, which switches off reasoning mode and saves the tokens. And it deliberately runs one generation per execution - a second one in the same execution tripped a CUDA device-side assert, so the negative is a second execution of the same node, fed the positive it just wrote.

Parsing is forgiving on purpose: clean JSON preferred, but a max_length truncation mid-object gets salvaged into the description, and if all else fails the raw text becomes your prompt. Degraded, but your queue doesn't die.

Inputs and outputs worth knowing

Required: clip (a Qwen3-VL text encoder), template, negative_template, temperature, seed, max_length. Optional: image, prompt, negative_prompt, width, height, plus a hidden positive. You need a prompt, an image, or both - otherwise it raises.

temperature changes the character of the output: at 0 it sticks to what you gave it and writes the same text every time; higher values invent more of whatever your brief left open. max_length is the token budget - the template asks for around five hundred words, so cutting it short truncates the answer. Wiring width and height gets you a suggested aspect_ratio instead of letting the model guess.

The outputs are prompt, negative_prompt and aspect_ratio, and none of them show on the canvas. Not a bug - the button is the interface. ✨ Enhance prompt queues the node plus only the upstream nodes it needs, not your whole workflow, and writes the three results into text boxes inside the node where you can edit them; they save with the workflow. ➤ Send prompt pushes the positive into an Academia SD Positive node and the negative into an Academia SD Negative one - those come from this pack's Advanced CLIP Text Encode node. With several on the canvas, select the one you mean first.

Because nothing in the graph hangs off its outputs, a normal Queue never runs it. That surprises people, and it's also why it costs you nothing when you're not using it.

Install

ComfyUI Manager, search comfyui_AcademiaSD, or:

cd ComfyUI/custom_nodes
git clone https://github.com/AcademiaSD/comfyui_AcademiaSD

Restart. No requirements.txt, no model downloads beyond the Qwen-Image stack you already have - but you do need a ComfyUI recent enough that a Qwen3-VL text encoder supports in-graph generation. The pack targets the Qwen Image 2.1 generation of encoders.

Common issues

If the button says the node is bypassed or muted, it is. If it complains about a missing Positive node, you don't have the pack's CLIP Text Encode node in the workflow and there's nowhere to send. Identical text on repeated clicks just means temperature is at 0.

Editing a template takes effect without a restart (template file mtimes are part of the cache key), but adding a new .md needs one - the dropdown is built when the node definition loads.

The last one isn't an error, it's the ceiling. Enhancers add detail you didn't ask for - the feature until it isn't, and the failure mode the whole category shares. Treat the output as a first draft: let it translate your idea into the flowing sentence form an LLM encoder wants, then cut the two things it invented.

CategoryAcademia SD

Inputs (12)

NameTypeDefaultDescription
clipCLIPA Qwen3-VL text encoder, like the one Qwen Image 2.1 loads. It sees the image and writes the prompt.
templateCOMBOqwen_image_rewriter.md4 options: bbox_json.md, bbox_json_detailed.md, qwen_image_negative.md, qwen_image_rewriter.md
negative_templateCOMBOqwen_image_negative.md4 options: bbox_json.md, bbox_json_detailed.md, qwen_image_negative.md, qwen_image_rewriter.md
temperatureFLOAT0.700–1.50 sticks to what it receives and always writes the same text. Higher values invent more of what the brief leaves open.
seedINT00–18446744073709550000—
max_lengthINT102464–4096Tokens it may write for the prompt. The template asks for about 500 words; too few cuts the answer.
imageoptIMAGE—
promptoptSTRING—
negative_promptoptSTRING—
widthoptINT—
heightoptINT—
positiveoptSTRING—

Outputs (3)

NameTypeDescription
promptSTRING—
negative_promptSTRING—
aspect_ratioSTRING—