> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-matt-router-pricing-pika-and-guard.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ImageStitch - ComfyUI Built-in Node Documentation

> 此节点允许您将两张图像沿指定方向（上、下、左、右）拼接在一起，并支持尺寸匹配和图像间距设置。

此节点允许您将两张图像沿指定方向（上、下、左、右）拼接在一起，并支持尺寸匹配和图像间距设置。

## 输入

| 参数名 | 说明 | 数据类型 | 输入类型 | 默认值 | 取值范围 |
| - | - | - | - | - | - |
| `图像1` | 第一张待拼接图像 | IMAGE | 必需 | - | - |
| `图像2` | 第二张待拼接图像，若未提供则仅返回第一张图像 | IMAGE | 可选 | 无 | - |
| `方向` | 拼接第二张图像的方向：右、下、左或上 | STRING | 必需 | right | right/down/left/up |
| `匹配图像尺寸` | 是否将第二张图像缩放至与第一张图像尺寸匹配 | BOOLEAN | 必需 | True | True/False |
| `间距宽度` | 图像之间的间距宽度，必须为偶数 | INT | 必需 | 0 | 0-1024 |
| `间距颜色` | 拼接图像之间间距的颜色 | STRING | 必需 | white | white/black/red/green/blue |

> 对于 `spacing_color`，当使用"white/black"以外的颜色时，若 `match_image_size` 设置为 `false`，则填充区域将显示为黑色

## 输出

| 输出名 | 说明 | 数据类型 |
| - | - | - |
| `IMAGE` | 拼接后的图像 | IMAGE |

## 工作流示例

在下方工作流中，我们使用3张不同尺寸的输入图像作为示例：

* image1：500x300
* image2：400x250
* image3：300x300

<img src="https://mintcdn.com/dripart-matt-router-pricing-pika-and-guard/QTMyKFkoVk7odD-Y/images/built-in-nodes/ImageStitch/workflow.webp?fit=max&auto=format&n=QTMyKFkoVk7odD-Y&q=85&s=25a5df9ceeab52832db9bd3c28940056" alt="工作流" width="2000" height="1044" data-path="images/built-in-nodes/ImageStitch/workflow.webp" />

**第一个图像拼接节点**

* `match_image_size`：false，图像将按原始尺寸拼接
* `direction`：up，`image2` 将放置在 `image1` 上方
* `spacing_width`：20
* `spacing_color`：black

输出图像1：

<img src="https://mintcdn.com/dripart-matt-router-pricing-pika-and-guard/QTMyKFkoVk7odD-Y/images/built-in-nodes/ImageStitch/output-1.webp?fit=max&auto=format&n=QTMyKFkoVk7odD-Y&q=85&s=59b9d780ec031c364782992fdc286ab3" alt="输出1" width="500" height="570" data-path="images/built-in-nodes/ImageStitch/output-1.webp" />

**第二个图像拼接节点**

* `match_image_size`：true，第二张图像将缩放至与第一张图像的高度或宽度匹配
* `direction`：right，`image3` 将出现在右侧
* `spacing_width`：20
* `spacing_color`：white

输出图像2：

<img src="https://mintcdn.com/dripart-matt-router-pricing-pika-and-guard/QTMyKFkoVk7odD-Y/images/built-in-nodes/ImageStitch/output-2.webp?fit=max&auto=format&n=QTMyKFkoVk7odD-Y&q=85&s=c9bdb616dd77374046105b3ca546cdcf" alt="输出2" width="1090" height="570" data-path="images/built-in-nodes/ImageStitch/output-2.webp" />

> 本文档由 AI 生成。如果您发现任何错误或有改进建议，欢迎贡献！ [在 GitHub 上编辑](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/ImageStitch/zh.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.