This fixes an edge case in the FlowUniPCMultistepScheduler where using high sampling step counts (> 50) would cause an assertion error in the last step. The issue was that with lower_order_final=True, the order calculation could become 0 when step_index equals len(timesteps), causing 'assert self.this_order > 0' to fail.
The fix ensures this_order is always at least 1, maintaining stability while allowing higher quality generation with increased step counts.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
* Update text2video.py to reduce GPU memory by emptying cache
If offload_model is set, empty_cache() must be called after the model is moved to CPU to actually free the GPU. I verified on a RTX 4090 that without calling empty_cache the model remains in memory and the subsequent vae decoding never finishes.
* Update text2video.py only one empty_cache needed before vae decode