Nodes/ComfyUI_IPAdapter_plus_V2/Prompt Schedule From Weights Strategy V2
ComfyUI Node

Prompt Schedule From Weights Strategy V2

Turn a weight curve into a prompt schedule

By chflame163·Created 2 years ago·Updated 2 years ago· 55
Prompt Schedule From Weights Strategy V2
  • weights_strategy
  • prompt_schedule
prompt

In an animated workflow you often want two things to change in sync: how hard the reference image pushes, and what the prompt is saying. This node makes sure they agree. It takes a weights_strategy (the bundle produced by IPAdapterWeightsV2) plus a prompt, and emits a prompt_schedule - a frame-numbered text blob of the "0": "first prompt" format that AnimateDiff-style conditioning systems consume. If your weight curve runs 24 frames, you get a schedule keyed to every frame your image batch covers, so the fade-in of the reference lines up with the moment the prompt switches.

The mechanism is refreshingly simple. It reads the frame bookkeeping out of the strategy (frames, add_starting_frames, add_ending_frames, frame_count), splits your multiline prompt field into one line per frame, pads or truncates to match the frame count, and writes a line for each. The add_starting_frames and add_ending_frames settings from the weights node get honored too - held frames produce held prompt entries at the start and end. If frame_count is 0 or the prompt is empty, you get an empty string back, which is the node's way of saying "nothing to schedule."

The two inputs you set:

  • weights_strategy - wire it from IPAdapterWeightsV2 (or from IPAdapterWeightsFromStrategyV2 passing it through). This defines how many frames and where the ramps are.
  • prompt - one prompt per line; the Nth line lands on the Nth frame. Fewer lines than frames pads the last one; more lines than frames truncates.

The single output is a STRING you feed into whatever expects a frame-keyed prompt schedule (AnimateDiff's schedule inputs, or a PromptSchedule node in a video pipeline). It's also genuinely useful as a preview - see exactly what your ramp implies before you commit.

Why it exists

Without it you'd hand-type the schedule and pray the frame numbers matched your weight curve. With it, the timing lives in one place - the weights node - and both the image influence and the prompt follow from it. That's the correct way to design an animated crossfade: define the curve once, derive everything else.

Install

This is part of chflame163/ComfyUI_IPAdapter_plus_V2, the V2-renamed fork of cubiq's IP-Adapter pack that lets it live alongside the original. Manager → search ComfyUI_IPAdapter_plus_V2, or:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_IPAdapter_plus_V2

Restart. No pip requirements. Same install for every node in the pack.

Where it bites

The subtle trap is assuming the schedule matches your sampler's actual frame count. The strategy's frame_count is derived from the image batch at the weights node - if you later change the number of frames in your latent batch without regenerating the strategy, the schedule silently drifts out of alignment. Rebuild the weights node whenever your frame count changes. And remember the output is a string: some tools want it wrapped or formatted differently, so if a downstream node rejects it, check whether it's expecting the exact "n": "prompt" format this produces.

Categoryipadapter/weights

Inputs (2)

NameTypeDefaultDescription
weights_strategyWEIGHTS_STRATEGY
promptSTRING

Outputs (1)

NameTypeDescription
prompt_scheduleSTRING