ComfyUI Node

Prompt Composer

Type what you want, let your LoRA folder write the rest

By FranckyB·Created 12 months ago·Updated 2 days ago· 164
Prompt Composer
  • compose_data
  • lora_stack
  • mods
  • Prompt
  • compose_data
  • lora_stack
  • mods
◄parts_data[]►
◄output_formattext►
◄compose_positionbefore►
◄generation_modeimage►
◄recipe_sync_modeedit►
◄input_prompt_modeno_prompt►
◄input_lora_modeno_lora►
◄prompt—►

The LoRA Prompt Composer is the node that asks you a question instead of the other way around. You type what you want to make in plain English - "cyberpunk woman in a neon-lit alley" - and it goes shopping in your models/loras folder, picks the LoRAs that actually fit the scene, and hands back a finished prompt with the <lora:name:weight> tags, trigger words, and weights already in place. If you're the person with 400 LoRAs who ends up prompting with the same three, this is aimed squarely at you.

Worth setting expectations first: the README sells this as "semantic LoRA discovery" and mentions sentence-transformers, but the shipped code actually builds its embeddings with scikit-learn's TF-IDF - names, descriptions, and trigger words turned into a term index, then scored against your scene description. The readme rotted; the code didn't. Either way it's a bag-of-words match, not a language model, so it's fast and offline, and it'll surprise you far more with what it doesn't catch than with what it does.

Here's how it works under the hood. On first run it recursively scans models/loras, but only keeps LoRAs that have a .metadata.json file sitting next to them - that's the LoRA Manager dependency you'll see in a second. It classifies each one as image or video LoRA from the base-model field in that metadata (anything mentioning Wan, i2v, or video counts as video), scores everything against your scene_description, sorts, and composes. Two niceties: content-specific LoRAs (character, pose) get their score multiplied by content_boost before ranking, and it will even auto-pair WAN 2.2 HIGH/LOW LoRA pairs so you don't end up with just the HIGH half of a character.

The inputs that matter:

  • scene_description - the only thing you really write. Be specific; "cinematic portrait of an old man" beats "portrait".
  • max_image_loras (default 3) and max_video_loras (default 2) - caps on how many tags per type land in the output.
  • content_boost (default 1.2) - how hard content LoRAs get pushed up the ranking.
  • style_preference - technical, artistic, or natural; changes how the surrounding prompt reads, not which LoRAs win.
  • image_lora_dir_path / wan_lora_dir_path - optional subfolders to restrict the search to, handy if you want only style LoRAs today.
  • default_lora_weight and low_lora_weight_offset - the second one drops WAN 2.2 LOW-pass LoRAs below the HIGH ones (e.g. 1.0 / 0.8), which mirrors how people actually run two-pass LoRAs.

It returns three strings: composed_prompt (the finished prompt - send it down the pack's usual path into the Visualizer and then into your text encoder), lora_analysis (which LoRAs were picked and their relevance scores), and metadata_summary (processing stats). All three are terminal outputs in the conditioning category.

Install is the standard story for this pack. Easiest via ComfyUI Manager - search "LoRA Visualizer" - or:

cd ComfyUI/custom_nodes
git clone https://github.com/oliverswitzer/ComfyUI-Lora-Visualizer.git

then restart ComfyUI. Dependencies are auto-installed; note there's no requirements.txt despite what the README's manual-install section says - the real deps live in pyproject.toml (scikit-learn, scipy) and ComfyUI handles them.

Where people get burned: the composer finds nothing if LoRA Manager hasn't downloaded metadata for your LoRAs - install ComfyUI-Lora-Manager first or the search pool is empty. And the README's advice to "reduce the threshold parameter" is stale: the current node has no threshold input. Your real levers are content_boost, the directory filters, and a more descriptive scene. If something still surprises you, run ComfyUI with COMFYUI_LORA_DEBUG=1 and it'll print a similarity score per LoRA so you can see exactly why it passed on your favorite.

CategoryPrompt Manager

Inputs (11)

NameTypeDefaultDescription
parts_dataSTRING[]Internal: JSON list of prompt composer parts
output_formatCOMBOtextChoose whether the node outputs plain text or structured JSON.
compose_positionCOMBObeforePlace composed prompt fragments before or after the incoming prompt.
generation_modeCOMBOimageChoose whether Prompt Composer emits Image or Video LoRAs for this run.
recipe_sync_modeCOMBOeditChoose whether Prompt Composer keeps local edits or follows connected compose_data on execute.
input_prompt_modeCOMBOno_promptWhen enabled during compose_data sync, use the saved prompt input from compose_data instead of the live prompt input.
input_lora_modeCOMBOno_loraWhen enabled during compose_data sync, include the saved extra LoRA input data from compose_data in addition to the composed LoRAs.
promptoptSTRINGOptional incoming prompt. Composed parts can be placed before or after it.
compose_dataoptRECIPE_DATA,COMPOSE_DATAOptional saved Prompt Composer payload. Connect recipe or compose data to restore Prompt Composer parts and reuse them.
lora_stackoptLORA_STACKOptional incoming LoRA stack. Prompt Composer either uses this live input or the saved compose_data LoRA input, then appends per-prompt LoRAs.
modsoptH3_REF_MODSOptional incoming RefMod bundle. Prompt Composer appends per-prompt RefMods to it.

Outputs (4)

NameTypeDescription
PromptSTRING—
compose_dataCOMPOSE_DATA—
lora_stackLORA_STACK—
modsH3_REF_MODS—