Nodes/comfy_Pond_Nodes/🐳图像扩展(V2)
ComfyUI Node

🐳图像扩展(V2)

Align up to three images to one reference in a single pass

By Pondowner857·Created about a year ago·Updated 21 days ago· 45
🐳图像扩展(V2)
  • 基准遮罩
  • 遮罩2
  • 图像2
  • 遮罩3
  • 图像3
  • 遮罩4
  • 图像4
  • 定位图像2
  • 定位图像3
  • 定位图像4
  • 合并遮罩
对齐方式居中对齐
X轴偏移0
Y轴偏移0
填充颜色白色
合并模式分别输出

The 🐳图像扩展(V2) node is the batch version of ImageAlignByMask - same trick, three times over. Instead of aligning one secondary image to your reference mask, this one takes up to three additional images (with their own masks) and aligns all of them to the same reference in one pass. If you're building a multi-face composite, a character sheet, or a multi-subject edit where everyone needs to sit in the same frame geometry, this is the node that does all three placements without chaining the single version three times.

The mechanism is the same geometry engine as the single version: each secondary mask gets its bounding box computed, a translation-and-scale transform is derived to fit it to the reference mask's bounds, and the image is resized and pasted onto a canvas matching the base. The V2 additions are the two extras and the merge logic.

The inputs

  • 基准遮罩 - the one reference everything aligns to.
  • 遮罩2 / 图像2 - the first secondary pair (required).
  • 遮罩3 / 图像3, 遮罩4 / 图像4 - optional second and third pairs. Leave them disconnected and only two images get placed.
  • 对齐方式 - the nine-way alignment dropdown, same as the single node.
  • X轴偏移 / Y轴偏移 - global nudges applied to all aligned images.
  • 填充颜色 - 白色/黑色/透明 for canvas edges.
  • 合并模式 - the V2 special: 分别输出 (separate outputs) or 合并输出 (merged output). Separate gives you each aligned image on its own; merged composites them all onto one canvas.

Outputs

  • 定位图像2, 定位图像3, 定位图像4 - the aligned images (empty if that pair wasn't connected).
  • 合并遮罩 - the combined mask of all aligned regions. This is what you'd feed into an inpainting or compositing pass that should treat all placed subjects as one region.

Install and when to use it

From comfy_Pond_Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Pondowner857/comfy_Pond_Nodes
cd comfy_Pond_Nodes && pip install -r requirements.txt

Pure torch, no extra deps. Use it when you're aligning multiple subjects to one frame - e.g., several face crops all normalized to a reference layout, or multiple objects placed into a scene by matching their masks. Same caveat as the single version applies, multiplied: since all three share one X/Y偏移, if one of them needs individual nudging you'll have to chain single ImageAlignByMask nodes after this. The merged-output mode is genuinely handy for "stamp all three subjects onto one aligned canvas" workflows, and the merged mask output closes the loop for the processing that follows.

Category🐳Pond/image

Inputs (12)

NameTypeDefaultDescription
基准遮罩MASK
遮罩2MASK
图像2IMAGE
对齐方式COMBO居中对齐9 options: 居中对齐, 左对齐, 右对齐, 上对齐, 下对齐, 左上对齐, +3
遮罩3optMASK
图像3optIMAGE
遮罩4optMASK
图像4optIMAGE
X轴偏移optINT0-2048–2048
Y轴偏移optINT0-2048–2048
填充颜色optCOMBO白色3 options: 白色, 黑色, 透明
合并模式optCOMBO分别输出2 options: 分别输出, 合并输出

Outputs (4)

NameTypeDescription
定位图像2IMAGE
定位图像3IMAGE
定位图像4IMAGE
合并遮罩MASK