From f4b912749da62f6ed9a9fdfc15dd7bd87a991fd5 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 21 Sep 2026 20:19:57 -0700 Subject: [PATCH] comfyui: VAE 4D-to-5D latent expansion for video VAEs The Qwen-Image 2.1 VAE is a video VAE (5D convs, time_conv, depth-3). ComfyUI detects it as WanVAE (latent_dim=3), but EmptyLatentImage produces a 4D latent. The decode function's memory_used_decode lambda accesses shape[4] which is out of range for 4D. Fix: expand 4D latents to 5D in the decode function when latent_dim==3. Added to the patch script for persistence across container recreations. --- dankclaw/Containerfile.comfyui | 1 + 1 file changed, 1 insertion(+) diff --git a/dankclaw/Containerfile.comfyui b/dankclaw/Containerfile.comfyui index 153d341..38eb82d 100644 --- a/dankclaw/Containerfile.comfyui +++ b/dankclaw/Containerfile.comfyui @@ -36,3 +36,4 @@ RUN chmod +x /opt/ComfyUI/comfyui-start.sh CMD ["/opt/ComfyUI/comfyui-start.sh"] EXPOSE 8188 +# v2: VAE 4D-to-5D latent expansion for video VAEs (qwen_image21)