Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
-
|
4 |
from ominicontrol import generate_image
|
|
|
|
|
5 |
|
6 |
-
USE_ZERO_GPU =
|
7 |
|
8 |
css = """
|
9 |
.inputPanel {
|
@@ -29,12 +30,12 @@ header = """
|
|
29 |
# 🌍 OminiControl Art
|
30 |
<div style="text-align: center; display: flex; justify-content: left; gap: 5px;">
|
31 |
<a href="https://arxiv.org/abs/2411.15098"><img src="https://img.shields.io/badge/ariXv-Paper-A42C25.svg" alt="arXiv"></a>
|
|
|
32 |
<a href="https://github.com/Yuanshi9815/OminiControl"><img src="https://img.shields.io/badge/GitHub-Code-blue.svg?logo=github&" alt="GitHub"></a>
|
33 |
</div>
|
34 |
"""
|
35 |
|
36 |
|
37 |
-
|
38 |
def style_transfer(image, style):
|
39 |
return image
|
40 |
|
@@ -119,6 +120,19 @@ def gradio_interface():
|
|
119 |
height=640,
|
120 |
label="Output Image",
|
121 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
|
123 |
with gr.Row():
|
124 |
examples = gr.Examples(
|
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
|
|
3 |
from ominicontrol import generate_image
|
4 |
+
import os
|
5 |
+
|
6 |
|
7 |
+
USE_ZERO_GPU = os.environ.get("USE_ZERO_GPU", "0") == "1"
|
8 |
|
9 |
css = """
|
10 |
.inputPanel {
|
|
|
30 |
# 🌍 OminiControl Art
|
31 |
<div style="text-align: center; display: flex; justify-content: left; gap: 5px;">
|
32 |
<a href="https://arxiv.org/abs/2411.15098"><img src="https://img.shields.io/badge/ariXv-Paper-A42C25.svg" alt="arXiv"></a>
|
33 |
+
<a href="https://huggingface.co/spaces/Yuanshi/OminiControl"><img src="https://img.shields.io/badge/🤗OminiControl-Demo-ffbd45.svg" alt="HuggingFace"></a>
|
34 |
<a href="https://github.com/Yuanshi9815/OminiControl"><img src="https://img.shields.io/badge/GitHub-Code-blue.svg?logo=github&" alt="GitHub"></a>
|
35 |
</div>
|
36 |
"""
|
37 |
|
38 |
|
|
|
39 |
def style_transfer(image, style):
|
40 |
return image
|
41 |
|
|
|
120 |
height=640,
|
121 |
label="Output Image",
|
122 |
)
|
123 |
+
hint = gr.Markdown(
|
124 |
+
"""
|
125 |
+
<div style="text-align: center; width: 100%;">
|
126 |
+
<b>Note: The selected style is in beta testing.</b> Feel free to try a few more times to get a the better result.
|
127 |
+
</div>
|
128 |
+
""",
|
129 |
+
visible=False,
|
130 |
+
)
|
131 |
+
style.change(
|
132 |
+
lambda x: gr.update(visible=x in styles[1:]),
|
133 |
+
style,
|
134 |
+
hint,
|
135 |
+
)
|
136 |
|
137 |
with gr.Row():
|
138 |
examples = gr.Examples(
|