Nodes/ComfyUI_VideoChunkTools/Chain Text Embeds ๐Ÿ”—
ComfyUI Node

Chain Text Embeds ๐Ÿ”—

Chain Text Embeds ๐Ÿ”— โ€” give every chunk its own prompt

By gregtee2ยทCreated 6 months agoยทUpdated 6 months agoยท 4
Chain Text Embeds ๐Ÿ”—
  • embed_1
  • embed_2
  • embed_3
  • embed_4
  • embed_5
  • embed_6
  • embed_7
  • embed_8
  • embed_sequence

"The cat sleeps on a sofa" is a great prompt for the first three seconds. It's a terrible prompt for the part where the cat wakes up and jumps off. If you're generating long, chunked videos with the WanChunkedI2VSampler, that's the problem this node exists for: it lets the narrative change as the video progresses, one prompt per chunk, instead of repeating the same text conditioning for the whole run.

ChainTextEmbeds takes up to eight already-encoded text embeddings from WanVideoTextEncode and stacks them into an ordered sequence. You then feed that sequence into the sampler's text_embed_sequence input, and chunk 1 gets embed_1, chunk 2 gets embed_2, and so on. The output type is TEXT_EMBED_SEQUENCE, a pack-specific type that only the WanChunkedI2VSampler consumes - which tells you exactly where this node lives in the ecosystem.

How it works

The inputs are dead simple: embed_1 (required) through embed_8 (optional), all of type WANVIDEOTEXTEMBEDS - that's the output type of a WanVideoTextEncode node. The behavior rules, which the author spells out and the source confirms:

  • Fewer embeds than chunks โ†’ the last embed repeats for all remaining chunks. Three chunks, two prompts: chunk 1 gets prompt A, chunks 2 and 3 get prompt B.
  • Non-connected slots are skipped. Embed_1 + embed_3 with no embed_2 gives you a two-entry sequence, not a blank in the middle.

Single embed_sequence output, wire it to text_embed_sequence on the sampler. If that input is connected, it overrides the sampler's plain text_embeds input, which applies one prompt to every chunk - so you can keep using the single input for uniform runs and only build a chain when the story actually changes.

Why you'd want this at all

People have been asking for per-window prompting since the first context-window workflows appeared - there are r/comfyui threads from mid-2025 wondering whether you can inject separate prompts into separate context windows of a long Wan run. The honest answer for a long time was "not really, not cleanly." This node is one of the cleaner answers: encode each prompt once, chain them, let the sampler pick per chunk. It's a small node, but it's the difference between a one-note 15-second clip and something that actually tells a story.

The setup

You'll need ComfyUI-WanVideoWrapper installed (the WanVideoTextEncode node comes from Kijai's wrapper), and you're doing this for use with the pack's WanChunkedI2VSampler:

cd ComfyUI/custom_nodes
git clone https://github.com/gregtee2/ComfyUI_VideoChunkTools.git
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper.git

Restart ComfyUI after both. The core nodes of this pack don't need the wrapper, but this one is useless without it.

One practical tip: when you write per-chunk prompts for a rolling-reference run, remember Wan's I2V convention of describing motion rather than restating the image - each chunk's prompt should carry the action forward, since the reference frame already establishes what's on screen.

CategoryVideoChunkTools

Inputs (8)

NameTypeDefaultDescription
embed_1WANVIDEOTEXTEMBEDSText embedding for chunk 1 (required).
embed_2optWANVIDEOTEXTEMBEDSText embedding for chunk 2.
embed_3optWANVIDEOTEXTEMBEDSText embedding for chunk 3.
embed_4optWANVIDEOTEXTEMBEDSText embedding for chunk 4.
embed_5optWANVIDEOTEXTEMBEDSText embedding for chunk 5.
embed_6optWANVIDEOTEXTEMBEDSText embedding for chunk 6.
embed_7optWANVIDEOTEXTEMBEDSText embedding for chunk 7.
embed_8optWANVIDEOTEXTEMBEDSText embedding for chunk 8.

Outputs (1)

NameTypeDescription
embed_sequenceTEXT_EMBED_SEQUENCEโ€”