Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,8 @@ import threading
|
|
10 |
import torch
|
11 |
from subprocess import getoutput
|
12 |
|
13 |
-
is_shared_ui = False
|
14 |
-
|
15 |
available_property = False if is_shared_ui else True
|
16 |
|
17 |
is_gpu_associated = torch.cuda.is_available()
|
@@ -232,15 +232,6 @@ with gr.Blocks(css=css) as demo:
|
|
232 |
gr.Markdown("# MimicMotion")
|
233 |
with gr.Row():
|
234 |
with gr.Column():
|
235 |
-
with gr.Row():
|
236 |
-
ref_image_in = gr.Image(label="Person Image Reference", type="filepath")
|
237 |
-
ref_video_in = gr.Video(label="Person Video Reference")
|
238 |
-
with gr.Accordion("Advanced Settings", open=False):
|
239 |
-
num_inference_steps = gr.Slider(label="num inference steps", minimum=12, maximum=50, value=25, step=1, interactive=available_property)
|
240 |
-
guidance_scale = gr.Slider(label="guidance scale", minimum=0.1, maximum=10, value=2, step=0.1, interactive=available_property)
|
241 |
-
output_frames_per_second = gr.Slider(label="fps", minimum=1, maximum=60, value=16, step=1, interactive=available_property)
|
242 |
-
seed = gr.Number(label="Seed", value=42, interactive=available_property)
|
243 |
-
submit_btn = gr.Button("Submit", interactive=available_property)
|
244 |
if is_shared_ui:
|
245 |
top_description = gr.HTML(f'''
|
246 |
<div class="gr-prose">
|
@@ -262,12 +253,21 @@ with gr.Blocks(css=css) as demo:
|
|
262 |
top_description = gr.HTML(f'''
|
263 |
<div class="gr-prose">
|
264 |
<h2 class="custom-color"><svg xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" style="margin-right: 0px;display: inline-block;"fill="none"><path fill="#fff" d="M7 13.2a6.3 6.3 0 0 0 4.4-10.7A6.3 6.3 0 0 0 .6 6.9 6.3 6.3 0 0 0 7 13.2Z"/><path fill="#fff" fill-rule="evenodd" d="M7 0a6.9 6.9 0 0 1 4.8 11.8A6.9 6.9 0 0 1 0 7 6.9 6.9 0 0 1 7 0Zm0 0v.7V0ZM0 7h.6H0Zm7 6.8v-.6.6ZM13.7 7h-.6.6ZM9.1 1.7c-.7-.3-1.4-.4-2.2-.4a5.6 5.6 0 0 0-4 1.6 5.6 5.6 0 0 0-1.6 4 5.6 5.6 0 0 0 1.6 4 5.6 5.6 0 0 0 4 1.7 5.6 5.6 0 0 0 4-1.7 5.6 5.6 0 0 0 1.7-4 5.6 5.6 0 0 0-1.7-4c-.5-.5-1.1-.9-1.8-1.2Z" clip-rule="evenodd"/><path fill="#000" fill-rule="evenodd" d="M7 2.9a.8.8 0 1 1 0 1.5A.8.8 0 0 1 7 3ZM5.8 5.7c0-.4.3-.6.6-.6h.7c.3 0 .6.2.6.6v3.7h.5a.6.6 0 0 1 0 1.3H6a.6.6 0 0 1 0-1.3h.4v-3a.6.6 0 0 1-.6-.7Z" clip-rule="evenodd"/></svg>
|
265 |
-
You have successfully associated a {which_gpu} GPU to
|
266 |
<p class="custom-color">
|
267 |
You will be billed by the minute from when you activated the GPU until when it is turned off.
|
268 |
</p>
|
269 |
</div>
|
270 |
''', elem_id="warning-ready")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
gr.Examples(
|
272 |
examples = [
|
273 |
["./examples/demo1.jpg", "./examples/preview_1.mp4"]
|
|
|
10 |
import torch
|
11 |
from subprocess import getoutput
|
12 |
|
13 |
+
# is_shared_ui = False
|
14 |
+
is_shared_ui = True if "fffiloni/MimicMotion" in os.environ['SPACE_ID'] else False
|
15 |
available_property = False if is_shared_ui else True
|
16 |
|
17 |
is_gpu_associated = torch.cuda.is_available()
|
|
|
232 |
gr.Markdown("# MimicMotion")
|
233 |
with gr.Row():
|
234 |
with gr.Column():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
if is_shared_ui:
|
236 |
top_description = gr.HTML(f'''
|
237 |
<div class="gr-prose">
|
|
|
253 |
top_description = gr.HTML(f'''
|
254 |
<div class="gr-prose">
|
255 |
<h2 class="custom-color"><svg xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" style="margin-right: 0px;display: inline-block;"fill="none"><path fill="#fff" d="M7 13.2a6.3 6.3 0 0 0 4.4-10.7A6.3 6.3 0 0 0 .6 6.9 6.3 6.3 0 0 0 7 13.2Z"/><path fill="#fff" fill-rule="evenodd" d="M7 0a6.9 6.9 0 0 1 4.8 11.8A6.9 6.9 0 0 1 0 7 6.9 6.9 0 0 1 7 0Zm0 0v.7V0ZM0 7h.6H0Zm7 6.8v-.6.6ZM13.7 7h-.6.6ZM9.1 1.7c-.7-.3-1.4-.4-2.2-.4a5.6 5.6 0 0 0-4 1.6 5.6 5.6 0 0 0-1.6 4 5.6 5.6 0 0 0 1.6 4 5.6 5.6 0 0 0 4 1.7 5.6 5.6 0 0 0 4-1.7 5.6 5.6 0 0 0 1.7-4 5.6 5.6 0 0 0-1.7-4c-.5-.5-1.1-.9-1.8-1.2Z" clip-rule="evenodd"/><path fill="#000" fill-rule="evenodd" d="M7 2.9a.8.8 0 1 1 0 1.5A.8.8 0 0 1 7 3ZM5.8 5.7c0-.4.3-.6.6-.6h.7c.3 0 .6.2.6.6v3.7h.5a.6.6 0 0 1 0 1.3H6a.6.6 0 0 1 0-1.3h.4v-3a.6.6 0 0 1-.6-.7Z" clip-rule="evenodd"/></svg>
|
256 |
+
You have successfully associated a {which_gpu} GPU to this Space 🎉</h2>
|
257 |
<p class="custom-color">
|
258 |
You will be billed by the minute from when you activated the GPU until when it is turned off.
|
259 |
</p>
|
260 |
</div>
|
261 |
''', elem_id="warning-ready")
|
262 |
+
with gr.Row():
|
263 |
+
ref_image_in = gr.Image(label="Person Image Reference", type="filepath")
|
264 |
+
ref_video_in = gr.Video(label="Person Video Reference")
|
265 |
+
with gr.Accordion("Advanced Settings", open=False):
|
266 |
+
num_inference_steps = gr.Slider(label="num inference steps", minimum=12, maximum=50, value=25, step=1, interactive=available_property)
|
267 |
+
guidance_scale = gr.Slider(label="guidance scale", minimum=0.1, maximum=10, value=2, step=0.1, interactive=available_property)
|
268 |
+
output_frames_per_second = gr.Slider(label="fps", minimum=1, maximum=60, value=16, step=1, interactive=available_property)
|
269 |
+
seed = gr.Number(label="Seed", value=42, interactive=available_property)
|
270 |
+
submit_btn = gr.Button("Submit", interactive=available_property)
|
271 |
gr.Examples(
|
272 |
examples = [
|
273 |
["./examples/demo1.jpg", "./examples/preview_1.mp4"]
|