multimodalart HF staff commited on
Commit
42e179a
β€’
1 Parent(s): 544fa37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -5,9 +5,6 @@ from ip_adapter.ip_adapter_faceid import IPAdapterFaceID
5
  from huggingface_hub import hf_hub_download
6
  from insightface.app import FaceAnalysis
7
 
8
-
9
- app = FaceAnalysis(name="buffalo_l", providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
10
-
11
  base_model_path = "SG161222/Realistic_Vision_V4.0_noVAE"
12
  vae_model_path = "stabilityai/sd-vae-ft-mse"
13
  ip_ckpt = hf_hub_download(repo_id='h94/IP-Adapter-FaceID', filename="ip-adapter-faceid_sd15.bin", repo_type="model")
@@ -43,6 +40,7 @@ def generate_faceid_embeddings(image):
43
 
44
  @spaces.GPU
45
  def generate_image(image, prompt, negative_prompt):
 
46
  app.prepare(ctx_id=0, det_size=(640, 640))
47
  pipe.to(device)
48
  faceid_embeds = generate_faceid_embeddings(image)
 
5
  from huggingface_hub import hf_hub_download
6
  from insightface.app import FaceAnalysis
7
 
 
 
 
8
  base_model_path = "SG161222/Realistic_Vision_V4.0_noVAE"
9
  vae_model_path = "stabilityai/sd-vae-ft-mse"
10
  ip_ckpt = hf_hub_download(repo_id='h94/IP-Adapter-FaceID', filename="ip-adapter-faceid_sd15.bin", repo_type="model")
 
40
 
41
  @spaces.GPU
42
  def generate_image(image, prompt, negative_prompt):
43
+ app = FaceAnalysis(name="buffalo_l", providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
44
  app.prepare(ctx_id=0, det_size=(640, 640))
45
  pipe.to(device)
46
  faceid_embeds = generate_faceid_embeddings(image)