Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from diffusers import DiffusionPipeline
|
|
7 |
import torch
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
-
model_repo_id = "
|
11 |
|
12 |
if torch.cuda.is_available():
|
13 |
torch_dtype = torch.float16
|
@@ -64,7 +64,7 @@ css = """
|
|
64 |
}
|
65 |
"""
|
66 |
|
67 |
-
with gr.Blocks(css=css) as
|
68 |
with gr.Column(elem_id="col-container"):
|
69 |
gr.Markdown(" # Text-to-Image Gradio Template")
|
70 |
|
@@ -150,5 +150,10 @@ with gr.Blocks(css=css) as demo:
|
|
150 |
outputs=[result, seed],
|
151 |
)
|
152 |
|
|
|
|
|
|
|
|
|
|
|
153 |
if __name__ == "__main__":
|
154 |
demo.launch()
|
|
|
7 |
import torch
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
+
model_repo_id = "myxlmynx/cyberrealistic_classic40" # Replace to the model you would like to use
|
11 |
|
12 |
if torch.cuda.is_available():
|
13 |
torch_dtype = torch.float16
|
|
|
64 |
}
|
65 |
"""
|
66 |
|
67 |
+
with gr.Blocks(css=css) as demo_cpu:
|
68 |
with gr.Column(elem_id="col-container"):
|
69 |
gr.Markdown(" # Text-to-Image Gradio Template")
|
70 |
|
|
|
150 |
outputs=[result, seed],
|
151 |
)
|
152 |
|
153 |
+
|
154 |
+
demo_inference = gr.load(model_repo_id, src='model')
|
155 |
+
|
156 |
+
demo = gr.TabbedInterface([demo_inference, demo_cpu], ["Inference API", "CPU"])
|
157 |
+
|
158 |
if __name__ == "__main__":
|
159 |
demo.launch()
|