Skip to content

Commit

Permalink
Merge pull request #4 from nateraw/revert-3-package
Browse files Browse the repository at this point in the history
Revert "add pypi package"
  • Loading branch information
nateraw authored Sep 7, 2022
2 parents 6e3ec16 + 969b94e commit 7d349cf
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 1,462 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/python-publish.yml

This file was deleted.

52 changes: 25 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,41 @@ The app is built with [Gradio](https://gradio.app/), which allows you to interac
- Set the `num_walk_steps` - for testing you can use a small number like 3 or 5, but to get great results you'll want to use something larger (60-200 steps).
- You can (and should) use the `name` input to separate out where the images/videos are saved. (Note that currently ffmpeg will not overwrite if you already made a video with the same name. You'll have to use ffmpeg to create the video yourself if the app fails to do so.)

### Python Package
### The Script

#### Setup

Install the package

```
pip install stable_diffusion_videos
```

Authenticate with Hugging Face

```
huggingface-cli login
git clone https://github.com/nateraw/stable-diffusion-videos
cd stable-diffusion-videos
pip install -r requirements.txt
```

#### Usage

```python
from stable_diffusion_videos import walk

walk(
prompts=['a cat', 'a dog'],
seeds=[42, 1337],
output_dir='dreams', # Where images/videos will be saved
name='animals_test', # Subdirectory of output_dir where images/videos will be saved
guidance_scale=8.5, # Higher adheres to prompt more, lower lets model take the wheel
num_steps=5, # Change to 60-200 for better results...3-5 for testing
num_inference_steps=50,
scheduler='klms', # One of: "klms", "default", "ddim"
disable_tqdm=False, # Set to True to disable tqdm progress bar
make_video=True, # If false, just save images
use_lerp_for_text=True, # Use lerp for text embeddings instead of slerp
do_loop=False, # Change to True if you want last prompt to loop back to first prompt
)
If you would prefer to use the `stable_diffusion_walk.py` script directly, you can do so by running:

Run with `num_steps` set to 3 or 5 for testing, then up it to something like 60-200 for better results.

```bash
python stable_diffusion_walk.py \
--prompts "['a cat', 'a dog', 'a horse']" \
--seeds 903,123,42 \
--output_dir dreams \
--name animals_test \
--guidance_scale 8.5 \
--num_steps 5 \
--height 512 \
--width 512 \
--num_inference_steps 50 \
--scheduler klms \
--disable_tqdm \
--make_video \
--use_lerp_for_text \
--do_loop
```


## Credits

This work built off of [a script](https://gist.github.com/karpathy/00103b0037c5aaea32fe1da1af553355
Expand Down
2 changes: 1 addition & 1 deletion stable_diffusion_videos/app.py → app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gradio as gr
import torch

from .stable_diffusion_walk import SCHEDULERS, pipeline, walk
from stable_diffusion_walk import SCHEDULERS, pipeline, walk


def fn_images(
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
transformers
diffusers @ git+https://github.com/huggingface/diffusers@f085d2f5c6569a1c0d90327c51328622036ef76e
git+https://github.com/huggingface/diffusers@f085d2f5c6569a1c0d90327c51328622036ef76e
scipy
fire
gradio
28 changes: 0 additions & 28 deletions setup.py

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 7d349cf

Please sign in to comment.