Nodes/SDXL Adherence/Smart Latent
ComfyUI Node

Smart Latent

A ComfyUI node in itsjustregi / SDXL Adherence with 17 inputs and 5 outputs.

By regiellis·Created 12 months ago·Updated 11 months ago· 9
Smart Latent
  • vae
  • image
  • latent
  • dims_json
  • width
  • height
  • bbox_json
mode
width1024
height1024
resolutionUse width/height
snap_modepad_up
pad_kindreflect
pad_value128
batch1
tile_size320
tile_overlap32
force_bchwtrue
use_tiledtrue
seed0
max_pixels1048576
max_long_side0
Categoryitsjustregi / SDXL Adherence

Inputs (17)

NameTypeDefaultDescription
vaeVAEVAE model used to create or encode latents.
modeCOMBOCreate an empty latent or encode an input image.
widthINT102464–4096Requested width; may downscale by 64s to respect max_pixels.
heightINT102464–4096Requested height; may downscale by 64s to respect max_pixels.
resolutionoptCOMBOUse width/heightQuick presets; selecting one overrides width/height (empty mode).
snap_modeoptCOMBOpad_upSnap policy for non-64 dims: pad, downscale, resize, or crop.
pad_kindoptCOMBOreflectPadding type for pad_up/downscale (reflect avoids seams). 'edge' behaves like 'replicate'.
pad_valueoptINT1280–255Pad value (constant mode only).
batchoptINT11–16Batch size for empty latent or image batch.
imageoptIMAGEImage tensor when mode = encode_image.
tile_sizeoptINT320192–512Tile size for VAE.encode_tiled if available.
tile_overlapoptINT320–256Tile overlap for tiled VAE encode/decode.
force_bchwoptBOOLEANtrueEnsure image is [B,C,H,W] before encoding.
use_tiledoptBOOLEANtrueUse tiled VAE encode/decode when available.
seedoptINT0Reserved for future use.
max_pixelsoptINT104857665536–16777216Upper bound on W*H; uniformly downscale to fit if exceeded.
max_long_sideoptINT00–8192Optional VRAM guard: if >0, downscale input image so max(H,W) <= this before snapping.

Outputs (5)

NameTypeDescription
latentLATENT
dims_jsonSTRING
widthINT
heightINT
bbox_jsonSTRING