Nodes/ComfyUI Layer Style/LayerUtility: Load Images From Path
ComfyUI Node Runs on cloud

LayerUtility: Load Images From Path

Load Images From Path

By chflame163·Created 3 years ago·Updated 4 days ago· 3,113
LayerUtility: Load Images From Path
    • images
    • masks
    • file_name
    • frame_count
    ◄path—►
    â—„image_load_cap0â–º
    â—„select_every_nth1â–º

    Point it at a folder, get every image in it. ComfyUI's built-in Load Image node handles one file at a time through an upload widget, which is fine until you have a directory of 200 frames or a batch of product shots to run through the same pipeline. Load Images From Path is the batch loader: give it a filesystem path and it pulls the whole folder in as a list you can iterate over. If you're doing anything at volume - processing a video's extracted frames, running a dataset through a workflow, batch-upscaling a shoot - this is the entry point.

    The mechanism is straightforward directory reading. It takes a path string, scans it for images, and loads them. The two optional controls shape which ones: image_load_cap limits how many to grab (0 means no limit - load everything), useful for testing a workflow on the first handful before committing to all 500. select_every_nth skips through the folder - set it to 5 and you load every fifth image, which is the standard trick for thinning out a dense frame sequence so you can preview the pipeline without processing every single frame.

    What it hands back is a proper batch. images is the list of loaded images (is_list is true - these come out as a batch you feed into nodes that iterate). masks is the corresponding list of masks, extracted from each image's alpha channel if it has one, so transparent PNGs bring their transparency along as usable masks. file_name is the list of filenames as strings, which is the underrated output - pair it with a save node and you can write results back out under the original names instead of ComfyUI_00001. And frame_count reports how many were loaded, an integer you can route into batch-size logic elsewhere.

    Install is the pack standard: search "ComfyUI Layer Style" in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/chflame163/ComfyUI_LayerStyle, then pip install -r requirements.txt and restart. No models to download.

    A few practical realities. The path is a filesystem path on the machine running ComfyUI - obvious when it's local, but a real gotcha on a remote or cloud instance, where you have to point at a path that exists on the server, not your laptop. Get the slashes right for the OS it's running on. Mixed image sizes in one folder can cause trouble downstream, since a lot of nodes expect a batch to share dimensions - if you hit shape-mismatch errors, run the images through a resize/scale-as step before batching them into a sampler. And the ever-present LayerStyle caveat: if the node doesn't appear after installing the pack, the pack failed to import on a dependency conflict (its signature failure), so check the console, run "Try Fix" in Manager, and reinstall the requirements into your venv.

    Category😺dzNodes/LayerUtility/SystemIO

    Inputs (3)

    NameTypeDefaultDescription
    pathSTRING—
    image_load_capoptINT00–999999—
    select_every_nthoptINT11–999999—

    Outputs (4)

    NameTypeDescription
    imagesIMAGE—
    masksMASK—
    file_nameSTRING—
    frame_countINT—