Richard Neuschulz commited on
Commit
ca07f5f
1 Parent(s): e491d44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -41,6 +41,11 @@ ip_model = ipown.IPAdapterFaceIDXL(pipe, ip_ckpt, device)
41
 
42
  @spaces.GPU(enable_queue=True)
43
  def generate_image(images, prompt, negative_prompt, face_strength, likeness_strength, progress=gr.Progress(track_tqdm=True)):
 
 
 
 
 
44
  pipe.to(device)
45
  app = FaceAnalysis(name="buffalo_l", providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
46
  app.prepare(ctx_id=0, det_size=(640, 640))
 
41
 
42
  @spaces.GPU(enable_queue=True)
43
  def generate_image(images, prompt, negative_prompt, face_strength, likeness_strength, progress=gr.Progress(track_tqdm=True)):
44
+
45
+ # Clear GPU memory
46
+ torch.cuda.empty_cache()
47
+
48
+ # Start the process
49
  pipe.to(device)
50
  app = FaceAnalysis(name="buffalo_l", providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
51
  app.prepare(ctx_id=0, det_size=(640, 640))