YeahPic / app.py
c-o-s's picture
Update app.py
ad37662
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)