Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,24 +87,24 @@ def update_dimensions_from_image(image_list):
|
|
| 87 |
return new_width, new_height
|
| 88 |
|
| 89 |
css = """
|
| 90 |
-
/*
|
| 91 |
-
@import url('https://fonts.googleapis.com/css2?family=
|
| 92 |
|
| 93 |
* {
|
| 94 |
-
font-family: '
|
| 95 |
}
|
| 96 |
|
| 97 |
body, .gradio-container {
|
| 98 |
-
background:
|
| 99 |
min-height: 100vh;
|
| 100 |
}
|
| 101 |
|
| 102 |
.gradio-container {
|
| 103 |
background:
|
| 104 |
-
radial-gradient(circle at
|
| 105 |
-
radial-gradient(circle at
|
| 106 |
-
|
| 107 |
-
|
| 108 |
}
|
| 109 |
|
| 110 |
#col-container {
|
|
@@ -113,17 +113,41 @@ body, .gradio-container {
|
|
| 113 |
padding: 25px 20px;
|
| 114 |
}
|
| 115 |
|
| 116 |
-
/* Header */
|
| 117 |
.header-box {
|
| 118 |
-
background:
|
| 119 |
-
border:
|
| 120 |
border-radius: 30px;
|
| 121 |
-
padding: 25px;
|
| 122 |
text-align: center;
|
| 123 |
margin-bottom: 25px;
|
| 124 |
-
box-shadow:
|
| 125 |
-
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
}
|
| 128 |
|
| 129 |
.badge-row {
|
|
@@ -133,183 +157,223 @@ body, .gradio-container {
|
|
| 133 |
}
|
| 134 |
|
| 135 |
.title-text {
|
| 136 |
-
font-
|
| 137 |
-
font-
|
| 138 |
-
color: #
|
| 139 |
margin: 8px 0 !important;
|
| 140 |
-
text-shadow:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
}
|
| 142 |
|
| 143 |
.subtitle-text {
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
font-
|
|
|
|
| 147 |
margin: 0 !important;
|
|
|
|
| 148 |
}
|
| 149 |
|
| 150 |
-
/* Cards */
|
| 151 |
-
.
|
| 152 |
-
background:
|
| 153 |
-
border:
|
| 154 |
-
border-radius:
|
| 155 |
padding: 20px !important;
|
| 156 |
-
box-shadow:
|
| 157 |
-
|
| 158 |
-
inset 0 -2px 0 rgba(255, 182, 193, 0.15) !important;
|
| 159 |
}
|
| 160 |
|
| 161 |
.gr-panel, .gr-box, .gr-form, .block, .form {
|
| 162 |
background: #ffffff !important;
|
| 163 |
-
border:
|
| 164 |
-
border-radius:
|
| 165 |
-
box-shadow:
|
| 166 |
}
|
| 167 |
|
| 168 |
-
/* Prompt Input */
|
| 169 |
.prompt-box textarea {
|
| 170 |
-
background:
|
| 171 |
-
border:
|
| 172 |
-
border-radius:
|
| 173 |
-
color: #
|
| 174 |
-
font-size: 1.
|
| 175 |
-
font-weight:
|
| 176 |
padding: 18px !important;
|
| 177 |
min-height: 90px !important;
|
| 178 |
-
transition: all 0.
|
|
|
|
| 179 |
}
|
| 180 |
|
| 181 |
.prompt-box textarea:focus {
|
| 182 |
-
border-color: #
|
| 183 |
-
box-shadow:
|
|
|
|
| 184 |
}
|
| 185 |
|
| 186 |
.prompt-box textarea::placeholder {
|
| 187 |
-
color: #
|
| 188 |
-
font-weight:
|
| 189 |
-
}
|
| 190 |
-
|
| 191 |
-
/* Generate Button */
|
| 192 |
-
.
|
| 193 |
-
background: linear-gradient(
|
| 194 |
-
border:
|
| 195 |
-
border-radius:
|
| 196 |
-
color: #
|
| 197 |
-
font-
|
| 198 |
-
font-
|
|
|
|
|
|
|
| 199 |
padding: 16px 35px !important;
|
| 200 |
-
transition: all 0.
|
| 201 |
-
box-shadow:
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
|
| 205 |
}
|
| 206 |
|
| 207 |
-
.
|
| 208 |
-
transform:
|
| 209 |
-
box-shadow:
|
| 210 |
-
|
| 211 |
-
inset 0 -3px 0 rgba(255, 120, 140, 0.3) !important;
|
| 212 |
}
|
| 213 |
|
| 214 |
-
.
|
| 215 |
-
transform:
|
|
|
|
| 216 |
}
|
| 217 |
|
| 218 |
-
/* Result Image */
|
| 219 |
.result-box {
|
| 220 |
-
background:
|
| 221 |
-
border:
|
| 222 |
-
border-radius:
|
| 223 |
padding: 15px !important;
|
| 224 |
-
box-shadow:
|
| 225 |
-
0 8px 25px rgba(181, 232, 227, 0.3),
|
| 226 |
-
inset 0 -2px 0 rgba(181, 232, 227, 0.2) !important;
|
| 227 |
min-height: 450px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
}
|
| 229 |
|
| 230 |
.result-box img {
|
| 231 |
-
border-radius:
|
|
|
|
| 232 |
}
|
| 233 |
|
| 234 |
-
/* Accordion */
|
| 235 |
.gr-accordion {
|
| 236 |
-
background:
|
| 237 |
-
border:
|
| 238 |
-
border-radius:
|
| 239 |
-
margin-top:
|
| 240 |
overflow: hidden !important;
|
|
|
|
| 241 |
}
|
| 242 |
|
| 243 |
.gr-accordion-header {
|
| 244 |
-
background:
|
| 245 |
-
color: #
|
| 246 |
font-weight: 700 !important;
|
| 247 |
padding: 12px 18px !important;
|
|
|
|
|
|
|
| 248 |
}
|
| 249 |
|
| 250 |
/* Gallery */
|
| 251 |
.gallery-box {
|
| 252 |
-
background: #
|
| 253 |
-
border-radius:
|
| 254 |
padding: 12px !important;
|
| 255 |
-
border:
|
| 256 |
}
|
| 257 |
|
| 258 |
.gallery-box img {
|
| 259 |
-
border-radius:
|
| 260 |
-
border:
|
| 261 |
}
|
| 262 |
|
| 263 |
/* Labels */
|
| 264 |
label, .label-wrap, span {
|
| 265 |
-
color: #
|
| 266 |
-
font-weight:
|
|
|
|
|
|
|
| 267 |
}
|
| 268 |
|
| 269 |
/* Sliders */
|
| 270 |
input[type="range"] {
|
| 271 |
-
accent-color: #
|
|
|
|
| 272 |
}
|
| 273 |
|
| 274 |
input[type="range"]::-webkit-slider-track {
|
| 275 |
-
background:
|
| 276 |
-
border-radius:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
}
|
| 278 |
|
| 279 |
/* Number Input */
|
| 280 |
input[type="number"] {
|
| 281 |
-
background: #
|
| 282 |
-
border:
|
| 283 |
-
border-radius:
|
| 284 |
-
color: #
|
| 285 |
-
font-weight:
|
|
|
|
| 286 |
}
|
| 287 |
|
| 288 |
/* Checkbox */
|
| 289 |
input[type="checkbox"] {
|
| 290 |
-
accent-color: #
|
| 291 |
-
width:
|
| 292 |
-
height:
|
|
|
|
| 293 |
}
|
| 294 |
|
| 295 |
/* Scrollbar */
|
| 296 |
::-webkit-scrollbar {
|
| 297 |
-
width:
|
| 298 |
}
|
| 299 |
|
| 300 |
::-webkit-scrollbar-track {
|
| 301 |
-
background: #
|
| 302 |
-
border
|
| 303 |
}
|
| 304 |
|
| 305 |
::-webkit-scrollbar-thumb {
|
| 306 |
-
background:
|
| 307 |
-
border
|
|
|
|
| 308 |
}
|
| 309 |
|
| 310 |
-
/* Layout
|
| 311 |
.main-row {
|
| 312 |
-
gap:
|
| 313 |
align-items: flex-start !important;
|
| 314 |
}
|
| 315 |
|
|
@@ -321,59 +385,63 @@ input[type="checkbox"] {
|
|
| 321 |
flex: 1.1 !important;
|
| 322 |
}
|
| 323 |
|
| 324 |
-
/*
|
| 325 |
-
.
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
/* Decorative Elements */
|
| 331 |
-
.deco-dots {
|
| 332 |
-
position: absolute;
|
| 333 |
width: 100%;
|
| 334 |
height: 100%;
|
| 335 |
-
background-image:
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
background-size: 30px 30px;
|
| 339 |
-
background-position: 0 0, 15px 15px;
|
| 340 |
-
opacity: 0.3;
|
| 341 |
pointer-events: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
}
|
| 343 |
"""
|
| 344 |
|
| 345 |
-
with gr.Blocks(css=css, theme=gr.themes.
|
|
|
|
|
|
|
|
|
|
| 346 |
|
| 347 |
with gr.Column(elem_id="col-container"):
|
| 348 |
-
# Header
|
| 349 |
gr.HTML("""
|
| 350 |
<div class="header-box">
|
| 351 |
<div class="badge-row">
|
| 352 |
<a href="https://www.humangen.ai" target="_blank">
|
| 353 |
-
<img src="https://img.shields.io/static/v1?label=Free%20AI%20HUB&message=humangen.ai&color=%
|
| 354 |
</a>
|
| 355 |
</div>
|
| 356 |
-
<h1 class="title-text"
|
| 357 |
-
<p class="subtitle-text"
|
| 358 |
</div>
|
| 359 |
""")
|
| 360 |
|
| 361 |
with gr.Row(elem_classes="main-row"):
|
| 362 |
# Left - Input
|
| 363 |
with gr.Column(elem_classes="input-col"):
|
| 364 |
-
with gr.Group(elem_classes="
|
| 365 |
prompt = gr.Text(
|
| 366 |
label="Prompt",
|
| 367 |
show_label=False,
|
| 368 |
max_lines=4,
|
| 369 |
-
placeholder="
|
| 370 |
container=False,
|
| 371 |
elem_classes="prompt-box"
|
| 372 |
)
|
| 373 |
|
| 374 |
-
run_button = gr.Button("
|
| 375 |
|
| 376 |
-
with gr.Accordion("
|
| 377 |
input_images = gr.Gallery(
|
| 378 |
label="Upload images",
|
| 379 |
type="pil",
|
|
@@ -382,17 +450,17 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
|
| 382 |
elem_classes="gallery-box"
|
| 383 |
)
|
| 384 |
|
| 385 |
-
with gr.Accordion("
|
| 386 |
-
seed = gr.Slider(label="
|
| 387 |
-
randomize_seed = gr.Checkbox(label="
|
| 388 |
|
| 389 |
with gr.Row():
|
| 390 |
-
width = gr.Slider(label="
|
| 391 |
-
height = gr.Slider(label="
|
| 392 |
|
| 393 |
with gr.Row():
|
| 394 |
-
num_inference_steps = gr.Slider(label="
|
| 395 |
-
guidance_scale = gr.Slider(label="
|
| 396 |
|
| 397 |
# Right - Output
|
| 398 |
with gr.Column(elem_classes="output-col"):
|
|
|
|
| 87 |
return new_width, new_height
|
| 88 |
|
| 89 |
css = """
|
| 90 |
+
/* POP ART Style */
|
| 91 |
+
@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Comic+Neue:wght@700&display=swap');
|
| 92 |
|
| 93 |
* {
|
| 94 |
+
font-family: 'Comic Neue', cursive !important;
|
| 95 |
}
|
| 96 |
|
| 97 |
body, .gradio-container {
|
| 98 |
+
background: #ffeb3b !important;
|
| 99 |
min-height: 100vh;
|
| 100 |
}
|
| 101 |
|
| 102 |
.gradio-container {
|
| 103 |
background:
|
| 104 |
+
radial-gradient(circle at 10px 10px, #ff1744 4px, transparent 4px),
|
| 105 |
+
radial-gradient(circle at 30px 30px, #ff1744 3px, transparent 3px),
|
| 106 |
+
linear-gradient(135deg, #ffeb3b 0%, #fff176 100%) !important;
|
| 107 |
+
background-size: 40px 40px, 40px 40px, 100% 100% !important;
|
| 108 |
}
|
| 109 |
|
| 110 |
#col-container {
|
|
|
|
| 113 |
padding: 25px 20px;
|
| 114 |
}
|
| 115 |
|
| 116 |
+
/* Header - Comic Speech Bubble */
|
| 117 |
.header-box {
|
| 118 |
+
background: #ffffff;
|
| 119 |
+
border: 5px solid #000000;
|
| 120 |
border-radius: 30px;
|
| 121 |
+
padding: 25px 30px;
|
| 122 |
text-align: center;
|
| 123 |
margin-bottom: 25px;
|
| 124 |
+
box-shadow: 8px 8px 0 #000000;
|
| 125 |
+
position: relative;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
.header-box::after {
|
| 129 |
+
content: "";
|
| 130 |
+
position: absolute;
|
| 131 |
+
bottom: -25px;
|
| 132 |
+
left: 50px;
|
| 133 |
+
width: 0;
|
| 134 |
+
height: 0;
|
| 135 |
+
border: 20px solid transparent;
|
| 136 |
+
border-top-color: #000000;
|
| 137 |
+
border-bottom: 0;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
.header-box::before {
|
| 141 |
+
content: "";
|
| 142 |
+
position: absolute;
|
| 143 |
+
bottom: -17px;
|
| 144 |
+
left: 53px;
|
| 145 |
+
width: 0;
|
| 146 |
+
height: 0;
|
| 147 |
+
border: 16px solid transparent;
|
| 148 |
+
border-top-color: #ffffff;
|
| 149 |
+
border-bottom: 0;
|
| 150 |
+
z-index: 1;
|
| 151 |
}
|
| 152 |
|
| 153 |
.badge-row {
|
|
|
|
| 157 |
}
|
| 158 |
|
| 159 |
.title-text {
|
| 160 |
+
font-family: 'Bangers', cursive !important;
|
| 161 |
+
font-size: 3rem !important;
|
| 162 |
+
color: #ff1744 !important;
|
| 163 |
margin: 8px 0 !important;
|
| 164 |
+
text-shadow:
|
| 165 |
+
3px 3px 0 #000000,
|
| 166 |
+
-1px -1px 0 #000000,
|
| 167 |
+
1px -1px 0 #000000,
|
| 168 |
+
-1px 1px 0 #000000;
|
| 169 |
+
letter-spacing: 3px;
|
| 170 |
}
|
| 171 |
|
| 172 |
.subtitle-text {
|
| 173 |
+
font-family: 'Comic Neue', cursive !important;
|
| 174 |
+
color: #1565c0 !important;
|
| 175 |
+
font-size: 1.1rem !important;
|
| 176 |
+
font-weight: 700 !important;
|
| 177 |
margin: 0 !important;
|
| 178 |
+
text-transform: uppercase;
|
| 179 |
}
|
| 180 |
|
| 181 |
+
/* Cards - Bold Comic Style */
|
| 182 |
+
.pop-card {
|
| 183 |
+
background: #ffffff !important;
|
| 184 |
+
border: 4px solid #000000 !important;
|
| 185 |
+
border-radius: 20px !important;
|
| 186 |
padding: 20px !important;
|
| 187 |
+
box-shadow: 6px 6px 0 #000000 !important;
|
| 188 |
+
position: relative;
|
|
|
|
| 189 |
}
|
| 190 |
|
| 191 |
.gr-panel, .gr-box, .gr-form, .block, .form {
|
| 192 |
background: #ffffff !important;
|
| 193 |
+
border: 3px solid #000000 !important;
|
| 194 |
+
border-radius: 15px !important;
|
| 195 |
+
box-shadow: 4px 4px 0 #000000 !important;
|
| 196 |
}
|
| 197 |
|
| 198 |
+
/* Prompt Input - Speech Bubble */
|
| 199 |
.prompt-box textarea {
|
| 200 |
+
background: #ffffff !important;
|
| 201 |
+
border: 4px solid #000000 !important;
|
| 202 |
+
border-radius: 20px !important;
|
| 203 |
+
color: #000000 !important;
|
| 204 |
+
font-size: 1.1rem !important;
|
| 205 |
+
font-weight: 700 !important;
|
| 206 |
padding: 18px !important;
|
| 207 |
min-height: 90px !important;
|
| 208 |
+
transition: all 0.2s ease !important;
|
| 209 |
+
box-shadow: 4px 4px 0 #000000 !important;
|
| 210 |
}
|
| 211 |
|
| 212 |
.prompt-box textarea:focus {
|
| 213 |
+
border-color: #ff1744 !important;
|
| 214 |
+
box-shadow: 6px 6px 0 #ff1744 !important;
|
| 215 |
+
transform: translate(-2px, -2px);
|
| 216 |
}
|
| 217 |
|
| 218 |
.prompt-box textarea::placeholder {
|
| 219 |
+
color: #757575 !important;
|
| 220 |
+
font-weight: 600 !important;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
/* Generate Button - POW! Style */
|
| 224 |
+
.pow-btn {
|
| 225 |
+
background: linear-gradient(180deg, #ff1744 0%, #d50000 100%) !important;
|
| 226 |
+
border: 4px solid #000000 !important;
|
| 227 |
+
border-radius: 15px !important;
|
| 228 |
+
color: #ffffff !important;
|
| 229 |
+
font-family: 'Bangers', cursive !important;
|
| 230 |
+
font-weight: 400 !important;
|
| 231 |
+
font-size: 1.5rem !important;
|
| 232 |
+
letter-spacing: 2px;
|
| 233 |
padding: 16px 35px !important;
|
| 234 |
+
transition: all 0.15s ease !important;
|
| 235 |
+
box-shadow: 5px 5px 0 #000000 !important;
|
| 236 |
+
text-shadow: 2px 2px 0 #000000;
|
| 237 |
+
text-transform: uppercase;
|
|
|
|
| 238 |
}
|
| 239 |
|
| 240 |
+
.pow-btn:hover {
|
| 241 |
+
transform: translate(-3px, -3px) !important;
|
| 242 |
+
box-shadow: 8px 8px 0 #000000 !important;
|
| 243 |
+
background: linear-gradient(180deg, #ff5252 0%, #ff1744 100%) !important;
|
|
|
|
| 244 |
}
|
| 245 |
|
| 246 |
+
.pow-btn:active {
|
| 247 |
+
transform: translate(2px, 2px) !important;
|
| 248 |
+
box-shadow: 2px 2px 0 #000000 !important;
|
| 249 |
}
|
| 250 |
|
| 251 |
+
/* Result Image - Comic Panel */
|
| 252 |
.result-box {
|
| 253 |
+
background: #ffffff !important;
|
| 254 |
+
border: 5px solid #000000 !important;
|
| 255 |
+
border-radius: 20px !important;
|
| 256 |
padding: 15px !important;
|
| 257 |
+
box-shadow: 8px 8px 0 #000000 !important;
|
|
|
|
|
|
|
| 258 |
min-height: 450px !important;
|
| 259 |
+
position: relative;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.result-box::before {
|
| 263 |
+
content: "★ OUTPUT ★";
|
| 264 |
+
position: absolute;
|
| 265 |
+
top: -15px;
|
| 266 |
+
left: 20px;
|
| 267 |
+
background: #ffeb3b;
|
| 268 |
+
border: 3px solid #000000;
|
| 269 |
+
padding: 3px 15px;
|
| 270 |
+
font-family: 'Bangers', cursive !important;
|
| 271 |
+
font-size: 1rem;
|
| 272 |
+
color: #000000;
|
| 273 |
+
z-index: 10;
|
| 274 |
}
|
| 275 |
|
| 276 |
.result-box img {
|
| 277 |
+
border-radius: 12px !important;
|
| 278 |
+
border: 3px solid #000000 !important;
|
| 279 |
}
|
| 280 |
|
| 281 |
+
/* Accordion - Comic Panels */
|
| 282 |
.gr-accordion {
|
| 283 |
+
background: #e3f2fd !important;
|
| 284 |
+
border: 3px solid #000000 !important;
|
| 285 |
+
border-radius: 15px !important;
|
| 286 |
+
margin-top: 20px !important;
|
| 287 |
overflow: hidden !important;
|
| 288 |
+
box-shadow: 4px 4px 0 #000000 !important;
|
| 289 |
}
|
| 290 |
|
| 291 |
.gr-accordion-header {
|
| 292 |
+
background: #2196f3 !important;
|
| 293 |
+
color: #ffffff !important;
|
| 294 |
font-weight: 700 !important;
|
| 295 |
padding: 12px 18px !important;
|
| 296 |
+
border-bottom: 3px solid #000000 !important;
|
| 297 |
+
text-transform: uppercase;
|
| 298 |
}
|
| 299 |
|
| 300 |
/* Gallery */
|
| 301 |
.gallery-box {
|
| 302 |
+
background: #fff9c4 !important;
|
| 303 |
+
border-radius: 12px !important;
|
| 304 |
padding: 12px !important;
|
| 305 |
+
border: 3px dashed #000000 !important;
|
| 306 |
}
|
| 307 |
|
| 308 |
.gallery-box img {
|
| 309 |
+
border-radius: 10px !important;
|
| 310 |
+
border: 3px solid #000000 !important;
|
| 311 |
}
|
| 312 |
|
| 313 |
/* Labels */
|
| 314 |
label, .label-wrap, span {
|
| 315 |
+
color: #000000 !important;
|
| 316 |
+
font-weight: 700 !important;
|
| 317 |
+
text-transform: uppercase;
|
| 318 |
+
font-size: 0.9rem !important;
|
| 319 |
}
|
| 320 |
|
| 321 |
/* Sliders */
|
| 322 |
input[type="range"] {
|
| 323 |
+
accent-color: #ff1744 !important;
|
| 324 |
+
height: 8px !important;
|
| 325 |
}
|
| 326 |
|
| 327 |
input[type="range"]::-webkit-slider-track {
|
| 328 |
+
background: #000000 !important;
|
| 329 |
+
border-radius: 5px !important;
|
| 330 |
+
height: 8px !important;
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
input[type="range"]::-webkit-slider-thumb {
|
| 334 |
+
background: #ffeb3b !important;
|
| 335 |
+
border: 3px solid #000000 !important;
|
| 336 |
+
width: 20px !important;
|
| 337 |
+
height: 20px !important;
|
| 338 |
}
|
| 339 |
|
| 340 |
/* Number Input */
|
| 341 |
input[type="number"] {
|
| 342 |
+
background: #ffffff !important;
|
| 343 |
+
border: 3px solid #000000 !important;
|
| 344 |
+
border-radius: 10px !important;
|
| 345 |
+
color: #000000 !important;
|
| 346 |
+
font-weight: 700 !important;
|
| 347 |
+
box-shadow: 3px 3px 0 #000000 !important;
|
| 348 |
}
|
| 349 |
|
| 350 |
/* Checkbox */
|
| 351 |
input[type="checkbox"] {
|
| 352 |
+
accent-color: #ff1744 !important;
|
| 353 |
+
width: 20px !important;
|
| 354 |
+
height: 20px !important;
|
| 355 |
+
border: 3px solid #000000 !important;
|
| 356 |
}
|
| 357 |
|
| 358 |
/* Scrollbar */
|
| 359 |
::-webkit-scrollbar {
|
| 360 |
+
width: 12px;
|
| 361 |
}
|
| 362 |
|
| 363 |
::-webkit-scrollbar-track {
|
| 364 |
+
background: #ffeb3b;
|
| 365 |
+
border: 2px solid #000000;
|
| 366 |
}
|
| 367 |
|
| 368 |
::-webkit-scrollbar-thumb {
|
| 369 |
+
background: #ff1744;
|
| 370 |
+
border: 2px solid #000000;
|
| 371 |
+
border-radius: 0;
|
| 372 |
}
|
| 373 |
|
| 374 |
+
/* Layout */
|
| 375 |
.main-row {
|
| 376 |
+
gap: 30px !important;
|
| 377 |
align-items: flex-start !important;
|
| 378 |
}
|
| 379 |
|
|
|
|
| 385 |
flex: 1.1 !important;
|
| 386 |
}
|
| 387 |
|
| 388 |
+
/* Halftone Pattern Overlay */
|
| 389 |
+
.halftone-overlay {
|
| 390 |
+
position: fixed;
|
| 391 |
+
top: 0;
|
| 392 |
+
left: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
width: 100%;
|
| 394 |
height: 100%;
|
| 395 |
+
background-image: radial-gradient(#000000 1px, transparent 1px);
|
| 396 |
+
background-size: 4px 4px;
|
| 397 |
+
opacity: 0.03;
|
|
|
|
|
|
|
|
|
|
| 398 |
pointer-events: none;
|
| 399 |
+
z-index: 9999;
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
/* Action Words */
|
| 403 |
+
.action-word {
|
| 404 |
+
font-family: 'Bangers', cursive !important;
|
| 405 |
+
color: #ff1744;
|
| 406 |
+
text-shadow: 2px 2px 0 #000000;
|
| 407 |
}
|
| 408 |
"""
|
| 409 |
|
| 410 |
+
with gr.Blocks(css=css, theme=gr.themes.Base()) as demo:
|
| 411 |
+
|
| 412 |
+
# Halftone overlay
|
| 413 |
+
gr.HTML('<div class="halftone-overlay"></div>')
|
| 414 |
|
| 415 |
with gr.Column(elem_id="col-container"):
|
| 416 |
+
# Header - Comic Speech Bubble
|
| 417 |
gr.HTML("""
|
| 418 |
<div class="header-box">
|
| 419 |
<div class="badge-row">
|
| 420 |
<a href="https://www.humangen.ai" target="_blank">
|
| 421 |
+
<img src="https://img.shields.io/static/v1?label=Free%20AI%20HUB&message=humangen.ai&color=%23ff1744&labelColor=%23000000&logo=huggingface&logoColor=white&style=for-the-badge" alt="badge">
|
| 422 |
</a>
|
| 423 |
</div>
|
| 424 |
+
<h1 class="title-text">💥 GLM-IMAGE GENERATOR</h1>
|
| 425 |
+
<p class="subtitle-text">⚡ 9B hybrid AI model for text-accurate image generation ⚡</p>
|
| 426 |
</div>
|
| 427 |
""")
|
| 428 |
|
| 429 |
with gr.Row(elem_classes="main-row"):
|
| 430 |
# Left - Input
|
| 431 |
with gr.Column(elem_classes="input-col"):
|
| 432 |
+
with gr.Group(elem_classes="pop-card"):
|
| 433 |
prompt = gr.Text(
|
| 434 |
label="Prompt",
|
| 435 |
show_label=False,
|
| 436 |
max_lines=4,
|
| 437 |
+
placeholder="💬 Type your image idea here...",
|
| 438 |
container=False,
|
| 439 |
elem_classes="prompt-box"
|
| 440 |
)
|
| 441 |
|
| 442 |
+
run_button = gr.Button("⚡ POW! GENERATE ⚡", variant="primary", elem_classes="pow-btn")
|
| 443 |
|
| 444 |
+
with gr.Accordion("📸 INPUT IMAGES", open=False):
|
| 445 |
input_images = gr.Gallery(
|
| 446 |
label="Upload images",
|
| 447 |
type="pil",
|
|
|
|
| 450 |
elem_classes="gallery-box"
|
| 451 |
)
|
| 452 |
|
| 453 |
+
with gr.Accordion("🔧 SETTINGS", open=False):
|
| 454 |
+
seed = gr.Slider(label="SEED", minimum=0, maximum=MAX_SEED, step=1, value=42)
|
| 455 |
+
randomize_seed = gr.Checkbox(label="RANDOMIZE", value=True)
|
| 456 |
|
| 457 |
with gr.Row():
|
| 458 |
+
width = gr.Slider(label="WIDTH", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024)
|
| 459 |
+
height = gr.Slider(label="HEIGHT", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024)
|
| 460 |
|
| 461 |
with gr.Row():
|
| 462 |
+
num_inference_steps = gr.Slider(label="STEPS", minimum=1, maximum=100, step=1, value=50)
|
| 463 |
+
guidance_scale = gr.Slider(label="GUIDANCE", minimum=0.0, maximum=10.0, step=0.1, value=1.5)
|
| 464 |
|
| 465 |
# Right - Output
|
| 466 |
with gr.Column(elem_classes="output-col"):
|