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

# 合成Latent遮罩（LatentCompositeMasked）

<div class="node-meta"><code>LatentCompositeMasked</code><span>model/latent</span><span>角色：潜空间处理</span><span class="star">★ 常用节点</span></div>

LatentCompositeMasked 节点用于在指定坐标处将两个潜在表示混合在一起，并可选择使用遮罩进行更可控的合成。该节点通过将一幅图像的部分叠加到另一幅图像上，并能够调整源图像大小以实现完美匹配，从而创建复杂的潜在图像。

## 参数

| 参数              | 类型           | 默认 / 范围         | 说明                             |
| --------------- | ------------ | --------------- | ------------------------------ |
| `destination`   | LATENT · 潜空间 | —（连线输入）         | 被粘贴/裁剪的底图。                     |
| `source`        | LATENT · 潜空间 | —（连线输入）         | 提供内容的一方。                       |
| `x`             | INT          | 0 \~ 16384，步长 8 | 源层在目标潜在表示中放置的 x 坐标，可实现源层的精确定位。 |
| `y`             | INT          | 0 \~ 16384，步长 8 | 源层在目标潜在表示中放置的 y 坐标，可实现精确的叠加定位。 |
| `resize_source` | BOOLEAN · 布尔 | true / false    | 是否对输入做插值缩放。                    |
| `mask`（选填）      | MASK · 遮罩    | —（连线输入）         | 白色区域参与运算。                      |

## 输出

| 输出     | 类型     | 说明  |
| ------ | ------ | --- |
| LATENT | LATENT | 潜空间 |

## 怎么接

- **上游**：EmptyLatentImage / VAEEncode / KSampler
- **下游**：VAEDecode / 下一段采样
- **接线**：接在 EmptyLatentImage / VAEEncode / 上一次采样之后，输出接着进 KSampler 或 VAEDecode；潜空间操作比像素空间快得多，放大和拼接优先在这一层做。

## 使用案例

属于「潜空间处理」类节点，向下游提供潜空间数据，通常进采样器或解码器。从 `destination`、`source`、`x`（0） 开始填就能跑起来。典型接法：`EmptyLatentImage` → 本节点 → `VAEDecode`。注意：遮罩白色为生效区、黑色为忽略区；边缘务必羽化 8-32px 避免硬边。

## 端口与连线示意

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

## 实战提示

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

## 同类节点

[空Latent图像](/nodes/04/EmptyLatentImage.md) · [合成Latent](/nodes/04/LatentComposite.md) · [缩放Latent](/nodes/04/LatentUpscale.md) · [缩放Latent（比例）](/nodes/04/LatentUpscaleBy.md) · [加载Latent](/nodes/04/LoadLatent.md) · [保存Latent](/nodes/04/SaveLatent.md) · [设置Latent噪波遮罩](/nodes/04/SetLatentNoiseMask.md) · [VAE解码](/nodes/04/VAEDecode.md) · [VAE解码（分块）](/nodes/04/VAEDecodeTiled.md) · [VAE编码](/nodes/04/VAEEncode.md) · [VAE编码（局部重绘）](/nodes/04/VAEEncodeForInpaint.md) · [空Latent音频](/nodes/04/EmptyLatentAudio.md)
