Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
4269cb2
1
Parent(s):
9d859cb
fix models
Browse files- app.py +3 -2
- llm_inference_video.py +7 -6
app.py
CHANGED
@@ -14,12 +14,12 @@ def create_video_interface():
|
|
14 |
with gr.Row():
|
15 |
with gr.Column(scale=2):
|
16 |
input_concept = gr.Textbox(label="Core Concept/Thematic Input", lines=3)
|
17 |
-
duration = gr.Slider(15, 600, value=60, label="Duration (seconds)")
|
18 |
style = gr.Dropdown(
|
19 |
choices=["Cinematic", "Documentary", "Animation", "Action", "Experimental"],
|
20 |
value="Cinematic",
|
21 |
label="Video Style"
|
22 |
)
|
|
|
23 |
camera_style = gr.Dropdown(
|
24 |
choices=["Steadicam flow", "Drone aerials", "Handheld urgency", "Crane elegance",
|
25 |
"Dolly precision", "VR 360", "Multi-angle rig"],
|
@@ -85,10 +85,11 @@ def create_video_interface():
|
|
85 |
|
86 |
generate_btn.click(
|
87 |
llm_node.generate_video_prompt,
|
88 |
-
inputs=[input_concept,
|
89 |
outputs=output
|
90 |
)
|
91 |
|
|
|
92 |
return demo
|
93 |
|
94 |
if __name__ == "__main__":
|
|
|
14 |
with gr.Row():
|
15 |
with gr.Column(scale=2):
|
16 |
input_concept = gr.Textbox(label="Core Concept/Thematic Input", lines=3)
|
|
|
17 |
style = gr.Dropdown(
|
18 |
choices=["Cinematic", "Documentary", "Animation", "Action", "Experimental"],
|
19 |
value="Cinematic",
|
20 |
label="Video Style"
|
21 |
)
|
22 |
+
|
23 |
camera_style = gr.Dropdown(
|
24 |
choices=["Steadicam flow", "Drone aerials", "Handheld urgency", "Crane elegance",
|
25 |
"Dolly precision", "VR 360", "Multi-angle rig"],
|
|
|
85 |
|
86 |
generate_btn.click(
|
87 |
llm_node.generate_video_prompt,
|
88 |
+
inputs=[input_concept, style, camera_style, pacing, special_effects, custom_elements, provider, model],
|
89 |
outputs=output
|
90 |
)
|
91 |
|
92 |
+
|
93 |
return demo
|
94 |
|
95 |
if __name__ == "__main__":
|
llm_inference_video.py
CHANGED
@@ -23,27 +23,28 @@ class VideoLLMInferenceNode:
|
|
23 |
def generate_video_prompt(
|
24 |
self,
|
25 |
input_concept,
|
26 |
-
duration,
|
27 |
style,
|
28 |
camera_style,
|
29 |
pacing,
|
30 |
special_effects,
|
31 |
custom_elements,
|
32 |
provider="Hugging Face",
|
|
|
33 |
model=None
|
34 |
):
|
35 |
try:
|
36 |
# Video prompt templates
|
37 |
prompt_templates = {
|
38 |
-
"cinematic": f"""Create a single, detailed paragraph describing a
|
|
|
|
|
39 |
|
40 |
-
"
|
41 |
|
42 |
-
"
|
43 |
|
44 |
-
"action": f"""Craft an energetic paragraph describing a {duration}-second action sequence centered on {input_concept}. Emphasize the dynamic flow of action using {camera_style} cinematography, {pacing} rhythm, and {special_effects} visual effects. Incorporate {style} stylistic choices and {custom_elements if custom_elements else 'impactful moments'} to create an adrenaline-pumping experience.""",
|
45 |
|
46 |
-
"experimental": f"""Create an avant-garde paragraph describing
|
47 |
}
|
48 |
|
49 |
base_prompt = prompt_templates.get(style.lower(), prompt_templates["cinematic"])
|
|
|
23 |
def generate_video_prompt(
|
24 |
self,
|
25 |
input_concept,
|
|
|
26 |
style,
|
27 |
camera_style,
|
28 |
pacing,
|
29 |
special_effects,
|
30 |
custom_elements,
|
31 |
provider="Hugging Face",
|
32 |
+
|
33 |
model=None
|
34 |
):
|
35 |
try:
|
36 |
# Video prompt templates
|
37 |
prompt_templates = {
|
38 |
+
"cinematic": f"""Create a single, detailed paragraph describing a cinematic video that captures {input_concept}. Focus on creating a cohesive narrative that incorporates {style} visual aesthetics, {camera_style} camera work, {pacing} pacing, and {special_effects} effects. Include atmospheric elements like {custom_elements if custom_elements else 'mood lighting and environmental details'} to enhance the storytelling. Describe the visual journey without technical timestamps or shot lists.""",
|
39 |
+
|
40 |
+
"documentary": f"""Write a comprehensive paragraph for a documentary-style video exploring {input_concept}. Blend observational footage with {camera_style} cinematography, incorporating {pacing} editorial rhythm and {special_effects} visual treatments. Focus on creating an immersive narrative that educates and engages, enhanced by {custom_elements if custom_elements else 'authentic moments and natural lighting'}.""",
|
41 |
|
42 |
+
"animation": f"""Compose a vivid paragraph describing a {style} animated video showcasing {input_concept}. Detail the unique visual style, character movements, and world-building elements, incorporating {camera_style} perspectives and {pacing} story flow. Include {special_effects} animation effects and {custom_elements if custom_elements else 'signature artistic elements'} to create a memorable visual experience.""",
|
43 |
|
44 |
+
"action": f"""Craft an energetic paragraph describing an action sequence centered on {input_concept}. Emphasize the dynamic flow of action using {camera_style} cinematography, {pacing} rhythm, and {special_effects} visual effects. Incorporate {style} stylistic choices and {custom_elements if custom_elements else 'impactful moments'} to create an adrenaline-pumping experience.""",
|
45 |
|
|
|
46 |
|
47 |
+
"experimental": f"""Create an avant-garde paragraph describing an experimental video exploring {input_concept}. Embrace unconventional storytelling through {style} aesthetics, {camera_style} techniques, and {pacing} temporal flow. Incorporate {special_effects} digital manipulations and {custom_elements if custom_elements else 'abstract visual metaphors'} to challenge traditional narrative structures."""
|
48 |
}
|
49 |
|
50 |
base_prompt = prompt_templates.get(style.lower(), prompt_templates["cinematic"])
|