Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ import torch
|
|
| 9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 10 |
#model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to use
|
| 11 |
model_repo_id = "CompVis/stable-diffusion-v1-4"
|
|
|
|
| 12 |
|
| 13 |
if torch.cuda.is_available():
|
| 14 |
torch_dtype = torch.float16
|
|
@@ -83,13 +84,21 @@ with gr.Blocks(css=css) as demo:
|
|
| 83 |
result = gr.Image(label="Result", show_label=False)
|
| 84 |
|
| 85 |
with gr.Accordion("Advanced Settings", open=False):
|
| 86 |
-
model_repo_id = gr.Text(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
label="Model Id",
|
|
|
|
| 88 |
max_lines=1,
|
| 89 |
placeholder="Choose model",
|
| 90 |
visible=True,
|
| 91 |
value=model_repo_id,
|
| 92 |
-
)
|
| 93 |
|
| 94 |
negative_prompt = gr.Text(
|
| 95 |
label="Negative prompt",
|
|
|
|
| 9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 10 |
#model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to use
|
| 11 |
model_repo_id = "CompVis/stable-diffusion-v1-4"
|
| 12 |
+
model_dropdown = ['stabilityai/sdxl-turbo', 'CompVis/stable-diffusion-v1-4' ]
|
| 13 |
|
| 14 |
if torch.cuda.is_available():
|
| 15 |
torch_dtype = torch.float16
|
|
|
|
| 84 |
result = gr.Image(label="Result", show_label=False)
|
| 85 |
|
| 86 |
with gr.Accordion("Advanced Settings", open=False):
|
| 87 |
+
# model_repo_id = gr.Text(
|
| 88 |
+
# label="Model Id",
|
| 89 |
+
# max_lines=1,
|
| 90 |
+
# placeholder="Choose model",
|
| 91 |
+
# visible=True,
|
| 92 |
+
# value=model_repo_id,
|
| 93 |
+
# )
|
| 94 |
+
model_repo_id = gr.DropDown(
|
| 95 |
label="Model Id",
|
| 96 |
+
choices=model_dropdown,
|
| 97 |
max_lines=1,
|
| 98 |
placeholder="Choose model",
|
| 99 |
visible=True,
|
| 100 |
value=model_repo_id,
|
| 101 |
+
)
|
| 102 |
|
| 103 |
negative_prompt = gr.Text(
|
| 104 |
label="Negative prompt",
|