Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
|
@@ -24,7 +25,7 @@ pipe.to("cuda")
|
|
24 |
app = FaceAnalysis(name='buffalo_l')
|
25 |
app.prepare(ctx_id=0, det_size=(640, 640))
|
26 |
|
27 |
-
|
28 |
def face_swap(src_img, dest_img):
|
29 |
src_img = Image.open('./images/' + src_img + '.JPG')
|
30 |
|
@@ -53,7 +54,7 @@ def face_swap(src_img, dest_img):
|
|
53 |
|
54 |
return final_image
|
55 |
|
56 |
-
|
57 |
def greet(description,color,features,occasion,type_,face):
|
58 |
|
59 |
# Parse input
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
|
|
|
25 |
app = FaceAnalysis(name='buffalo_l')
|
26 |
app.prepare(ctx_id=0, det_size=(640, 640))
|
27 |
|
28 |
+
@spaces.GPU(enable_queue=True)
|
29 |
def face_swap(src_img, dest_img):
|
30 |
src_img = Image.open('./images/' + src_img + '.JPG')
|
31 |
|
|
|
54 |
|
55 |
return final_image
|
56 |
|
57 |
+
@spaces.GPU(enable_queue=True)
|
58 |
def greet(description,color,features,occasion,type_,face):
|
59 |
|
60 |
# Parse input
|