Spaces:
Sleeping
Sleeping
add log
Browse files
app.py
CHANGED
|
@@ -205,6 +205,10 @@ def preview_crop(image_path, npy_file, video_path, expand_x, expand_y, offset_x,
|
|
| 205 |
def generate_video(input_img, should_crop_face, expand_x, expand_y, offset_x, offset_y, input_video_type, input_video, input_npy_select, input_npy, input_video_frames,
|
| 206 |
settings_steps, settings_cfg_scale, settings_seed, resolution_w, resolution_h,
|
| 207 |
model_step, custom_output_path, use_custom_fps, output_fps, callback_steps, context_frames, context_stride, context_overlap, context_batch_size, anomaly_action,intropolate_factor):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
config['resolution_w'] = resolution_w
|
| 209 |
config['resolution_h'] = resolution_h
|
| 210 |
config['video_length'] = input_video_frames
|
|
@@ -245,28 +249,36 @@ def generate_video(input_img, should_crop_face, expand_x, expand_y, offset_x, of
|
|
| 245 |
|
| 246 |
input_img = cropped_image_path
|
| 247 |
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
|
| 271 |
|
| 272 |
frames_archive = None
|
|
|
|
| 205 |
def generate_video(input_img, should_crop_face, expand_x, expand_y, offset_x, offset_y, input_video_type, input_video, input_npy_select, input_npy, input_video_frames,
|
| 206 |
settings_steps, settings_cfg_scale, settings_seed, resolution_w, resolution_h,
|
| 207 |
model_step, custom_output_path, use_custom_fps, output_fps, callback_steps, context_frames, context_stride, context_overlap, context_batch_size, anomaly_action,intropolate_factor):
|
| 208 |
+
print("🚀 Generate Video started!")
|
| 209 |
+
print(f" Input image: {input_img}")
|
| 210 |
+
print(f" Video type: {input_video_type}")
|
| 211 |
+
|
| 212 |
config['resolution_w'] = resolution_w
|
| 213 |
config['resolution_h'] = resolution_h
|
| 214 |
config['video_length'] = input_video_frames
|
|
|
|
| 249 |
|
| 250 |
input_img = cropped_image_path
|
| 251 |
|
| 252 |
+
try:
|
| 253 |
+
print("📞 Calling run_inference...")
|
| 254 |
+
status, oo_video_path, all_video_path = run_inference(
|
| 255 |
+
config_path=INFER_CONFIG_PATH,
|
| 256 |
+
model_path=MODEL_PATH,
|
| 257 |
+
input_path=input_img,
|
| 258 |
+
lmk_path=lmk_path,
|
| 259 |
+
output_path=output_path,
|
| 260 |
+
model_step=model_step,
|
| 261 |
+
seed=settings_seed,
|
| 262 |
+
resolution_w=resolution_w,
|
| 263 |
+
resolution_h=resolution_h,
|
| 264 |
+
video_length=input_video_frames,
|
| 265 |
+
num_inference_steps=settings_steps,
|
| 266 |
+
guidance_scale=settings_cfg_scale,
|
| 267 |
+
output_fps=output_fps,
|
| 268 |
+
callback_steps=callback_steps,
|
| 269 |
+
context_frames=context_frames,
|
| 270 |
+
context_stride=context_stride,
|
| 271 |
+
context_overlap=context_overlap,
|
| 272 |
+
context_batch_size=context_batch_size,
|
| 273 |
+
anomaly_action=anomaly_action,
|
| 274 |
+
interpolation_factor=intropolate_factor
|
| 275 |
+
)
|
| 276 |
+
print(f"✅ Inference completed! Status: {status}")
|
| 277 |
+
except Exception as e:
|
| 278 |
+
print(f"❌ Error in run_inference: {str(e)}")
|
| 279 |
+
import traceback
|
| 280 |
+
traceback.print_exc()
|
| 281 |
+
return f"Error: {str(e)}", None, None, None
|
| 282 |
|
| 283 |
|
| 284 |
frames_archive = None
|