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

How do the parameters frame_window_size and frame_window_stride work? #110

Open
jsjtczh opened this issue Sep 13, 2024 · 5 comments
Open

Comments

@jsjtczh
Copy link

jsjtczh commented Sep 13, 2024

I reviewed the code and couldn't find any implementation related to these two parameters. How do they work?

@kijai
Copy link
Owner

kijai commented Sep 13, 2024

It's for extending the text2video models, window size is the context window size, if you have used AnimateDiff it's the same concept. You set the window size to what the model is trained for, then you set max frames to whatever you want (and what you can fit into your available VRAM).

@jsjtczh
Copy link
Author

jsjtczh commented Sep 13, 2024

It's for extending the text2video models, window size is the context window size, if you have used AnimateDiff it's the same concept. You set the window size to what the model is trained for, then you set max frames to whatever you want (and what you can fit into your available VRAM).

Thank you for your reply. I'm just curious about how the code is implemented. The DDIMSampler doesn't seem to have these two parameters. These parameters appear to be included in **kwargs. So, are they implemented in self.model.apply_model?

@jsjtczh
Copy link
Author

jsjtczh commented Sep 13, 2024

BTW, if frame_window_size=16 and frame_window_stride=4, it means two consecutive clips have 12 frames in common?

@kijai
Copy link
Owner

kijai commented Sep 13, 2024

The code is actually in the attention code, this is work of @painebenjamin which he graciously shared in this PR: #20

@jsjtczh
Copy link
Author

jsjtczh commented Sep 13, 2024

The code is actually in the attention code, this is work of @painebenjamin which he graciously shared in this PR: #20

Thank you so much! I found the code. In the case of frame_window_size=16 and frame_window_stride=4, the overlap is 12.

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

No branches or pull requests

2 participants