Spaces:
Runtime error
Runtime error
xunsong.li
commited on
Commit
•
daa45ed
1
Parent(s):
172285b
limit generation params, beautify page
Browse files
app.py
CHANGED
@@ -31,12 +31,6 @@ snapshot_download(
|
|
31 |
repo_id="patrolli/AnimateAnyone",
|
32 |
local_dir="./pretrained_weights",
|
33 |
)
|
34 |
-
is_spaces = True if "SPACE_ID" in os.environ else False
|
35 |
-
true_for_shared_ui = False # This will be true only if you are in a shared UI
|
36 |
-
if is_spaces:
|
37 |
-
true_for_shared_ui = (
|
38 |
-
True if "xunsong/Moore-AnimateAnyone" in os.environ["SPACE_ID"] else False
|
39 |
-
)
|
40 |
|
41 |
|
42 |
class AnimateController:
|
@@ -172,9 +166,20 @@ controller = AnimateController()
|
|
172 |
|
173 |
def ui():
|
174 |
with gr.Blocks() as demo:
|
175 |
-
gr.
|
176 |
"""
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
"""
|
179 |
)
|
180 |
animation = gr.Video(
|
@@ -192,13 +197,13 @@ def ui():
|
|
192 |
|
193 |
with gr.Column():
|
194 |
width_slider = gr.Slider(
|
195 |
-
label="Width", minimum=
|
196 |
)
|
197 |
height_slider = gr.Slider(
|
198 |
-
label="Height", minimum=
|
199 |
)
|
200 |
length_slider = gr.Slider(
|
201 |
-
label="Video Length", minimum=24, maximum=
|
202 |
)
|
203 |
with gr.Row():
|
204 |
seed_textbox = gr.Textbox(label="Seed", value=-1)
|
@@ -213,10 +218,10 @@ def ui():
|
|
213 |
with gr.Row():
|
214 |
sampling_steps = gr.Slider(
|
215 |
label="Sampling steps",
|
216 |
-
value=
|
217 |
-
info="default:
|
218 |
step=5,
|
219 |
-
maximum=
|
220 |
minimum=10,
|
221 |
)
|
222 |
guidance_scale = gr.Slider(
|
@@ -224,7 +229,7 @@ def ui():
|
|
224 |
value=3.5,
|
225 |
info="default: 3.5",
|
226 |
step=0.5,
|
227 |
-
maximum=
|
228 |
minimum=2.0,
|
229 |
)
|
230 |
submit = gr.Button("Animate")
|
|
|
31 |
repo_id="patrolli/AnimateAnyone",
|
32 |
local_dir="./pretrained_weights",
|
33 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
|
36 |
class AnimateController:
|
|
|
166 |
|
167 |
def ui():
|
168 |
with gr.Blocks() as demo:
|
169 |
+
gr.HTML(
|
170 |
"""
|
171 |
+
<h1 style="color:#dc5b1c;text-align:center">
|
172 |
+
Moore-AnimateAnyone Gradio Demo
|
173 |
+
</h1>
|
174 |
+
<div style="text-align:center">
|
175 |
+
<div style="display: inline-block; text-align: left;">
|
176 |
+
<p> This is a quick preview demo of Moore-AnimateAnyone. We appreciate the assistance provided by the HuggingFace team in setting up this demo. </p>
|
177 |
+
|
178 |
+
<p> To reduce waiting time, we limit the size (width, height and length) and inference steps when generating videos. </p>
|
179 |
+
|
180 |
+
<p> If you like this project, please consider giving a star on <a herf="https://github.com/MooreThreads/Moore-AnimateAnyone"> our GitHub repo </a> 🤗. </p>
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
"""
|
184 |
)
|
185 |
animation = gr.Video(
|
|
|
197 |
|
198 |
with gr.Column():
|
199 |
width_slider = gr.Slider(
|
200 |
+
label="Width", minimum=256, maximum=448, value=448, step=64
|
201 |
)
|
202 |
height_slider = gr.Slider(
|
203 |
+
label="Height", minimum=256, maximum=512, value=512, step=64
|
204 |
)
|
205 |
length_slider = gr.Slider(
|
206 |
+
label="Video Length", minimum=24, maximum=24, value=24, step=1
|
207 |
)
|
208 |
with gr.Row():
|
209 |
seed_textbox = gr.Textbox(label="Seed", value=-1)
|
|
|
218 |
with gr.Row():
|
219 |
sampling_steps = gr.Slider(
|
220 |
label="Sampling steps",
|
221 |
+
value=15,
|
222 |
+
info="default: 15",
|
223 |
step=5,
|
224 |
+
maximum=15,
|
225 |
minimum=10,
|
226 |
)
|
227 |
guidance_scale = gr.Slider(
|
|
|
229 |
value=3.5,
|
230 |
info="default: 3.5",
|
231 |
step=0.5,
|
232 |
+
maximum=6.5,
|
233 |
minimum=2.0,
|
234 |
)
|
235 |
submit = gr.Button("Animate")
|