Commit
·
22ca749
1
Parent(s):
e28c066
Update app.py
Browse files
app.py
CHANGED
@@ -5,63 +5,22 @@ from __future__ import annotations
|
|
5 |
import gradio as gr
|
6 |
import torch
|
7 |
|
8 |
-
|
9 |
-
from app_depth import create_demo as create_demo_depth
|
10 |
-
from app_ip2p import create_demo as create_demo_ip2p
|
11 |
-
from app_lineart import create_demo as create_demo_lineart
|
12 |
-
from app_mlsd import create_demo as create_demo_mlsd
|
13 |
-
from app_normal import create_demo as create_demo_normal
|
14 |
-
from app_openpose import create_demo as create_demo_openpose
|
15 |
from app_scribble import create_demo as create_demo_scribble
|
16 |
-
from app_scribble_interactive import \
|
17 |
-
create_demo as create_demo_scribble_interactive
|
18 |
-
from app_segmentation import create_demo as create_demo_segmentation
|
19 |
-
from app_shuffle import create_demo as create_demo_shuffle
|
20 |
-
from app_softedge import create_demo as create_demo_softedge
|
21 |
from model import Model
|
22 |
from settings import (ALLOW_CHANGING_BASE_MODEL, DEFAULT_MODEL_ID,
|
23 |
SHOW_DUPLICATE_BUTTON)
|
24 |
|
25 |
-
DESCRIPTION = '# ControlNet v1.1'
|
26 |
|
27 |
-
|
28 |
-
DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
|
29 |
|
30 |
model = Model(base_model_id=DEFAULT_MODEL_ID, task_name='Canny')
|
31 |
|
32 |
-
with gr.Blocks(css='style.css') as demo:
|
33 |
gr.Markdown(DESCRIPTION)
|
34 |
-
|
35 |
-
elem_id='duplicate-button',
|
36 |
-
visible=SHOW_DUPLICATE_BUTTON)
|
37 |
-
|
38 |
-
with gr.Tabs():
|
39 |
-
with gr.TabItem('Canny'):
|
40 |
-
create_demo_canny(model.process_canny)
|
41 |
-
with gr.TabItem('MLSD'):
|
42 |
-
create_demo_mlsd(model.process_mlsd)
|
43 |
-
with gr.TabItem('Scribble'):
|
44 |
-
create_demo_scribble(model.process_scribble)
|
45 |
-
with gr.TabItem('Scribble Interactive'):
|
46 |
-
create_demo_scribble_interactive(
|
47 |
-
model.process_scribble_interactive)
|
48 |
-
with gr.TabItem('SoftEdge'):
|
49 |
-
create_demo_softedge(model.process_softedge)
|
50 |
-
with gr.TabItem('OpenPose'):
|
51 |
-
create_demo_openpose(model.process_openpose)
|
52 |
-
with gr.TabItem('Segmentation'):
|
53 |
-
create_demo_segmentation(model.process_segmentation)
|
54 |
-
with gr.TabItem('Depth'):
|
55 |
-
create_demo_depth(model.process_depth)
|
56 |
-
with gr.TabItem('Normal map'):
|
57 |
-
create_demo_normal(model.process_normal)
|
58 |
-
with gr.TabItem('Lineart'):
|
59 |
-
create_demo_lineart(model.process_lineart)
|
60 |
-
with gr.TabItem('Content Shuffle'):
|
61 |
-
create_demo_shuffle(model.process_shuffle)
|
62 |
-
with gr.TabItem('Instruct Pix2Pix'):
|
63 |
-
create_demo_ip2p(model.process_ip2p)
|
64 |
|
|
|
65 |
with gr.Accordion(label='Base model', open=False):
|
66 |
with gr.Row():
|
67 |
with gr.Column(scale=5):
|
@@ -103,5 +62,6 @@ with gr.Blocks(css='style.css') as demo:
|
|
103 |
outputs=current_base_model,
|
104 |
api_name=False,
|
105 |
)
|
|
|
106 |
|
107 |
demo.queue(max_size=20).launch()
|
|
|
5 |
import gradio as gr
|
6 |
import torch
|
7 |
|
8 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
from app_scribble import create_demo as create_demo_scribble
|
|
|
|
|
|
|
|
|
|
|
10 |
from model import Model
|
11 |
from settings import (ALLOW_CHANGING_BASE_MODEL, DEFAULT_MODEL_ID,
|
12 |
SHOW_DUPLICATE_BUTTON)
|
13 |
|
|
|
14 |
|
15 |
+
DESCRIPTION = '# Sketch to Image 🖼️'
|
|
|
16 |
|
17 |
model = Model(base_model_id=DEFAULT_MODEL_ID, task_name='Canny')
|
18 |
|
19 |
+
with gr.Blocks(css='style.css', theme=gr.themes.Soft()) as demo:
|
20 |
gr.Markdown(DESCRIPTION)
|
21 |
+
create_demo_scribble(model.process_scribble)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
+
"""
|
24 |
with gr.Accordion(label='Base model', open=False):
|
25 |
with gr.Row():
|
26 |
with gr.Column(scale=5):
|
|
|
62 |
outputs=current_base_model,
|
63 |
api_name=False,
|
64 |
)
|
65 |
+
"""
|
66 |
|
67 |
demo.queue(max_size=20).launch()
|