nateraw / stable-diffusion-videos

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

Add Replicate demo and API #9

Open chenxwh opened 2 years ago

chenxwh commented 2 years ago

Hey @nateraw ! 👋

Great implementation for the stable-diffusion videos!

This pull request makes it possible to run your model inside a Docker environment, which makes it easier for other people to run it. We're using an open source tool called Cog to make this process easier.

This also means we can make a web page where other people can run your model! View it here: https://replicate.com/nateraw/stable-diffusion-videos

Replicate also have an API, so people can easily run your model from their code:

import replicate
model = replicate.models.get("nateraw/stable-diffusion-videos")
output = model.predict(prompts="a cat | a dog | a horse")

We noticed you have registered Replicate account, do claim the page so modify the demo, push any updates to it!

In case you're wondering who I am, I'm from Replicate, where we're trying to make machine learning reproducible. We got frustrated that we couldn't run all the really interesting ML work being done. So, we're going round implementing models we like. 😊

nateraw commented 2 years ago

Hey there! Does this still work given the changes that were made yesterday? I updated to pin diffusers to stable pypi version, among a couple other updates. The package is now pip installable: pip install stable_diffusion_videos.

chenxwh commented 2 years ago

Hi! Ah I probably implemented the version before your update yesterday- basically the predict.py is the code used for the web demo, you can update the demo by claiming the page and with cog login (gives you permission to push) then cog push r8.im/nateraw/stable-diffusion-videos.

The demo now is hosted on A100 for faster inference. We can feature it to the front page once you claim the page which makes it 'public', you can see the popular models featured on Replicate here.

I can also help to update the demo to the latest version used in your repo. Let me know!

chenxwh commented 2 years ago

Hi thanks for reviewing the PR, sorry for not having checked all the unused import. Yes the weights are loaded to the cache folder in the image before pushing to the website, so no need to download it and the demo can start faster. The download-weight.py just puts the weights to the folder, no need to run with cog, and probably no need to add to the repo as long as it is mentioned somewhere that the weights are expected.

Thanks again!