Update app.py
Browse files
app.py
CHANGED
@@ -2,14 +2,19 @@ from diffusers import StableDiffusionXLPipeline
|
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
|
5 |
-
pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
6 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
7 |
|
8 |
def greet(prompt):
|
9 |
print(prompt)
|
10 |
-
|
11 |
-
print(
|
12 |
-
return
|
13 |
|
14 |
demo = gr.Interface(
|
15 |
fn=greet,
|
|
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
|
5 |
+
pipe = StableDiffusionXLPipeline.from_pretrained(
|
6 |
+
"stabilityai/stable-diffusion-xl-base-1.0",
|
7 |
+
torch_dtype=torch.float16,
|
8 |
+
use_safetensors=True,
|
9 |
+
variant="fp16"
|
10 |
+
)
|
11 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
12 |
|
13 |
def greet(prompt):
|
14 |
print(prompt)
|
15 |
+
image = pipe(prompt).images[0]
|
16 |
+
print(image)
|
17 |
+
return image
|
18 |
|
19 |
demo = gr.Interface(
|
20 |
fn=greet,
|