Update app.py
Browse files
app.py
CHANGED
|
@@ -1,37 +1,7 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import subprocess
|
| 3 |
-
import uuid
|
| 4 |
-
import os
|
| 5 |
-
|
| 6 |
-
def generate_video(prompt, style, duration):
|
| 7 |
-
video_id = str(uuid.uuid4())[:8]
|
| 8 |
-
output_path = f"{video_id}.mp4"
|
| 9 |
|
| 10 |
-
|
| 11 |
-
seconds = int(duration)
|
| 12 |
-
|
| 13 |
-
command = [
|
| 14 |
-
"python", "generate.py",
|
| 15 |
-
"--size", resolution,
|
| 16 |
-
"--prompt", prompt,
|
| 17 |
-
"--output", output_path,
|
| 18 |
-
"--duration", str(seconds)
|
| 19 |
-
]
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
return output_path
|
| 24 |
-
except Exception as e:
|
| 25 |
-
return f"Σφάλμα: {e}"
|
| 26 |
|
| 27 |
-
gr.Interface(
|
| 28 |
-
fn=generate_video,
|
| 29 |
-
inputs=[
|
| 30 |
-
gr.Textbox(label="Περιγραφή βίντεο", placeholder="π.χ. Ένα ηλιοβασίλεμα στη Σαντορίνη"),
|
| 31 |
-
gr.Radio(["Cinematic", "Simple"], label="Στυλ"),
|
| 32 |
-
gr.Slider(1, 10, value=5, label="Διάρκεια (δευτερόλεπτα)")
|
| 33 |
-
],
|
| 34 |
-
outputs=gr.Video(label="Το βίντεό σου"),
|
| 35 |
-
title="Text-to-Video Generator",
|
| 36 |
-
description="Δώσε μια περιγραφή και δημιούργησε ένα demo βίντεο!"
|
| 37 |
-
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
+
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
def hello(name):
|
| 5 |
+
return f"Γεια σου, {name}!"
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
gr.Interface(fn=hello, inputs="text", outputs="text").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|