Skip to main content

VAE Encode Batched πŸŽ₯πŸ…₯πŸ…—πŸ…’

Video Helper Suite πŸŽ₯πŸ…₯πŸ…—πŸ…’/batched nodes
VHS_VAEEncodeBatched

VAE Encode Batched πŸŽ₯πŸ…₯πŸ…—πŸ…’<div style="font-size: 0.8em"><div id=VHS_shortdesc>Encode images as latents with a manually specified batch size.</div></div><div style="font-size: 0.8em">Some people have ran into VRAM issues when encoding or decoding large batches of images. As a workaround, this node lets you manually set a batch size when encoding images.</div><div style="font-size: 0.8em">Unless these issues have been encountered, it is simpler to use the native VAE Encode or to encode directly from a Load Video</div><div style="font-size: 0.8em"><div vhs_title="Inputs" style="display: flex; font-size: 0.8em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">Inputs: <div vhs_title="pixels" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">pixels: The images to be encoded.</div></div><div vhs_title="vae" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">vae: The VAE to use when encoding.</div></div></div></div><div vhs_title="Outputs" style="display: flex; font-size: 0.8em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">Outputs: <div vhs_title="LATENT" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">LATENT: The encoded latents.</div></div></div></div><div vhs_title="Widgets" style="display: flex; font-size: 0.8em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">Widgets: <div vhs_title="per_batch" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">per_batch: The maximum number of images to encode in each batch.</div></div></div></div></div>

Example

JSON Example
{
  "class_type": "VHS_VAEEncodeBatched",
  "inputs": {
    "pixels": [
      "node_id",
      0
    ],
    "vae": [
      "node_id",
      0
    ],
    "per_batch": 16
  }
}

This example shows required inputs only. Connection values like ["node_id", 0] should reference actual node IDs from your workflow.

Inputs

NameTypeStatusConstraintsDefault
pixelsIMAGErequired--
vaeVAErequired--
per_batchINTrequiredmin: 116

Outputs

IndexNameTypeIs ListConnection Reference
0LATENTLATENTNo["{node_id}", 0]
How to connect to these outputs

To connect another node's input to an output from this node, use the connection reference format:

["node_id", output_index]

Where node_id is the ID of this VHS_VAEEncodeBatched node in your workflow, and output_index is the index from the table above.

Example

If this node has ID "5" in your workflow:

  • LATENT (LATENT): ["5", 0]
Was this page helpful?