File size: 809 Bytes
66b0cef
9b4118a
66b0cef
434846f
8a42a65
9b4118a
 
 
 
 
bce0716
9b4118a
bce0716
 
147944d
4cb2cd7
 
 
 
147944d
bce0716
434846f
f7420b8
9b4118a
09fb843
9b4118a
 
f7420b8
 
94f65a5
434846f
8a42a65
9b4118a
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
import gradio as gr
import random

model = gr.load("models/Purz/face-projection")

def generate_image(text, seed):
    if seed is not None:
        random.seed(seed)

    if text in [example[0] for example in examples]:
        print(f"Using example: {text}")

    return model(text)

examples = [
    ["Humanoid Cat Warrior, Full View", None],
    ["Fantasy dragon", None],
    ["Future Robots war", None],
    ["Warhammer Sisterhood", None]
]

interface = gr.Interface(
    fn=generate_image,
    inputs=[
        gr.Textbox(label="Type here your imagination:", placeholder="Type or click an example..."),
        gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)")
    ],
    outputs=gr.Image(label="Generated Image"),
    examples=examples,
    theme="NoCrypt/miku",
)

interface.launch()