Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,17 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
|
4 |
gr.Interface.load("models/nan2/lcbanner").launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import torch
|
3 |
+
from torch import autocast
|
4 |
+
from diffusers import StableDiffusionPipeline
|
5 |
+
|
6 |
+
#model_id = "hakurei/waifu-diffusion"
|
7 |
+
pipe = StableDiffusionPipeline.from_pretrained("hakurei/waifu-diffusion", torch_type=torch.float16, revision="fp16")
|
8 |
+
pipe = pipe.to("cuda")
|
9 |
+
#torch.backends.cudnn.benchmark = True
|
10 |
+
num_samples = 2
|
11 |
+
|
12 |
+
def infer(prompt):
|
13 |
+
images = pipe([prompt] * num_samples, guidance_scale=7.5)["sample"]
|
14 |
+
return images
|
15 |
|
16 |
|
17 |
gr.Interface.load("models/nan2/lcbanner").launch()
|