Spaces:
Running on Zero
Running on Zero
update app [ui-theme] ✅
#5
by prithivMLmods - opened
app.py
CHANGED
|
@@ -12,8 +12,8 @@ from gradio.themes.utils import colors, fonts, sizes
|
|
| 12 |
|
| 13 |
colors.orange_red = colors.Color(
|
| 14 |
name="orange_red",
|
| 15 |
-
c50="#
|
| 16 |
-
c100="#
|
| 17 |
c200="#FFC299",
|
| 18 |
c300="#FFA366",
|
| 19 |
c400="#FF8533",
|
|
@@ -334,18 +334,347 @@ def infer_example(images, prompt, lora_adapter):
|
|
| 334 |
)
|
| 335 |
return result, seed
|
| 336 |
|
| 337 |
-
css="""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
#col-container {
|
| 339 |
margin: 0 auto;
|
| 340 |
max-width: 1000px;
|
| 341 |
}
|
| 342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 343 |
"""
|
| 344 |
|
| 345 |
with gr.Blocks() as demo:
|
| 346 |
with gr.Column(elem_id="col-container"):
|
| 347 |
gr.Markdown("# **Qwen-Image-Edit-2511-LoRAs-Fast**", elem_id="main-title")
|
| 348 |
-
gr.Markdown("Perform diverse image edits using specialized [LoRA](https://huggingface.co/models?other=base_model:adapter:Qwen/Qwen-Image-Edit-2511) adapters. Open on [GitHub](https://github.com/PRITHIVSAKTHIUR/Qwen-Image-Edit-2511-LoRAs-Fast-Lazy-Load).")
|
| 349 |
|
| 350 |
with gr.Row(equal_height=True):
|
| 351 |
with gr.Column():
|
|
|
|
| 12 |
|
| 13 |
colors.orange_red = colors.Color(
|
| 14 |
name="orange_red",
|
| 15 |
+
c50="#FFF5F0",
|
| 16 |
+
c100="#FFE8E0",
|
| 17 |
c200="#FFC299",
|
| 18 |
c300="#FFA366",
|
| 19 |
c400="#FF8533",
|
|
|
|
| 334 |
)
|
| 335 |
return result, seed
|
| 336 |
|
| 337 |
+
css = """
|
| 338 |
+
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
|
| 339 |
+
|
| 340 |
+
/* Background grid pattern - Orange Red theme */
|
| 341 |
+
body, .gradio-container {
|
| 342 |
+
background-color: #FFF5F0 !important;
|
| 343 |
+
background-image:
|
| 344 |
+
linear-gradient(#FFC299 1px, transparent 1px),
|
| 345 |
+
linear-gradient(90deg, #FFC299 1px, transparent 1px) !important;
|
| 346 |
+
background-size: 40px 40px !important;
|
| 347 |
+
font-family: 'Outfit', sans-serif !important;
|
| 348 |
+
}
|
| 349 |
+
|
| 350 |
+
/* Dark mode grid */
|
| 351 |
+
.dark body, .dark .gradio-container {
|
| 352 |
+
background-color: #1a1a1a !important;
|
| 353 |
+
background-image:
|
| 354 |
+
linear-gradient(rgba(255, 69, 0, 0.1) 1px, transparent 1px),
|
| 355 |
+
linear-gradient(90deg, rgba(255, 69, 0, 0.1) 1px, transparent 1px) !important;
|
| 356 |
+
background-size: 40px 40px !important;
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
#col-container {
|
| 360 |
margin: 0 auto;
|
| 361 |
max-width: 1000px;
|
| 362 |
}
|
| 363 |
+
|
| 364 |
+
/* Main title styling */
|
| 365 |
+
#main-title {
|
| 366 |
+
text-align: center !important;
|
| 367 |
+
padding: 1rem 0 0.5rem 0;
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
#main-title h1 {
|
| 371 |
+
font-size: 2.3em !important;
|
| 372 |
+
font-weight: 700 !important;
|
| 373 |
+
background: linear-gradient(135deg, #FF4500 0%, #FF8533 50%, #E63E00 100%);
|
| 374 |
+
background-size: 200% 200%;
|
| 375 |
+
-webkit-background-clip: text;
|
| 376 |
+
-webkit-text-fill-color: transparent;
|
| 377 |
+
background-clip: text;
|
| 378 |
+
animation: gradient-shift 4s ease infinite;
|
| 379 |
+
letter-spacing: -0.02em;
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
@keyframes gradient-shift {
|
| 383 |
+
0%, 100% { background-position: 0% 50%; }
|
| 384 |
+
50% { background-position: 100% 50%; }
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
/* Subtitle styling */
|
| 388 |
+
#subtitle {
|
| 389 |
+
text-align: center !important;
|
| 390 |
+
margin-bottom: 1.5rem;
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
#subtitle p {
|
| 394 |
+
margin: 0 auto;
|
| 395 |
+
color: #666666;
|
| 396 |
+
font-size: 1rem;
|
| 397 |
+
text-align: center !important;
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
#subtitle a {
|
| 401 |
+
color: #FF4500 !important;
|
| 402 |
+
text-decoration: none;
|
| 403 |
+
font-weight: 500;
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
#subtitle a:hover {
|
| 407 |
+
text-decoration: underline;
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
/* Card styling */
|
| 411 |
+
.gradio-group {
|
| 412 |
+
background: rgba(255, 255, 255, 0.9) !important;
|
| 413 |
+
border: 2px solid #FFC299 !important;
|
| 414 |
+
border-radius: 12px !important;
|
| 415 |
+
box-shadow: 0 4px 24px rgba(255, 69, 0, 0.08) !important;
|
| 416 |
+
backdrop-filter: blur(10px);
|
| 417 |
+
transition: all 0.3s ease;
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
.gradio-group:hover {
|
| 421 |
+
box-shadow: 0 8px 32px rgba(255, 69, 0, 0.12) !important;
|
| 422 |
+
border-color: #FF8533 !important;
|
| 423 |
+
}
|
| 424 |
+
|
| 425 |
+
.dark .gradio-group {
|
| 426 |
+
background: rgba(30, 30, 30, 0.9) !important;
|
| 427 |
+
border-color: rgba(255, 69, 0, 0.3) !important;
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
/* Image upload area */
|
| 431 |
+
.gradio-image {
|
| 432 |
+
border-radius: 10px !important;
|
| 433 |
+
overflow: hidden;
|
| 434 |
+
border: 2px dashed #FF8533 !important;
|
| 435 |
+
transition: all 0.3s ease;
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
.gradio-image:hover {
|
| 439 |
+
border-color: #FF4500 !important;
|
| 440 |
+
background: rgba(255, 69, 0, 0.02) !important;
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
/* Gallery styling */
|
| 444 |
+
.gradio-gallery {
|
| 445 |
+
border-radius: 10px !important;
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
.gradio-gallery .gallery-item {
|
| 449 |
+
border: 2px solid #FFC299 !important;
|
| 450 |
+
border-radius: 8px !important;
|
| 451 |
+
transition: all 0.2s ease !important;
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
.gradio-gallery .gallery-item:hover {
|
| 455 |
+
border-color: #FF4500 !important;
|
| 456 |
+
box-shadow: 0 4px 12px rgba(255, 69, 0, 0.15) !important;
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
/* Radio buttons */
|
| 460 |
+
.gradio-radio {
|
| 461 |
+
border-radius: 8px !important;
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
.gradio-radio label {
|
| 465 |
+
border-radius: 6px !important;
|
| 466 |
+
transition: all 0.2s ease !important;
|
| 467 |
+
border: 1px solid transparent !important;
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
.gradio-radio label:hover {
|
| 471 |
+
background: rgba(255, 69, 0, 0.05) !important;
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
.gradio-radio label.selected {
|
| 475 |
+
background: rgba(255, 69, 0, 0.1) !important;
|
| 476 |
+
border-color: #FF4500 !important;
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
/* Primary button */
|
| 480 |
+
.primary {
|
| 481 |
+
border-radius: 8px !important;
|
| 482 |
+
font-weight: 600 !important;
|
| 483 |
+
letter-spacing: 0.02em !important;
|
| 484 |
+
transition: all 0.3s ease !important;
|
| 485 |
+
}
|
| 486 |
+
|
| 487 |
+
.primary:hover {
|
| 488 |
+
transform: translateY(-2px) !important;
|
| 489 |
+
}
|
| 490 |
+
|
| 491 |
+
/* Tabs styling */
|
| 492 |
+
.tab-nav {
|
| 493 |
+
border-bottom: 2px solid #FFC299 !important;
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
.tab-nav button {
|
| 497 |
+
font-weight: 500 !important;
|
| 498 |
+
padding: 10px 18px !important;
|
| 499 |
+
border-radius: 8px 8px 0 0 !important;
|
| 500 |
+
transition: all 0.2s ease !important;
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
.tab-nav button.selected {
|
| 504 |
+
background: rgba(255, 69, 0, 0.1) !important;
|
| 505 |
+
border-bottom: 2px solid #FF4500 !important;
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
/* Output textbox */
|
| 509 |
+
.gradio-textbox textarea {
|
| 510 |
+
font-family: 'IBM Plex Mono', monospace !important;
|
| 511 |
+
font-size: 0.95rem !important;
|
| 512 |
+
line-height: 1.7 !important;
|
| 513 |
+
background: rgba(255, 255, 255, 0.95) !important;
|
| 514 |
+
border: 1px solid #FFC299 !important;
|
| 515 |
+
border-radius: 8px !important;
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
+
.dark .gradio-textbox textarea {
|
| 519 |
+
background: rgba(30, 30, 30, 0.95) !important;
|
| 520 |
+
border-color: rgba(255, 69, 0, 0.2) !important;
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
/* Markdown output */
|
| 524 |
+
.gradio-markdown {
|
| 525 |
+
font-family: 'Outfit', sans-serif !important;
|
| 526 |
+
line-height: 1.7 !important;
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
.gradio-markdown code {
|
| 530 |
+
font-family: 'IBM Plex Mono', monospace !important;
|
| 531 |
+
background: rgba(255, 69, 0, 0.08) !important;
|
| 532 |
+
padding: 2px 6px !important;
|
| 533 |
+
border-radius: 4px !important;
|
| 534 |
+
color: #CC3700 !important;
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
+
.gradio-markdown pre {
|
| 538 |
+
background: rgba(255, 69, 0, 0.05) !important;
|
| 539 |
+
border: 1px solid #FFC299 !important;
|
| 540 |
+
border-radius: 8px !important;
|
| 541 |
+
padding: 1rem !important;
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
/* Examples section */
|
| 545 |
+
.gradio-examples {
|
| 546 |
+
border-radius: 10px !important;
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
+
.gradio-examples .gallery-item {
|
| 550 |
+
border: 2px solid #FFC299 !important;
|
| 551 |
+
border-radius: 8px !important;
|
| 552 |
+
transition: all 0.2s ease !important;
|
| 553 |
+
}
|
| 554 |
+
|
| 555 |
+
.gradio-examples .gallery-item:hover {
|
| 556 |
+
border-color: #FF4500 !important;
|
| 557 |
+
transform: translateY(-2px) !important;
|
| 558 |
+
box-shadow: 0 4px 12px rgba(255, 69, 0, 0.15) !important;
|
| 559 |
+
}
|
| 560 |
+
|
| 561 |
+
/* Scrollbar styling */
|
| 562 |
+
::-webkit-scrollbar {
|
| 563 |
+
width: 8px;
|
| 564 |
+
height: 8px;
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
::-webkit-scrollbar-track {
|
| 568 |
+
background: rgba(255, 69, 0, 0.05);
|
| 569 |
+
border-radius: 4px;
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
::-webkit-scrollbar-thumb {
|
| 573 |
+
background: linear-gradient(135deg, #FF4500, #FF8533);
|
| 574 |
+
border-radius: 4px;
|
| 575 |
+
}
|
| 576 |
+
|
| 577 |
+
::-webkit-scrollbar-thumb:hover {
|
| 578 |
+
background: linear-gradient(135deg, #E63E00, #FF4500);
|
| 579 |
+
}
|
| 580 |
+
|
| 581 |
+
/* Accordion styling */
|
| 582 |
+
.gradio-accordion {
|
| 583 |
+
border-radius: 10px !important;
|
| 584 |
+
border: 1px solid #FFC299 !important;
|
| 585 |
+
}
|
| 586 |
+
|
| 587 |
+
.gradio-accordion > .label-wrap {
|
| 588 |
+
background: rgba(255, 69, 0, 0.03) !important;
|
| 589 |
+
border-radius: 10px !important;
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
/* Hide footer */
|
| 593 |
+
footer {
|
| 594 |
+
display: none !important;
|
| 595 |
+
}
|
| 596 |
+
|
| 597 |
+
/* Animations */
|
| 598 |
+
@keyframes fadeIn {
|
| 599 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 600 |
+
to { opacity: 1; transform: translateY(0); }
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
.gradio-row {
|
| 604 |
+
animation: fadeIn 0.4s ease-out;
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
/* Label styling */
|
| 608 |
+
label {
|
| 609 |
+
font-weight: 600 !important;
|
| 610 |
+
color: #333 !important;
|
| 611 |
+
}
|
| 612 |
+
|
| 613 |
+
.dark label {
|
| 614 |
+
color: #eee !important;
|
| 615 |
+
}
|
| 616 |
+
|
| 617 |
+
/* Dropdown styling */
|
| 618 |
+
.gradio-dropdown {
|
| 619 |
+
border-radius: 8px !important;
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
.gradio-dropdown select, .gradio-dropdown input {
|
| 623 |
+
border: 1px solid #FFC299 !important;
|
| 624 |
+
border-radius: 8px !important;
|
| 625 |
+
transition: all 0.2s ease !important;
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
.gradio-dropdown select:focus, .gradio-dropdown input:focus {
|
| 629 |
+
border-color: #FF4500 !important;
|
| 630 |
+
box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.1) !important;
|
| 631 |
+
}
|
| 632 |
+
|
| 633 |
+
/* Slider styling */
|
| 634 |
+
.gradio-slider input[type="range"] {
|
| 635 |
+
accent-color: #FF4500 !important;
|
| 636 |
+
}
|
| 637 |
+
|
| 638 |
+
.gradio-slider .range-slider {
|
| 639 |
+
background: #FFC299 !important;
|
| 640 |
+
}
|
| 641 |
+
|
| 642 |
+
.gradio-slider .range-slider .handle {
|
| 643 |
+
background: #FF4500 !important;
|
| 644 |
+
border-color: #FF4500 !important;
|
| 645 |
+
}
|
| 646 |
+
|
| 647 |
+
/* Progress bar */
|
| 648 |
+
.dark .progress-text {
|
| 649 |
+
color: white !important;
|
| 650 |
+
}
|
| 651 |
+
|
| 652 |
+
.progress-bar {
|
| 653 |
+
background: linear-gradient(90deg, #FF4500, #FF8533) !important;
|
| 654 |
+
}
|
| 655 |
+
|
| 656 |
+
/* Checkbox styling */
|
| 657 |
+
.gradio-checkbox input[type="checkbox"]:checked {
|
| 658 |
+
background-color: #FF4500 !important;
|
| 659 |
+
border-color: #FF4500 !important;
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
/* Number input styling */
|
| 663 |
+
.gradio-number input {
|
| 664 |
+
border: 1px solid #FFC299 !important;
|
| 665 |
+
border-radius: 8px !important;
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
.gradio-number input:focus {
|
| 669 |
+
border-color: #FF4500 !important;
|
| 670 |
+
box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.1) !important;
|
| 671 |
+
}
|
| 672 |
"""
|
| 673 |
|
| 674 |
with gr.Blocks() as demo:
|
| 675 |
with gr.Column(elem_id="col-container"):
|
| 676 |
gr.Markdown("# **Qwen-Image-Edit-2511-LoRAs-Fast**", elem_id="main-title")
|
| 677 |
+
gr.Markdown("Perform diverse image edits using specialized [LoRA](https://huggingface.co/models?other=base_model:adapter:Qwen/Qwen-Image-Edit-2511) adapters. Open on [GitHub](https://github.com/PRITHIVSAKTHIUR/Qwen-Image-Edit-2511-LoRAs-Fast-Lazy-Load).", elem_id="subtitle")
|
| 678 |
|
| 679 |
with gr.Row(equal_height=True):
|
| 680 |
with gr.Column():
|