File size: 954 Bytes
1d24639
 
 
 
 
 
 
 
 
 
 
 
 
 
12388d5
1d24639
 
 
 
 
 
 
 
 
6ec71b2
1d24639
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import spaces
import gradio as gr
from inference_utils import inference


@spaces.GPU
def send_to_model(id_image, makeup_image, guidance_scale):
    if guidance_scale is None:
        # when creating example caches.
        guidance_scale = 1.6
    return inference(id_image, makeup_image, guidance_scale, size=512)

if __name__ == "__main__":
    with gr.Blocks() as demo:

        gr.Interface(
            fn=send_to_model,
            inputs=[
                gr.Image(type="pil", label="id_image", height=512, width=512),
                gr.Image(type="pil", label="makeup_image", height=512, width=512),
                gr.Slider(minimum=1.01, maximum=3, value=1.6, step=0.05, label="guidance_scale", info="1.05-1.15 is suggested for light makeup and 2 for heavy makeup."),
            ],
            outputs="image",
            allow_flagging="never",
            description="FACE: AI Makeup",
        )
        demo.queue(max_size=10).launch()