Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,9 +96,11 @@ def generate_video(
|
|
| 96 |
guidance_scale: float = 5.0,
|
| 97 |
seed: int = -1,
|
| 98 |
enabled_loras: list = None,
|
| 99 |
-
lora_strength_multiplier: float = 1.0
|
|
|
|
| 100 |
):
|
| 101 |
try:
|
|
|
|
| 102 |
pipeline = initialize_pipeline()
|
| 103 |
|
| 104 |
# ββ Hot-swap / enable only selected LoRAs βββββββ
|
|
@@ -153,7 +155,18 @@ def generate_video(
|
|
| 153 |
gen_params["image"] = image
|
| 154 |
|
| 155 |
print(f"Generating: {width}x{height}, {num_frames} frames, steps={num_inference_steps}")
|
| 156 |
-
output = pipeline(**gen_params).frames[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
output_path = "output.mp4"
|
| 159 |
export_to_video(output, output_path, fps=24)
|
|
|
|
| 96 |
guidance_scale: float = 5.0,
|
| 97 |
seed: int = -1,
|
| 98 |
enabled_loras: list = None,
|
| 99 |
+
lora_strength_multiplier: float = 1.0,
|
| 100 |
+
progress=gr.Progress()
|
| 101 |
):
|
| 102 |
try:
|
| 103 |
+
|
| 104 |
pipeline = initialize_pipeline()
|
| 105 |
|
| 106 |
# ββ Hot-swap / enable only selected LoRAs βββββββ
|
|
|
|
| 155 |
gen_params["image"] = image
|
| 156 |
|
| 157 |
print(f"Generating: {width}x{height}, {num_frames} frames, steps={num_inference_steps}")
|
| 158 |
+
#output = pipeline(**gen_params).frames[0]
|
| 159 |
+
|
| 160 |
+
progress(0, desc="Starting generation...")
|
| 161 |
+
|
| 162 |
+
def step_callback(step, timestep, latents):
|
| 163 |
+
progress(step / num_inference_steps, desc=f"Step {step+1}/{num_inference_steps}")
|
| 164 |
+
|
| 165 |
+
output = pipeline(
|
| 166 |
+
**gen_params,
|
| 167 |
+
callback=step_callback,
|
| 168 |
+
callback_steps=1,
|
| 169 |
+
).frames[0]
|
| 170 |
|
| 171 |
output_path = "output.mp4"
|
| 172 |
export_to_video(output, output_path, fps=24)
|