ze=1` will decode one frame at a time and will use the least amount of memory but the video might have some flickering.
Additionally, we also use model cpu offloading to reduce the memory usage.  Torch.compile You can achieve a 20-25% speed-up at the expense of slightly increased memory by compiling the UNet as follows:   Copied - pipe.enable_model_cpu_offload()
+ pipe.to("cuda")
+ pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fu