ComfyUI Node

多图上传

The one node in this pack that doesn't call any API

By MoJIeAIGC·Created about a year ago·Updated 17 days ago· 50
多图上传
  • image1
  • image2
  • image_batch
filenames
max_size1024

Fun fact: this is the only node in comfyui-MJAPI-party that never touches the network. No key, no credits, no image leaving your machine. 多图上传 just means "multi-image upload," and that's all it does - it gathers a pile of images, normalizes them into a uniform square batch, and hands the batch to the pack's multi-image models (the Gemini/Nano, seedream, and Vidu nodes all happily eat a batch of reference images). If you've been manually resizing and letterboxing reference shots before every API call, this is the glue node you were missing.

The author describes it as "非常好用" (very handy), and for the pack's typical workflow it genuinely is: most of the downstream models want several reference images at the same resolution, and this node enforces that in one place instead of you praying each upload happens to line up.

How it works

There are two ways in, and they're additive. First, the filenames text field: a comma-separated list of file names already sitting in ComfyUI's input/ directory - the same files you'd otherwise drag into an LoadImage node. Second, the optional image1 and image2 inputs, which accept images from anywhere else in your graph (a previous node's output, a saved batch, whatever). Everything collected gets resized with the pack's keep_ratio_pad routine: aspect ratio preserved, scaled so the long edge hits max_size, and padded to a perfect square with white borders, centered. LANCZOS resampling, white canvas - clean and predictable.

Then it's just one torch.cat into a single batched IMAGE tensor on the image_batch output. The README claims up to 10 images per run; with the two optional inputs plus a comma list of filenames, you're not going to hit that limit by accident.

Inputs that matter

  • filenames - comma-separated names of files in ComfyUI/input/. The honest gotcha: files you uploaded through the browser don't show up here until you've restarted ComfyUI once, and a typo raises FileNotFoundError right in your face.
  • max_size - 64 to 4096, default 1024, stepped in 64s. This is the output square's edge length. Lower it and the batch shrinks (faster uploads to the API, less credit-burning bandwidth); raise it for quality-hungry editors. The white padding only exists because the downstream models want squares.
  • image1 / image2 - optional programmatic inputs, prioritized before any filenames.

Installing it

Same pack install as its siblings - ComfyUI Manager search "mojieapi_party", or git clone the repo into custom_nodes, then restart. Because it's a pure utility node it doesn't even need a key, but it ships in a pack that does, so you'll likely configure one anyway for the nodes it feeds.

Where it trips people up

  • White borders, not transparency. The padding is hard white. If your downstream model needs a transparent plate (product-on-white-background tricks), this node isn't the tool - that's what KouTuNode's alpha output is for.
  • "No images provided." You get this error if both inputs are empty and filenames is blank or points at nothing real. It's a ValueError, not a crash, but it stops the run cold.
  • It pads, it doesn't crop. Objects off-center come out with generous white margins. That's usually fine for reference images, but if you want edge-to-edge framing, crop before you feed it in.
Category🎨MJapiparty/Product&tool

Inputs (4)

NameTypeDefaultDescription
filenamesSTRING
max_sizeINT102464–4096
image1optIMAGE
image2optIMAGE

Outputs (1)

NameTypeDescription
image_batchIMAGE