Spaces:
Runtime error
Runtime error
Commit
·
4654883
1
Parent(s):
67798b2
CSS
Browse files
app.py
CHANGED
@@ -247,33 +247,23 @@ examples = [
|
|
247 |
]
|
248 |
|
249 |
css = """
|
250 |
-
/* Define CSS Variables for Consistency */
|
251 |
-
:root {
|
252 |
-
--main-bg-color: #1b1b1b;
|
253 |
-
--main-font: 'Cinzel', serif;
|
254 |
-
--text-color: #f5f5f5;
|
255 |
-
--highlight-color: #ffd700;
|
256 |
-
--accent-color: #8b4513;
|
257 |
-
--shadow-color: rgba(255, 223, 0, 0.8);
|
258 |
-
}
|
259 |
-
|
260 |
/* General body styling */
|
261 |
body {
|
262 |
-
background-color:
|
263 |
-
font-family:
|
264 |
-
color:
|
265 |
background-image: url('https://www.transparenttextures.com/patterns/dark-matter.png');
|
266 |
margin: 0;
|
267 |
padding: 0;
|
268 |
}
|
269 |
|
270 |
-
/* Container
|
271 |
#col-container {
|
272 |
margin: 0 auto;
|
273 |
max-width: 550px;
|
274 |
padding: 20px;
|
275 |
-
border: 6px solid
|
276 |
-
background: radial-gradient(circle, #302d2b 0%, #3b3634 60%,
|
277 |
border-radius: 20px;
|
278 |
box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(139, 69, 19, 0.7);
|
279 |
transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
|
@@ -281,22 +271,21 @@ body {
|
|
281 |
|
282 |
#col-container:hover {
|
283 |
transform: scale(1.03);
|
284 |
-
box-shadow: 0 0 40px
|
285 |
}
|
286 |
|
287 |
-
/* Fancy
|
288 |
#col-container h1, #col-container h2, #col-container h3 {
|
289 |
color: #ffebcc;
|
290 |
-
text-shadow: 0 0 10px
|
291 |
}
|
292 |
|
293 |
-
/* Paragraph Text Styling */
|
294 |
#col-container p {
|
295 |
color: #dcdcdc;
|
296 |
text-shadow: 0 0 6px rgba(139, 69, 19, 0.8);
|
297 |
}
|
298 |
|
299 |
-
/*
|
300 |
#col-container a {
|
301 |
color: #e6ac00;
|
302 |
text-decoration: none;
|
@@ -306,13 +295,13 @@ body {
|
|
306 |
|
307 |
#col-container a:hover {
|
308 |
color: #fff700;
|
309 |
-
text-shadow: 0 0 10px
|
310 |
}
|
311 |
|
312 |
-
/*
|
313 |
.gr-button {
|
314 |
-
background-color:
|
315 |
-
color:
|
316 |
font-weight: bold;
|
317 |
padding: 10px 20px;
|
318 |
border: 2px solid #b8860b;
|
@@ -324,39 +313,60 @@ body {
|
|
324 |
.gr-button:hover {
|
325 |
background-color: #b8860b;
|
326 |
transform: scale(1.05);
|
327 |
-
box-shadow: 0 0 12px
|
328 |
}
|
329 |
|
330 |
-
/* Input and Dropdown
|
331 |
input, select, .gr-input, .gr-slider {
|
332 |
background-color: #302d2b;
|
333 |
-
color:
|
334 |
-
border: 2px solid
|
335 |
border-radius: 5px;
|
336 |
padding: 8px 12px;
|
337 |
-
font-family:
|
338 |
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
339 |
}
|
340 |
|
341 |
input:focus, select:focus, .gr-input:focus, .gr-slider:focus {
|
342 |
outline: none;
|
343 |
-
border-color:
|
344 |
-
box-shadow: 0 0 8px
|
|
|
|
|
|
|
|
|
|
|
345 |
}
|
346 |
|
347 |
-
/*
|
348 |
-
.gr-checkbox-label
|
349 |
font-weight: bold;
|
350 |
-
color:
|
351 |
text-shadow: 0 0 5px rgba(139, 69, 19, 0.7);
|
352 |
}
|
353 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
.gr-image {
|
355 |
-
border: 4px solid
|
356 |
border-radius: 10px;
|
357 |
-
box-shadow: 0 0 10px
|
358 |
}
|
359 |
|
|
|
360 |
.gr-image:hover {
|
361 |
box-shadow: 0 0 20px rgba(255, 140, 0, 0.7), 0 0 40px rgba(255, 223, 0, 0.9);
|
362 |
}
|
@@ -375,7 +385,7 @@ with gr.Blocks(css=css) as demo:
|
|
375 |
"""
|
376 |
)
|
377 |
|
378 |
-
#
|
379 |
with gr.Row():
|
380 |
prompt = gr.Textbox(
|
381 |
label="🎲 Describe Your Vision:",
|
@@ -387,13 +397,13 @@ with gr.Blocks(css=css) as demo:
|
|
387 |
choices=STYLE_NAMES,
|
388 |
value=DEFAULT_STYLE_NAME,
|
389 |
)
|
390 |
-
|
391 |
-
#
|
392 |
with gr.Row():
|
393 |
run_button = gr.Button("Generate Image")
|
394 |
result = gr.Image(label="🖼️ Your Legendary Vision")
|
395 |
|
396 |
-
# Advanced
|
397 |
with gr.Accordion("⚙️ Advanced Settings", open=False):
|
398 |
seed = gr.Slider(
|
399 |
label="Seed",
|
@@ -419,7 +429,7 @@ with gr.Blocks(css=css) as demo:
|
|
419 |
step=32,
|
420 |
value=1024,
|
421 |
)
|
422 |
-
|
423 |
num_inference_steps = gr.Slider(
|
424 |
label="Inference Steps",
|
425 |
minimum=1,
|
@@ -428,7 +438,7 @@ with gr.Blocks(css=css) as demo:
|
|
428 |
value=6,
|
429 |
)
|
430 |
|
431 |
-
# Examples
|
432 |
gr.Examples(
|
433 |
examples=examples,
|
434 |
inputs=[prompt, style],
|
@@ -445,5 +455,5 @@ with gr.Blocks(css=css) as demo:
|
|
445 |
outputs=[result, seed],
|
446 |
)
|
447 |
|
448 |
-
# Launch
|
449 |
demo.launch()
|
|
|
247 |
]
|
248 |
|
249 |
css = """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
/* General body styling */
|
251 |
body {
|
252 |
+
background-color: #1b1b1b;
|
253 |
+
font-family: 'Cinzel', serif;
|
254 |
+
color: #f5f5f5;
|
255 |
background-image: url('https://www.transparenttextures.com/patterns/dark-matter.png');
|
256 |
margin: 0;
|
257 |
padding: 0;
|
258 |
}
|
259 |
|
260 |
+
/* Container */
|
261 |
#col-container {
|
262 |
margin: 0 auto;
|
263 |
max-width: 550px;
|
264 |
padding: 20px;
|
265 |
+
border: 6px solid #8b4513;
|
266 |
+
background: radial-gradient(circle, #302d2b 0%, #3b3634 60%, #1b1b1b 100%);
|
267 |
border-radius: 20px;
|
268 |
box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(139, 69, 19, 0.7);
|
269 |
transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
|
|
|
271 |
|
272 |
#col-container:hover {
|
273 |
transform: scale(1.03);
|
274 |
+
box-shadow: 0 0 40px rgba(255, 223, 0, 0.8), 0 0 20px rgba(255, 140, 0, 0.8);
|
275 |
}
|
276 |
|
277 |
+
/* Fancy title and text effects */
|
278 |
#col-container h1, #col-container h2, #col-container h3 {
|
279 |
color: #ffebcc;
|
280 |
+
text-shadow: 0 0 10px #8b4513, 0 0 20px #ffd700;
|
281 |
}
|
282 |
|
|
|
283 |
#col-container p {
|
284 |
color: #dcdcdc;
|
285 |
text-shadow: 0 0 6px rgba(139, 69, 19, 0.8);
|
286 |
}
|
287 |
|
288 |
+
/* Markdown links */
|
289 |
#col-container a {
|
290 |
color: #e6ac00;
|
291 |
text-decoration: none;
|
|
|
295 |
|
296 |
#col-container a:hover {
|
297 |
color: #fff700;
|
298 |
+
text-shadow: 0 0 10px #fff700, 0 0 20px #ffebcc;
|
299 |
}
|
300 |
|
301 |
+
/* Buttons with D&D glowing effect */
|
302 |
.gr-button {
|
303 |
+
background-color: #8b4513;
|
304 |
+
color: #f5f5f5;
|
305 |
font-weight: bold;
|
306 |
padding: 10px 20px;
|
307 |
border: 2px solid #b8860b;
|
|
|
313 |
.gr-button:hover {
|
314 |
background-color: #b8860b;
|
315 |
transform: scale(1.05);
|
316 |
+
box-shadow: 0 0 12px rgba(255, 223, 0, 0.9), 0 0 24px rgba(255, 140, 0, 0.7);
|
317 |
}
|
318 |
|
319 |
+
/* Input and Dropdown styling */
|
320 |
input, select, .gr-input, .gr-slider {
|
321 |
background-color: #302d2b;
|
322 |
+
color: #f5f5f5;
|
323 |
+
border: 2px solid #8b4513;
|
324 |
border-radius: 5px;
|
325 |
padding: 8px 12px;
|
326 |
+
font-family: 'Cinzel', serif;
|
327 |
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
328 |
}
|
329 |
|
330 |
input:focus, select:focus, .gr-input:focus, .gr-slider:focus {
|
331 |
outline: none;
|
332 |
+
border-color: #ffd700;
|
333 |
+
box-shadow: 0 0 8px #ffd700;
|
334 |
+
}
|
335 |
+
|
336 |
+
/* Slider styling */
|
337 |
+
.gr-slider > div {
|
338 |
+
background-color: #8b4513 !important;
|
339 |
}
|
340 |
|
341 |
+
/* Checkbox customization */
|
342 |
+
.gr-checkbox-label {
|
343 |
font-weight: bold;
|
344 |
+
color: #f5f5f5;
|
345 |
text-shadow: 0 0 5px rgba(139, 69, 19, 0.7);
|
346 |
}
|
347 |
|
348 |
+
/* Accordion effects */
|
349 |
+
.gr-accordion {
|
350 |
+
background: linear-gradient(145deg, #302d2b, #3b3634);
|
351 |
+
color: #f5f5f5;
|
352 |
+
border: 2px solid #8b4513;
|
353 |
+
border-radius: 10px;
|
354 |
+
padding: 8px;
|
355 |
+
transition: all 0.3s ease;
|
356 |
+
}
|
357 |
+
|
358 |
+
.gr-accordion:hover {
|
359 |
+
box-shadow: 0 0 12px rgba(255, 223, 0, 0.7), 0 0 20px rgba(255, 140, 0, 0.5);
|
360 |
+
}
|
361 |
+
|
362 |
+
/* Image glow effect */
|
363 |
.gr-image {
|
364 |
+
border: 4px solid #8b4513;
|
365 |
border-radius: 10px;
|
366 |
+
box-shadow: 0 0 10px #8b4513, 0 0 20px #ffd700;
|
367 |
}
|
368 |
|
369 |
+
/* Add glow on hover for images */
|
370 |
.gr-image:hover {
|
371 |
box-shadow: 0 0 20px rgba(255, 140, 0, 0.7), 0 0 40px rgba(255, 223, 0, 0.9);
|
372 |
}
|
|
|
385 |
"""
|
386 |
)
|
387 |
|
388 |
+
# Prompt input and style selector
|
389 |
with gr.Row():
|
390 |
prompt = gr.Textbox(
|
391 |
label="🎲 Describe Your Vision:",
|
|
|
397 |
choices=STYLE_NAMES,
|
398 |
value=DEFAULT_STYLE_NAME,
|
399 |
)
|
400 |
+
|
401 |
+
# Run button and result display
|
402 |
with gr.Row():
|
403 |
run_button = gr.Button("Generate Image")
|
404 |
result = gr.Image(label="🖼️ Your Legendary Vision")
|
405 |
|
406 |
+
# Advanced settings
|
407 |
with gr.Accordion("⚙️ Advanced Settings", open=False):
|
408 |
seed = gr.Slider(
|
409 |
label="Seed",
|
|
|
429 |
step=32,
|
430 |
value=1024,
|
431 |
)
|
432 |
+
|
433 |
num_inference_steps = gr.Slider(
|
434 |
label="Inference Steps",
|
435 |
minimum=1,
|
|
|
438 |
value=6,
|
439 |
)
|
440 |
|
441 |
+
# Examples with styles
|
442 |
gr.Examples(
|
443 |
examples=examples,
|
444 |
inputs=[prompt, style],
|
|
|
455 |
outputs=[result, seed],
|
456 |
)
|
457 |
|
458 |
+
# Launch the demo
|
459 |
demo.launch()
|