Scale Ref Image and VAE Encode ππ π β‘
Preparing a reference image for AnimateLCM-I2V
- image
- vae
- latent_size
- LATENT
Displayed as Scale Ref Image and VAE Encode, and the README names it directly: preparing the reference image for AnimateLCM-I2V's ref_latent input is exactly what it says to do - "use Scale Ref Image and VAE Encode node to preprocess input images." If you've read the articles for ADE_ApplyAnimateLCMI2VModel or ADE_LoadAnimateLCMI2VModel, this is the node those point back to.
What it does
AnimateLCM-I2V anchors generated motion to a reference latent, and that latent needs to match your actual generation's dimensions exactly. This node does the whole preparation in one step: resize a plain image to your target resolution, then VAE-encode it into a latent - rather than you manually chaining a separate resize node and a generic VAE Encode and hoping the dimensions line up.
The key input is latent_size - not the image being encoded, but a reference LATENT (typically straight from your EmptyLatentImage or wherever your generation's actual target dimensions originate) that this node reads the target width and height from. image gets resized to match using scale_method, and crop (default "center") controls how any aspect-ratio mismatch between your source image and the target dimensions gets handled - cropping to fit rather than distorting the image. The result is VAE-encoded through vae into the output LATENT.
Inputs and output
All required:
image(IMAGE) - your reference photo or frame.vae(VAE) - the VAE to encode with, same as any VAE Encode node.latent_size(LATENT) - a reference latent this node reads target dimensions from, not content.scale_method- standard ComfyUI upscale method choices (nearest, bilinear, and similar).crop(default "center") - how to handle any aspect-ratio mismatch during resize.
Output is a single LATENT, wired directly into ADE_ApplyAnimateLCMI2VModel's ref_latent input.
How to install it
ComfyUI Manager: search AnimateDiff Evolved, confirm the author is Kosinkadink, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved
No model download tied to this node specifically, but it exists to feed AnimateLCM-I2V - you'll need those weights (HuggingFace wangfuyun/AnimateLCM-I2V, per the README) plus the general AnimateLCM settings elsewhere in your graph: autoselect/lcm/lcm[100_ots] beta schedule, an LCM LoRA, the lcm sampler in your KSampler, low CFG (roughly 1.0β2.0), and few steps (minimum around 4).
Common issues & troubleshooting
Reference image doesn't seem to be influencing output at all. Make sure it went through this node rather than a generic VAE Encode - the README specifically calls this one out by name, and a mismatched latent shape or scale from skipping it is a likely silent failure point.
Output looks stretched or distorted relative to your reference. Check crop - center-cropping avoids distortion but does lose some of the frame if your source image's aspect ratio doesn't match latent_size's. If preserving the full frame matters more than exact dimension match, you may need to pre-crop or pre-pad your source image before this node rather than relying on crop alone.
Reference is at the wrong resolution entirely. Double-check latent_size is actually wired from the same EmptyLatentImage (or equivalent) driving your real generation, not a leftover or placeholder latent from earlier in the graph.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| vae | VAE | β | |
| latent_size | LATENT | β | |
| scale_method | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| crop | COMBO | center | 2 options: disabled, center |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | β |