-
Notifications
You must be signed in to change notification settings - Fork 434
/
Copy pathrun_app.py
25 lines (19 loc) · 805 Bytes
/
run_app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from stable_diffusion_videos import StableDiffusionWalkPipeline, Interface
from diffusers.models import AutoencoderKL
from diffusers.schedulers import LMSDiscreteScheduler
from diffusers.utils.import_utils import is_xformers_available
import torch
pipe = StableDiffusionWalkPipeline.from_pretrained(
'runwayml/stable-diffusion-v1-5',
torch_dtype=torch.float16,
safety_checker=None,
vae=AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16).to("cuda"),
scheduler=LMSDiscreteScheduler(
beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear"
)
).to("cuda")
if is_xformers_available():
pipe.enable_xformers_memory_efficient_attention()
interface = Interface(pipe)
if __name__ == '__main__':
interface.launch(debug=True)