FunRiflex
Trying to push Wan video past its native frame ceiling
- riflex_k
Wan's native training window tops out around 81 frames, and generating longer than that tends to produce looping or degraded motion - the model wasn't taught what a longer clip looks like. RIFLEx (from thu-ml's research, this node's namesake) is a technique that extrapolates the positional embedding frequency at inference time to push past that ceiling without retraining. FunRiflex is how you turn that on for a generation: it outputs a RIFLEXT_ARGS value that plugs into the optional riflex_k input on Wan2_2I2VSampler, WanI2VSampler, and WanT2VSampler.
Here's the honest part: results are genuinely mixed. Community reports on RIFLEx applied to Wan range from clean 121-frame generations on capable hardware to no visible improvement at all, or a new artifact - a flash or glitch in the first several frames - that wasn't there without it. Treat this as worth trying when you need longer clips, not as a guaranteed fix.
How it works
You set a single value, riflex_k, and the node packages it into the RIFLEXT_ARGS type the samplers expect. Internally, this adjusts the frequency RIFLEx uses to extrapolate Wan's rotary position embeddings so the model can "extend" its sense of time beyond what it was trained on, rather than genuinely understanding longer sequences.
The inputs that matter
riflex_k- default 6, range 0-10086. This is the one parameter on the whole node, and it's the extrapolation strength. There's no single documented "correct" value for a given target length in the README - community usage varies, and it's the kind of parameter you'll want to experiment with rather than set-and-forget. Higher values push further past the native window; that's also where artifacting tends to show up first.
Output: riflex_k (RIFLEXT_ARGS type) - into the riflex_k optional input on a T2V or I2V Wan sampler.
Installing it
Part of the base VideoX-Fun pack, no separate install. Search ComfyUI Manager for VideoX-Fun; if it's not indexed there:
cd ComfyUI/custom_nodes
git clone https://github.com/aigc-apps/VideoX-Fun
pip install -r VideoX-Fun/requirements.txt
Restart ComfyUI.
Common issues
No visible difference with RIFLEx connected. This matches community experience directly - plenty of people report trying it and seeing nothing change, particularly on shots with complex or non-repeating motion. It seems to help most on simple, fairly repetitive motion where the subject stays in frame; it's much less reliable when the subject enters, leaves, or changes significantly over the clip.
A flash or glitch in the first several frames of an otherwise-long clip. This is a reported artifact of pushing RIFLEx hard, not something you did wrong. If it's showing up, try a lower riflex_k before assuming your workflow is broken.
Not sure if this is even the right tool for a longer video. If you need genuinely long, coherent output rather than just squeezing a few extra frames out of one generation, the more reliable community approach is chaining separate generations - using each clip's last frame as the next one's starting image - rather than relying on RIFLEx to stretch a single pass. RIFLEx is worth trying for modest extensions (say, past 81 toward 121 frames); it's not a substitute for proper extension workflows if you need 10+ seconds of coherent motion.
No corresponding node for CogVideoX-Fun. Correct - riflex_k is only wired into the Wan-family samplers in this pack; the CogVideoXFun samplers don't expose it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| riflex_k | INT | 60–10086 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| riflex_k | RIFLEXT_ARGS | — |