nateraw / stable-diffusion-videos

Create 🔥 videos with Stable Diffusion by exploring the latent space and morphing between text prompts
Apache License 2.0
4.36k stars 417 forks source link

Interpolate newly generated upsampled images #112

Open tralala87 opened 1 year ago

tralala87 commented 1 year ago

Hi :)

Sorry to open another issue, but after I have 4x upsampled all folders with pictures, how do I interpolate them? Originally I had 6 folders of roughly 50 images (acquired from running "Making Videos"), which together formed a final mp4 file. But now I have upsampled each of those folders and would like to interpolate between all those pictures (6x50=300) to get the final mp4 file, just like original. Or just interpolate between all new upsampled images in a single folder.

nateraw commented 1 year ago

can you describe the full directory structure? should be able to use stable_diffusion_videos.make_video_pyav to do this in one line of code.

tralala87 commented 1 year ago

\stable-diffusion\output_dir\test --> is the main folder with many smaller folders:

nateraw commented 1 year ago

Sorry for late reply...commenting in case you/others having issue still with this...

I don't think you're interpolating here, eh? Since you already generated the interpolated images. If you want to put together all the clips, you can use that function I mentioned above.

from stable_diffusion_videos import make_video_pyav

make_video_pyav(
    frames_or_frame_dir='./stable-diffusion/output_dir/test',
    fps=30,  # Or any fps you'd like
    output_filepath="output.mp4", # name it whatever you want
)

The folder names/filenames within of pictures should be named such that when you glob and sort them, they are in the order you want the video to be in. Since you have parts here numbered, I'm assuming the above code would work for ya