Spaces:
Runtime error
Runtime error
Commit
·
86bd99c
1
Parent(s):
52c3429
Add validations
Browse files
app.py
CHANGED
|
@@ -34,6 +34,19 @@ def create(
|
|
| 34 |
|
| 35 |
output_path = f"output_{mode}_{used_seed}.mp4"
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
config = InferenceConfig(
|
| 38 |
pipeline_config="configs/ltxv-2b-0.9.8-distilled.yaml",
|
| 39 |
prompt=prompt,
|
|
|
|
| 34 |
|
| 35 |
output_path = f"output_{mode}_{used_seed}.mp4"
|
| 36 |
|
| 37 |
+
# Validate mode-specific required parameters
|
| 38 |
+
if mode == "image-to-video":
|
| 39 |
+
if not input_image_filepath:
|
| 40 |
+
raise gr.Error("input_image_filepath is required for image-to-video mode")
|
| 41 |
+
elif mode == "video-to-video":
|
| 42 |
+
if not input_video_filepath:
|
| 43 |
+
raise gr.Error("input_video_filepath is required for video-to-video mode")
|
| 44 |
+
elif mode == "text-to-video":
|
| 45 |
+
# No additional file inputs required for text-to-video
|
| 46 |
+
pass
|
| 47 |
+
else:
|
| 48 |
+
raise gr.Error(f"Invalid mode: {mode}. Must be one of: text-to-video, image-to-video, video-to-video")
|
| 49 |
+
|
| 50 |
config = InferenceConfig(
|
| 51 |
pipeline_config="configs/ltxv-2b-0.9.8-distilled.yaml",
|
| 52 |
prompt=prompt,
|