Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -81,22 +81,26 @@ def inference(text, style, inference_step, guidance_scale, seed, guidance_method
|
|
81 |
|
82 |
return image_pipeline, image_guide
|
83 |
|
84 |
-
title = "
|
85 |
description = "A simple Gradio interface to infer Stable Diffusion and generate images with different art styles"
|
86 |
-
examples = [
|
87 |
-
|
|
|
|
|
|
|
|
|
88 |
|
89 |
demo = gr.Interface(inference,
|
90 |
inputs = [gr.Textbox(label="Prompt", type="text"),
|
91 |
gr.Dropdown(label="Style", choices=list(style_token_dict.keys()), value="Illustration Style"),
|
92 |
-
gr.Slider(10, 30,
|
93 |
gr.Slider(1, 10, 7.5, step = 0.1, label="Guidance scale"),
|
94 |
-
gr.Slider(0, 10000,
|
95 |
gr.Dropdown(label="Guidance method", choices=['Grayscale', 'Bright', 'Contrast',
|
96 |
'Symmetry', 'Saturation'], value="Grayscale"),
|
97 |
gr.Slider(100, 10000, 200, step = 100, label="Loss scale")],
|
98 |
-
outputs= [gr.Image(width=
|
99 |
-
gr.Image(width=
|
100 |
title=title,
|
101 |
description=description,
|
102 |
examples=examples)
|
|
|
81 |
|
82 |
return image_pipeline, image_guide
|
83 |
|
84 |
+
title = "Generative with Textual Inversion"
|
85 |
description = "A simple Gradio interface to infer Stable Diffusion and generate images with different art styles"
|
86 |
+
examples = [
|
87 |
+
["A majestic castle on a floating island", 'Illustration Style', 20, 7.5, 42, 'Grayscale', 200],
|
88 |
+
["A cyberpunk cityscape at night", 'Midjourney', 25, 8.0, 123, 'Contrast', 300],
|
89 |
+
["A serene Japanese garden with cherry blossoms", 'Hanfu Anime', 15, 6.5, 789, 'Saturation', 250],
|
90 |
+
["An abstract representation of emotions", 'Marc Allante', 30, 9.0, 1010, 'Symmetry', 400]
|
91 |
+
]
|
92 |
|
93 |
demo = gr.Interface(inference,
|
94 |
inputs = [gr.Textbox(label="Prompt", type="text"),
|
95 |
gr.Dropdown(label="Style", choices=list(style_token_dict.keys()), value="Illustration Style"),
|
96 |
+
gr.Slider(10, 30, 20, step = 1, label="Inference steps"),
|
97 |
gr.Slider(1, 10, 7.5, step = 0.1, label="Guidance scale"),
|
98 |
+
gr.Slider(0, 10000, 42, step = 1, label="Seed"),
|
99 |
gr.Dropdown(label="Guidance method", choices=['Grayscale', 'Bright', 'Contrast',
|
100 |
'Symmetry', 'Saturation'], value="Grayscale"),
|
101 |
gr.Slider(100, 10000, 200, step = 100, label="Loss scale")],
|
102 |
+
outputs= [gr.Image(width=512, height=512, label="Generated art"),
|
103 |
+
gr.Image(width=512, height=512, label="Generated art with guidance")],
|
104 |
title=title,
|
105 |
description=description,
|
106 |
examples=examples)
|