Nodes/ComfyUI-RogoAI-PromptRelay/RogoAI Prompt Relay (Wan2.2 I2V)
ComfyUI Node

RogoAI Prompt Relay (Wan2.2 I2V)

Prompt Relay in ComfyUI

By RogoAI-Takeji·Created 4 months ago·Updated 4 months ago· 1
RogoAI Prompt Relay (Wan2.2 I2V)
  • model
  • t5
  • model
  • text_embeds
global_promptA young woman with long black wavy hair and blue headphones, sitting at a PC desk, realistic cinematic lighting.
negative_promptblurry, low quality, distorted face
local_prompt_1She faces the camera directly with a calm expression.
local_prompt_2She turns her head away, looking at the monitor.
local_prompt_3She turns back to the camera with a slight smile.
segment_lengths7,7,7
frame_num81
width832
height480
local_prompt_4
local_prompt_5
local_prompt_6
epsilon0.0010
force_offloadtrue

Here's the Wan problem nobody has a clean answer for: you write one prompt, you get one action. Try to fake a multi-scene clip - cut together separate generations, or prompt a full "she walks in, sits down, turns around" in one go - and the character drifts, the lighting jumps, and the seams show. This node attacks that differently. It splits your 81-frame Wan 2.2 I2V clip into segments and gives each segment its own prompt, while a shared global prompt holds the scene together. One generation, no stitching, and the character mostly stays the same person the whole way through.

What Prompt Relay actually is

Not the author's invention, despite the "RogoAI" branding. Prompt Relay is a real research technique - arXiv:2604.10030 from NTU S-Lab - and it's an inference-time trick, not a new model and not an API. The idea: your text prompts get concatenated into one big prompt and encoded together, but each local prompt's tokens get a penalty applied to their cross-attention for frames outside their assigned time window. In the code that shows up as a cost matrix subtracted from the attention logits - softmax(QKᵀ/√d − C) - built from a Gaussian-ish falloff around each segment's midpoint. Tokens for "she turns her head" only get to influence the frames you assigned that line to. Global prompt, no penalty, hits everything. That's the whole trick: route the text to the right frames instead of hoping the model figures it out.

How the node works

You feed it a Wan model and T5 encoder (both WANVIDEOMODEL / WANTEXTENCODER types from Kijai's ComfyUI-WanVideoWrapper), plus your global, negative, and up to six local prompts. It concatenates them, tokenizes, maps each local prompt to its token range, then clones the model and drops a mask function into model_options["transformer_options"]["prompt_relay_mask_fn"] for the wrapper's attention path to call. Then it encodes the full prompt and negative through T5 exactly the way WanVideoTextEncode does. Two outputs, both of which matter:

  • model (WANVIDEOMODEL) - the attention-patched model, straight into the sampler.
  • text_embeds (WANVIDEOTEXTEMBEDS) - the combined prompt/negative embeddings.

Wire them both into a WanVideo Sampler, with your first-frame image going through the usual I2V Encode, and you're off.

The inputs that matter

Only a handful. global_prompt is the one to get right - keep it short and make it carry character, outfit, place, lighting, because it hits every frame. local_prompt_1..6 are per-scene actions and camera moves; only fill the ones you use, and remember the segment_lengths string (default 7,7,7) must contain exactly as many numbers as you have non-empty local prompts, and should sum to your latent frame count - mismatch and the node throws ValueError rather than guessing. frame_num defaults to 81, the WanVideoWrapper cap; width/height default to 832×480. The two optional ones: epsilon (default 0.001) sharpens or softens the segment-boundary penalty, and force_offload (default on) pushes the T5 back to CPU after encoding to save VRAM - leave it on.

Installing it

ComfyUI Manager, search "ComfyUI-RogoAI-PromptRelay" - or:

cd ComfyUI/custom_nodes
git clone https://github.com/RogoAI-Takeji/ComfyUI-RogoAI-PromptRelay

Restart ComfyUI. The real dependency is ComfyUI-WanVideoWrapper - this node imports its types, and the pack's requirements.txt is a joke ("torch, accelerate, tqdm" and a note saying the wrapper covers everything). Install WanVideoWrapper first or the node won't even load. No model files to download; it wraps whatever Wan 2.2 and T5 you already have.

Where people get burned

  • The 81-frame cap. The wrapper stops at 81 frames (~3s), so 2–3 scenes is what's actually practical. The README's long-video talk is all about LTX-Video 2.3 - which is not in this repo. For LTX, the README points you at Kijai's ComfyUI-LTXVideo Prompt Relay workflow instead; this pack only ships the two Wan nodes.
  • Segment math. 81 frames → 21 latent frames (Wan's VAE strides 4 in time). Hand-typing 7,7,7 works, but use the companion RogoAI_PromptRelaySegCalc node and wire its segment_lengths in.
  • It routes attention, it doesn't create identity. A weak global prompt or a low-res reference frame and people still get face drift - the community threads on Prompt Relay are full of this. Use a close-up first frame and keep the global prompt locked to the character's look. That pairing is what actually sells the consistency.
CategoryRogoAI/PromptRelay

Inputs (16)

NameTypeDefaultDescription
modelWANVIDEOMODEL
t5WANTEXTENCODER
global_promptSTRINGA young woman with long black wavy hair and blue headphones, sitting at a PC desk, realistic cinematic lighting.
negative_promptSTRINGblurry, low quality, distorted face
local_prompt_1STRINGShe faces the camera directly with a calm expression.
local_prompt_2STRINGShe turns her head away, looking at the monitor.
local_prompt_3STRINGShe turns back to the camera with a slight smile.
segment_lengthsSTRING7,7,7
frame_numINT819–201
widthINT83264–2048
heightINT48064–2048
local_prompt_4optSTRING
local_prompt_5optSTRING
local_prompt_6optSTRING
epsilonoptFLOAT0.00100.0001–0.1
force_offloadoptBOOLEANtrue

Outputs (2)

NameTypeDescription
modelWANVIDEOMODEL
text_embedsWANVIDEOTEXTEMBEDS