multimodalart HF staff commited on
Commit
481f4d5
1 Parent(s): ffb3ec5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -39,7 +39,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
39
  vae=vae,
40
  feature_extractor=safety_feature_extractor,
41
  safety_checker=safety_checker
42
- )
43
 
44
  #pipe.load_lora_weights("h94/IP-Adapter-FaceID", weight_name="ip-adapter-faceid-plusv2_sd15_lora.safetensors")
45
  #pipe.fuse_lora()
@@ -47,12 +47,11 @@ pipe = StableDiffusionPipeline.from_pretrained(
47
  ip_model = IPAdapterFaceID(pipe, ip_ckpt, device)
48
  ip_model_plus = IPAdapterFaceIDPlus(pipe, image_encoder_path, ip_plus_ckpt, device)
49
 
 
 
 
50
  @spaces.GPU(enable_queue=True)
51
  def generate_image(images, prompt, negative_prompt, preserve_face_structure, face_strength, likeness_strength, nfaa_negative_prompt, progress=gr.Progress(track_tqdm=True)):
52
- pipe.to(device)
53
- app = FaceAnalysis(name="buffalo_l", providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
54
- app.prepare(ctx_id=0, det_size=(640, 640))
55
-
56
  faceid_all_embeds = []
57
  first_iteration = True
58
  for image in images:
 
39
  vae=vae,
40
  feature_extractor=safety_feature_extractor,
41
  safety_checker=safety_checker
42
+ ).to(device)
43
 
44
  #pipe.load_lora_weights("h94/IP-Adapter-FaceID", weight_name="ip-adapter-faceid-plusv2_sd15_lora.safetensors")
45
  #pipe.fuse_lora()
 
47
  ip_model = IPAdapterFaceID(pipe, ip_ckpt, device)
48
  ip_model_plus = IPAdapterFaceIDPlus(pipe, image_encoder_path, ip_plus_ckpt, device)
49
 
50
+ app = FaceAnalysis(name="buffalo_l", providers=['CPUExecutionProvider'])
51
+ app.prepare(ctx_id=0, det_size=(640, 640))
52
+
53
  @spaces.GPU(enable_queue=True)
54
  def generate_image(images, prompt, negative_prompt, preserve_face_structure, face_strength, likeness_strength, nfaa_negative_prompt, progress=gr.Progress(track_tqdm=True)):
 
 
 
 
55
  faceid_all_embeds = []
56
  first_iteration = True
57
  for image in images: