Nodes/comfyui-lumi-tools/Lumi LLM Prompt Processor
ComfyUI Node

Lumi LLM Prompt Processor

An LLM that rewrites your prompt before it ever touches the sampler

By illuminatianon·Created 9 months ago·Updated 4 months ago· 0
Lumi LLM Prompt Processor
  • provider
  • text
instructions
prompt
seed0

This is the node that turns "a cozy coffee shop in the rain" into a full paragraph before your sampler ever sees it. If you've moved to an LLM-encoded model, you already know the drill: your prompt is now an instruction, not a bag of tokens, and writing it well is half the battle. Lumi LLM Prompt Processor is the pack's workhorse for fixing that - it takes a prompt, hands it to a real LLM, and hands the improved text back to your workflow.

The clever bit is the design, and it's worth understanding because it's the same pattern every LLM node in this pack uses. The processor is stateless: it holds nothing, remembers nothing, and owns no API key. All the configuration - which model, which key, token limits - lives in a separate provider node (Lumi OpenRouter Provider) that you wire into the provider input. You get a clean separation: swap the provider and every processor downstream just follows along.

What it actually does

Under the hood it's a plain requests POST to OpenRouter with your instructions slotted in as the system message and prompt as the user message, then it extracts the reply as plain text. The pack's inference layer retries transient failures (HTTP 408/425/429 and 5xx) with backoff, and it respects ComfyUI's interrupt - cancel the queue and the call dies politely instead of hanging.

The inputs that matter:

  • provider - an LLM_PROVIDER connection from Lumi OpenRouter Provider. Nothing works without it.
  • instructions - the system prompt. This is where you set the persona: "You are a prompt engineer. Expand the user's idea into a detailed image description."
  • prompt - the text to process.
  • seed - only has an effect if the model supports deterministic seeding; on many OpenRouter models it's a no-op, which is fine. It still forces ComfyUI to actually rerun the node, so bumping it guarantees a fresh call.

The single output, text, is a plain STRING - wire it into a CLIP Text Encode, another Lumi text node, or Lumi Show Text to see what the model said.

Getting it installed

This ships with the Lumi Tools pack, so install once and you get every Lumi node:

cd ComfyUI/custom_nodes
git clone https://github.com/illuminatianon/comfyui-lumi-tools
cd comfyui-lumi-tools
uv sync

Then restart ComfyUI. ComfyUI Manager works too - search "Lumi Tools". Dependencies are light (dynamicprompts and requests only, no model downloads), and you'll need an OPENROUTER_API_KEY set in the environment for the provider node to hand the key over.

Where people get burned

The classic failure is a node that silently did nothing: you forgot the provider, or the provider fired its "API key not found in environment variable" error because the key isn't visible to the ComfyUI process. Check the env var on the actual process, not just your shell. Also set your instructions well - a bare "rewrite this" tends to return fluff, while "expand into a detailed scene description, keep it under 50 words" gives you something the encoder can actually use. If the returned text looks worse than what you typed, lower the temperature in the provider and re-run on a bumped seed.

CategoryLumi/LLM

Inputs (4)

NameTypeDefaultDescription
providerLLM_PROVIDERLLM provider configuration from a provider node
instructionsSTRINGSystem instructions for the LLM
promptSTRINGUser prompt to process
seedINT00–18446744073709550000Random seed for deterministic generation (if supported by model)

Outputs (1)

NameTypeDescription
textSTRING