Spaces:
Runtime error
Runtime error
Add function
Browse files- app_v2v.py +37 -3
app_v2v.py
CHANGED
|
@@ -634,7 +634,7 @@ with block:
|
|
| 634 |
|
| 635 |
resolution = gr.Number(label="Resolution (max width or height)", value=640, precision=0, visible=False)
|
| 636 |
|
| 637 |
-
total_second_length = gr.Slider(label="Additional Video Length to Generate (Seconds)", minimum=1, maximum=120, value=
|
| 638 |
|
| 639 |
gs = gr.Slider(label="Distilled CFG Scale", minimum=1.0, maximum=32.0, value=3.0, step=0.01, info='Prompt adherence at the cost of less details from the input video, but to a lesser extent than Context Frames.')
|
| 640 |
cfg = gr.Slider(label="CFG Scale", minimum=1.0, maximum=32.0, value=1.0, step=0.01, visible=True, info='Use this instead of Distilled for more detail/control + Negative Prompt (make sure Distilled set to 1). Doubles render time.') # Should not change
|
|
@@ -662,7 +662,7 @@ with block:
|
|
| 662 |
with gr.Row():
|
| 663 |
input_video_debug = gr.Video(sources='upload', label="Input Video Debug", height=320)
|
| 664 |
prompt_debug = gr.Textbox(label="Prompt Debug", value='')
|
| 665 |
-
total_second_length_debug = gr.Slider(label="Additional Video Length to Generate (Seconds) Debug", minimum=1, maximum=120, value=
|
| 666 |
|
| 667 |
with gr.Column():
|
| 668 |
preview_image = gr.Image(label="Next Latents", height=200, visible=False)
|
|
@@ -682,7 +682,7 @@ with block:
|
|
| 682 |
640, # resolution
|
| 683 |
1, # total_second_length
|
| 684 |
9, # latent_window_size
|
| 685 |
-
|
| 686 |
1.0, # cfg
|
| 687 |
3.0, # gs
|
| 688 |
0.0, # rs
|
|
@@ -709,4 +709,38 @@ with block:
|
|
| 709 |
start_button.click(fn=process, inputs=ips, outputs=[result_video, preview_image, progress_desc, progress_bar, start_button, end_button])
|
| 710 |
end_button.click(fn=end_process)
|
| 711 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 712 |
block.launch(ssr_mode=False)
|
|
|
|
| 634 |
|
| 635 |
resolution = gr.Number(label="Resolution (max width or height)", value=640, precision=0, visible=False)
|
| 636 |
|
| 637 |
+
total_second_length = gr.Slider(label="Additional Video Length to Generate (Seconds)", minimum=1, maximum=120, value=1, step=0.1)
|
| 638 |
|
| 639 |
gs = gr.Slider(label="Distilled CFG Scale", minimum=1.0, maximum=32.0, value=3.0, step=0.01, info='Prompt adherence at the cost of less details from the input video, but to a lesser extent than Context Frames.')
|
| 640 |
cfg = gr.Slider(label="CFG Scale", minimum=1.0, maximum=32.0, value=1.0, step=0.01, visible=True, info='Use this instead of Distilled for more detail/control + Negative Prompt (make sure Distilled set to 1). Doubles render time.') # Should not change
|
|
|
|
| 662 |
with gr.Row():
|
| 663 |
input_video_debug = gr.Video(sources='upload', label="Input Video Debug", height=320)
|
| 664 |
prompt_debug = gr.Textbox(label="Prompt Debug", value='')
|
| 665 |
+
total_second_length_debug = gr.Slider(label="Additional Video Length to Generate (Seconds) Debug", minimum=1, maximum=120, value=1, step=0.1)
|
| 666 |
|
| 667 |
with gr.Column():
|
| 668 |
preview_image = gr.Image(label="Next Latents", height=200, visible=False)
|
|
|
|
| 682 |
640, # resolution
|
| 683 |
1, # total_second_length
|
| 684 |
9, # latent_window_size
|
| 685 |
+
25, # steps
|
| 686 |
1.0, # cfg
|
| 687 |
3.0, # gs
|
| 688 |
0.0, # rs
|
|
|
|
| 709 |
start_button.click(fn=process, inputs=ips, outputs=[result_video, preview_image, progress_desc, progress_bar, start_button, end_button])
|
| 710 |
end_button.click(fn=end_process)
|
| 711 |
|
| 712 |
+
|
| 713 |
+
def handle_input_video_debug_upload(input):
|
| 714 |
+
global input_video_debug_value
|
| 715 |
+
input_video_debug_value = input
|
| 716 |
+
return []
|
| 717 |
+
|
| 718 |
+
def handle_prompt_debug_change(input):
|
| 719 |
+
global prompt_debug_value
|
| 720 |
+
prompt_debug_value = input
|
| 721 |
+
return []
|
| 722 |
+
|
| 723 |
+
def handle_total_second_length_debug_change(input):
|
| 724 |
+
global total_second_length_debug_value
|
| 725 |
+
total_second_length_debug_value = input
|
| 726 |
+
return []
|
| 727 |
+
|
| 728 |
+
input_video_debug.upload(
|
| 729 |
+
fn=handle_input_video_debug_upload,
|
| 730 |
+
inputs=[input_video_debug],
|
| 731 |
+
outputs=[]
|
| 732 |
+
)
|
| 733 |
+
|
| 734 |
+
prompt_debug.change(
|
| 735 |
+
fn=handle_prompt_debug_change,
|
| 736 |
+
inputs=[prompt_debug],
|
| 737 |
+
outputs=[]
|
| 738 |
+
)
|
| 739 |
+
|
| 740 |
+
total_second_length_debug.change(
|
| 741 |
+
fn=handle_total_second_length_debug_change,
|
| 742 |
+
inputs=[total_second_length_debug],
|
| 743 |
+
outputs=[]
|
| 744 |
+
)
|
| 745 |
+
|
| 746 |
block.launch(ssr_mode=False)
|