wyjlu commited on
Commit
5146a97
·
verified ·
1 Parent(s): 8e43c83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -50,7 +50,7 @@ def list_images(folder: Path):
50
 
51
 
52
  def build_example_rows():
53
- """Build up to 3 (content, style, seed) example rows."""
54
  base = Path(__file__).parent
55
  image_exts = (".jpg", ".jpeg", ".png", ".webp", ".JPG", ".JPEG", ".PNG", ".WEBP")
56
  root_images = sorted([p for p in base.iterdir() if p.is_file() and p.suffix in image_exts])
@@ -70,12 +70,12 @@ def build_example_rows():
70
 
71
  paired_keys = sorted(set(content_map.keys()) & set(style_map.keys()))
72
  if paired_keys:
73
- return [[content_map[k], style_map[k], 1] for k in paired_keys[:3]]
74
 
75
  # Fallback: pair by sorted order if using generic names.
76
  content_files = [str(p) for p in root_images if p.stem.lower().startswith("content")]
77
  style_files = [str(p) for p in root_images if p.stem.lower().startswith("style")]
78
- n = min(3, len(content_files), len(style_files))
79
  return [[content_files[i], style_files[i], 1] for i in range(n)]
80
 
81
 
@@ -272,7 +272,7 @@ with gr.Blocks() as demo:
272
  fn=infer,
273
  cache_examples=False,
274
  run_on_click=True,
275
- examples_per_page=3,
276
  )
277
  else:
278
  gr.Markdown(
 
50
 
51
 
52
  def build_example_rows():
53
+ """Build up to 4 (content, style, seed) example rows."""
54
  base = Path(__file__).parent
55
  image_exts = (".jpg", ".jpeg", ".png", ".webp", ".JPG", ".JPEG", ".PNG", ".WEBP")
56
  root_images = sorted([p for p in base.iterdir() if p.is_file() and p.suffix in image_exts])
 
70
 
71
  paired_keys = sorted(set(content_map.keys()) & set(style_map.keys()))
72
  if paired_keys:
73
+ return [[content_map[k], style_map[k], 1] for k in paired_keys[:4]]
74
 
75
  # Fallback: pair by sorted order if using generic names.
76
  content_files = [str(p) for p in root_images if p.stem.lower().startswith("content")]
77
  style_files = [str(p) for p in root_images if p.stem.lower().startswith("style")]
78
+ n = min(4, len(content_files), len(style_files))
79
  return [[content_files[i], style_files[i], 1] for i in range(n)]
80
 
81
 
 
272
  fn=infer,
273
  cache_examples=False,
274
  run_on_click=True,
275
+ examples_per_page=4,
276
  )
277
  else:
278
  gr.Markdown(