File size: 1,507 Bytes
097e86c
 
 
 
 
ad37662
097e86c
 
 
 
 
 
 
 
 
ad37662
 
 
 
 
 
 
 
 
097e86c
 
 
 
 
ad37662
 
097e86c
 
 
ad37662
097e86c
 
 
ad37662
 
097e86c
 
 
ad37662
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import gradio as gr

sex_value = ""
age_value = 0


def prompt(user_upload, name, sex_value, age_value):

    if sex_value == "male":
        sex = "man"
    elif sex_value == "female":
        sex = "women"
    else:
        sex = "nutral person"

    processed_output=[
    "output/demo1.jpg", 
    "output/demo2.jpg",
    "output/demo3.jpg",
    "output/demo4.jpg",
    "output/demo5.jpg"
    ]

    return f"RAW photo, VAR TRIGGERWORD, photo a {sex} ,wearing a suit, {age_value} years old,standing on a huge stage, energetic pose, wide shot, huge american flag in background, stage lighting --n (deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation", name, processed_output


demo = gr.Interface(
    fn=prompt,
    inputs=[
        gr.Files(label="upload 10 pics", file_count="directory", file_types=["image", ".jpg"]),
        #gr.Button(value="load demo files"),
        gr.Textbox(label="name"),
        gr.Radio(["male", "female", "none binary"], label="sex"),
        gr.Slider(18, 99, step=1, label="age")
    ],
    outputs=[
        gr.Textbox(label="prompt"),
        gr.Textbox(label="name"),
        gr.Gallery(label="processed images", columns=[3])
        #gr.Textbox(label="file list")
    ]
)

demo.launch(share=True)