Efficient batch frame editing - videos. #8167
Symbiomatrix
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I was thinking about this as well, this is definitely the expected way that batch size should behave when doing a batch img2img sequence. I would open a draft PR instead of a discussion though, you're more likely to get more eyes on it then and it would make discussing the code easier with the diff available. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I went over some of the batch processing code last night, and it seems that with a small alteration, img2img's batch mode could load & convert frames en masse, by converting the "batch size" parameter in that mode to essentially "number of frames to be loaded per batch", and storing the correct filenames for the later save. Seems to be just an altered loop in img2img.process_batch. Fixing the seed to be the same across the batch is pretty easy too - the inner processing function can accept a list of seeds & subseeds as is, so it's just a matter of replicating the p.seed & p.subseed properties.
With a good chunk of spare vram, I think it would speed up frame processing a great deal (x2-x3 at least).
Haven't given much thought to inpainting and the myriad other features, so I'm not sure whether that'd break something terribly, but I'm wondering if anyone else has. I tried adapting controlnet's code to frames too, but it gets pretty convoluted with how it handles the preprocessed source image (currently just takes the first of init_images when creating the control image, then sends it off to the hook to do god knows what).
Here's the code for it so far:
Beta Was this translation helpful? Give feedback.
All reactions