Nodes/ComfyWarp/SchedulerString
ComfyUI Node

SchedulerString

Prompt changes per frame, without the spreadsheet

By Sxela·Created 3 years ago·Updated 2 months ago· 49
SchedulerString
    • STRING
    schedule
    frame_number0

    In per-frame video, your prompt shouldn't be a constant. The shot opens on a cat in a garden; by frame 60 the camera's panned to a dog on a beach. If you feed every frame the same prompt, the model fights itself trying to reconcile both. SchedulerString is how you swap text as the frame counter advances - the string version of ComfyWarp's scheduler family, and the one that covers prompts, model names, and any text input.

    How it works

    Same core as SchedulerFloat and SchedulerInt, one crucial difference. Your schedule is the usual three formats, but the dict format is what you'll actually use:

    {0: "a cat sleeping in a sunlit garden", 60: "a dog running on a beach", 120: "a seagull over the ocean"}
    

    The format supports both lists and single values too, but a dict of keyframe→string is the natural shape for prompts. Here's the part that surprises people: there's no interpolation for strings. SchedulerFloat eases between numeric keyframes; SchedulerString can't, and it doesn't try. Between keyframes it returns the previous keyframe's value, and at the next exact keyframe it jumps to the new one. That's why the node has no blend_json input at all - the float and int versions have one, this one doesn't, because there's nothing to blend. The flip side of that is nice though: values are always exactly what you wrote, never a mangled halfway state.

    If you want a smooth prompt transition, you fake it the old-fashioned way - add intermediate keyframes with progressively more of the new subject described, and let the sampler's denoise do the morphing. That's exactly how WarpFusion-era workflows handled prompt evolution.

    The inputs that matter

    Only two:

    • schedule (string, multiline) - your keyframe→string dict, one per line. This is the whole node.
    • frame_number (int) - the current frame, driven from the pack's FixedQueue current_frame output so it advances with the render.

    Output is a single STRING, which wires into any text input - most commonly the positive prompt on a CLIP Text Encode node, but it'll happily feed a LoraLoader name field or anything else that takes text.

    Installing it

    With the rest of the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Sxela/ComfyWarp
    

    Restart ComfyUI, or search "ComfyWarp" in Manager. No model downloads, no heavy deps - opencv-python and scikit-image are all it needs.

    Where people get burned

    The number one trap is expecting smooth blending between prompts, because the node can't do it - add keyframes instead of wondering why frame 30 is still cat-only. Number two is quoting: the schedule is parsed with Python's eval(), so your strings need their quotes, and a stray unescaped quote or mismatched brace is an instant error. Keep each keyframe on its own line and mind the braces. And as with the rest of this pack, it's old and lightly maintained - but a string-lookup-by-frame is simple enough that it survives ComfyUI updates better than most.

    CategoryWarpFusion

    Inputs (2)

    NameTypeDefaultDescription
    scheduleSTRING
    frame_numberINT00–9999999999

    Outputs (1)

    NameTypeDescription
    STRINGSTRING