Nodes/ComfyUI-ZoeyTool/Zoey - 真尺寸图像加载器
ComfyUI Node

Zoey - 真尺寸图像加载器

A folder loader that keeps original resolution — and hands you the alpha as a mask

By liangzoey·Created about a year ago·Updated 3 days ago· 5
Zoey - 真尺寸图像加载器
    • images
    • masks
    • current_index
    • file_paths
    folder_path
    file_typesjpg,png,jpeg,webp
    start_index0
    reset_counterfalse
    loop_counter0

    TrueToSizeImageLoader is the node that says "my whole dataset lives in a folder, load it for me, at its real resolution, in the right order." The stock ComfyUI LoadImage wants one file at a time and forces you through an upload picker. This one points at a directory, grabs every matching file in natural sort order (so img2.png genuinely comes before img10.png), and hands the whole run to your workflow as a batch of tensors. The name is the promise: no resize, no padding to a canvas, no auto-downscale - whatever resolution each file is, that's the tensor you get.

    It's part of the Zoey toolset (comfyui-ZoeyTool) built for folder-batch work - paired in the same pack with batch savers and croppers, it's the input half of "process this folder in ComfyUI instead of in a script." If you've been hand-feeding a directory of images through LoadImage one at a time for an img2img pass or a captioning run, this is the upgrade.

    How it works

    Set folder_path and a comma-separated file_types list (default jpg,png,jpeg,webp). The node globs the folder, sorts files by a natural-sort key that splits numbers out of names, and converts each image to a float tensor. Two behaviors are the actual point:

    • True resolution. Each image loads at its own width × height. That means a batch of differently-sized images will not stack into one clean tensor - this node returns them as a list, one tensor per image, which is why the output sockets say list.
    • Alpha becomes a mask. If a file is RGBA/PNG with transparency, its alpha channel is peeled off and returned in the masks output. Files without alpha get an all-white mask so the wiring stays consistent. That alone makes it handy for cutout workflows where your assets ship as transparent PNGs and you want the alpha as an edit region or composite mask without extra nodes.

    The loader is stateful: it remembers where it is in the folder so you can step through files across runs (see below), and current_index tells you the position.

    The inputs and outputs that matter

    For a simple run you only set folder_path and hit go. start_index sets where in the list to begin. reset_counter snaps the internal position back to the start. loop_counter is the widget you feed current_index back into when you want controlled one-at-a-time stepping rather than "load everything."

    Outputs, in order:

    • images - list of image tensors, original resolution each.
    • masks - list of masks, alpha-derived for RGBA, white otherwise.
    • current_index - the next position in the folder after this run (wraps to 0 at the end).
    • file_paths - the actual file paths, handy if a downstream node needs to know where a frame came from.

    Installing it

    It's part of comfyui-ZoeyTool, so install the pack once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/liangzoey/comfyui-ZoeyTool.git
    cd comfyui-ZoeyTool
    pip install -r requirements.txt
    

    Then restart ComfyUI. Or just search comfyui-ZoeyTool in ComfyUI Manager. No models to download - this is a pure file-loader.

    Where people get burned

    The two classic confusions are lists and indexing. Because images come back as a list (different sizes can't share one tensor), don't plug images straight into a node that expects a single batched IMAGE - your batch-type nodes will complain or silently flatten. And the sequential-stepping behavior trips people who expect "one folder, one image per run": run it once and you get the remainder of the list from your current position. Feed current_index back into the loop_counter input (right-click the widget → Convert to input) and reset as needed, and you get a repeatable step-through. Oh, and keep an eye on file_types - a tiff-only folder with the default jpg,png,jpeg,webp returns nothing, silently, which reads as "the node is broken" when it isn't.

    CategoryZoey Tool/图像处理

    Inputs (5)

    NameTypeDefaultDescription
    folder_pathSTRING
    file_typesSTRINGjpg,png,jpeg,webp
    start_indexINT00–10000
    reset_counterBOOLEANfalse
    loop_counteroptINT0

    Outputs (4)

    NameTypeDescription
    imagesIMAGE
    masksMASK
    current_indexINT
    file_pathsLIST