ComfyUI Node

Prompt Traveling

A prompt that walks itself forward — Prompt Traveling

By pmarmotte2·Created 4 months ago·Updated 4 months ago· 3
Prompt Traveling
    • Prompt
    prompts
    prompt_index1

    The prompt that moves on its own. If you're building a multi-scene story in ComfyUI Video Progression, you're probably sick of babysitting the prompt box between scenes. Prompt Traveling is the pack's answer: paste a list of prompts, one per line, and it hands you a different one every time you hit queue. It just drifts through your list.

    Mechanically, this is the interesting part. A plain text node in ComfyUI gets cached - if nothing about its inputs changed, it doesn't re-run. Prompt Traveling defeats that with the IS_CHANGED trick: it returns NaN as its change marker, which in ComfyUI means "never equal to anything, always dirty, always re-run me." That's the only way a counter like this can advance on every queue execution. The cost is real and worth knowing: an always-dirty node poisons the execution cache for everything behind it, so the whole graph stays hot. In a workflow that's regenerating frames anyway that's usually a non-issue - just don't expect it to save you any caching.

    The inputs are two, and the output is one:

    • prompts - a multiline STRING, one prompt per line. Blank lines are ignored, and only the first 20 non-empty lines are used.
    • prompt_index - the visible slider, 1 to 20. This is the "next one to run" counter.
    • Prompt (STRING) - the current line, ready to wire into a CLIP Text Encode or the pack's Story Scene Switch.

    Run flow: it outputs the line matching the slider, then bumps the slider by one through a websocket update to the frontend, wrapping back to 1 when it passes the last line. So the number on the slider is the one that will fire next - the same "control fires after the run" trap as KSampler seeds, just with a visible widget. Edit the prompt text mid-run all you want; the counter lives in the slider, not the text.

    Where it earns its keep is a story ladder: line 1 "wide shot, morning", line 2 "slow dolly in", line 3 "close-up, dusk". Each scene generation gets the next rung automatically, and it wraps, so a three-line list just keeps cycling for as long as your loop runs. In this pack you'd wire Prompt into Story Scene Switch's prompt input so the wrapped storytelling prefix lands on top of each traveling line.

    Common issues:

    • The slider isn't advancing. This node ships a frontend widget, and the README's fix for any frontend weirdness is restart ComfyUI and hard-refresh the browser (Ctrl+F5). If you've updated the pack, do both.
    • It skipped to a prompt you didn't write. Count your lines. Only the first 20 non-blank ones are used, and if the list shrinks below the current slider value it wraps.
    • It looks stuck. Check the console - the node logs count, current_index, and next_index on every run, which makes diagnosis trivial.

    Install is the whole pack's install. No model downloads, no heavy dependencies - the pack only expects torch, numpy, Pillow, and imageio, all standard in a working ComfyUI:

    cd ComfyUI/custom_nodes
    git clone https://github.com/pmarmotte2/Comfyui-Video-Progression
    

    then restart, and hard-refresh so the traveling widget loads. Or through Manager: Install Custom Nodes → search "Comfyui-Video-Progression" → install → restart.

    It's a small node that does one thing well. For a story workflow where the prompt should drift scene to scene without you touching anything, it's the one you'd reach for.

    Categorystory/utility

    Inputs (2)

    NameTypeDefaultDescription
    promptsSTRING
    prompt_indexINT11–20

    Outputs (1)

    NameTypeDescription
    PromptSTRING