Rikan Prompt Relay Encode (Timeline)
Drag segments on a timeline and each one gets its own prompt, smoothly
- model
- clip
- latent
- model
- positive
- fps_out
- max_frames_out
Here's the problem this solves: a video model gets one prompt, so a 5-second clip is one idea. But a real shot changes - the light shifts, the camera pulls back, the subject walks into a new scene. The community trick that went around in 2026 is "prompt relay": split the clip into segments and give each one its own prompt, letting the model transition between them smoothly instead of you cutting two renders together. Rikan Prompt Relay Encode (Timeline) is that idea done natively in ComfyUI, with a visual timeline editor instead of a script.
The node's headline feature is the timeline UI. Instead of typing JSON, you get a colored bar per segment that you drag and resize on a ruler, each segment with its own prompt box. The max_frames (default 129) ruler shows seconds at your fps (default 24), an Equalize button snaps all segments to the same length, and everything serializes into hidden widgets (timeline_data, local_prompts, segment_lengths) that you never have to touch. If the JSON format changes under you, the editor just rebuilds a default two-segment timeline and moves on.
How the smoothing works
This is the part that's actually clever. The full prompt is your global_prompt followed by each local_prompts block (separated by |). The node tokenizes the whole thing, works out which token ranges belong to which segment, and then patches the model's cross-attention with a per-frame penalty matrix: each segment's text tokens are allowed to attend strongly to frames near their segment's midpoint, and their influence falls off with a gaussian window into neighboring frames. The epsilon control (default 0.001) sets how wide that falloff is - smaller = tighter, sharper boundaries; larger = blurrier, more blended transitions. Soft gating is what makes a prompt change feel like a drift instead of a hard cut.
It detects the model architecture and patches accordingly - Wan and LTX are the two it handles. The output model is a clone with those attention patches baked in, positive is the full-prompt conditioning, and fps_out / max_frames_out just pass your values through for whatever consumes them.
The inputs that matter
model,clip,latent- your video model, its CLIP, and the empty latent (Wan's, typically).global_prompt- the always-on prompt shared by every segment.local_prompts- segment prompts,|-separated. In practice the timeline UI writes this for you.max_frames(129),fps(24),seconds(5.375),time_units(frames or seconds) - the ruler.timeline_data,segment_lengths- hidden widgets the UI manages; you can also paste prebuilt JSON in if you're scripting.
Beyond the outputs, the node stashes the segment map inside the patched model's options (rikan_pr_segments, latent frame count, tokens per frame). That metadata is the handshake the pack's Prompt Relay Multi LoRA Gate relies on - so the intended graph is Timeline → (optionally) gate → KSampler.
Honest notes and install
The seconds/max_frames widgets are linked - edit one, the other recalculates - which can surprise you if you're used to set-and-forget. And because this patches attention, it needs a model that supports the patch (Wan and LTX) and a reasonably current ComfyUI. Install via ComfyUI Manager (search Rikannodes) or git clone https://github.com/rikanrino/Rikannodes into custom_nodes, pip install -r Rikannodes/requirements.txt, restart. It's under the Rikannodes category. It's a young pack - treat version bumps as potentially breaking, and test on a short clip first, because attention-patch nodes either work beautifully or don't register at all.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| clip | CLIP | — | |
| latent | LATENT | — | |
| global_prompt | STRING | — | |
| max_frames | INT | 1291–10000 | — |
| timeline_data | STRING | — | |
| local_prompts | STRING | — | |
| segment_lengths | STRING | — | |
| epsilon | FLOAT | 0.00100.000001–0.99 | — |
| fpsopt | FLOAT | 24.000.1–240 | — |
| secondsopt | FLOAT | 5.40.1–1000 | — |
| time_unitsopt | COMBO | frames | 2 options: frames, seconds |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| positive | CONDITIONING | — |
| fps_out | FLOAT | — |
| max_frames_out | INT | — |