Nodes/ComfyUI_StreamingT2V/LoadText_StreamingT2V
ComfyUI Node

LoadText_StreamingT2V

A boring text-file reader that the prompt-travel workflow quietly depends on

By chaojie·Created 2 years ago·Updated 2 years ago· 36
LoadText_StreamingT2V
    • STRING
    • BOOLEAN
    root_diroutput
    filedragtest_1.txt

    LoadText_StreamingT2V reads a .txt file out of ComfyUI's input, output, or temp directories and hands you its contents as a string. That's the whole job. In a normal StreamingT2V workflow it does nothing you'd notice - which is exactly why it's easy to miss that the pack's flashy prompt-travel workflow would fall over without it.

    The reason it exists: this pack generates long videos by looping. The README tells you to turn on Auto Queue and let generations run, stopping when you like the result. When you're running the same graph over and over, you need a way for state to survive from one pass to the next. That state - your growing prompt list, your frame count - lives in a text file, and this node is the "load" half of that loop. Its sibling SaveText_StreamingT2V is the "save" half. In wf_prompttravel.json, the cyclist demo, you'll see both wired around the prompt-travel run node, keeping the story on disk so each auto-queue iteration picks up where the last one left off.

    How it works

    It's a small subclass of the pack's TextFileNode. The root_dir input maps to a real ComfyUI folder (input, output, or temp - the mapping lives in text_file_dirs.json inside the pack), and file is the filename under it. The useful bit is that IS_CHANGED is keyed to the file's modification time. ComfyUI caches node outputs to skip unnecessary work, so without that, an edited file would be ignored forever. Change the file on disk and the next run re-reads it - which is what makes the save/load loop actually work.

    Inputs and outputs that matter

    You'll set two things:

    • root_dir - where to look, default output. If you're loading a file you wrote yourself, input is usually the more sensible home for it.
    • file - the filename, defaulting to dragtest_1.txt. That's the author's leftover test file. It doesn't exist out of the box, so don't be surprised when the node returns an empty string.

    The outputs are a STRING (the file contents, empty string if the file is missing) and a BOOLEAN that's True when the file was found. That boolean is your "did this load succeed" signal - genuinely handy when you're auto-queueing and want a failed load to be visible rather than silent.

    Installing it

    This is part of the ComfyUI_StreamingT2V pack, so you install the pack, not the node. In ComfyUI Manager, search StreamingT2V and install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chaojie/ComfyUI_StreamingT2V
    

    Restart ComfyUI. Be warned the pack's requirements.txt is a heavyweight list - pytorch-lightning, diffusers, modelscope, xformers, bitsandbytes, imageio[ffmpeg], and more - so the install can churn for a while. The text nodes themselves have no special dependencies; it's everything else in the pack that makes setup heavy.

    The trap

    The default filename. First run returns ("", False) and a beginner assumes the node is broken. Point it at a real file - or let SaveText_StreamingT2V create one first - and it just works. Also keep it to .txt; the dirs config only maps text files. Beyond that there's nothing to tune. It's a utility node, and it's supposed to be boring.

    Categoryutils

    Inputs (2)

    NameTypeDefaultDescription
    root_dirCOMBOoutput3 options: input, output, temp
    fileSTRINGdragtest_1.txt

    Outputs (2)

    NameTypeDescription
    STRINGSTRING
    BOOLEANBOOLEAN