Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def reduce_highlight(images):
|
|
40 |
amber_error = (red_error + green_error + blue_error) / 3
|
41 |
return amber_error
|
42 |
|
43 |
-
def
|
44 |
if use_loss:
|
45 |
image = gen_image_as_per_prompt(text, styles_dict[style], seed_dict[style], reduce_highlight)
|
46 |
else:
|
@@ -49,22 +49,21 @@ def _inference(text, style, use_loss=False):
|
|
49 |
|
50 |
|
51 |
title = "Stable Diffusion with different styles"
|
52 |
-
description = "
|
53 |
-
examples = [["
|
54 |
-
["
|
55 |
-
["
|
56 |
-
["
|
57 |
|
58 |
demo = gr.Interface(
|
59 |
-
|
60 |
inputs=[
|
61 |
-
gr.Textbox(placeholder="
|
62 |
gr.Radio(styles, label="Select a Style"),
|
63 |
gr.Checkbox(label="Use custom loss")
|
64 |
],
|
65 |
outputs=[
|
66 |
-
gr.Image(width=
|
67 |
-
# gr.Text(label="output")
|
68 |
],
|
69 |
title=title,
|
70 |
description=description,
|
|
|
40 |
amber_error = (red_error + green_error + blue_error) / 3
|
41 |
return amber_error
|
42 |
|
43 |
+
def output(text, style, use_loss=False):
|
44 |
if use_loss:
|
45 |
image = gen_image_as_per_prompt(text, styles_dict[style], seed_dict[style], reduce_highlight)
|
46 |
else:
|
|
|
49 |
|
50 |
|
51 |
title = "Stable Diffusion with different styles"
|
52 |
+
description = "Explore the versatility of artistic styles by transforming your prompts. This demo takes the word 'cat' in your input and applies a unique style of your choice, giving you a fresh visual interpretation."
|
53 |
+
examples = [["A majestic lion with the playful expression of a puppy", "depthmap", True],
|
54 |
+
["A futuristic robot designed in space suit", "midjourney", True],
|
55 |
+
["A serene forest scene, with animals that resemble puppies", "cosmicgalaxy", False],
|
56 |
+
["A warrior in an ancient battlefield, with a hint of puppy charm", "concept-art", False]]
|
57 |
|
58 |
demo = gr.Interface(
|
59 |
+
output,
|
60 |
inputs=[
|
61 |
+
gr.Textbox(placeholder="Explore the versatility of artistic styles by transforming your prompts. This demo takes the word 'cat' in your input and applies a unique style of your choice, giving you a fresh visual interpretation.", container=False, scale=7),
|
62 |
gr.Radio(styles, label="Select a Style"),
|
63 |
gr.Checkbox(label="Use custom loss")
|
64 |
],
|
65 |
outputs=[
|
66 |
+
gr.Image(width=512, height=512, label="output")
|
|
|
67 |
],
|
68 |
title=title,
|
69 |
description=description,
|