{"record":{"id":"b780edff96067206","repo":"invoke-ai/InvokeAI","slug":"end-image-flf2v-interpolation-is-only-supported","errorCode":null,"errorMessage":"End-image (FLF2V) interpolation is only supported for I2V-A14B video (num_frames > 1). Got {'TI2V-5B' if is_ti2v_5b else 'single-frame I2V'}. Remove the End Image input, or use an A14B VAE with num_frames > 1.","messagePattern":"End-image \\(FLF2V\\) interpolation is only supported for I2V-A14B video \\(num_frames > 1\\)\\. Got (.+?)\\. Remove the End Image input, or use an A14B VAE with num_frames > 1\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/wan_ref_image_encoder.py","lineNumber":152,"sourceCode":"            device = get_effective_device(vae)\n            target_dtype = TorchDevice.choose_bfloat16_safe_dtype(device)\n            context.util.signal_progress(\n                (\"VAE-encoding FLF2V start+end images\" if end_pil_image is not None else \"VAE-encoding reference image\")\n                + (f\" ({self.num_frames} frames)\" if self.num_frames > 1 else \"\")\n            )\n            # Free cached allocator blocks left over from earlier nodes (denoise expert\n            # swaps in particular can leave the cache fragmented in ways that look like\n            # free VRAM but fail a single large contiguous request). Mirrors the\n            # pattern used in wan_latents_to_image.py / wan_latents_to_video.py.\n            TorchDevice.empty_cache()\n            # Pick the encoder path by VAE z_dim: 48 means the Wan 2.2-VAE (TI2V-5B),\n            # which uses a single-frame 48-channel condition that the denoise loop\n            # blends with the noisy latents at every step (expand_timesteps path).\n            # 16 means the standard Wan VAE (A14B), which uses the 20-channel\n            # mask + latent condition concatenated to noise along the channel dim.\n            is_ti2v_5b = getattr(vae.config, \"z_dim\", 16) == 48\n            if end_pil_image is not None and (is_ti2v_5b or self.num_frames <= 1):\n                raise ValueError(\n                    \"End-image (FLF2V) interpolation is only supported for I2V-A14B video \"\n                    f\"(num_frames > 1). Got {'TI2V-5B' if is_ti2v_5b else 'single-frame I2V'}. \"\n                    \"Remove the End Image input, or use an A14B VAE with num_frames > 1.\"\n                )\n            if is_ti2v_5b:\n                # TI2V-5B I2V needs latent H/W to be even for the transformer\n                # patch_size=(1,2,2), so pixel dims must be multiples of 32\n                # (16x VAE * 2 transformer patch). A14B's 8x VAE only needed\n                # multiples of 16.\n                if self.width % 32 != 0 or self.height % 32 != 0:\n                    raise ValueError(\n                        f\"TI2V-5B I2V requires width and height to be multiples of 32 \"\n                        f\"(got {self.width}x{self.height}). The Wan 2.2-VAE uses 16x \"\n                        f\"spatial compression and the transformer adds a 2x patch on \"\n                        f\"top, so pixel dims must divide by 32 for the patchify step.\"\n                    )\n                condition = encode_reference_image_to_ti2v_condition(\n                    image=pil_image,","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/wan_ref_image_encoder.py#L134-L170","documentation":"First-last-frame (FLF2V) interpolation — encoding both a start and an end image into a 20-channel mask+latent condition — is only implemented for the Wan 2.2 I2V-A14B path with multi-frame output. It is rejected for the TI2V-5B VAE (z_dim == 48, single-frame 48-channel condition) and for single-frame I2V. InvokeAI raises ValueError to prevent silently dropping the end image.","triggerScenarios":"Supplying an End Image to wan_ref_image_encoder while either (a) the loaded VAE is TI2V-5B (z_dim 48) or (b) num_frames <= 1.","commonSituations":"Users expect FLF2V to work with the smaller TI2V-5B model, or leave num_frames at 1 while adding an end image expecting an interpolated pair.","solutions":["Switch to the Wan 2.2 I2V-A14B VAE (and matching A14B transformer).","Set num_frames > 1 and satisfy (num_frames - 1) % 4 == 0 (e.g. 81).","Remove the End Image input if you must stay on TI2V-5B or single-frame mode."],"exampleFix":"// before\nvae = ti2v_5b_vae; end_image = img; num_frames = 1\n// after\nvae = i2v_a14b_vae; end_image = img; num_frames = 81","handlingStrategy":"validation","validationCode":"flf2v_ok = end_image is None or (\n    getattr(vae.config, \"z_dim\", 16) == 16 and num_frames > 1\n)\nif not flf2v_ok:\n    end_image = None  # or switch to A14B VAE + multi-frame","typeGuard":null,"tryCatchPattern":"try:\n    out = encoder.invoke(context)\nexcept ValueError as e:\n    if \"End-image (FLF2V) interpolation\" in str(e):\n        end_image = None  # degrade to I2V without last frame\n    else:\n        raise","preventionTips":["Only add an End Image when using the I2V-A14B VAE/transformer.","Remember FLF2V also requires num_frames > 1 satisfying (num_frames-1)%4==0.","TI2V-5B supports start-image I2V only."],"tags":["validation","flf2v","wan","unsupported-combination"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}