Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
-
import spaces
|
3 |
-
|
4 |
from ominicontrol import generate_image
|
5 |
|
6 |
-
|
|
|
|
|
7 |
|
8 |
css = """
|
9 |
.inputPanel {
|
@@ -25,6 +25,15 @@ css = """
|
|
25 |
}
|
26 |
"""
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
def style_transfer(image, style):
|
30 |
return image
|
@@ -40,7 +49,7 @@ styles = [
|
|
40 |
|
41 |
def gradio_interface():
|
42 |
with gr.Blocks(css=css) as demo:
|
43 |
-
gr.Markdown(
|
44 |
with gr.Row(equal_height=False):
|
45 |
with gr.Column(variant="panel", elem_classes="inputPanel"):
|
46 |
original_image = gr.Image(
|
@@ -111,6 +120,19 @@ def gradio_interface():
|
|
111 |
label="Output Image",
|
112 |
)
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
btn.click(
|
115 |
fn=infer,
|
116 |
inputs=[
|
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
from ominicontrol import generate_image
|
3 |
|
4 |
+
import spaces
|
5 |
+
|
6 |
+
USE_ZERO_GPU = False
|
7 |
|
8 |
css = """
|
9 |
.inputPanel {
|
|
|
25 |
}
|
26 |
"""
|
27 |
|
28 |
+
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
|
|
|
49 |
|
50 |
def gradio_interface():
|
51 |
with gr.Blocks(css=css) as demo:
|
52 |
+
gr.Markdown(header)
|
53 |
with gr.Row(equal_height=False):
|
54 |
with gr.Column(variant="panel", elem_classes="inputPanel"):
|
55 |
original_image = gr.Image(
|
|
|
120 |
label="Output Image",
|
121 |
)
|
122 |
|
123 |
+
with gr.Row():
|
124 |
+
examples = gr.Examples(
|
125 |
+
examples=[
|
126 |
+
["examples/DistractedBoyfriend.webp", styles[0]],
|
127 |
+
["examples/steve.webp", styles[0]],
|
128 |
+
["examples/oiiai.png", styles[1]],
|
129 |
+
["examples/doge.jpg", styles[1]],
|
130 |
+
["examples/breakingbad.jpg", styles[2]],
|
131 |
+
["examples/PulpFiction.jpg", styles[3]],
|
132 |
+
],
|
133 |
+
inputs=[original_image, style],
|
134 |
+
)
|
135 |
+
|
136 |
btn.click(
|
137 |
fn=infer,
|
138 |
inputs=[
|