Nodes/ComfyUI-JNodes/Load Visual Media From Path (List)
ComfyUI Node

Load Visual Media From Path (List)

Load a folder of media as a list, not a batch

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Load Visual Media From Path (List)
    • IMAGE
    media_path/insert/path/here
    recursivetrue
    start_at_n0
    start_at_unit
    sample_next_n0
    sample_next_unit
    frame_skip0
    discard_transparencytrue
    image_return_limit0
    shufflefalse

    This is JNodes_LoadVisualMediaFromPath_Batch's twin, and the schema is genuinely identical field for field - the only difference that matters is one flag buried in the output type: IMAGE here is a list, not a batch. That distinction sounds pedantic until you actually need it. A batch is one tensor stack that flows through the graph as a single unit; a list is a sequence of separate items that ComfyUI can iterate - feed it into a node that runs per item (rather than treating the whole stack as one operation) and each file gets its own pass instead of being merged into one big tensor.

    Practically: reach for _Batch when you want everything as one combined stack to sample or process together. Reach for _List when each file needs to be treated as its own thing - say, running a separate upscale or caption pass per source image and keeping outputs distinct, rather than one blended batch.

    How it works

    Same mechanics as the batch version. Point media_path at a folder; recursive decides whether subfolders count. start_at_n/start_at_unit and sample_next_n/sample_next_unit slice how much of each file gets read, frame_skip thins frames, discard_transparency flattens alpha, image_return_limit caps the total count, and shuffle randomizes order. The only behavioral fork is at the very end, where the frames get packaged as a list of items instead of a single concatenated batch.

    The inputs and outputs

    • media_path (STRING) - the folder to read from.
    • recursive (default on) - include subfolders.
    • start_at_n / sample_next_n (+ _unit fields) - per-file slicing.
    • frame_skip - thin frames within each file.
    • discard_transparency - flatten alpha (on by default).
    • image_return_limit - cap on total items returned (0 = unlimited).
    • shuffle - randomize order.
    • IMAGE output - a list, not a batch: items stay distinct rather than merging into one tensor.

    How to install it

    Via ComfyUI Manager: Install Custom Nodes, search "JNodes", install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JaredTherriault/ComfyUI-JNodes
    pip install -r ComfyUI-JNodes/requirements.txt
    

    then restart ComfyUI. No model downloads.

    Common issues & troubleshooting

    Picked the wrong variant and got a shape error. The single most common trap with this node isn't anything internal to it - it's grabbing _List when a downstream node actually wants a batched IMAGE tensor (or vice versa). If a node errors out complaining about the shape or type of what it received, check whether you meant the _Batch sibling instead.

    Slower than expected on large folders. List-mode processing runs each item through downstream nodes individually rather than as one vectorized batch operation, which is exactly the point when you need per-item handling - but it does mean it won't be as fast as a batched pass over the same files. If you don't actually need per-item separation, _Batch will usually be faster.

    Same VRAM caution as the batch version. image_return_limit at 0 is still unlimited here - a big recursive folder with no cap will try to load everything, list or not. Set a real limit before pointing this at a dataset you haven't sized up first.

    Order-sensitive workflows breaking under shuffle. If a downstream node pairs list items positionally with something else (say, matching images to a parallel list of captions), turning shuffle on will desync that pairing. Leave it off unless you're deliberately randomizing.

    Categorysd

    Inputs (10)

    NameTypeDefaultDescription
    media_pathSTRING/insert/path/here
    recursiveBOOLEANtrue
    start_at_nINT0
    start_at_unitCOMBO2 options: frames, seconds
    sample_next_nINT0
    sample_next_unitCOMBO2 options: frames, seconds
    frame_skipINT0
    discard_transparencyBOOLEANtrue
    image_return_limitINT0
    shuffleBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE