Nodes/ComfyUI-AuK/AuK Prompt Enhance
ComfyUI Node

AuK Prompt Enhance

No API, no key — your own encoder writes the instruction

By Saganaki22·Created a day ago·Updated about 23 hours ago· 12
AuK Prompt Enhance
  • encoder
  • instruction
  • seconds
  • task
instructionmake her sound excited and say welcome home
context
max_new_tokens256

Type make her sound excited and say welcome home, and this node turns it into the canonical AuK instruction, picks the closest task, and estimates how many seconds you'll need. It's a local port of upstream's Prompt Enhancer, and the word "local" is doing real work: there is no cloud call, no API key, and no second model to download. It uses the language-model head already sitting inside the Qwen encoder you loaded for Instruction Encode.

Most prompt-enhancer nodes in ComfyUI mean a separate LLM - an Ollama model, a bundled abliterated 8B, a whole extra VRAM budget. Here the encoder is already an LLM, so the enhancement is a byproduct of loading an encoder you needed anyway. That's a genuinely tidy bit of design and it's why this node is worth wiring up.

How it works

The node builds a system prompt that lists all 27 AuK tasks with their canonical templates and asks the model to pick one, fill its slots, and answer in minified JSON. Decoding is single-sample greedy with a KV cache, max_new_tokens capped at 1024 - so it's deterministic and boring, which is what you want from a classifier. Then the pack does the plumbing:

  • It snaps values to legal choices. Pitch to whole semitones 1–12, speed to one of 0.5/0.75/1.25/1.5/2.0, volume to 5/10/15 dB. Your "a little faster" becomes a value the model will actually accept.
  • It renders the template. Output is the same sentence the Instruction Builder would produce, not a rewrite.
  • It estimates duration. For TTS and cloning tasks it estimates from text length (~2.5 words/second) unless the model gave a number; for every edit task it returns 0, which means "match the source duration" on the sampler.
  • It repairs sloppy JSON. Fenced blocks, balanced braces, then a regex salvage pass - the source comments that quantized language heads drop a quote or comma now and then.

Inputs and outputs

  • encoder - AUK_ENCODER from AuK Encoder Loader. It must be a conversion that includes the LM head; all the released encoder files do. If it doesn't, you get a specific error telling you to re-run tools/convert.py --component encoder.
  • instruction - your loose request, in any wording you like. Default is a nice demonstration: make her sound excited and say welcome home.
  • context (optional) - extra text to condition the decision on. The obvious use is the STRING from AuK Whisper Transcribe, so the model knows what the source audio says before it writes a replace instruction.
  • max_new_tokens (optional, default 256) - raise it if you get a malformed-reply error on a long request.

Three outputs: instruction (STRING) → Instruction Encode's instruction; seconds (FLOAT) → Generate / Edit's seconds; and task (STRING), which is the picked task name - handy as a debug readout when the instruction it wrote isn't what you meant.

Suggested chain: Instruction Builder → AuK Prompt Enhance → Instruction Encode, with seconds going to the sampler.

Install

cd ComfyUI/custom_nodes && git clone https://github.com/Saganaki22/ComfyUI-AuK
cd ComfyUI-AuK && python -m pip install -r requirements.txt

No extra models - this node exists because of the encoder you already have. Restart after installing.

Troubleshooting

"This converted encoder lacks the language head." The conversion was made without the LM head, so Instruction Encode still works but this node can't. Re-run the converter with --component encoder on the original Qwen directory.

"The language model returned malformed JSON." Usually a hard request through a harder-quantized encoder. Raise max_new_tokens, phrase the request closer to one of the task templates, or just use the Instruction Builder for that one and keep Prompt Enhance for the easy 80%.

"Request is outside AuK's capabilities." The model picked the unsupported task and wrote a reason into the reply. That sentence is often the most useful thing on screen - it's the LLM telling you which part of your ask has no template. Note this is a real ceiling: if there's no task for it, there's no instruction for it.

It answered something adjacent to what you asked. It's a classifier with a fill-in-the-blanks job, not a writer. Greedy decoding means the same input gives the same output every time, so rewording the request is the only lever.

Don't feed it an audio description instead of an audio task. a warm female narrator reading the news describes a voice; say this in a warm voice, slower is an instruction it can route. The context input is where you put the situation (the transcript), not a vibe.

CategoryAuK

Inputs (4)

NameTypeDefaultDescription
encoderAUK_ENCODEREncoder from AuK Encoder Loader. Its checkpoint must include the language head - re-run tools/convert.py --component encoder on the original Qwen directory if this errors.
instructionSTRINGmake her sound excited and say welcome homeLoose request in any wording. The language model picks the closest AuK task and fills its template.
contextoptSTRINGOptional extra context, e.g. the STRING output of AuK Whisper Transcribe on the source audio.
max_new_tokensoptINT25632–1024Generation budget for the language-model answer.

Outputs (3)

NameTypeDescription
instructionSTRING
secondsFLOAT
taskSTRING