Spaces:
Runtime error
Runtime error
Commit
·
7389249
1
Parent(s):
bcbecf4
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,49 +97,87 @@ options = ['SD1.4', 'SD1.5', 'SD2.1']
|
|
| 97 |
with block:
|
| 98 |
gr.Markdown("SD vs. FreeU.")
|
| 99 |
with gr.Row():
|
| 100 |
-
with gr.
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
)
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
|
| 144 |
|
| 145 |
ex = gr.Examples(examples=examples, fn=infer, inputs=[text], outputs=[image_1, image_2], cache_examples=False)
|
|
|
|
| 97 |
with block:
|
| 98 |
gr.Markdown("SD vs. FreeU.")
|
| 99 |
with gr.Row():
|
| 100 |
+
with gr.Group():
|
| 101 |
+
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
| 102 |
+
with gr.Column():
|
| 103 |
+
text = gr.Textbox(
|
| 104 |
+
label="Enter your prompt",
|
| 105 |
+
show_label=False,
|
| 106 |
+
max_lines=1,
|
| 107 |
+
placeholder="Enter your prompt",
|
| 108 |
+
container=False,
|
| 109 |
+
)
|
| 110 |
+
btn = gr.Button("Generate image", scale=0)
|
| 111 |
+
|
| 112 |
+
with gr.Row():
|
| 113 |
+
with gr.Column(min_width=256) as c1:
|
| 114 |
+
image_1 = gr.Image(interactive=False)
|
| 115 |
+
image_1_label = gr.Markdown("SD")
|
| 116 |
+
with gr.Row():
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
with gr.Group():
|
| 121 |
+
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
| 122 |
+
with gr.Column():
|
| 123 |
+
text = gr.Textbox(
|
| 124 |
+
label="Enter your prompt",
|
| 125 |
+
show_label=False,
|
| 126 |
+
max_lines=1,
|
| 127 |
+
placeholder="Enter your prompt",
|
| 128 |
+
container=False,
|
| 129 |
+
)
|
| 130 |
+
btn = gr.Button("Generate image", scale=0)
|
| 131 |
+
|
| 132 |
+
with gr.Row():
|
| 133 |
+
with gr.Column(min_width=256) as c2:
|
| 134 |
+
image_2 = gr.Image(interactive=False)
|
| 135 |
+
image_2_label = gr.Markdown("FreeU")
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
# with gr.Column():
|
| 139 |
+
# sd_options = gr.Dropdown(options, value='SD1.4', label="SD options")
|
| 140 |
+
# model_id = "CompVis/stable-diffusion-v1-4"
|
| 141 |
+
# with gr.Accordion('FreeU Parameters', open=False):
|
| 142 |
+
# b1 = gr.Slider(label='b1: backbone factor of the first stage block of decoder',
|
| 143 |
+
# minimum=1,
|
| 144 |
+
# maximum=1.6,
|
| 145 |
+
# step=0.1,
|
| 146 |
+
# value=1)
|
| 147 |
+
# b2 = gr.Slider(label='b2: backbone factor of the second stage block of decoder',
|
| 148 |
+
# minimum=1,
|
| 149 |
+
# maximum=1.6,
|
| 150 |
+
# step=0.1,
|
| 151 |
+
# value=1)
|
| 152 |
+
# s1 = gr.Slider(label='s1: skip factor of the first stage block of decoder',
|
| 153 |
+
# minimum=0,
|
| 154 |
+
# maximum=1,
|
| 155 |
+
# step=0.1,
|
| 156 |
+
# value=1)
|
| 157 |
+
# s2 = gr.Slider(label='s2: skip factor of the second stage block of decoder',
|
| 158 |
+
# minimum=0,
|
| 159 |
+
# maximum=1,
|
| 160 |
+
# step=0.1,
|
| 161 |
+
# value=1)
|
| 162 |
+
# with gr.Group():
|
| 163 |
+
# with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
| 164 |
+
# with gr.Column():
|
| 165 |
+
# text = gr.Textbox(
|
| 166 |
+
# label="Enter your prompt",
|
| 167 |
+
# show_label=False,
|
| 168 |
+
# max_lines=1,
|
| 169 |
+
# placeholder="Enter your prompt",
|
| 170 |
+
# container=False,
|
| 171 |
+
# )
|
| 172 |
+
# btn = gr.Button("Generate image", scale=0)
|
| 173 |
|
| 174 |
+
# with gr.Row():
|
| 175 |
+
# with gr.Column(min_width=256) as c1:
|
| 176 |
+
# image_1 = gr.Image(interactive=False)
|
| 177 |
+
# image_1_label = gr.Markdown("SD")
|
| 178 |
+
# with gr.Column(min_width=256) as c2:
|
| 179 |
+
# image_2 = gr.Image(interactive=False)
|
| 180 |
+
# image_2_label = gr.Markdown("FreeU")
|
| 181 |
|
| 182 |
|
| 183 |
ex = gr.Examples(examples=examples, fn=infer, inputs=[text], outputs=[image_1, image_2], cache_examples=False)
|