ultimaxxl commited on
Commit
3ad4f95
·
1 Parent(s): 578b7b0

Add Example UI

Browse files
Files changed (1) hide show
  1. app.py +22 -13
app.py CHANGED
@@ -2,12 +2,14 @@ import os
2
  import random
3
  import sys
4
  import subprocess
5
- from typing import Sequence, Mapping, Any, Union
6
  import torch
7
  import gradio as gr
 
 
 
8
  from PIL import Image, ImageChops
9
  from huggingface_hub import hf_hub_download
10
- import spaces
11
 
12
  # Setup ComfyUI if not already set up
13
  #if not os.path.exists("ComfyUI"):
@@ -418,17 +420,24 @@ with gr.Blocks(css="footer {visibility: hidden}") as app:
418
 
419
  with gr.Column(scale=1):
420
  output_image = gr.Image(label="Generated Image")
421
-
422
- # gr.Examples(
423
- # examples=[
424
- # ["A beautiful landscape with mountains and a lake", "examples/structure1.jpg", "examples/style1.jpg", 20, 0.4, 0.6, 30],
425
- # ["A cyberpunk cityscape at night", "examples/structure2.jpg", "examples/style2.jpg", 15, 0.35, 0.7, 28],
426
- # ],
427
- # inputs=[prompt_input, structure_image, style_image, depth_strength, canny_strength, style_strength, steps],
428
- # outputs=output_image,
429
- # fn=generate_image,
430
- # cache_examples=True
431
- # )
 
 
 
 
 
 
 
432
 
433
  generate_btn.click(
434
  fn=generate_image,
 
2
  import random
3
  import sys
4
  import subprocess
5
+ import spaces
6
  import torch
7
  import gradio as gr
8
+
9
+ from typing import Sequence, Mapping, Any, Union
10
+ from examples_db import ZEN_EXAMPLES
11
  from PIL import Image, ImageChops
12
  from huggingface_hub import hf_hub_download
 
13
 
14
  # Setup ComfyUI if not already set up
15
  #if not os.path.exists("ComfyUI"):
 
420
 
421
  with gr.Column(scale=1):
422
  output_image = gr.Image(label="Generated Image")
423
+
424
+ gr.Examples(
425
+ examples=ZEN_EXAMPLES,
426
+ inputs=[
427
+ prompt_input,
428
+ structure_image,
429
+ style_image,
430
+ output_image,
431
+ depth_strength,
432
+ canny_strength,
433
+ style_strength,
434
+ steps,
435
+ ],
436
+ fn=generate_image,
437
+ cache_examples=True,
438
+ label="Presets",
439
+ examples_per_page=6
440
+ )
441
 
442
  generate_btn.click(
443
  fn=generate_image,