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

# 从批次获取Latent（LatentFromBatch）

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

此节点用于根据指定的批次索引和长度，从给定批次中提取特定的潜在样本子集。它允许对潜在样本进行选择性处理，便于对批次中的较小片段进行操作，以提高效率或实现针对性处理。

## 参数

| 参数            | 类型           | 默认 / 范围         | 说明                             |
| ------------- | ------------ | --------------- | ------------------------------ |
| `samples`     | LATENT · 潜空间 | —（连线输入）         | LATENT。采样器的输入/输出，需 VAE 解码才能看图。 |
| `batch_index` | INT          | -16384 \~ 16384 | —                              |
| `length`      | INT          | 1 \~ 64         | 视频模型生成的总帧数，需满足模型帧数约束（如 4n+1）。  |

## 输出

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

## 怎么接

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

## 使用案例

属于「潜空间处理」类节点，向下游提供潜空间数据，通常进采样器或解码器。从 `samples`、`batch_index`（0）、`length`（1） 开始填就能跑起来。典型接法：`EmptyLatentImage` → 本节点 → `VAEDecode`。输出类型是 LATENT，只能接同类型的输入端口，颜色对不上就是接错了。

## 端口与连线示意

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

## 同类节点

[组合Latent批次](/nodes/04/LatentBatch.md) · [复制Latent批次](/nodes/04/RepeatLatentBatch.md) · [批量latent](/nodes/04/BatchLatentsNode.md) · [重设Latent批次](/nodes/04/RebatchLatents.md) · [替换视频Latent](/nodes/04/ReplaceVideoLatentFrames.md)
