Spaces:
Running
on
Zero
Running
on
Zero
Add Example UI
Browse files
app.py
CHANGED
|
@@ -2,12 +2,14 @@ import os
|
|
| 2 |
import random
|
| 3 |
import sys
|
| 4 |
import subprocess
|
| 5 |
-
|
| 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 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 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,
|