Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,6 +20,11 @@ pipe = pipe.to(device)
|
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
| 21 |
MAX_IMAGE_SIZE = 1024
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
| 25 |
def infer(
|
|
@@ -68,6 +73,16 @@ with gr.Blocks(css=css) as demo:
|
|
| 68 |
with gr.Column(elem_id="col-container"):
|
| 69 |
gr.Markdown(" # Text-to-Image Gradio Template")
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
with gr.Row():
|
| 72 |
prompt = gr.Text(
|
| 73 |
label="Prompt",
|
|
|
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
| 21 |
MAX_IMAGE_SIZE = 1024
|
| 22 |
|
| 23 |
+
MODELS = [
|
| 24 |
+
"stabilityai/sdxl-turbo",
|
| 25 |
+
"CompVis/stable-diffusion-v1-4"
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
|
| 29 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
| 30 |
def infer(
|
|
|
|
| 73 |
with gr.Column(elem_id="col-container"):
|
| 74 |
gr.Markdown(" # Text-to-Image Gradio Template")
|
| 75 |
|
| 76 |
+
|
| 77 |
+
with gr.Row():
|
| 78 |
+
model_dropdown = gr.Dropdown(
|
| 79 |
+
choices=list(MODELS.keys()),
|
| 80 |
+
value=DEFAULT_MODEL,
|
| 81 |
+
label="Select Model",
|
| 82 |
+
info="Choose which diffusion model to use"
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
|
| 86 |
with gr.Row():
|
| 87 |
prompt = gr.Text(
|
| 88 |
label="Prompt",
|