Update app.py
Browse files
app.py
CHANGED
|
@@ -20,11 +20,11 @@ def get_examples(examples_dir: str = "assets/examples/ghibli-fine-tuned-sd-2.1")
|
|
| 20 |
# Check if the directory exists
|
| 21 |
if not os.path.exists(examples_dir) or not os.path.isdir(examples_dir):
|
| 22 |
raise ValueError(f"Directory {examples_dir} does not exist or is not a directory")
|
| 23 |
-
|
| 24 |
# Get list of subfolder paths (e.g., 1, 2, etc.)
|
| 25 |
all_examples_dir = [os.path.join(examples_dir, d) for d in os.listdir(examples_dir)
|
| 26 |
if os.path.isdir(os.path.join(examples_dir, d))]
|
| 27 |
-
|
| 28 |
ans = []
|
| 29 |
for example_dir in all_examples_dir:
|
| 30 |
config_path = os.path.join(example_dir, "config.json")
|
|
@@ -206,7 +206,7 @@ def create_demo(
|
|
| 206 |
output_image = gr.Image(label="Generated Image")
|
| 207 |
output_text = gr.Textbox(label="Status")
|
| 208 |
|
| 209 |
-
examples = get_examples("assets/examples")
|
| 210 |
gr.Examples(
|
| 211 |
examples=examples,
|
| 212 |
inputs=[prompt, height, width, num_inference_steps, guidance_scale, seed, output_image],
|
|
|
|
| 20 |
# Check if the directory exists
|
| 21 |
if not os.path.exists(examples_dir) or not os.path.isdir(examples_dir):
|
| 22 |
raise ValueError(f"Directory {examples_dir} does not exist or is not a directory")
|
| 23 |
+
|
| 24 |
# Get list of subfolder paths (e.g., 1, 2, etc.)
|
| 25 |
all_examples_dir = [os.path.join(examples_dir, d) for d in os.listdir(examples_dir)
|
| 26 |
if os.path.isdir(os.path.join(examples_dir, d))]
|
| 27 |
+
|
| 28 |
ans = []
|
| 29 |
for example_dir in all_examples_dir:
|
| 30 |
config_path = os.path.join(example_dir, "config.json")
|
|
|
|
| 206 |
output_image = gr.Image(label="Generated Image")
|
| 207 |
output_text = gr.Textbox(label="Status")
|
| 208 |
|
| 209 |
+
examples = get_examples("assets/examples/ghibli-fine-tuned-sd-2.1")
|
| 210 |
gr.Examples(
|
| 211 |
examples=examples,
|
| 212 |
inputs=[prompt, height, width, num_inference_steps, guidance_scale, seed, output_image],
|