fffiloni commited on
Commit
bb96703
·
verified ·
1 Parent(s): 740e739

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -40,11 +40,7 @@ try:
40
  raise FileNotFoundError(f"Base model not found at: {BASE_MODEL_PATH}")
41
  if not os.path.exists(LORA_MODEL_PATH):
42
  raise FileNotFoundError(f"LoRA model not found at: {LORA_MODEL_PATH}")
43
-
44
- face_processor = FaceProcessor(antelopv2_path=ANTELOPEV2_PATH)
45
- pipe = load_wan_pipe(base_path=BASE_MODEL_PATH, torch_dtype=torch.bfloat16)
46
- set_stand_in(pipe, model_path=LORA_MODEL_PATH)
47
- print("Model loaded successfully!")
48
  except Exception as e:
49
  print(f"Model loading failed: {e}")
50
  with gr.Blocks() as demo:
@@ -74,6 +70,11 @@ def generate_video(
74
  if pil_image is None:
75
  raise gr.Error("Please upload a face image first!")
76
 
 
 
 
 
 
77
  print("Processing face...")
78
  ip_image = face_processor.process(pil_image)
79
  print("Face processing completed.")
 
40
  raise FileNotFoundError(f"Base model not found at: {BASE_MODEL_PATH}")
41
  if not os.path.exists(LORA_MODEL_PATH):
42
  raise FileNotFoundError(f"LoRA model not found at: {LORA_MODEL_PATH}")
43
+
 
 
 
 
44
  except Exception as e:
45
  print(f"Model loading failed: {e}")
46
  with gr.Blocks() as demo:
 
70
  if pil_image is None:
71
  raise gr.Error("Please upload a face image first!")
72
 
73
+ face_processor = FaceProcessor(antelopv2_path=ANTELOPEV2_PATH)
74
+ pipe = load_wan_pipe(base_path=BASE_MODEL_PATH, torch_dtype=torch.bfloat16)
75
+ set_stand_in(pipe, model_path=LORA_MODEL_PATH)
76
+ print("Model loaded successfully!")
77
+
78
  print("Processing face...")
79
  ip_image = face_processor.process(pil_image)
80
  print("Face processing completed.")