CogVideo
CogVideo copied to clipboard
looping video
Feature request / 功能建议
Does anyone know if it is possible to force the video to loop seamlessly?
Motivation / 动机
Would be a great feature for posting short videos
Your contribution / 您的贡献
I might be able to implement this with some guidance would gladly contribute this back to the project.
Could you describe it in more detail? Are you trying to extend the video by continuously generating 6-second segments and stitching them together into a longer video? :)
Well - I meant something like this 😉
If interested, I can try to clean this up a bit and submit it as a pull request as a pipeline option or maybe just a standalone demo using callback_on_step_end.
That sounds interesting! Are you connecting the first and last frames of a video to create a 6-second looping animation? If so, I’d be happy to contribute a pull request (PR) as a tool! Looking forward to collaborating.
If interested, I can try to clean this up a bit and submit it as a pull request as a pipeline option or maybe just a standalone demo using callback_on_step_end.
looks great! came looking for the same
looks great! came looking for the same
Thanks - my version is a quick hack, but I cleaned it up a bit and pushed it to a with_looping branch in my fork in case anyone wants to use it as a starting point. There's a utility called cli_demo_loop.py that will create videos that more or less match at the beginning and end. Here's a few examples:
python cli_demo_loop.py --prompt "A couple are having dinner together."
python cli_demo_loop.py --prompt "A woman is running on the beach in the late afternoon."
python cli_demo_loop.py --prompt "A lion is drinking water."
There's still some glitchiness at the seam and depending on the prompt you might get only an approximate match. For example:
python cli_demo_loop.py --prompt "A man is skiing."
or it might not match at all and just insert a cut frame 🤷♂️
python cli_demo_loop.py --prompt "Nightfall in a metropolis."
but when it does work it's pretty neat. I might come back to it and refine it or happy to discuss & improve it with anyone.
https://github.com/feizc/CogvideX-Interpolation/tree/main?tab=readme-ov-file