Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
-
from diffusers import DiffusionPipeline
|
3 |
import torch
|
4 |
from gradio_client import Client
|
5 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
|
6 |
if torch.cuda.is_available(): pipe.to("cuda")
|
7 |
client = Client("stabilityai/triposr")
|
|
|
8 |
|
9 |
|
10 |
ABOUT_TEXT = """
|
@@ -16,7 +16,24 @@ For image-to-3D, use [TripoSR](https://huggingface.co/spaces/stabilityai/TripoSR
|
|
16 |
""".strip()
|
17 |
def generate(text):
|
18 |
# generate image
|
19 |
-
image =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
# preprocess
|
21 |
result = client.predict(
|
22 |
image,
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import torch
|
3 |
from gradio_client import Client
|
4 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
|
5 |
if torch.cuda.is_available(): pipe.to("cuda")
|
6 |
client = Client("stabilityai/triposr")
|
7 |
+
sdxl = Client("hysts/SD-XL")
|
8 |
|
9 |
|
10 |
ABOUT_TEXT = """
|
|
|
16 |
""".strip()
|
17 |
def generate(text):
|
18 |
# generate image
|
19 |
+
image = sdxl.predict(
|
20 |
+
text,
|
21 |
+
"",
|
22 |
+
"",
|
23 |
+
"",
|
24 |
+
False,
|
25 |
+
False,
|
26 |
+
False,
|
27 |
+
0,
|
28 |
+
1024,
|
29 |
+
1024,
|
30 |
+
5,
|
31 |
+
5,
|
32 |
+
25,
|
33 |
+
25,
|
34 |
+
False, # bool in 'Apply refiner' Checkbox component
|
35 |
+
api_name="/run"
|
36 |
+
)
|
37 |
# preprocess
|
38 |
result = client.predict(
|
39 |
image,
|