Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,18 +24,15 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 24 |
|
| 25 |
@tool
|
| 26 |
def video_generation(
|
| 27 |
-
prompt: str
|
| 28 |
-
num_frames: int = 24,
|
| 29 |
-
num_inference_steps: int = 50,
|
| 30 |
-
guidance_scale: float = 9.0
|
| 31 |
) -> str:
|
| 32 |
"""Generate a video from text. Returns path to saved video file.
|
| 33 |
|
| 34 |
Args:
|
| 35 |
prompt (str): Text description of the desired video content
|
| 36 |
-
num_frames (int): Number of frames in output video (16-32 recommended)
|
| 37 |
-
num_inference_steps (int): Denoising steps (25-75, higher=better quality)
|
| 38 |
-
guidance_scale (float): Prompt adherence (7.0-10.0 recommended)
|
| 39 |
|
| 40 |
Returns:
|
| 41 |
str: Path to generated video file
|
|
@@ -46,9 +43,9 @@ def video_generation(
|
|
| 46 |
# Generate frames
|
| 47 |
video_frames = pipe(
|
| 48 |
prompt,
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
generator=torch.Generator().manual_seed(42) # Optional seed
|
| 53 |
).frames[0]
|
| 54 |
|
|
|
|
| 24 |
|
| 25 |
@tool
|
| 26 |
def video_generation(
|
| 27 |
+
prompt: str
|
|
|
|
|
|
|
|
|
|
| 28 |
) -> str:
|
| 29 |
"""Generate a video from text. Returns path to saved video file.
|
| 30 |
|
| 31 |
Args:
|
| 32 |
prompt (str): Text description of the desired video content
|
| 33 |
+
# num_frames (int): Number of frames in output video (16-32 recommended)
|
| 34 |
+
# num_inference_steps (int): Denoising steps (25-75, higher=better quality)
|
| 35 |
+
# guidance_scale (float): Prompt adherence (7.0-10.0 recommended)
|
| 36 |
|
| 37 |
Returns:
|
| 38 |
str: Path to generated video file
|
|
|
|
| 43 |
# Generate frames
|
| 44 |
video_frames = pipe(
|
| 45 |
prompt,
|
| 46 |
+
24,
|
| 47 |
+
50,
|
| 48 |
+
9.0,
|
| 49 |
generator=torch.Generator().manual_seed(42) # Optional seed
|
| 50 |
).frames[0]
|
| 51 |
|