Nodes/ComfyUI-YCNodes_Toolkit/YC Live Load Images (Multi)
ComfyUI Node

YC Live Load Images (Multi)

Drag in a stack of images, get an aligned batch out

By yichengup·Created 10 months ago·Updated 4 months ago· 59
YC Live Load Images (Multi)
    • images
    • masks
    • image
    • mask
    • meta_json
    images_json
    selected_index-1
    batch_start-1
    batch_end-1
    align_modelargest
    pad_color#000000

    The source code labels this one 实验节点 - experimental - so calibrate your expectations. YC Live Load Images (Multi) lets you drag or upload multiple images onto the node itself, see thumbnails immediately on the node face (no run needed just to check what you loaded), and on run hands back an aligned batch of images plus masks, a single chosen image, and the metadata JSON. It's the multi-image loader the pack was missing, with a live preview built in.

    How it works

    Your uploads land in ComfyUI's temp/input directories; the frontend writes the file list into images_json, and the backend resolves the actual paths from the JSON metadata, loads each image, and aligns the batch to a common size. The alignment is the interesting part: align_mode picks how. Default is largest - pad smaller images up with pad_color and mark the true image area in the mask (1.0 where the image actually is). You can also align to the first image or center-crop down to the smallest.

    Inputs:

    • images_json - auto-written by the frontend; leave it alone.
    • selected_index - which single image to pull out; -1 means the last one.
    • batch_start / batch_end - optional slice of the batch range (-1 = unset).
    • align_mode - first / largest / smallest.
    • pad_color - fill hex for padded areas.

    Outputs: images (batch), masks (batch), image (single), mask (single), meta_json (STRING).

    What it's good for

    The "see your batch before you run" preview plus aligned masks is the real value: feed the batch into batch inpainting, compositing, or a batch-to-batch pipeline and the masks tell you exactly which pixels are content versus padding. If you mostly load one image at a time with stock nodes, this is extra machinery. If you're assembling a multi-image batch pipeline and want masks for free, it's a shortcut.

    Worth knowing: with nothing loaded, it returns a 64×64 blank plus an all-white mask and an empty meta_json, so an empty node won't hard-crash a run. It's experimental though - expect rough edges, and pin the pack version if a workflow depends on it.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/yichengup/ComfyUI-YCNodes_Toolkit
    

    Restart (or ComfyUI Manager → "ComfyUI-YCNodes_Toolkit"). Dependencies are numpy and Pillow - no models to fetch. If you want thumbnails before running, make sure the frontend JS actually loaded; if the node face looks like a plain widget, a hard refresh of the ComfyUI page usually fixes it.

    CategoryYCNode/Image

    Inputs (6)

    NameTypeDefaultDescription
    images_jsonSTRING前端上传生成的图片列表 JSON
    selected_indexINT-1-1–999
    batch_startoptINT-1-1–999
    batch_endoptINT-1-1–999
    align_modeoptCOMBOlargest3 options: first, largest, smallest
    pad_coloroptSTRING#000000

    Outputs (5)

    NameTypeDescription
    imagesIMAGE
    masksMASK
    imageIMAGE
    maskMASK
    meta_jsonSTRING