Spaces:
Running
on
Zero
Running
on
Zero
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from llm_inference_video import VideoLLMInferenceNode
|
3 |
+
import random
|
4 |
+
|
5 |
+
title = """<h1 align="center">CineGen: AI Video Prompt Architect</h1>
|
6 |
+
<p align="center">Generate cinematic video prompts with technical specifications</p>"""
|
7 |
+
|
8 |
+
def create_video_interface():
|
9 |
+
llm_node = VideoLLMInferenceNode()
|
10 |
+
|
11 |
+
with gr.Blocks(theme='bethecloud/storj_theme') as demo:
|
12 |
+
gr.HTML(title)
|
13 |
+
|
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"],
|
26 |
+
value="Steadicam flow",
|
27 |
+
label="Camera Movement Style"
|
28 |
+
)
|
29 |
+
|
30 |
+
with gr.Column(scale=2):
|
31 |
+
pacing = gr.Dropdown(
|
32 |
+
choices=["Slow burn", "Rhythmic pulse", "Frantic energy", "Ebb and flow", "Hypnotic drift"],
|
33 |
+
value="Rhythmic pulse",
|
34 |
+
label="Pacing Rhythm"
|
35 |
+
)
|
36 |
+
special_effects = gr.Dropdown(
|
37 |
+
choices=["Practical effects", "CGI enhancement", "Analog glitches",
|
38 |
+
"Light painting", "Projection mapping", "Nanosecond exposures"],
|
39 |
+
value="Practical effects",
|
40 |
+
label="SFX Approach"
|
41 |
+
)
|
42 |
+
custom_elements = gr.Textbox(label="Custom Technical Elements",
|
43 |
+
placeholder="e.g., Infrared hybrid, Datamosh transitions")
|
44 |
+
|
45 |
+
provider = gr.Dropdown(
|
46 |
+
choices=["Hugging Face", "Groq", "SambaNova"],
|
47 |
+
value="Hugging Face",
|
48 |
+
label="LLM Provider"
|
49 |
+
)
|
50 |
+
model = gr.Dropdown(label="Model", value="meta-llama/Meta-Llama-3.1-70B-Instruct")
|
51 |
+
|
52 |
+
generate_btn = gr.Button("Generate Video Blueprint", variant="primary")
|
53 |
+
output = gr.Textbox(label="Video Production Prompt", lines=12, interactive=False)
|
54 |
+
|
55 |
+
generate_btn.click(
|
56 |
+
llm_node.generate_video_prompt,
|
57 |
+
inputs=[input_concept, duration, style, camera_style, pacing, special_effects,
|
58 |
+
custom_elements, provider, model],
|
59 |
+
outputs=output
|
60 |
+
)
|
61 |
+
|
62 |
+
return demo
|
63 |
+
|
64 |
+
if __name__ == "__main__":
|
65 |
+
demo = create_video_interface()
|
66 |
+
demo.launch(share=True)
|