Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,7 +92,6 @@ pathchsageattentionkj_96_high = pathchsageattentionkj.patch(sage_attention="auto
|
|
| 92 |
|
| 93 |
model_loaders = [cliploader_38, unetloader_37_low_noise, unetloader_91_high_noise, vaeloader_39, clipvisionloader_49, loraloadermodelonly_94_high, loraloadermodelonly_95_low]
|
| 94 |
valid_models = [getattr(loader[0], 'patcher', loader[0]) for loader in model_loaders if not isinstance(loader[0], dict) and not isinstance(getattr(loader[0], 'patcher', None), dict)]
|
| 95 |
-
model_management.load_models_gpu(valid_models)
|
| 96 |
|
| 97 |
# --- App Logic ---
|
| 98 |
def calculate_dimensions(width, height):
|
|
@@ -103,6 +102,7 @@ def calculate_dimensions(width, height):
|
|
| 103 |
|
| 104 |
@spaces.GPU(duration=120)
|
| 105 |
def generate_video(prompt, first_image_path, last_image_path, duration_seconds):
|
|
|
|
| 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)
|
|
|
|
| 92 |
|
| 93 |
model_loaders = [cliploader_38, unetloader_37_low_noise, unetloader_91_high_noise, vaeloader_39, clipvisionloader_49, loraloadermodelonly_94_high, loraloadermodelonly_95_low]
|
| 94 |
valid_models = [getattr(loader[0], 'patcher', loader[0]) for loader in model_loaders if not isinstance(loader[0], dict) and not isinstance(getattr(loader[0], 'patcher', None), dict)]
|
|
|
|
| 95 |
|
| 96 |
# --- App Logic ---
|
| 97 |
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)
|