Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

looping video #149

Closed
dribnet opened this issue Aug 20, 2024 · 6 comments
Closed

looping video #149

dribnet opened this issue Aug 20, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@dribnet
Copy link

dribnet commented Aug 20, 2024

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.

@zRzRzRzRzRzRzR
Copy link
Member

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? :)

@zRzRzRzRzRzRzR zRzRzRzRzRzRzR self-assigned this Aug 20, 2024
@dribnet
Copy link
Author

dribnet commented Aug 20, 2024

Well - I meant something like this 😉

trimmed

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.

@zRzRzRzRzRzRzR
Copy link
Member

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.

@zRzRzRzRzRzRzR zRzRzRzRzRzRzR added the enhancement New feature or request label Aug 28, 2024
@screan
Copy link

screan commented Sep 2, 2024

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

@dribnet
Copy link
Author

dribnet commented Sep 4, 2024

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."
with_loop_02g

python cli_demo_loop.py --prompt "A woman is running on the beach in the late afternoon."
with_loop_03g

python cli_demo_loop.py --prompt "A lion is drinking water."
with_loop_06g

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."
with_loop_04g

or it might not match at all and just insert a cut frame 🤷‍♂️

python cli_demo_loop.py --prompt "Nightfall in a metropolis."
with_loop_05g

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.

@rodjjo
Copy link
Contributor

rodjjo commented Oct 17, 2024

https://github.com/feizc/CogvideX-Interpolation/tree/main?tab=readme-ov-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants