Nodes/Vantage-Nodes/Vantage Prompt Scene Router
ComfyUI Node

Vantage Prompt Scene Router

One node that swaps prompts and LoRAs per scene

By vantagewithai·Created 8 months ago·Updated about a month ago· 25
Vantage Prompt Scene Router
  • model
  • clip
  • model
  • conditioning
  • total_scenes
execute_index0
lora_1
lora_2
lora_3
lora_4
lora_5
lora_6
lora_7
lora_8

Prompt Scene Router is the one genuinely workflow-shaped node in Vantage Nodes: a single node that holds a whole set of scenes - each with its own prompt and its own set of enabled LoRAs - and, depending on an index you feed it, outputs the right model and the right conditioning. Think of it as a prompt book for your graph. Instead of a dozen text encoders and LoRA loaders scattered across the canvas, you get one node and a switch.

It's aimed squarely at video and storyboard-style work: scene 1 is "sunset over a harbor," scene 2 is "crowded night market," and the same sampler pipeline renders them in sequence as the index advances. It slots into the "switch / fallback control" culture of ComfyUI utility packs - the whole point is fewer wires and a graph you can still read when it's ten scenes deep.

How it works

The backend is deliberately stateless: all the scene data lives in a JSON blob (scene_data) that the node's JavaScript widget builds and maintains, so the Python side stays dumb. Each scene is an object with a prompt, a source, and an enable_loras list. On each run:

  1. It parses the JSON and reads the scene list.
  2. It clamps execute_index to [0, total_scenes - 1] and picks that scene.
  3. It walks your eight LoRA slots; for any slot whose index appears in the scene's enable_loras list, it loads that LoRA from your loras folder and merges it at full strength (1.0).
  4. It encodes the scene's prompt with the CLIP you passed in, and returns the patched model plus the conditioning.

Inputs:

  • model (MODEL) - the checkpoint's model to patch LoRAs onto.
  • clip (CLIP) - the text encoder used for the scene prompts.
  • execute_index (INT, default 0) - which scene to render. Drive it from a stepper or frame counter for per-scene video.
  • lora_1lora_8 (STRING, optional) - LoRA filenames for the pool. A scene only applies a LoRA if its index is in that scene's enable_loras.

Outputs: model (MODEL), conditioning (CONDITIONING), and total_scenes (INT) - the count, handy for loop bounds. Note there's no separate negative conditioning output; encode your negative once outside and leave this node to the positive side.

The honest caveat: check the shipped code

This node is a case where you should trust the source over the README. As shipped in the current code, run() references a variable named lora_names that was never defined - the method actually receives the LoRA slots as **loras. The practical result is a NameError: name 'lora_names' is not defined on execution, even with no LoRAs configured. If you hit exactly that error, the fix is a one-line edit in prompt_scene_router.py:

# change this line:
for i, name in enumerate(lora_names.values()):
# to:
for i, name in enumerate(loras.values()):

Keep an eye on the repo - this is the kind of thing that gets patched quickly once it's reported, so re-pull before you assume it's still broken.

Where you'd reach for it

  • Multi-scene video where each shot needs its own prompt and character/style LoRAs.
  • A/B scene testing from one graph: flip execute_index and compare outputs without touching a wire.
  • Keeping a "final cut" workflow shareable - collaborators get one node instead of a tangle of switches.

Installation

Part of Vantage Nodes. ComfyUI Manager: search "Vantage Nodes." Or:

cd ComfyUI/custom_nodes
git clone https://github.com/vantagewithai/Vantage-Nodes.git
pip install -r requirements.txt

Restart ComfyUI. The heavy requirements.txt is mostly for the pack's GGUF and Qwen TTS nodes; the router itself needs only a working install and your LoRAs in the usual folder.

Troubleshooting

  • NameError: lora_names: the known bug above - apply the one-line fix or update the pack.
  • ValueError: No scenes defined: the scene list in the node's widget is empty; add a scene in the panel before queueing.
  • FileNotFoundError: LoRA not found: the LoRA filename in a scene's enable_loras doesn't resolve in your ComfyUI/models/loras folder - check the exact filename (extensions are added automatically, so foofoo.safetensors).
CategoryVantage/Utilities

Inputs (11)

NameTypeDefaultDescription
modelMODEL
clipCLIP
execute_indexINT0
lora_1optSTRING
lora_2optSTRING
lora_3optSTRING
lora_4optSTRING
lora_5optSTRING
lora_6optSTRING
lora_7optSTRING
lora_8optSTRING

Outputs (3)

NameTypeDescription
modelMODEL
conditioningCONDITIONING
total_scenesINT