Nodes/Ostris Nodes ComfyUI/LLM Prompt Upsampling - Ostris
ComfyUI Node

LLM Prompt Upsampling - Ostris

Short prompt in, three hundred words out

By ostris·Created 3 years ago·Updated about a year ago· 49
LLM Prompt Upsampling - Ostris
  • llm_pipe
  • seed
  • string
  • text
string

Type a man holding a sword, and this node hands you back a paragraph about a pale figure in a dark forest, sword glowing blue, light casting across the trees. That's prompt upsampling: an LLM expands your short prompt into a long, descriptive one before it ever reaches the sampler. It's a fun trick, it's experimental, and you should know exactly what you're trading before you wire it in.

The node takes three things:

  • llm_pipe - the LLM_PIPELINE from LLM Pipe Loader, and it has to be loaded first; the node raises a clear error if you feed it nothing.
  • string - your prompt, multiline.
  • seed - a SEED, same format as the sampler wants, and it's not decoration: it seeds the LLM's sampling, so the same seed reproduces the same expansion.

Both outputs, string and text, carry the same rewritten prompt under the two type labels - grab whichever your downstream node accepts.

The mechanism comes from sayakpaul's caption-upsampling project, which the README credits directly, and it's the DALL·E 3 approach. The source builds a chat message with a system prompt lifted from the DALL·E 3 technical report - you're part of a team of bots, the partner bot draws whatever you describe, output only one description, 15–300 words, always keep every detail from the input - plus a few few-shot examples ("a frog playing dominoes" → a tree frog at a worn table across from an elderly raccoon smoking a cigar). Your prompt gets dropped in as the final user message, the LLM generates with a 256-token cap at temperature 0.7, and the assistant's reply is scraped out and newlines stripped. The result is prose, not tags, which is a key point.

The README's warnings are the honest ones: it's experimental, it will likely strip TI embeddings, and it loads 4-bit but is still VRAM-hungry. The embedding part is the thing to really hear. This node rewrites your prompt into plain descriptive English, so anything that isn't plain text - <lora:...>, embedding:..., danbooru tags with their underscores, weighted syntax - gets mangled or dropped somewhere in the rewrite. Use it on natural-language prompts, not on tag-based ones.

Other things that will bite:

  • VRAM. Add a 4-bit 7B model's worth of memory on top of your diffusion model. On a 12GB card that's a squeeze. The Pipe Loader article covers the math.
  • Reproducibility. The seed makes the expansion repeatable, so when the rewrite is great and the image is bad, you can tweak generation without losing the text.
  • It's a tool of the SDXL / early-Flux era. On modern LLM-encoded models - Z-Image, Klein, the whole current generation - the encoder already reads natural language fluently, and the KB's own findings are that past ~75–100 tokens more words stop helping and can even hurt. Expanding "a man holding a sword" into 300 words for a model that's already great at long prompts is often busywork. The honest community verdict on local LLM prompt enhancement has generally been "not worth the inference overhead."

Install with the rest of the pack: ComfyUI Manager, search Ostris Nodes, restart, or clone and pip install -r requirements.txt as covered in the LLM Pipe Loader article.

It's genuinely impressive the first time you run it, and if you're on SDXL chasing that extra descriptive richness, it can be a real shot in the arm. But it's also the most demanding node in the pack for the least certain payoff. Try it with a small model, keep your prompt natural-language, and decide for yourself whether the paragraph is earning its VRAM.

Categoryostris/llm

Inputs (3)

NameTypeDefaultDescription
llm_pipeLLM_PIPELINE
stringSTRING
seedSEED

Outputs (2)

NameTypeDescription
stringSTRING
textTEXT