> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# 自动增长输入 - ComfyUI 的动态节点输入

> 自动增长输入（动态输入）会在你连上最后一个输入后自动新增一个插槽，让一个节点就能接收任意数量的图像、蒙版或潜空间。

<img src="https://mintcdn.com/dripart/U2iZLdB9XBorZSfA/images/interface/features/autogrow/autogrow-1.png?fit=max&auto=format&n=U2iZLdB9XBorZSfA&q=85&s=b702db2e40661333c41b9783a2090f38" alt="Batch Images 节点已连接一张图像，下方还有一个空闲输入" width="1556" height="712" data-path="images/interface/features/autogrow/autogrow-1.png" />

ComfyUI 中有些节点带有**自动增长输入**（autogrow inputs），也叫**动态输入**。这类节点不会固定显示一组输入插槽：当你把最后一个空闲输入连上之后，它会自动再增加一个输入，所以一个节点就能批处理两张或二十张图像，不需要额外设置。

## 自动增长输入的工作方式

1. **连上最后一个空闲输入。** 以本页的 **Batch Images** 节点为例，把图像连到 `image0`，此时 `image1` 仍为空闲状态。
2. **节点随之增长。** 一旦最后一个空闲输入被连上，节点就会在下方自动新增一个空输入。下图里 `image1` 连上后，新的 `image2` 输入出现了。
3. **按需重复。** 每当最后一个输入被占满，节点就会继续增长，直到达到该节点允许的最大输入数。

<img src="https://mintcdn.com/dripart/U2iZLdB9XBorZSfA/images/interface/features/autogrow/autogrow-2.png?fit=max&auto=format&n=U2iZLdB9XBorZSfA&q=85&s=cafe6c1aa5420a7c2445ff30fb499548" alt="Batch Images 节点已连接两个输入，并高亮显示新出现的空闲输入" width="1556" height="832" data-path="images/interface/features/autogrow/autogrow-2.png" />

还有两点需要注意：

* **顺序有意义。** 输入会按显示顺序传给节点，`image0` 排在 `image1` 之前，依此类推。当结果与顺序有关时（例如这些图像要一起送进视频模型）要特别留意。
* **空闲输入只是占位。** 只有真正连上内容后，它才属于节点数据的一部分；允许 0 个输入的节点即使所有插槽都空着也能运行。

## 使用自动增长输入的节点

| 节点 | 会增长的输入 | 最大输入数 |
| - | - | - |
| **Batch Images** | `image` | 50 |
| **Batch Masks** | `mask` | 50 |
| **Batch Latents** | `latent` | 50 |
| **And** / **Or** | `value` | 10 |
| **Nano Banana 2** 等需要参考图的合作节点 | `image_1`、`image_2` 等 | 最多 14 张图 |

每个节点自己决定上限。不确定某个输入能接多少值时，在 ComfyUI 里把鼠标悬停在输入上查看提示。

<Tip>
  自动增长属于 ComfyUI V3 节点 schema。如果你在编写自定义节点，请参考[动态输入](/zh/custom-nodes/v3_migration#动态输入)中的 `Autogrow` 模板 API。
</Tip>

<Card title="Batch Images 节点" icon="book-open" href="/zh/built-in-nodes/BatchImagesNode">
  把多张图像合并成一个批次，输入数量按需增加。
</Card>


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