Commit
·
ea7f8c4
1
Parent(s):
3a1812f
28. Sept. 2024, 12:25
Browse files
app.py
CHANGED
@@ -1,12 +1,21 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
import cv2
|
3 |
import numpy as np
|
4 |
|
5 |
from annotator.util import resize_image, HWC3
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
title = "ControlNet v1.1 Preprocessors Standalone"
|
8 |
|
9 |
|
|
|
10 |
model_canny = None
|
11 |
|
12 |
|
@@ -265,7 +274,7 @@ theme = gr.themes.Soft(
|
|
265 |
neutral_hue=gr.themes.Color(c100="#a6adc8", c200="#9399b2", c300="#7f849c", c400="#6c7086", c50="#cdd6f4", c500="#585b70", c600="#45475a", c700="#313244", c800="#1e1e2e", c900="#181825", c950="#11111b"),
|
266 |
)
|
267 |
|
268 |
-
with gr.Blocks(theme=theme, css=
|
269 |
with gr.Row(elem_classes="row-header"):
|
270 |
gr.Markdown(
|
271 |
f"""
|
|
|
1 |
+
import os, sys, time, random, shutil, json, re
|
2 |
import gradio as gr
|
3 |
import cv2
|
4 |
import numpy as np
|
5 |
|
6 |
from annotator.util import resize_image, HWC3
|
7 |
|
8 |
+
RES = os.path.join(os.path.dirname(__file__), "_res")
|
9 |
+
|
10 |
+
gr.set_static_paths(paths=["_res", "_res/assets/"])
|
11 |
+
|
12 |
+
custom_css = RES + "/_custom.css"
|
13 |
+
custom_js = RES + "/_custom.js"
|
14 |
+
|
15 |
title = "ControlNet v1.1 Preprocessors Standalone"
|
16 |
|
17 |
|
18 |
+
|
19 |
model_canny = None
|
20 |
|
21 |
|
|
|
274 |
neutral_hue=gr.themes.Color(c100="#a6adc8", c200="#9399b2", c300="#7f849c", c400="#6c7086", c50="#cdd6f4", c500="#585b70", c600="#45475a", c700="#313244", c800="#1e1e2e", c900="#181825", c950="#11111b"),
|
275 |
)
|
276 |
|
277 |
+
with gr.Blocks(theme=theme, css=custom_css, js=custom_js) as demo:
|
278 |
with gr.Row(elem_classes="row-header"):
|
279 |
gr.Markdown(
|
280 |
f"""
|