handle_timed_prompt_change
Browse files
app.py
CHANGED
|
@@ -942,7 +942,7 @@ def handle_prompt_number_change():
|
|
| 942 |
timed_prompts = {}
|
| 943 |
return []
|
| 944 |
|
| 945 |
-
def
|
| 946 |
timed_prompts[timed_prompt_id] = timed_prompt
|
| 947 |
return ";".join(list(timed_prompts.values()))
|
| 948 |
|
|
@@ -981,7 +981,7 @@ adapted from the official code repo [FramePack](https://github.com/lllyasviel/Fr
|
|
| 981 |
for digit in range(prompt_number):
|
| 982 |
timed_prompt_id = gr.Textbox(value="timed_prompt_" + str(digit), visible=False)
|
| 983 |
timed_prompt = gr.Textbox(label="Timed prompt #" + str(digit + 1), elem_id="timed_prompt_" + str(digit), value="")
|
| 984 |
-
timed_prompt.change(fn=
|
| 985 |
|
| 986 |
total_second_length = gr.Slider(label="Video Length to Generate (seconds)", minimum=1, maximum=120, value=2, step=0.1)
|
| 987 |
|
|
|
|
| 942 |
timed_prompts = {}
|
| 943 |
return []
|
| 944 |
|
| 945 |
+
def handle_timed_prompt_change(timed_prompt_id, timed_prompt):
|
| 946 |
timed_prompts[timed_prompt_id] = timed_prompt
|
| 947 |
return ";".join(list(timed_prompts.values()))
|
| 948 |
|
|
|
|
| 981 |
for digit in range(prompt_number):
|
| 982 |
timed_prompt_id = gr.Textbox(value="timed_prompt_" + str(digit), visible=False)
|
| 983 |
timed_prompt = gr.Textbox(label="Timed prompt #" + str(digit + 1), elem_id="timed_prompt_" + str(digit), value="")
|
| 984 |
+
timed_prompt.change(fn=handle_timed_prompt_change, inputs=[timed_prompt_id, timed_prompt], outputs=[prompt])
|
| 985 |
|
| 986 |
total_second_length = gr.Slider(label="Video Length to Generate (seconds)", minimum=1, maximum=120, value=2, step=0.1)
|
| 987 |
|