> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# 合成图像（遮罩）（ImageCompositeMasked）

<div class="node-meta"><code>ImageCompositeMasked</code><span>image/compositing</span><span>角色：图像处理</span><span class="star">★ 常用节点</span></div>

`ImageCompositeMasked` 节点专为图像合成而设计，支持将源图像叠加到目标图像的指定坐标位置，并可选择调整大小和遮罩。

## 参数

| 参数              | 类型           | 默认 / 范围      | 说明                  |
| --------------- | ------------ | ------------ | ------------------- |
| `destination`   | IMAGE · 图像   | —（连线输入）      | 被粘贴/裁剪的底图。          |
| `source`        | IMAGE · 图像   | —（连线输入）      | 提供内容的一方。            |
| `x`             | INT          | 0 \~ 16384   | 源图像左上角在目标图像中的 x 坐标。 |
| `y`             | INT          | 0 \~ 16384   | 源图像左上角在目标图像中的 y 坐标。 |
| `resize_source` | BOOLEAN · 布尔 | true / false | 是否对输入做插值缩放。         |
| `mask`（选填）      | MASK · 遮罩    | —（连线输入）      | 白色区域参与运算。           |

## 输出

| 输出    | 类型    | 说明 |
| ----- | ----- | -- |
| IMAGE | IMAGE | 图像 |

## 怎么接

- **上游**：LoadImage / VAEDecode
- **下游**：VAEEncode / SaveImage / 下一个图像节点
- **接线**：接在 LoadImage 或 VAEDecode 之后，处理结果再交给 VAEEncode（重绘）、SaveImage（出图）或下一个图像节点；这类节点可以任意串联成处理流水线。

## 使用案例

属于「图像处理」类节点，向下游提供图像数据。从 `destination`、`source`、`x`（0） 开始填就能跑起来。典型接法：`LoadImage` → 本节点 → `VAEEncode`。注意：遮罩白色为生效区、黑色为忽略区；边缘务必羽化 8-32px 避免硬边。

## 端口与连线示意

![ImageCompositeMasked 端口与连线示意](/svg/ImageCompositeMasked.svg)

## 实战提示

- 遮罩白色为生效区、黑色为忽略区；边缘务必羽化 8-32px 避免硬边。

## 同类节点

[合并图像Alpha](/nodes/06/JoinImageWithAlpha.md) · [Porter-Duff图像合成](/nodes/06/PorterDuffImageComposite.md) · [分离图像Alpha](/nodes/06/SplitImageWithAlpha.md)
