Use pathlib for examples
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
import shlex
|
3 |
import shutil
|
4 |
import subprocess
|
@@ -285,10 +286,10 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
285 |
output_buf = gr.State()
|
286 |
|
287 |
examples = gr.Examples(
|
288 |
-
examples=
|
289 |
-
inputs=[image_prompt],
|
290 |
fn=preprocess_image,
|
291 |
-
|
|
|
292 |
run_on_click=True,
|
293 |
examples_per_page=64,
|
294 |
)
|
|
|
1 |
import os
|
2 |
+
import pathlib
|
3 |
import shlex
|
4 |
import shutil
|
5 |
import subprocess
|
|
|
286 |
output_buf = gr.State()
|
287 |
|
288 |
examples = gr.Examples(
|
289 |
+
examples=sorted(pathlib.Path("assets/example_image").glob("*.png")),
|
|
|
290 |
fn=preprocess_image,
|
291 |
+
inputs=image_prompt,
|
292 |
+
outputs=image_prompt,
|
293 |
run_on_click=True,
|
294 |
examples_per_page=64,
|
295 |
)
|