Spaces:
Sleeping
Sleeping
Commit
·
d104cb7
1
Parent(s):
6e6e228
css
Browse files
app.py
CHANGED
@@ -3,106 +3,137 @@ import gradio as gr
|
|
3 |
# Load the model
|
4 |
model = gr.load("models/strangerzonehf/Flux-Midjourney-Mix2-LoRA")
|
5 |
|
6 |
-
#
|
7 |
custom_css = """
|
8 |
body {
|
9 |
-
background-color: #1b1b1b; /*
|
10 |
-
color: #
|
11 |
-
font-family: 'Palatino Linotype', serif; /*
|
12 |
margin: 0;
|
13 |
padding: 0;
|
14 |
display: flex;
|
15 |
flex-direction: column;
|
16 |
align-items: center;
|
17 |
-
justify-content:
|
18 |
height: 100vh;
|
19 |
}
|
20 |
|
21 |
.gradio-container {
|
22 |
-
max-width:
|
23 |
margin: auto;
|
24 |
-
padding:
|
25 |
-
background: linear-gradient(145deg, #2e2b2a, #3a3433); /*
|
26 |
-
border:
|
27 |
border-radius: 15px;
|
28 |
-
box-shadow: 0 0
|
29 |
}
|
30 |
|
31 |
h1, h2 {
|
32 |
-
color: #ffd700;
|
33 |
-
text-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
text-align: center;
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
textarea, input[type="text"] {
|
38 |
-
background-color: #
|
39 |
-
color: #f5e6ca;
|
40 |
-
border: 2px solid #8b4513;
|
41 |
border-radius: 5px;
|
42 |
padding: 10px;
|
43 |
-
font-family: 'Palatino Linotype', serif;
|
44 |
font-size: 16px;
|
45 |
}
|
46 |
|
47 |
textarea:focus, input[type="text"]:focus {
|
48 |
outline: none;
|
49 |
-
border-color: #ffd700;
|
50 |
-
box-shadow: 0 0
|
51 |
}
|
52 |
|
53 |
button {
|
54 |
-
background: #8b4513;
|
55 |
color: #f0e6d2;
|
56 |
-
font-family: 'Palatino Linotype', serif;
|
57 |
font-size: 18px;
|
|
|
58 |
border: none;
|
59 |
border-radius: 8px;
|
60 |
-
padding: 12px
|
61 |
cursor: pointer;
|
62 |
transition: 0.3s ease-in-out;
|
63 |
-
box-shadow: 0 0
|
64 |
}
|
65 |
|
66 |
button:hover {
|
67 |
-
background: #a0522d;
|
68 |
-
box-shadow: 0 0
|
69 |
}
|
70 |
|
71 |
.gradio-output {
|
72 |
-
background
|
73 |
color: #ffd700;
|
74 |
-
border:
|
75 |
border-radius: 8px;
|
76 |
-
|
77 |
-
padding: 15px;
|
78 |
text-align: center;
|
|
|
79 |
}
|
80 |
|
81 |
.gradio-output img {
|
82 |
max-width: 100%;
|
83 |
border: 2px solid #a0522d;
|
84 |
border-radius: 8px;
|
85 |
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.
|
86 |
}
|
87 |
|
88 |
.footer {
|
89 |
-
margin-top: 20px;
|
90 |
-
font-size: 14px;
|
91 |
text-align: center;
|
|
|
92 |
color: #ffd700;
|
|
|
93 |
text-shadow: 1px 1px #7c5200;
|
94 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
"""
|
96 |
|
97 |
-
# Define Gradio interface
|
98 |
iface = gr.Interface(
|
99 |
-
fn=model,
|
100 |
-
inputs=gr.Textbox(lines=3, label="Enter Your Quest
|
101 |
-
outputs=gr.Image(type="pil", label="Your
|
102 |
title="🛡️ Dungeons & Dragons Image Generator ⚔️",
|
103 |
-
description="
|
|
|
|
|
104 |
css=custom_css
|
105 |
)
|
106 |
|
107 |
-
# Launch the interface
|
108 |
iface.launch()
|
|
|
3 |
# Load the model
|
4 |
model = gr.load("models/strangerzonehf/Flux-Midjourney-Mix2-LoRA")
|
5 |
|
6 |
+
# Enhanced D&D-themed CSS with previously used styles and new additions
|
7 |
custom_css = """
|
8 |
body {
|
9 |
+
background-color: #1b1b1b; /* Dungeon-like backdrop */
|
10 |
+
color: #f5f5f5;
|
11 |
+
font-family: 'Palatino Linotype', serif; /* Fantasy-themed font */
|
12 |
margin: 0;
|
13 |
padding: 0;
|
14 |
display: flex;
|
15 |
flex-direction: column;
|
16 |
align-items: center;
|
17 |
+
justify-content: flex-start;
|
18 |
height: 100vh;
|
19 |
}
|
20 |
|
21 |
.gradio-container {
|
22 |
+
max-width: 950px;
|
23 |
margin: auto;
|
24 |
+
padding: 30px;
|
25 |
+
background: linear-gradient(145deg, #2e2b2a, #3a3433); /* Mystic gradient for depth */
|
26 |
+
border: 4px solid #8b4513;
|
27 |
border-radius: 15px;
|
28 |
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
|
29 |
}
|
30 |
|
31 |
h1, h2 {
|
32 |
+
color: #ffd700;
|
33 |
+
text-align: center;
|
34 |
+
text-shadow: 2px 2px #7c5200; /* Gold shine effect */
|
35 |
+
}
|
36 |
+
|
37 |
+
.description {
|
38 |
+
margin-top: 15px;
|
39 |
+
color: #d4af37; /* Lighter gold for elegance */
|
40 |
+
font-size: 18px;
|
41 |
+
line-height: 1.6;
|
42 |
text-align: center;
|
43 |
}
|
44 |
|
45 |
+
a {
|
46 |
+
color: #ffd700;
|
47 |
+
text-decoration: none;
|
48 |
+
font-weight: bold;
|
49 |
+
}
|
50 |
+
|
51 |
+
a:hover {
|
52 |
+
color: #ffcc33; /* Brighter gold for interactivity */
|
53 |
+
}
|
54 |
+
|
55 |
textarea, input[type="text"] {
|
56 |
+
background-color: #292828;
|
57 |
+
color: #f5e6ca;
|
58 |
+
border: 2px solid #8b4513;
|
59 |
border-radius: 5px;
|
60 |
padding: 10px;
|
61 |
+
font-family: 'Palatino Linotype', serif;
|
62 |
font-size: 16px;
|
63 |
}
|
64 |
|
65 |
textarea:focus, input[type="text"]:focus {
|
66 |
outline: none;
|
67 |
+
border-color: #ffd700;
|
68 |
+
box-shadow: 0 0 8px #ffd700;
|
69 |
}
|
70 |
|
71 |
button {
|
72 |
+
background: #8b4513;
|
73 |
color: #f0e6d2;
|
|
|
74 |
font-size: 18px;
|
75 |
+
font-family: 'Palatino Linotype', serif;
|
76 |
border: none;
|
77 |
border-radius: 8px;
|
78 |
+
padding: 12px 30px;
|
79 |
cursor: pointer;
|
80 |
transition: 0.3s ease-in-out;
|
81 |
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
|
82 |
}
|
83 |
|
84 |
button:hover {
|
85 |
+
background: #a0522d;
|
86 |
+
box-shadow: 0 0 15px #ffd700;
|
87 |
}
|
88 |
|
89 |
.gradio-output {
|
90 |
+
background: #2f2f2f;
|
91 |
color: #ffd700;
|
92 |
+
border: 2px solid #8b4513;
|
93 |
border-radius: 8px;
|
94 |
+
padding: 20px;
|
|
|
95 |
text-align: center;
|
96 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
97 |
}
|
98 |
|
99 |
.gradio-output img {
|
100 |
max-width: 100%;
|
101 |
border: 2px solid #a0522d;
|
102 |
border-radius: 8px;
|
103 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
|
104 |
}
|
105 |
|
106 |
.footer {
|
|
|
|
|
107 |
text-align: center;
|
108 |
+
margin-top: 30px;
|
109 |
color: #ffd700;
|
110 |
+
font-size: 14px;
|
111 |
text-shadow: 1px 1px #7c5200;
|
112 |
}
|
113 |
+
|
114 |
+
.footer a {
|
115 |
+
color: #ffd700;
|
116 |
+
text-decoration: none;
|
117 |
+
margin: 0 10px;
|
118 |
+
}
|
119 |
+
|
120 |
+
.footer a:hover {
|
121 |
+
color: #ffcc33;
|
122 |
+
text-shadow: 2px 2px #ff9900;
|
123 |
+
}
|
124 |
"""
|
125 |
|
126 |
+
# Define Gradio interface with enhanced description and external links
|
127 |
iface = gr.Interface(
|
128 |
+
fn=model,
|
129 |
+
inputs=gr.Textbox(lines=3, label="🎲 Enter Your Quest:", placeholder="Describe your scene, hero, or epic landscape..."),
|
130 |
+
outputs=gr.Image(type="pil", label="🖼️ Your Legendary Vision"),
|
131 |
title="🛡️ Dungeons & Dragons Image Generator ⚔️",
|
132 |
+
description="**Unleash Your Imagination!** Create heroes, maps, quests, and epic scenes to bring your campaigns to life. "
|
133 |
+
"Tailored for adventurers seeking inspiration or Dungeon Masters constructing their next grand story. <br>"
|
134 |
+
"[Visit Our Website](https://chatdnd.net) | [Support Us](https://buymeacoffee.com/watchoutformike)",
|
135 |
css=custom_css
|
136 |
)
|
137 |
|
138 |
+
# Launch the Gradio interface
|
139 |
iface.launch()
|