Nodes/JJMaden Random Nodes/LTX Latent Resizer (Divisible by 32)
ComfyUI Node

LTX Latent Resizer (Divisible by 32)

The name is a lie — it never touches a latent

By jjmaden·Created 27 days ago·Updated 23 days ago· 0
LTX Latent Resizer (Divisible by 32)
  • image
  • IMAGE
  • width
  • height
  • frame_count
scale_factor1.00
multiple_of32
resize_methodbilinear
video_presetnone (spatial resize only)
custom_frame_multiple8
custom_frame_remainder1

Let's get the naming out of the way first: despite "Latent Resizer," this node operates on pixels. It takes an IMAGE, scales it, and rounds the result to a size your video VAE will accept - and you run it before a VAEEncode, not after. If you reach for it expecting latent-space math, you're in the wrong place. If you reach for it because you keep hitting "resolution not divisible by 32" errors from LTX or another video model, you're exactly right.

Video models are fussy about canvas math. LTX-2.3, for example, requires width and height divisible by 32 and a frame count divisible by 8 plus 1 - and off-grid values fail rather than round. ComfyUI's stock resize nodes won't nudge you onto the grid for you; this one does, in one step.

What it does: multiplies the input's width/height by scale_factor, then rounds both dimensions up to the next multiple of multiple_of (default 32 - which fits LTX and most video VAEs; change it if yours needs different alignment). The resize itself is torch.nn.functional.interpolate with your pick of bilinear (default), bicubic, nearest, or area, and the output is clamped to [0, 1] - bicubic can overshoot slightly past that range at sharp edges, and the clamp keeps every method safe to feed straight into a VAEEncode.

Inputs that matter:

  • image - the IMAGE tensor. Run this before VAEEncode.
  • scale_factor - float, 0.1–8.0, default 1.0. Your quick "generate at 0.5×, upscale later" dial.
  • multiple_of - default 32.
  • resize_method - bilinear / bicubic / nearest / area.
  • video_preset - the newer, genuinely useful addition: none (spatial resize only), LTX-Video (8k+1 frames), Hunyuan Video (4k+1 frames), WAN 2.1 / 2.2 (4k+1 frames), or Custom (your own custom_frame_multiple / custom_frame_remainder). This trims the batch/frame dimension down to a valid count for the chosen model's causal VAE.

Outputs: the resized IMAGE, plus width, height, and frame_count as INTs - useful for wiring into downstream nodes that want those numbers.

The one hard rule: video_preset only ever trims frames from the end, never pads or duplicates - there's no way to invent frames that don't exist. If you need a specific frame count, feed in at least that many frames before this node. Keep that in mind and it's hard to go wrong.

Install is the pack standard, and this one is dependency-free:

cd ComfyUI/custom_nodes
git clone https://github.com/jjmaden/comfyui-jjmaden-random-nodes

Restart ComfyUI, or search "JJMaden Random Nodes" in ComfyUI Manager. MIT, no models to download - it's a personal utility pack (author jjmaden).

Where people get burned: wiring it after VAEEncode (it won't accept a LATENT, which is the hint), or forgetting that the frame trim is trim-only and wondering why a 41-frame clip came out as 33. Otherwise this is the node you stick between your image loader and the video VAE and forget about - which is the highest compliment a resize node can earn.

CategoryLTXVideo/Utils

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
scale_factorFLOAT1.000.1–8
multiple_ofoptINT321–25632 fits LTX and most video VAEs; change it if yours needs otherwise.
resize_methodoptCOMBObilinear4 options: bilinear, bicubic, nearest, area
video_presetoptCOMBOnone (spatial resize only)Trims the batch (frame) dimension down to the nearest valid count for the chosen model's VAE, e.g. LTX needs 8k+1 frames. 'none' leaves the frame count untouched (spatial resize only, the original behavior of this node).
custom_frame_multipleoptINT81–64Only used when video_preset is 'Custom'.
custom_frame_remainderoptINT10–63Only used when video_preset is 'Custom'. Must be less than custom_frame_multiple.

Outputs (4)

NameTypeDescription
IMAGEIMAGE
widthINT
heightINT
frame_countINT