Skip to content

Instantly share code, notes, and snippets.

@nateraw
Created February 18, 2023 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nateraw/abaf9f6359ca90e3c95f2e1006011bd6 to your computer and use it in GitHub Desktop.
Save nateraw/abaf9f6359ca90e3c95f2e1006011bd6 to your computer and use it in GitHub Desktop.
sdv-SD2-1-example.ipynb
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@quintendewilde
Copy link

Love this!
Question how would I make my video's longer?

Kind regards!!

@nateraw
Copy link
Author

nateraw commented Feb 21, 2023

Hey there, glad ya like it :)

There are a number of ways to make the video longer. Your video is generated with num_frames = num_interpolation_steps * (len(prompts) - 1) frames, and the video duration is num_frames / fps seconds long.

So...

  • can add more prompts/seeds
  • can increase num_interpolation steps
  • can decrease FPS (this is really just making the video slower but longer in duration as its same number of frames

For example, the following would produce num_frames = 30 * 4 (120) frames at 30fps, so 4 seconds long with decent quality.

prompts=['a cat', 'a dog', 'a bird', 'a horse', 'a camel']
seeds = [0, 1, 2, 3, 4]  # Set to anything you want, or random numbers. must be same len as prompts
pipe.walk(prompts=prompts, seeds=seeds, num_interpolation_steps=30, num_inference_steps=50, fps=30)

@quintendewilde
Copy link

quintendewilde commented Feb 21, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment