Spaces:
Build error
Build error
smdbs commited on
Commit ·
7e131c5
1
Parent(s): 66d8db1
feat: add examples
Browse files
app.py
CHANGED
|
@@ -45,6 +45,7 @@ def sd_2_1_base(
|
|
| 45 |
num_inference_steps: int,
|
| 46 |
width: int,
|
| 47 |
height: int,
|
|
|
|
| 48 |
) -> Tuple[Union[np.ndarray, Image.Image, str, Path, None], int]:
|
| 49 |
if randomize_seed:
|
| 50 |
seed = np.random.randint(0, MAX_SEED)
|
|
@@ -145,11 +146,20 @@ with gr.Blocks() as ui:
|
|
| 145 |
step=1,
|
| 146 |
value=28,
|
| 147 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
with gr.Column():
|
| 149 |
is_local = gr.Checkbox(
|
| 150 |
label="Check this box to use a local model 🖥️",
|
| 151 |
)
|
| 152 |
img_out = gr.Image(label="Generated Image")
|
|
|
|
| 153 |
gr.HTML(
|
| 154 |
f"<p style='text-align: center;'>This app uses the <a href='https://huggingface.co/{model_name}'>{model_name}</a> model.</p>"
|
| 155 |
)
|
|
|
|
| 45 |
num_inference_steps: int,
|
| 46 |
width: int,
|
| 47 |
height: int,
|
| 48 |
+
progress: gr.Progress = gr.Progress(track_tqdm=True),
|
| 49 |
) -> Tuple[Union[np.ndarray, Image.Image, str, Path, None], int]:
|
| 50 |
if randomize_seed:
|
| 51 |
seed = np.random.randint(0, MAX_SEED)
|
|
|
|
| 146 |
step=1,
|
| 147 |
value=28,
|
| 148 |
)
|
| 149 |
+
gr.Examples(
|
| 150 |
+
examples=[
|
| 151 |
+
"Cat in the forest",
|
| 152 |
+
"Cat flying in the sky",
|
| 153 |
+
"Cat in the desert",
|
| 154 |
+
],
|
| 155 |
+
inputs=[prompt],
|
| 156 |
+
)
|
| 157 |
with gr.Column():
|
| 158 |
is_local = gr.Checkbox(
|
| 159 |
label="Check this box to use a local model 🖥️",
|
| 160 |
)
|
| 161 |
img_out = gr.Image(label="Generated Image")
|
| 162 |
+
|
| 163 |
gr.HTML(
|
| 164 |
f"<p style='text-align: center;'>This app uses the <a href='https://huggingface.co/{model_name}'>{model_name}</a> model.</p>"
|
| 165 |
)
|