Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,12 +102,12 @@ def calculate_dimensions(width, height):
|
|
| 102 |
|
| 103 |
@spaces.GPU(duration=120)
|
| 104 |
def generate_video(prompt, first_image_path, last_image_path, duration_seconds):
|
| 105 |
-
model_management.load_models_gpu(valid_models)
|
| 106 |
# Create a temporary directory for resized images
|
| 107 |
temp_dir = f"temp_resized_{uuid.uuid4().hex}"
|
| 108 |
os.makedirs(temp_dir, exist_ok=True)
|
| 109 |
|
| 110 |
with torch.inference_mode():
|
|
|
|
| 111 |
# --- Python Image Preprocessing using Pillow ---
|
| 112 |
print("Preprocessing images with Pillow...")
|
| 113 |
with Image.open(first_image_path) as img:
|
|
|
|
| 102 |
|
| 103 |
@spaces.GPU(duration=120)
|
| 104 |
def generate_video(prompt, first_image_path, last_image_path, duration_seconds):
|
|
|
|
| 105 |
# Create a temporary directory for resized images
|
| 106 |
temp_dir = f"temp_resized_{uuid.uuid4().hex}"
|
| 107 |
os.makedirs(temp_dir, exist_ok=True)
|
| 108 |
|
| 109 |
with torch.inference_mode():
|
| 110 |
+
model_management.load_models_gpu(valid_models)
|
| 111 |
# --- Python Image Preprocessing using Pillow ---
|
| 112 |
print("Preprocessing images with Pillow...")
|
| 113 |
with Image.open(first_image_path) as img:
|