Spaces:
Running
Running
Update stable_cascade.py
Browse files- stable_cascade.py +2 -9
stable_cascade.py
CHANGED
@@ -2,17 +2,10 @@ import torch, os
|
|
2 |
from diffusers import StableCascadeDecoderPipeline, StableCascadePriorPipeline
|
3 |
import gradio as gr
|
4 |
|
5 |
-
torch._dynamo.config.suppress_errors = True
|
6 |
os.environ['TOKENIZERS_PARALLELISM'] = 'false'
|
7 |
|
8 |
-
prior = StableCascadePriorPipeline.from_pretrained("stabilityai/stable-cascade-prior", torch_dtype=torch.bfloat16)
|
9 |
-
decoder = StableCascadeDecoderPipeline.from_pretrained("stabilityai/stable-cascade", torch_dtype=torch.bfloat16)
|
10 |
-
|
11 |
-
prior.prior = torch.compile(prior.prior, mode="reduce-overhead", fullgraph=True)
|
12 |
-
decoder.decoder = torch.compile(decoder.decoder, mode="max-autotune", fullgraph=True)
|
13 |
-
|
14 |
-
prior.to("cuda")
|
15 |
-
decoder.to("cuda")
|
16 |
|
17 |
def generate_images(
|
18 |
prompt="a photo of a girl",
|
|
|
2 |
from diffusers import StableCascadeDecoderPipeline, StableCascadePriorPipeline
|
3 |
import gradio as gr
|
4 |
|
|
|
5 |
os.environ['TOKENIZERS_PARALLELISM'] = 'false'
|
6 |
|
7 |
+
prior = StableCascadePriorPipeline.from_pretrained("stabilityai/stable-cascade-prior", torch_dtype=torch.bfloat16).to("cuda")
|
8 |
+
decoder = StableCascadeDecoderPipeline.from_pretrained("stabilityai/stable-cascade", torch_dtype=torch.bfloat16.to("cuda")
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
def generate_images(
|
11 |
prompt="a photo of a girl",
|