Nodes/ComfyUI-Przewodo-Utils/WanPromptChunkStacker
ComfyUI Node

WanPromptChunkStacker

Per-chunk prompts for long video, stacked in one wire

By przewodo·Created about a year ago·Updated 4 months ago· 4
WanPromptChunkStacker
  • previous_prompt
  • lora_stack
  • prompt
positive_prompt
negative_prompt
start_on_seconds0

Long-form video is the one place Wan's weakness shows up as a wall: the model generates in chunks, and a single prompt for the whole thing makes each chunk drift from the last. The community answer - for Wan and the multi-chunk samplers in this pack - is per-chunk prompting: give segment one its own prompt, segment two its own, and chain them so the video tells one story instead of five unrelated ones. This node is how you build that prompt stack.

You write a positive and negative prompt for one chunk of the video, optionally attach a LoRA stack, say which second the chunk starts at, and pass the accumulated stack down the chain. Each node instance appends its chunk to the stack built by the previous one, and the finished stack rides one wire into the pack's multi-chunk Wan sampler.

How it works

Mechanically it's a linked-list builder in node form:

  • The previous_prompt input is the stack so far. If it's None (first chunk), the node starts a fresh list.
  • You provide positive_prompt and negative_prompt for this segment, plus a lora_stack (which pairs with this pack's WanVideoLoraStack node).
  • The start_on_seconds input tells the sampler where this chunk sits - the code converts it to a chunk index by start_on_seconds // 5, so it assumes 5-second chunk boundaries.
  • Each chunk gets appended as [positive, negative, chunk_index, lora_stack], and the whole list comes out the prompt output, ready to feed the next chunk stacker or the sampler.

Chain several of these - second 0, second 5, second 10 - and you get one stack describing the whole video, with each segment's own text and LoRAs. That's the whole idea: the prompt becomes the timeline.

The inputs that matter

  • previous_prompt - chain this node's own output here to keep building the stack.
  • positive_prompt / negative_prompt - this chunk's text, multiline.
  • lora_stack - optional, from the pack's LoRA stack node; applied to this chunk only.
  • start_on_seconds - where this chunk begins. The 5-second chunk assumption lives here.

One output: prompt, the growing stack.

Installing it

Part of ComfyUI-Przewodo-Utils. ComfyUI Manager → search the pack, or:

cd ComfyUI/custom_nodes
git clone https://github.com/przewodo/ComfyUI-Przewodo-Utils.git

Restart. The stacker itself needs nothing special; the pack's heavier deps (teacache, gguf, wanblockswap, Rife-TensorRT) exist for the sampler this feeds into.

Where people get tripped up

The hardcoded 5-second chunking is the thing to know. start_on_seconds isn't a free-form timeline offset - it's "which 5-second bucket does this go in" (start_on_seconds // 5). Feed in second 7 and you get the same chunk index as second 5. If your chunks aren't 5 seconds, this node's indexing will quietly disagree with your sampler. Check your chunk length before blaming weird prompt ordering.

Also: this is a pack-internal structure on a *-typed output. It will only make sense to this pack's sampler - don't try to wire the stack into a generic prompt encoder and expect anything. And as a niche personal-pack node (zero community footprint to lean on), expect to debug against the pack's example workflow rather than forum posts. When it works, though, it's a genuinely clean way to make a long Wan video read as one directed piece instead of five accidental ones.

CategoryPrzewodoUtils/Wan

Inputs (5)

NameTypeDefaultDescription
previous_promptopt*Previous prompt stack to append to. If None, creates a new stack. Used for chaining multiple prompt chunks together
lora_stackopt*Stack of LoRAs to apply to the diffusion model. Each LoRA modifies the model's behavior.
positive_promptoptSTRINGPositive prompt text for this chunk. Describes what you want to generate in the video segment
negative_promptoptSTRINGNegative prompt text for this chunk. Describes what you want to avoid in the video segment
start_on_secondsoptINT00–1000The starting seconds (chunk) of the video.

Outputs (1)

NameTypeDescription
prompt*