Nodes/fxai-toolkit/凤希AI - 时序提示词编码器
ComfyUI Node

凤希AI - 时序提示词编码器

FxAiPromptRelayEncode

By fxai666·Created 4 months ago·Updated 4 days ago· 35
凤希AI - 时序提示词编码器
  • model
  • clip
  • latent
  • data
  • model
  • positive
epsilon0.0010

FxAiPromptRelayEncode is the most technically ambitious node in this pack, and the one where the marketing finally matches the mechanism. It implements temporal prompt relay: instead of one prompt conditioning the whole video, each time segment of the latent attends to its own slice of the prompt. Frame 0–50 sees "a man opens the door", frames 51–100 see "he walks into a neon bar". Same model, same clip, one video, no cuts - the story just shifts as the timeline advances. If you've ever made a long video and watched the model either freeze on the first thing you said or smear everything into a mush, this is the fix.

Mechanically, it's a port of the Prompt Relay technique that the LTX community popularized for time-windowed conditioning (see ecosystems/ltx-video.md) - the author's own comments say "logic copied from the original." The input data is a JSON DICT (exactly the 字典数据结构 output of FxAiMultiPromptLoader, containing global_prompt, segments[{prompt,start,end}], total_frames). The node tokenizes the full prompt, works out which tokens belong to which segment, then builds a cross-attention penalty matrix: for every query frame, it computes a soft cost (a quadratic falloff controlled by epsilon, default 0.001) that pushes attention toward the right segment's tokens and away from everyone else's. It then patches the diffusion model's cross-attention forward pass with that mask - supporting both Wan and LTX architectures, detected automatically from the model - and returns the patched model plus the encoded conditioning.

Inputs: model (MODEL), clip (CLIP), latent (LATENT - your video latent, which sets the frame count and tokens-per-frame), data (JSON), and epsilon (FLOAT, how hard the segment boundaries are). Outputs: model (the patched clone - you sample with this model, not the original) and positive (CONDITIONING).

This is where the caveats start, and they're real ones from reading the source. It supports Wan and LTX only - feed it another architecture and it raises "Unsupported model type" before doing anything. It needs the raw tokenizer off the CLIP object, so the CLIP you hand it has to be the video model's own (Wan/LTX clip, not a random SDXL one). And the latent's frame count must be consistent with the segment lengths in data - that's the alignment the loader's total_frames exists to enforce. Get the framerate or the timeline wrong and the mask lands on the wrong frames; the node logs the penalty matrix shape so you can sanity-check.

Also worth knowing: it patches a cloned model in memory - the original model object is untouched, so you can run relay and non-relay branches off the same checkpoint. On a low-VRAM card, patching plus a second conditioning pass adds memory, which is exactly why this pack pairs it with FxAiReleaseResources. It's under conditioning/prompt_relay, installs with fxai-toolkit (凤希AI / fxai.site):

cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit

or ComfyUI Manager → search "fxai-toolkit", restart. If you're doing story-driven long video on Wan or LTX, this node is the closest thing in the pack to a superpower - just feed it the DICT from FxAiMultiPromptLoader.

Categoryconditioning/prompt_relay

Inputs (5)

NameTypeDefaultDescription
modelMODEL
clipCLIP
latentLATENT
dataJSON
epsilonFLOAT0.00100.000001–0.99

Outputs (2)

NameTypeDescription
modelMODEL
positiveCONDITIONING