Spaces:
Runtime error
Runtime error
LeoXing1996
commited on
Commit
·
b36ce1d
1
Parent(s):
07e3768
revise example
Browse files- app-huggingface.py +2 -13
app-huggingface.py
CHANGED
@@ -344,7 +344,6 @@ class AnimateController:
|
|
344 |
seed_textbox,
|
345 |
ip_adapter_scale,
|
346 |
style,
|
347 |
-
example_img=None,
|
348 |
with_text=False,
|
349 |
text_idx=0,
|
350 |
progress=gr.Progress(),
|
@@ -352,7 +351,8 @@ class AnimateController:
|
|
352 |
):
|
353 |
global sample_idx
|
354 |
if init_img is None:
|
355 |
-
|
|
|
356 |
|
357 |
if seed_textbox != -1 and seed_textbox != "":
|
358 |
torch.manual_seed(int(seed_textbox))
|
@@ -414,7 +414,6 @@ class AnimateController:
|
|
414 |
sample_idx += 1
|
415 |
return (save_sample_path_mp4,
|
416 |
[save_sample_path_mp4, save_sample_path_gif],
|
417 |
-
example_img,
|
418 |
seed,
|
419 |
motion_scale,
|
420 |
cfg_scale_slider,
|
@@ -427,8 +426,6 @@ controller = AnimateController()
|
|
427 |
def ui():
|
428 |
with gr.Blocks(css=css) as demo:
|
429 |
# build state for default buttons
|
430 |
-
example_img = gr.State(
|
431 |
-
value='__assets__/image_animation/zhening/zhening.jpeg')
|
432 |
default_motion = gr.State(value=1)
|
433 |
default_prompt1 = gr.State(
|
434 |
value='lift a red envelope, Chinese new year')
|
@@ -577,14 +574,12 @@ def ui():
|
|
577 |
default_seed,
|
578 |
default_ip_adapter_scale,
|
579 |
default_style,
|
580 |
-
example_img,
|
581 |
with_wishes,
|
582 |
default_1_idx,
|
583 |
],
|
584 |
outputs=[
|
585 |
result_video,
|
586 |
download,
|
587 |
-
example_img,
|
588 |
default_seed,
|
589 |
default_motion,
|
590 |
default_cfg,
|
@@ -601,14 +596,12 @@ def ui():
|
|
601 |
default_seed,
|
602 |
default_ip_adapter_scale,
|
603 |
default_style,
|
604 |
-
example_img,
|
605 |
with_wishes,
|
606 |
default_2_idx,
|
607 |
],
|
608 |
outputs=[
|
609 |
result_video,
|
610 |
download,
|
611 |
-
example_img,
|
612 |
default_seed,
|
613 |
default_motion,
|
614 |
default_cfg,
|
@@ -625,14 +618,12 @@ def ui():
|
|
625 |
default_seed,
|
626 |
default_ip_adapter_scale,
|
627 |
default_style,
|
628 |
-
example_img,
|
629 |
with_wishes,
|
630 |
default_3_idx,
|
631 |
],
|
632 |
outputs=[
|
633 |
result_video,
|
634 |
download,
|
635 |
-
example_img,
|
636 |
default_seed,
|
637 |
default_motion,
|
638 |
default_cfg,
|
@@ -649,14 +640,12 @@ def ui():
|
|
649 |
default_seed,
|
650 |
default_ip_adapter_scale,
|
651 |
default_style,
|
652 |
-
example_img,
|
653 |
with_wishes,
|
654 |
default_4_idx,
|
655 |
],
|
656 |
outputs=[
|
657 |
result_video,
|
658 |
download,
|
659 |
-
example_img,
|
660 |
default_seed,
|
661 |
default_motion,
|
662 |
default_cfg,
|
|
|
344 |
seed_textbox,
|
345 |
ip_adapter_scale,
|
346 |
style,
|
|
|
347 |
with_text=False,
|
348 |
text_idx=0,
|
349 |
progress=gr.Progress(),
|
|
|
351 |
):
|
352 |
global sample_idx
|
353 |
if init_img is None:
|
354 |
+
init_img = np.array(Image.open('__assets__/image_animation/zhening/zhening.jpeg'))
|
355 |
+
gr.Info('User example image for quick run.')
|
356 |
|
357 |
if seed_textbox != -1 and seed_textbox != "":
|
358 |
torch.manual_seed(int(seed_textbox))
|
|
|
414 |
sample_idx += 1
|
415 |
return (save_sample_path_mp4,
|
416 |
[save_sample_path_mp4, save_sample_path_gif],
|
|
|
417 |
seed,
|
418 |
motion_scale,
|
419 |
cfg_scale_slider,
|
|
|
426 |
def ui():
|
427 |
with gr.Blocks(css=css) as demo:
|
428 |
# build state for default buttons
|
|
|
|
|
429 |
default_motion = gr.State(value=1)
|
430 |
default_prompt1 = gr.State(
|
431 |
value='lift a red envelope, Chinese new year')
|
|
|
574 |
default_seed,
|
575 |
default_ip_adapter_scale,
|
576 |
default_style,
|
|
|
577 |
with_wishes,
|
578 |
default_1_idx,
|
579 |
],
|
580 |
outputs=[
|
581 |
result_video,
|
582 |
download,
|
|
|
583 |
default_seed,
|
584 |
default_motion,
|
585 |
default_cfg,
|
|
|
596 |
default_seed,
|
597 |
default_ip_adapter_scale,
|
598 |
default_style,
|
|
|
599 |
with_wishes,
|
600 |
default_2_idx,
|
601 |
],
|
602 |
outputs=[
|
603 |
result_video,
|
604 |
download,
|
|
|
605 |
default_seed,
|
606 |
default_motion,
|
607 |
default_cfg,
|
|
|
618 |
default_seed,
|
619 |
default_ip_adapter_scale,
|
620 |
default_style,
|
|
|
621 |
with_wishes,
|
622 |
default_3_idx,
|
623 |
],
|
624 |
outputs=[
|
625 |
result_video,
|
626 |
download,
|
|
|
627 |
default_seed,
|
628 |
default_motion,
|
629 |
default_cfg,
|
|
|
640 |
default_seed,
|
641 |
default_ip_adapter_scale,
|
642 |
default_style,
|
|
|
643 |
with_wishes,
|
644 |
default_4_idx,
|
645 |
],
|
646 |
outputs=[
|
647 |
result_video,
|
648 |
download,
|
|
|
649 |
default_seed,
|
650 |
default_motion,
|
651 |
default_cfg,
|