roll-ai commited on
Commit
776193b
·
verified ·
1 Parent(s): 7134edf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -22
app.py CHANGED
@@ -110,25 +110,31 @@ def run_inference(prompt, image, pose_type, speed, use_flow_integration, cam_pos
110
  # 3. Gradio App Interface
111
  # =========================================
112
 
113
- with gr.Blocks() as demo:
114
- gr.Markdown("## 🎥 FloVD: Optical Flow + CogVideoX Video Generation")
115
- with gr.Row():
116
- with gr.Column():
117
- prompt = gr.Textbox(label="Prompt", value="A girl riding a bicycle through a park.")
118
- image = gr.Image(type="pil", label="Input Image")
119
- pose_type = gr.Radio(choices=["manual", "re10k"], value="manual", label="Camera Pose Type")
120
- cam_pose_name = gr.Textbox(label="Camera Trajectory Name", placeholder="e.g. zoom_in, tilt_up")
121
- speed = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=0.5, label="Speed")
122
- use_flow_integration = gr.Checkbox(label="Use Flow Integration", value=False)
123
- submit = gr.Button("Generate Video")
124
- with gr.Column():
125
- output_video = gr.Video(label="Generated Video")
126
- output_logs = gr.Textbox(label="Logs", lines=20, interactive=False)
127
-
128
- submit.click(
129
- fn=run_inference,
130
- inputs=[prompt, image, pose_type, speed, use_flow_integration, cam_pose_name],
131
- outputs=[output_video, output_logs]
132
- )
133
-
134
- demo.launch(show_error=True)
 
 
 
 
 
 
 
110
  # 3. Gradio App Interface
111
  # =========================================
112
 
113
+ demo = gr.Interface(
114
+ fn=run_inference,
115
+ inputs=[
116
+ gr.Textbox(label="Prompt", value="A girl riding a bicycle through a park."),
117
+ gr.Image(type="pil", label="Input Image"),
118
+ gr.Radio(choices=["manual", "re10k"], value="manual", label="Camera Pose Type"),
119
+ gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=0.5, label="Camera Speed"),
120
+ gr.Checkbox(label="Use Flow Integration", value=False),
121
+ gr.Dropdown(
122
+ choices=["zoom_in", "zoom_out", "tilt_up", "tilt_down", "circle", ""],
123
+ label="Camera Trajectory",
124
+ value="zoom_in",
125
+ allow_custom_value=True
126
+ )
127
+ ],
128
+ outputs=[
129
+ gr.Video(label="Generated Video"),
130
+ gr.Textbox(label="Logs", lines=20, interactive=False),
131
+ ],
132
+ title="🎥 FloVD: Optical Flow + CogVideoX Video Generation",
133
+ description="Upload an image and prompt to generate motion-controlled video using FloVD and CogVideoX."
134
+ )
135
+
136
+ # -----------------------------
137
+ # Launch the App
138
+ # -----------------------------
139
+ if __name__ == "__main__":
140
+ demo.launch(server_name="0.0.0.0", server_port=7860)