Nodes/comfyui-PD_comfy-api-node/PD_comfyplus_image (Multi-Size Pack)
ComfyUI Node

PD_comfyplus_image (Multi-Size Pack)

The pack helper that stuffs up to 9 reference images into one input

By 7BEII·Created 10 months ago·Updated 9 days ago· 2
PD_comfyplus_image (Multi-Size Pack)
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • image7
  • image8
  • image9
  • previous_files
  • files

If you've used the official ComfyUI API nodes, you know the drill: a Gemini or GPT Image node accepts a files input that is really a list of image parts, and a plain IMAGE tensor doesn't slot into it directly. PD_comfyplus_image is the glue - it takes up to nine images of whatever sizes, packs them into a single GEMINI_INPUT_FILES value, and hands that to the image-generation nodes in the comfyui-PD_comfy-api-node pack (or anything else that speaks the same type).

It won't win any prizes for glamour. It's the node you reach for when your workflow has more reference images than inputs, which happens shockingly fast once you start feeding GPT Image 2 or Gemini multiple style shots.

How it works

Each image1 through image9 input is a standard ComfyUI IMAGE tensor. The node converts them into the Gemini-style inline-data parts the API nodes expect - comfy_api_nodes' GeminiInlineData type under the hood - and emits one files value. The trick for the >9-image case is the previous_files input: connect a previous PD_comfyplus_image node's files output into it, and the node appends, so you can daisy-chain as many images as you need.

There's a subtlety the changelog got burned on: when those packed files go to GPT Image 2's edit path, the MIME types get normalized (GeminiMimeType.image_pngimage/png) before the multipart request is sent, because GPT Image 2 is pickier about that than Gemini is. That fix landed in v2.0.1, so if you're chasing a weird "invalid file type" error on GPT Image 2 edits, make sure you're on the latest version of the pack.

Where it plugs in

Look at the sibling nodes' optional files inputs:

  • PD: Gemini Image, PD: Gemini Pro Image, PD: Nano Banana 2 - all take files alongside the plain images input.
  • PD: GPT Image 2 (both key and token variants) - files is your multi-image path; this is exactly the scenario the v2.0.1 MIME fix was for.

The output is files (GEMINI_INPUT_FILES) and nothing else. If you only have one reference image, you don't need this node at all - just plug straight into the images input. It earns its keep when "one" becomes "several."

Installing and caveats

Same story as every node in this pack: clone once into custom_nodes, restart, find it under PD_Tools. It depends on the official ComfyUI API nodes pack (comfy_api_nodes) being present for the GEMINI_INPUT_FILES type - again, that ships with ComfyUI Desktop.

Worth knowing: the node has no way to know what sizes the receiving model wants, so it packs images as-is and lets the generation node handle resizing (GPT Image 2's edit path caps things at 2048×2048 pixels internally). If you feed it a 4000px monster, the downstream node resizes rather than failing - but you'll save upload time by resizing beforehand. The tooltips in the UI are in Chinese ("必须输入的第1张图片"), which is mildly confusing on first contact; that's just the author's native language leaking through, the behavior is what the field names suggest.

CategoryPD_Tools

Inputs (10)

NameTypeDefaultDescription
image1IMAGE必须输入的第1张图片
image2optIMAGE可选输入的第2张图片
image3optIMAGE可选输入的第3张图片
image4optIMAGE可选输入的第4张图片
image5optIMAGE可选输入的第5张图片
image6optIMAGE可选输入的第6张图片
image7optIMAGE可选输入的第7张图片
image8optIMAGE可选输入的第8张图片
image9optIMAGE可选输入的第9张图片
previous_filesoptGEMINI_INPUT_FILES如超过9张图需继续打包,可连接上一个该节点输出的files

Outputs (1)

NameTypeDescription
filesGEMINI_INPUT_FILES