Nodes/ComfyUI-Load-DirectoryFiles/Load Images and Prompts from Directory(Advanced)
ComfyUI Node

Load Images and Prompts from Directory(Advanced)

Split each planned prompt into six routable parts

By educator-art·Created 2 years ago·Updated about a year ago· 4
Load Images and Prompts from Directory(Advanced)
    • 1st prompt
    • 2nd prompt
    • 3rd prompt
    • 4th prompt
    • 5th prompt
    • 6th prompt
    • negative prompt
    • image
    dirPlease input Directory Path
    files_index0

    This is the bigger sibling of Load Images and Prompts from Directory. Same job - walk a folder of numbered prompt/image sets and pull one set by index - but instead of handing you a single positive prompt string, it breaks that positive prompt into up to six separate outputs. If your planned generations need different chunks of a prompt going to different places, this is the version you want.

    Why six prompt outputs instead of one

    The basic node gives you one positive string, one negative, one image. That's perfect when your whole positive prompt is a single blob. But a lot of real workflows want to route pieces of a prompt independently - a subject clause to one CLIP encoder and a style clause to another, separate conditioning for a regional-prompt setup, a base description plus modifiers you attach conditionally. Doing that from one merged string means splitting it back apart inside the graph with string nodes, which is fiddly.

    The Advanced node front-loads that split. Each entry's positive prompt file comes out pre-divided into as many as six parts, so you wire each part where it needs to go without any string surgery in between.

    Inputs and outputs

    The inputs are identical to the basic node - two of them, and you set both:

    • dir - the folder path. The default is the placeholder Please input Directory Path, so nothing loads until you swap in a real path (absolute is safest).
    • files_index - which numbered set to grab, 0 through 4096.

    Where it differs is the outputs. There are eight, and the schema names them plainly: 1st prompt, 2nd prompt, 3rd prompt, 4th prompt, 5th prompt, 6th prompt, negative prompt, and image. The six prompt outputs are the pieces of that entry's positive prompt; the negative and the image are the same single outputs the basic node gives you. You don't have to use all six - take the ones you need and leave the rest unconnected. Route the prompt parts into your CLIP Text Encode nodes, the negative into your negative encoder, and the image into a ControlNet preprocessor, a VAE Encode for img2img, or an IPAdapter, depending on your plan.

    The folder layout (same as the basic node)

    Same rules - one directory, files matched by a shared number:

    • 001.txt - the positive prompt
    • 001_n.txt - the negative prompt (the _n suffix matters)
    • 001.png - the reference image

    The number ties the three files into one set. To feed the six prompt outputs, your positive .txt supplies the separate pieces the node splits out - keep them organised the same way for every entry so a given output slot always means the same thing across your batch.

    Installing it

    Both nodes ship in the same pack, so if you already installed the basic one, this is already there - no separate step. If not, clone the repo into ComfyUI's custom nodes folder and restart:

    cd ComfyUI/custom_nodes
    git clone https://github.com/educator-art/ComfyUI-Load-DirectoryFiles
    

    It's a niche pack, so don't count on finding it by name in ComfyUI Manager - the git clone is the reliable path. Nothing heavy comes with it: no model downloads, no dependency stack to untangle, just file reads. GPL-3.0 licensed.

    Common snags

    The traps are the same shape as the basic node, plus one that's specific to the six outputs:

    • The default path is a placeholder. Please input Directory Path isn't a directory. Point dir at a real folder before you run.
    • Naming has to line up. Positive, negative (_n), and image share the same number; keep zero-padding consistent so 010 doesn't drift from 10.
    • Wire slots consistently. The value of this node is that "1st prompt" always carries the same kind of clause across every entry - but only if you author your prompt files that way. If entry 001 puts the style in the first slot and 002 puts it in the fourth, your downstream wiring will send the wrong text to the wrong encoder. The discipline lives in how you write the files, not in the node.
    • It's one set per run. Like the basic version, the graph loads a single index at a time; churning through the whole batch hands-free means driving files_index from outside via ComfyUI's API, which is how the author automated planned batch generation in the first place.

    If you only ever use one prompt output, save yourself the extra ports and reach for the plain Load Images and Prompts from Directory instead. Pick Advanced when routing several prompt pieces separately is genuinely part of the plan - that's the one thing it does that the basic node can't.

    CategoryLoad Images and Prompts from Directory

    Inputs (2)

    NameTypeDefaultDescription
    dirSTRINGPlease input Directory Path
    files_indexINT00–4096

    Outputs (8)

    NameTypeDescription
    1st promptSTRING
    2nd promptSTRING
    3rd promptSTRING
    4th promptSTRING
    5th promptSTRING
    6th promptSTRING
    negative promptSTRING
    imageIMAGE