Spaces:
Runtime error
Runtime error
Add SD v1.5
Browse files
app.py
CHANGED
@@ -8,7 +8,9 @@ import torch
|
|
8 |
from torch import autocast
|
9 |
|
10 |
from transformers import pipeline, set_seed
|
11 |
-
from diffusers import StableDiffusionPipeline
|
|
|
|
|
12 |
|
13 |
# GPT2
|
14 |
generator = pipeline('text-generation', model='gpt2')
|
@@ -19,4 +21,7 @@ generator("Hello world, I'm vizard,", max_length=50, num_return_sequences=3)
|
|
19 |
# SD v1.4
|
20 |
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True, revision="fp16", torch_dtype=torch.float16)
|
21 |
pipe = pipe.to(device)
|
22 |
-
torch.backends.cudnn.benchmark = True
|
|
|
|
|
|
|
|
8 |
from torch import autocast
|
9 |
|
10 |
from transformers import pipeline, set_seed
|
11 |
+
from diffusers import DiffusionPipeline, StableDiffusionPipeline
|
12 |
+
|
13 |
+
|
14 |
|
15 |
# GPT2
|
16 |
generator = pipeline('text-generation', model='gpt2')
|
|
|
21 |
# SD v1.4
|
22 |
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True, revision="fp16", torch_dtype=torch.float16)
|
23 |
pipe = pipe.to(device)
|
24 |
+
torch.backends.cudnn.benchmark = True
|
25 |
+
|
26 |
+
# SD v1.5
|
27 |
+
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|