Nodes/ComfyUI_Dados_Nodes/Dynamic Text Loader
ComfyUI Node

Dynamic Text Loader

Pull prompts from a text file instead of typing them

By DadoIrie·Created 2 years ago·Updated 2 days ago· 10
Dynamic Text Loader
    • text
    • seed
    • count
    file_path
    always_reloadfalse
    random_promptfalse
    count1
    seed0

    If you've got a pile of prompt lines sitting in a .txt file - outfit descriptions, camera angles, whatever you've been collecting - this node reads that file directly instead of making you paste lines into a multiline box every time. It's part of dadoirie's ComfyUI_Dados_Nodes pack, and it's the closest thing in this particular grab-bag to the wildcard idea that packs like Impact Pack made standard: keep a big pool of options somewhere, pull from it randomly, get variety without retyping. The difference is your pool here is a literal file on disk you point to with a path, not a __token__ embedded inside your prompt text.

    How it works

    You give it file_path and it loads lines from that file. From there, two toggles decide how it hands them back to you. random_prompt switches between reading through the file in order and grabbing lines at random. seed controls that randomness - same seed against the same file gets you the same selection, so a batch you liked is reproducible later, the same way a KSampler seed lets you regenerate a specific image. count decides how many lines it returns in one go - set it above 1 and you get a batch of prompts out of a single node instead of one.

    The one to remember if you're actively iterating on the file itself is always_reload. Left off, it's reasonable to expect the node caches what it read on the first run; flip it on if you're editing the text file mid-session and want fresh lines without restarting the queue.

    Inputs and outputs that matter

    All five inputs are required - there's no optional set:

    • file_path (STRING) - where your text file lives.
    • random_prompt (BOOLEAN) - random pick vs. sequential read.
    • seed (INT) - makes the random pick reproducible. Worth noting its range tops out at 2,000,000,000, not the astronomically large range you're used to from a core KSampler seed - plenty for prompt selection, just don't expect the same headroom.
    • count (INT) - how many lines to return per run.
    • always_reload (BOOLEAN) - force a fresh file read instead of using a cached copy.

    Outputs come back as three things: text (a list of strings - one per line pulled, sized by count), seed (a list, paired with each text entry so you can trace which seed produced which line), and count (a plain INT confirming how many you got back). Wire text into whatever consumes a batch of prompts downstream - a Text Concatenator, a loop, or directly into a batch-capable encoder.

    Installing it

    Same as the rest of the pack: search "Dados Nodes" in ComfyUI Manager and install, or manually cd ComfyUI/custom_nodes && git clone https://github.com/dadoirie/ComfyUI_Dados_Nodes.git, then cd ComfyUI_Dados_Nodes && pip install -r requirements.txt, then restart ComfyUI. Nothing here needs a model download - the automatic HuggingFace pulls the README describes are for the pack's vision-tagger nodes (SmolVLM, JoyTagger, MiaoshouAI), not this one. This node just reads a plain text file you already have, so there's no first-run wait beyond loading it.

    Common issues

    Use an absolute path for file_path rather than a relative one - it removes any ambiguity about what directory ComfyUI happened to be launched from, which is a common source of "file not found" that has nothing to do with the file actually being missing. If you edit the source file and don't see the change reflected, that's always_reload sitting off - flip it on rather than restarting the whole server to force a re-read. And because this pack is a small, actively-changing personal project rather than something with a large support community behind it, if something behaves unexpectedly your best bet is the pack's GitHub issues rather than assuming it's a well-known, already-answered problem - there's no large forum thread history to lean on here.

    CategoryDado's Nodes/Text

    Inputs (5)

    NameTypeDefaultDescription
    file_pathSTRING
    always_reloadBOOLEANfalse
    random_promptBOOLEANfalseIs the text a prompt with wildcards? Then turn this on.
    countINT11–2000000000Number of prompts to generate.
    seedINT00–2000000000The seed to use for generating images. Plug returned seed(s) into sampler.

    Outputs (3)

    NameTypeDescription
    textSTRING
    seedINT
    countINT