Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,20 +3,13 @@ import random
|
|
3 |
|
4 |
model = gr.load("models/Purz/face-projection")
|
5 |
|
6 |
-
def generate_image(text, seed
|
7 |
if seed is not None:
|
8 |
random.seed(seed)
|
9 |
|
10 |
if text in [example[0] for example in examples]:
|
11 |
print(f"Using example: {text}")
|
12 |
|
13 |
-
if style == "Anime":
|
14 |
-
text = f"Anime style, {text}"
|
15 |
-
elif style == "Realistic":
|
16 |
-
text = f"Realistic style, {text}"
|
17 |
-
elif style == "Photographic":
|
18 |
-
text = f"Photographic style, {text}"
|
19 |
-
|
20 |
return model(text)
|
21 |
|
22 |
examples = [
|
@@ -30,8 +23,7 @@ interface = gr.Interface(
|
|
30 |
fn=generate_image,
|
31 |
inputs=[
|
32 |
gr.Textbox(label="Type here your imagination:", placeholder="Type or click an example..."),
|
33 |
-
gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)")
|
34 |
-
gr.Radio(choices=["Anime", "Realistic", "Photographic"], label="Style", value="Realistic")
|
35 |
],
|
36 |
outputs=gr.Image(label="Generated Image"),
|
37 |
examples=examples,
|
|
|
3 |
|
4 |
model = gr.load("models/Purz/face-projection")
|
5 |
|
6 |
+
def generate_image(text, seed):
|
7 |
if seed is not None:
|
8 |
random.seed(seed)
|
9 |
|
10 |
if text in [example[0] for example in examples]:
|
11 |
print(f"Using example: {text}")
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
return model(text)
|
14 |
|
15 |
examples = [
|
|
|
23 |
fn=generate_image,
|
24 |
inputs=[
|
25 |
gr.Textbox(label="Type here your imagination:", placeholder="Type or click an example..."),
|
26 |
+
gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)")
|
|
|
27 |
],
|
28 |
outputs=gr.Image(label="Generated Image"),
|
29 |
examples=examples,
|