🐳图像扩展(V2)
Align up to three images to one reference in a single pass
- 基准遮罩
- 遮罩2
- 图像2
- 遮罩3
- 图像3
- 遮罩4
- 图像4
- 定位图像2
- 定位图像3
- 定位图像4
- 合并遮罩
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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| 基准遮罩 | MASK | — | |
| 遮罩2 | MASK | — | |
| 图像2 | IMAGE | — | |
| 对齐方式 | COMBO | 居中对齐 | 9 options: 居中对齐, 左对齐, 右对齐, 上对齐, 下对齐, 左上对齐, +3 |
| 遮罩3opt | MASK | — | |
| 图像3opt | IMAGE | — | |
| 遮罩4opt | MASK | — | |
| 图像4opt | IMAGE | — | |
| X轴偏移opt | INT | 0-2048–2048 | — |
| Y轴偏移opt | INT | 0-2048–2048 | — |
| 填充颜色opt | COMBO | 白色 | 3 options: 白色, 黑色, 透明 |
| 合并模式opt | COMBO | 分别输出 | 2 options: 分别输出, 合并输出 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| 定位图像2 | IMAGE | — |
| 定位图像3 | IMAGE | — |
| 定位图像4 | IMAGE | — |
| 合并遮罩 | MASK | — |