Nodes/ComfyUI-YogurtKiwiEdit/Kiwi Edit VAE Encode Inputs (Yogurt Kiwi Edit)
ComfyUI Node

Kiwi Edit VAE Encode Inputs (Yogurt Kiwi Edit)

Cram every video into latents without melting your GPU

By yogurt7771·Created 6 months ago·Updated 6 months ago· 1
Kiwi Edit VAE Encode Inputs (Yogurt Kiwi Edit)
  • pipeline
  • source_video
  • source_input_video
  • ref_image
  • input_video
  • conditioning
max_frames81
max_pixels921600
tiledtrue

Kiwi-Edit's pipeline is big enough that loading the whole thing at once is a one-way ticket to an out-of-memory error on anything short of a big card. So this pack splits it into stages, and this node is stage one: everything VAE-side gets prepped and encoded here, with only the VAE sitting on the GPU while it runs.

The VIDEO on the required source_video input is your starting clip. The node trims it to max_frames frames at the video's own framerate, caps the resolution to max_pixels, and encodes the result to latents. Then it tucks the VAE back onto the CPU and hands a conditioning handle to the next two stages. That per-stage module shuffling is the pack's whole design - it trades a bit of time for dramatically lower peak VRAM, which is the right trade for a ~20 GB model.

The inputs that matter

The source_video is the only required input. Everything else is either a knob or an optional feature:

  • max_frames (default 81) - how many frames of the source you keep. The clip is trimmed from the start; 81 frames at 24 fps is about 3.4 seconds.
  • max_pixels (default 921600, i.e. 720×1280) - a cap, not a target. Bigger sources get scaled down to fit while keeping aspect, snapped to 16-multiple dimensions. It doesn't upscale anything.
  • tiled (on by default) - toggles the Wan VAE's tiled encode path (enable_tiling()), which cuts peak memory on the encode itself. Leave it on.
  • source_input_video (optional) - if you want a different clip driving the VAE conditioning than the source you're editing, this overrides it. Unplugged, it falls back to source_video.
  • ref_image (optional) - an image or batch of images used as reference guidance. The whole connected batch becomes a reference list, each frame padded to the target aspect (white padding) and encoded.
  • input_video (optional) - this is your video-to-video hook. It gets VAE-encoded here but not noised yet; the noise is added later in Generate Latents at your chosen denoising strength.

The single output, conditioning, is a bundle of all of it: the encoded source, ref latents, input latents, target height/width/frame count, plus the original audio, fps, and metadata. Wire it into both MLLM Encode Context and Generate Latents.

How it slots into the workflow

Load Kiwi Edit Pipeline ──► Kiwi Edit VAE Encode Inputs ──► Kiwi Edit MLLM Encode Context ──► ...
                        └──────────────► Kiwi Edit Generate Latents ◄──────────────┘

If you connect input_video, Generate Latents treats it as a starting latent and denoises from there at denoising_strength - that's how you get video-to-video instead of a from-scratch edit.

Installing it

Same as the rest of the pack: ComfyUI Manager, search "ComfyUI-YogurtKiwiEdit", or clone and pip install -r requirements.txt (diffusers>=0.36.0, accelerate), then restart. You also need a Kiwi-Edit diffusers model folder under ComfyUI/models/KiwiEdit - the full details live on the Load Kiwi Edit Pipeline page, and nothing here works until that loader node has a model to encode with.

Where people get stuck

The usual suspects: a source video longer than your max_frames budget just gets its tail chopped, so set the frame count to what you actually want to edit. If a huge 4K clip refuses to fit in VRAM even with tiled on, drop max_pixels - the VAE encode is where big inputs bite first. And don't expect the audio to be regenerated; this is an edit, so the source audio rides along and comes back out in VAE Decode.

CategoryYogurtKiwiEdit/Video

Inputs (8)

NameTypeDefaultDescription
pipelineKIWI_EDIT_PIPELINE
source_videoVIDEO
max_framesINT811–4096
max_pixelsINT921600256–67108864
tiledBOOLEANtrueEnable diffusers VAE tiled encode for source/reference/input-video encoding.
source_input_videooptVIDEO
ref_imageoptIMAGE
input_videooptVIDEO

Outputs (1)

NameTypeDescription
conditioningKIWI_EDIT_CONDITIONING