Spaces:
Runtime error
Runtime error
commit
Browse files
app.py
CHANGED
@@ -213,7 +213,7 @@ class ImageComp:
|
|
213 |
seed_everything(seed)
|
214 |
|
215 |
scale = [scale_s, scale_f, scale_t]
|
216 |
-
|
217 |
if save_memory:
|
218 |
model.low_vram_shift(is_diffusing=False)
|
219 |
# uc_cross = model.get_unconditional_conditioning(num_samples)
|
@@ -248,7 +248,26 @@ css = """
|
|
248 |
h1 {
|
249 |
text-align: center;
|
250 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
|
|
|
|
|
|
|
|
|
|
|
252 |
"""
|
253 |
|
254 |
def create_app_demo():
|
@@ -258,17 +277,22 @@ def create_app_demo():
|
|
258 |
with gr.Row():
|
259 |
gr.HTML(
|
260 |
"""
|
261 |
-
<div
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
|
|
|
|
|
|
|
|
|
|
272 |
with gr.Column():
|
273 |
with gr.Row():
|
274 |
img_edit = ImageComp('edit_app')
|
@@ -380,11 +404,6 @@ with block:
|
|
380 |
|
381 |
with gr.Tab('Edit Appearance'):
|
382 |
create_app_demo()
|
383 |
-
gr.HTML("""<br><p>  Visual guide to use the demo</p><br>
|
384 |
-
<div id="myinst">
|
385 |
-
<img src="file/assets/GIF.gif" width="400" height="400">
|
386 |
-
</div>
|
387 |
-
""")
|
388 |
with gr.Tab('Edit Structure'):
|
389 |
create_struct_demo()
|
390 |
with gr.Tab('Edit Both'):
|
|
|
213 |
seed_everything(seed)
|
214 |
|
215 |
scale = [scale_s, scale_f, scale_t]
|
216 |
+
print(scale)
|
217 |
if save_memory:
|
218 |
model.low_vram_shift(is_diffusing=False)
|
219 |
# uc_cross = model.get_unconditional_conditioning(num_samples)
|
|
|
248 |
h1 {
|
249 |
text-align: center;
|
250 |
}
|
251 |
+
.container {
|
252 |
+
display: flex;
|
253 |
+
justify-content: space-between
|
254 |
+
}
|
255 |
+
|
256 |
+
img {
|
257 |
+
max-width: 100%
|
258 |
+
padding-right: 100px;
|
259 |
+
}
|
260 |
+
|
261 |
+
.image {
|
262 |
+
flex-basis: 40%
|
263 |
+
|
264 |
+
}
|
265 |
|
266 |
+
.text {
|
267 |
+
font-size: 15px;
|
268 |
+
padding-right: 20px;
|
269 |
+
padding-left: 0px;
|
270 |
+
}
|
271 |
"""
|
272 |
|
273 |
def create_app_demo():
|
|
|
277 |
with gr.Row():
|
278 |
gr.HTML(
|
279 |
"""
|
280 |
+
<div class="container">
|
281 |
+
<div class="text">
|
282 |
+
<h4> Instructions </h4>
|
283 |
+
<ol>
|
284 |
+
<li>Upload an Input Image.</li>
|
285 |
+
<li>Mark one of segmented objects in the <i>Select Object to Edit</i> tab.</li>
|
286 |
+
<li>Upload an Reference Image.</li>
|
287 |
+
<li>Mark one of segmented objects in the <i>Select Reference Object</i> tab, for the reference appearance.</li>
|
288 |
+
<li>Enter a prompt and press <i>Run</i> button. (A very simple would also work) </li>
|
289 |
+
</ol>
|
290 |
+
</div>
|
291 |
+
<div class="image">
|
292 |
+
<img src="file/assets/GIF.gif" width="400"">
|
293 |
+
</div>
|
294 |
+
</div>
|
295 |
+
""")
|
296 |
with gr.Column():
|
297 |
with gr.Row():
|
298 |
img_edit = ImageComp('edit_app')
|
|
|
404 |
|
405 |
with gr.Tab('Edit Appearance'):
|
406 |
create_app_demo()
|
|
|
|
|
|
|
|
|
|
|
407 |
with gr.Tab('Edit Structure'):
|
408 |
create_struct_demo()
|
409 |
with gr.Tab('Edit Both'):
|