Nodes/ComfyUI-ShellAgent-Plugin/Input Image Array (ShellAgent Plugin)
ComfyUI Node

Input Image Array (ShellAgent Plugin)

Take a list of images and split it four ways

By myshell-ai·Created 2 years ago·Updated 4 months ago· 46
Input Image Array (ShellAgent Plugin)
    • images_batch
    • masks_batch
    • images_list
    • count
    input_nameinput_images
    default_value[]
    description
    resize_moderesize_to_first
    min_items0
    max_items0

    Input Image Array (ShellAgent Plugin) is the batch-capable cousin of Input Image: instead of one image, it accepts an array of images - a JSON list of URLs or file paths, the format a ShellAgent app uses when it hands a workflow several pictures at once - and splits it into the four things downstream nodes actually want: a batched IMAGE, batched masks, an iterable list of images, and a count.

    This is the node you reach for when the app's input isn't "here's a picture" but "here's a pile of pictures" - a folder of references for style transfer, multiple input frames for a video model, a set of images to process in a loop.

    How it works

    The default_value is a JSON string, defaulting to [], with a placeholder showing the expected shape: ["https://example.com/a.png", "https://example.com/b.png"]. Each entry is loaded (local paths and URLs both work), and the results are organized into:

    • images_batch - one IMAGE tensor with all frames stacked along the batch dimension.
    • masks_batch - the matching MASK tensor for each image.
    • images_list - the same images as a Python list (OUTPUT_IS_LIST true), for nodes that iterate.
    • count - an INT with the number of images.

    The resize_mode option decides what to do when the images aren't all the same size: pad_to_first, resize_to_first, or none_keep_list_only (leave them alone, useful only for the list output). min_items/max_items let you enforce the array length - handy as a sanity check against the app sending nothing or sending too much.

    There's a deliberate edge-case behavior worth knowing: an empty array doesn't error - it returns a 1×1 black image and count 0, so the rest of the workflow doesn't crash while the app is still deciding what to send.

    Inputs that matter

    • input_name - the variable name the app sees. Default input_images.
    • default_value - the JSON array of image references. This is what the app overrides at runtime.
    • resize_mode - how to reconcile mixed sizes. resize_to_first (the default) is usually what you want for batching.
    • min_items / max_items - optional length constraints; 0 means unlimited.

    Installing it

    Same one-pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/myshell-ai/ComfyUI-ShellAgent-Plugin
    

    restart, or grab ComfyUI-ShellAgent-Plugin from ComfyUI Manager. No model downloads; the pack's usual pip requirements install with it.

    Common issues

    • "Invalid array input" error. The default_value isn't parseable JSON. Watch for trailing commas or single quotes - JSON, not Python.
    • Batch is all black. An empty (or all-failed) array falls back to the 1×1 black placeholder. Check that the app is actually sending entries.
    • Images with different sizes break the batch. Use resize_to_first (or pad_to_first if you want to preserve aspect content) instead of the list-only mode.
    • count is 0 but I sent images. The node truncates to max_items and validates against min_items; verify those aren't fighting your input length.

    If you're building anything batch-shaped for an agent to feed, this is the input node you'll use far more than the singular Input Image.

    Categoryshellagent

    Inputs (6)

    NameTypeDefaultDescription
    input_nameSTRINGinput_images
    default_valueSTRING[]
    descriptionoptSTRING
    resize_modeoptCOMBOresize_to_first3 options: pad_to_first, resize_to_first, none_keep_list_only
    min_itemsoptINT00–1024
    max_itemsoptINT00–10240 = unlimited

    Outputs (4)

    NameTypeDescription
    images_batchIMAGE
    masks_batchMASK
    images_listIMAGE
    countINT