Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
8c8a286
1
Parent(s):
3efe99a
fix models
Browse files- app.py +14 -1
- llm_inference_video.py +12 -1
app.py
CHANGED
@@ -35,6 +35,19 @@ def create_video_interface():
|
|
35 |
label="Camera Movement Style"
|
36 |
)
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
with gr.Column(scale=2):
|
39 |
pacing = gr.Dropdown(
|
40 |
choices=[
|
@@ -107,7 +120,7 @@ def create_video_interface():
|
|
107 |
|
108 |
generate_btn.click(
|
109 |
llm_node.generate_video_prompt,
|
110 |
-
inputs=[input_concept, style, camera_style, pacing, special_effects,
|
111 |
custom_elements, provider, model, prompt_length],
|
112 |
outputs=output
|
113 |
)
|
|
|
35 |
label="Camera Movement Style"
|
36 |
)
|
37 |
|
38 |
+
camera_direction = gr.Dropdown(
|
39 |
+
choices=[
|
40 |
+
"None",
|
41 |
+
"Zoom in", "Zoom out", "Pan left", "Pan right",
|
42 |
+
"Tilt up", "Tilt down", "Orbital rotation",
|
43 |
+
"Push in", "Pull out", "Track forward", "Track backward",
|
44 |
+
"Spiral in", "Spiral out", "Arc movement",
|
45 |
+
"Diagonal traverse", "Vertical rise", "Vertical descent"
|
46 |
+
],
|
47 |
+
value="None",
|
48 |
+
label="Camera Direction"
|
49 |
+
)
|
50 |
+
|
51 |
with gr.Column(scale=2):
|
52 |
pacing = gr.Dropdown(
|
53 |
choices=[
|
|
|
120 |
|
121 |
generate_btn.click(
|
122 |
llm_node.generate_video_prompt,
|
123 |
+
inputs=[input_concept, style, camera_style, camera_direction, pacing, special_effects,
|
124 |
custom_elements, provider, model, prompt_length],
|
125 |
outputs=output
|
126 |
)
|
llm_inference_video.py
CHANGED
@@ -20,6 +20,7 @@ class VideoLLMInferenceNode:
|
|
20 |
input_concept,
|
21 |
style,
|
22 |
camera_style,
|
|
|
23 |
pacing,
|
24 |
special_effects,
|
25 |
custom_elements,
|
@@ -35,16 +36,26 @@ class VideoLLMInferenceNode:
|
|
35 |
|
36 |
element_prefixes = {
|
37 |
"camera": "utilizing",
|
|
|
38 |
"pacing": "with",
|
39 |
"effects": "incorporating"
|
40 |
}
|
41 |
|
42 |
return f" {element_prefixes.get(element_type, '')} {element}"
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
# Video prompt templates
|
45 |
prompt_templates = {
|
46 |
"minimalist": f"""Create an elegantly sparse video description focusing on {input_concept}.
|
47 |
-
{format_element(
|
48 |
{format_element(pacing, 'pacing')}
|
49 |
{format_element(special_effects, 'effects')}
|
50 |
{' with ' + custom_elements if custom_elements else ''}.""",
|
|
|
20 |
input_concept,
|
21 |
style,
|
22 |
camera_style,
|
23 |
+
camera_direction,
|
24 |
pacing,
|
25 |
special_effects,
|
26 |
custom_elements,
|
|
|
36 |
|
37 |
element_prefixes = {
|
38 |
"camera": "utilizing",
|
39 |
+
"direction": "with",
|
40 |
"pacing": "with",
|
41 |
"effects": "incorporating"
|
42 |
}
|
43 |
|
44 |
return f" {element_prefixes.get(element_type, '')} {element}"
|
45 |
|
46 |
+
# Format camera movement combination
|
47 |
+
camera_movement = ""
|
48 |
+
if camera_style != "None" and camera_direction != "None":
|
49 |
+
camera_movement = f"{camera_style} {camera_direction}"
|
50 |
+
elif camera_style != "None":
|
51 |
+
camera_movement = camera_style
|
52 |
+
elif camera_direction != "None":
|
53 |
+
camera_movement = camera_direction
|
54 |
+
|
55 |
# Video prompt templates
|
56 |
prompt_templates = {
|
57 |
"minimalist": f"""Create an elegantly sparse video description focusing on {input_concept}.
|
58 |
+
{format_element(camera_movement, 'camera')}
|
59 |
{format_element(pacing, 'pacing')}
|
60 |
{format_element(special_effects, 'effects')}
|
61 |
{' with ' + custom_elements if custom_elements else ''}.""",
|