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

Multiple number of prompts and seeds #111

Closed tralala87 closed 1 year ago

tralala87 commented 1 year ago

Hi. First, thank you so much for this amazing repo! Second, looking at: prompts=['a cat', 'a dog'], seeds=[42, 1337], if I want to use 20+ number of prompts, how do I get seeds for that? Is there somehow I can just use general code, which would generate random seeds depending on the number of prompts? Where do I write that and what do I write?

nateraw commented 1 year ago

If I understand correctly, you want a list of random seeds generated for the given number of prompts in your list? If so, this is one way you could do that:

import random

prompts = ['a cat', 'a dog', 'a bird', 'a mouse']
seeds = [random.randrange(9e9) for _ in prompts]
print(seeds)
# [474227052, 304952392, 1281923936, 1052805215]
tralala87 commented 1 year ago

Thank you so much! Now I get NameError: name 'prompts' is not defined .. Have no clue why :)

nateraw commented 1 year ago

Sounds like you didn't provide prompts/didn't define prompts. you can send your full code if you can't figure it out

tralala87 commented 1 year ago

Never mind the comment, it works :) Just had to clean up the whole code and notebook. Thank you again!