ultimaxxl commited on
Commit
ae4669b
·
1 Parent(s): 7266d63

add conditional to display examples

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -241,12 +241,13 @@ with gr.Blocks(title="🌍 ZenCtrl") as demo:
241
  )
242
 
243
  # ---------------- Templates --------------------
244
- gr.Examples(
245
- examples=examples_db.MODE_EXAMPLES.get(mode, []),
246
- inputs=[input_image, prompt_box, output_image],
247
- label="Presets (Input / Prompt / Output)",
248
- examples_per_page=6,
249
- )
 
250
 
251
  if __name__ == "__main__":
252
  demo.launch()
 
241
  )
242
 
243
  # ---------------- Templates --------------------
244
+ if examples_db.MODE_EXAMPLES.get(mode):
245
+ gr.Examples(
246
+ examples=examples_db.MODE_EXAMPLES.get(mode, []),
247
+ inputs=[input_image, prompt_box, output_image],
248
+ label="Presets (Input / Prompt / Output)",
249
+ examples_per_page=6,
250
+ )
251
 
252
  if __name__ == "__main__":
253
  demo.launch()