kadirnar commited on
Commit
93d7b49
1 Parent(s): 42cde26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -16
app.py CHANGED
@@ -78,22 +78,32 @@ def run_inference(model_name, prompt_text):
78
  os.remove(prompt_file.name)
79
 
80
  def main():
81
- gr.Interface(
82
- fn=run_inference,
83
- inputs=[
84
- gr.Dropdown(choices=[
85
- "OpenSora-v1-16x256x256.pth",
86
- "OpenSora-v1-HQ-16x256x256.pth",
87
- "OpenSora-v1-HQ-16x512x512.pth"
88
- ],
89
- value="OpenSora-v1-16x256x256.pth",
90
- label="Model Selection"),
91
- gr.Textbox(label="Prompt Text", value="Enter prompt text here")
92
- ],
93
- outputs=gr.Video(label="Output Video"),
94
- title="Open-Sora Inference",
95
- description="Run Open-Sora Inference with Custom Parameters",
96
- ).launch()
 
 
 
 
 
 
 
 
 
 
97
 
98
  if __name__ == "__main__":
99
  main()
 
78
  os.remove(prompt_file.name)
79
 
80
  def main():
81
+ with gr.Blocks() as demo:
82
+ gr.Markdown("# Open-Sora Inference")
83
+ gr.Markdown("Run Open-Sora Inference with custom parameters.")
84
+
85
+ with gr.Row():
86
+ with gr.Column(scale=1):
87
+ model_dropdown = gr.Dropdown(
88
+ choices=[
89
+ "OpenSora-v1-16x256x256.pth",
90
+ "OpenSora-v1-HQ-16x256x256.pth",
91
+ "OpenSora-v1-HQ-16x512x512.pth"
92
+ ],
93
+ label="Model Selection"
94
+ )
95
+ prompt_text = gr.Textbox(label="Prompt Text", value="Enter prompt text here", lines=4)
96
+ submit_button = gr.Button("Run Inference")
97
+
98
+ output_video = gr.Video(label="Output Video")
99
+
100
+ submit_button.click(
101
+ fn=run_inference,
102
+ inputs=[model_dropdown, prompt_text],
103
+ outputs=output_video
104
+ )
105
+
106
+ demo.launch()
107
 
108
  if __name__ == "__main__":
109
  main()