⬡ Polyhedron Wan Frame Inflate (T2I LoRA fix)
Bump one latent frame up to seventeen
- image_embeds
- image_embeds
Here's a genuinely maddening Wan bug: you apply a LoRA to a text-to-image run and it does nothing. No error, no crash - the LoRA just doesn't trigger. It turns out to be a frame-count problem, and it's kijai issue #1827: when a Wan latent is only one frame long, the LoRA's attention mechanism doesn't get enough temporal context to activate. The Polyhedron Wan Frame Inflate is the workaround - it bumps the latent frame count from 1 to N so the sampler actually runs in video mode and the LoRA fires.
It sits between kijai's WanVideoEmptyEmbeds and WanVideoSampler, and it operates on the embeds dict itself - it consumes the WANVIDIMAGE_EMBEDS type without touching kijai's code. The mechanism is a deep copy, so it never mutates the upstream node's cached embeds, and it rebuilds the target shape to the frame count you ask for.
The numbers that matter
target_latent_frames is the one real knob, and the tooltip gives you the translation table because the VAE math isn't intuitive. A Wan VAE compresses time 4:1, so each latent frame becomes roughly four image frames plus an anchor - the formula the ecosystem knows as "4n+1":
- 5 latent frames → 17 image frames - fast, and plenty for a single still.
- 9 → 33 frames - stronger LoRA activation.
- 21 → 81 frames - full video quality, the longest common case, and the slowest.
Higher = stronger activation but slower, and there's a real sweet-spot tradeoff: too few frames and the LoRA still doesn't trigger properly, too many and you're paying video-length sampling time for what is, in the T2I case, a single image. Start at 5 and go up if the LoRA's effect is weak.
only_if_single_frame decides the guardrail: ON (the default) means only inflate when the input already has exactly 1 latent frame - the bug case. OFF means always replace the target frame count with your value, which is how you force a longer latent deliberately.
The output is the inflated image_embeds, still WANVIDIMAGE_EMBEDS, which feeds straight into WanVideoSampler. After decode, pair it with the pack's ULSImagePickFrame to pull the best frame back out - that's the "T2I LoRA fix" pipeline in full: inflate, sample, decode, pick the middle frame.
Installing it
It's in the Polyhedron Suite pack:
cd ComfyUI/custom_nodes
git clone https://github.com/PolyhedronAI/ComfyUI-PolyhedronLoRAStack.git
# restart ComfyUI
or ComfyUI Manager, search "Polyhedron Suite". No extra dependencies, but it only makes sense with kijai's ComfyUI-WanVideoWrapper installed.
One honest limitation, printed in the source: this node supports T2V-style empty embeds. If you feed it an I2V flow (which carries its own num_frames and conditional fields), it passes through unchanged with a warning rather than risk corrupting the I2V-specific state. For the I2V case you're usually not hitting the single-frame bug anyway - the workaround is a T2I/LoRA-trigger fix, which is what the display name says.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image_embeds | WANVIDIMAGE_EMBEDS | — | |
| target_latent_frames | INT | 52–41 | Number of LATENT frames to inflate to. 5 latent frames = 17 image frames (VAE 4:1 stride + anchor). Higher = stronger LoRA activation but slower. Common values: 5 (17 frames, fast), 9 (33 frames, stronger), 21 (81 frames, full video quality). |
| only_if_single_frame | BOOLEAN | true | When ON, only inflate if the input already has exactly 1 latent frame. When OFF, always replace target_latent_frames with the value above. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_embeds | WANVIDIMAGE_EMBEDS | — |