danhtran2mind commited on
Commit
9c4b316
·
verified ·
1 Parent(s): 3e0e5da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- print("examples_dir: ", examples_dir)
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
- print("all_examples_dir: ", all_examples_dir)
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],