Spaces:
Running on Zero
Running on Zero
update app
Browse files
app.py
CHANGED
|
@@ -355,571 +355,448 @@ def infer(
|
|
| 355 |
|
| 356 |
css = r"""
|
| 357 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');
|
| 358 |
-
|
| 359 |
*{box-sizing:border-box;margin:0;padding:0}
|
| 360 |
-
|
| 361 |
-
:
|
| 362 |
-
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
-
|
| 370 |
-
|
| 371 |
-
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
--
|
| 375 |
-
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
}
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
}
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
}
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
border-radius:
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
}
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
.
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
}
|
| 458 |
-
.
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
}
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
.
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
}
|
| 498 |
-
.
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
}
|
| 509 |
-
.
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
.
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
}
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
.
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
}
|
| 548 |
-
.
|
| 549 |
-
.
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
}
|
| 560 |
-
.
|
| 561 |
-
.
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
.
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
.
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
.
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
}
|
| 588 |
-
.
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
.
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
}
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
}
|
| 603 |
-
.
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
}
|
| 610 |
-
.
|
| 611 |
-
|
| 612 |
-
background:
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
.thumb-remove:hover { background:#FF4500; border-color:#FF4500; }
|
| 618 |
-
.gallery-add-card {
|
| 619 |
-
aspect-ratio:1; border-radius:10px; border:2px dashed #333338;
|
| 620 |
-
display:flex; flex-direction:column; align-items:center; justify-content:center;
|
| 621 |
-
cursor:pointer; transition:all .2s ease; background:rgba(255,69,0,.05); gap:4px;
|
| 622 |
-
}
|
| 623 |
-
.gallery-add-card:hover { border-color:#FF4500; background:rgba(255,69,0,.1); }
|
| 624 |
-
.gallery-add-card .add-icon { font-size:28px; color:#555560; font-weight:300; }
|
| 625 |
-
.gallery-add-card .add-text { font-size:12px; color:#555560; font-weight:600; font-family:'Inter',sans-serif; }
|
| 626 |
-
|
| 627 |
-
/* ββ Hint bar ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 628 |
-
.hint-bar {
|
| 629 |
-
background: rgba(255,69,0,.05) !important;
|
| 630 |
-
border-top:1px solid #2a2a2e; border-bottom:1px solid #2a2a2e;
|
| 631 |
-
padding:10px 20px; font-size:13px; color:#9898a8; line-height:1.7;
|
| 632 |
-
font-weight:400; font-family:'Inter',sans-serif;
|
| 633 |
-
}
|
| 634 |
-
.hint-bar b { color:#FF7A4D; font-weight:700; }
|
| 635 |
-
.hint-bar kbd {
|
| 636 |
-
display:inline-block; padding:1px 6px; background:#222226;
|
| 637 |
-
border:1px solid #333338; border-radius:4px;
|
| 638 |
-
font-family:var(--mono); font-size:11px; color:#9898a8;
|
| 639 |
-
}
|
| 640 |
-
|
| 641 |
-
/* ββ Suggestions βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 642 |
-
.suggestions-section { border-top:1px solid #2a2a2e; padding:12px 16px; background:#141416!important; }
|
| 643 |
-
.suggestions-title, .examples-title {
|
| 644 |
-
font-size:11px; font-weight:700; color:#555560;
|
| 645 |
-
text-transform:uppercase; letter-spacing:1px; margin-bottom:10px;
|
| 646 |
-
font-family:'Inter',sans-serif;
|
| 647 |
-
}
|
| 648 |
-
.suggestions-wrap { display:flex; flex-wrap:wrap; gap:6px; }
|
| 649 |
-
.suggestion-chip {
|
| 650 |
-
display:inline-flex; align-items:center; gap:4px; padding:5px 13px;
|
| 651 |
-
background:rgba(255,69,0,.1); border:1px solid rgba(255,69,0,.25); border-radius:20px;
|
| 652 |
-
color:#FF7A4D; font-size:12px; font-weight:600; font-family:'Inter',sans-serif;
|
| 653 |
-
cursor:pointer; transition:all .15s; white-space:nowrap;
|
| 654 |
-
}
|
| 655 |
-
.suggestion-chip:hover { background:rgba(255,69,0,.2); border-color:#FF4500; color:#fff; transform:translateY(-1px); }
|
| 656 |
-
|
| 657 |
-
/* ββ Examples ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 658 |
-
.examples-section { border-top:1px solid #2a2a2e; padding:14px 16px 18px; background:#141416!important; }
|
| 659 |
-
.examples-scroll { display:flex; gap:10px; overflow-x:auto; padding-bottom:10px; padding-top:2px; }
|
| 660 |
-
.examples-scroll::-webkit-scrollbar { height:5px; }
|
| 661 |
-
.examples-scroll::-webkit-scrollbar-track { background:#0d0d0f; border-radius:3px; }
|
| 662 |
-
.examples-scroll::-webkit-scrollbar-thumb { background:#333338; border-radius:3px; }
|
| 663 |
-
.examples-scroll::-webkit-scrollbar-thumb:hover { background:#CC3700; }
|
| 664 |
-
.example-card {
|
| 665 |
-
flex-shrink:0; width:220px; background:#1a1a1d!important; border:1px solid #2a2a2e;
|
| 666 |
-
border-radius:12px; overflow:hidden; cursor:pointer; transition:all .2s ease;
|
| 667 |
-
}
|
| 668 |
-
.example-card:hover { border-color:#FF4500; transform:translateY(-3px); box-shadow:0 6px 20px rgba(255,69,0,.22); }
|
| 669 |
-
.example-card.loading { opacity:.5; pointer-events:none; }
|
| 670 |
-
.example-thumbs { display:flex; height:115px; overflow:hidden; background:#222226!important; }
|
| 671 |
-
.example-thumbs img { flex:1; object-fit:cover; min-width:0; }
|
| 672 |
-
.example-thumb-placeholder {
|
| 673 |
-
flex:1; display:flex; align-items:center; justify-content:center;
|
| 674 |
-
background:#222226!important; color:#555560; font-size:11px; min-width:0;
|
| 675 |
-
}
|
| 676 |
-
.example-meta { padding:7px 10px 3px; display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
|
| 677 |
-
.example-badge {
|
| 678 |
-
display:inline-flex; padding:2px 7px; background:rgba(255,69,0,.1); border-radius:4px;
|
| 679 |
-
font-size:10px; font-weight:700; color:#FF6A33; font-family:var(--mono);
|
| 680 |
-
white-space:nowrap; border:1px solid rgba(255,69,0,.2);
|
| 681 |
-
}
|
| 682 |
-
.example-lora-badge {
|
| 683 |
-
display:inline-flex; padding:2px 7px; background:rgba(255,255,255,.06); border-radius:4px;
|
| 684 |
-
font-size:10px; font-weight:600; color:#9898a8; font-family:var(--mono);
|
| 685 |
-
white-space:nowrap; border:1px solid #2a2a2e;
|
| 686 |
-
max-width:120px; overflow:hidden; text-overflow:ellipsis;
|
| 687 |
-
}
|
| 688 |
-
.example-prompt-text {
|
| 689 |
-
padding:2px 10px 10px; font-size:11.5px; color:#9898a8; line-height:1.45;
|
| 690 |
-
display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
|
| 691 |
-
overflow:hidden; font-weight:400; font-family:'Inter',sans-serif;
|
| 692 |
-
}
|
| 693 |
-
|
| 694 |
-
/* ββ Right panel βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 695 |
-
.panel-card { border-bottom:1px solid #2a2a2e; background:#141416!important; }
|
| 696 |
-
.panel-card-title {
|
| 697 |
-
padding:11px 20px; font-size:11px; font-weight:700; color:#555560;
|
| 698 |
-
text-transform:uppercase; letter-spacing:1px;
|
| 699 |
-
border-bottom:1px solid rgba(42,42,46,.6);
|
| 700 |
-
background:#141416!important; font-family:'Inter',sans-serif;
|
| 701 |
-
}
|
| 702 |
-
.panel-card-body { padding:14px 18px; display:flex; flex-direction:column; gap:8px; background:#141416!important; }
|
| 703 |
-
.modern-label { font-size:13px; font-weight:600; color:#9898a8; margin-bottom:4px; display:block; font-family:'Inter',sans-serif; }
|
| 704 |
-
.modern-textarea {
|
| 705 |
-
width:100%; background:#09090b!important; border:1px solid #2a2a2e; border-radius:8px;
|
| 706 |
-
padding:10px 14px; font-family:'Inter',sans-serif; font-size:14px;
|
| 707 |
-
color:#e8e8ec!important; -webkit-text-fill-color:#e8e8ec!important;
|
| 708 |
-
resize:vertical; outline:none; min-height:44px; transition:border-color .2s; font-weight:400;
|
| 709 |
-
}
|
| 710 |
-
.modern-textarea:focus { border-color:#FF4500; box-shadow:0 0 0 3px rgba(255,69,0,.22); }
|
| 711 |
-
.modern-textarea::placeholder { color:#555560!important; -webkit-text-fill-color:#555560!important; }
|
| 712 |
-
.modern-textarea.error-flash {
|
| 713 |
-
border-color:#ef4444!important;
|
| 714 |
-
box-shadow:0 0 0 3px rgba(239,68,68,.2)!important;
|
| 715 |
-
animation:shake .4s ease;
|
| 716 |
-
}
|
| 717 |
-
@keyframes shake {
|
| 718 |
-
0%,100%{transform:translateX(0)}
|
| 719 |
-
20%,60%{transform:translateX(-4px)}
|
| 720 |
-
40%,80%{transform:translateX(4px)}
|
| 721 |
-
}
|
| 722 |
-
|
| 723 |
-
/* ββ LoRA selector - always dark βββββββββββββββββββββββββββββββββββββββββββββ */
|
| 724 |
-
.lora-selector-card { border-bottom:1px solid #2a2a2e!important; background:#0d0d0f!important; }
|
| 725 |
-
.lora-selector-body { padding:12px 18px!important; background:#0d0d0f!important; }
|
| 726 |
-
.lora-select-label {
|
| 727 |
-
font-size:11px!important; font-weight:700!important;
|
| 728 |
-
color:#555560!important; -webkit-text-fill-color:#555560!important;
|
| 729 |
-
text-transform:uppercase!important; letter-spacing:1px!important;
|
| 730 |
-
margin-bottom:8px!important; display:flex!important; align-items:center!important;
|
| 731 |
-
gap:6px!important; font-family:'Inter',sans-serif!important;
|
| 732 |
-
}
|
| 733 |
-
.lora-select-label::before {
|
| 734 |
-
content:''; display:inline-block; width:8px; height:8px;
|
| 735 |
-
background:#FF4500; border-radius:50%; flex-shrink:0;
|
| 736 |
-
}
|
| 737 |
-
.lora-native-select {
|
| 738 |
-
width:100%!important; background:#09090b!important;
|
| 739 |
-
border:1px solid #333338!important; border-radius:8px!important;
|
| 740 |
padding:9px 36px 9px 14px!important;
|
| 741 |
font-family:'Inter',sans-serif!important;
|
| 742 |
-
font-size:13px!important;
|
| 743 |
-
color:#
|
| 744 |
-
outline:none!important;
|
| 745 |
-
background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%
|
| 746 |
-
background-repeat:no-repeat!important;
|
| 747 |
-
cursor:pointer!important;
|
| 748 |
-
}
|
| 749 |
-
.lora-native-select:focus
|
| 750 |
-
.lora-native-select option
|
| 751 |
-
|
| 752 |
-
@media (prefers-color-scheme: light)
|
| 753 |
-
.lora-selector-card
|
| 754 |
-
.lora-selector-body
|
| 755 |
-
.lora-select-label
|
| 756 |
-
.lora-native-select
|
| 757 |
-
background:#09090b!important;
|
| 758 |
-
-webkit-text-fill-color:#
|
| 759 |
-
border-color:#
|
| 760 |
}
|
| 761 |
-
.lora-native-select option
|
| 762 |
}
|
| 763 |
|
| 764 |
-
/* ββ Toast ββ
|
| 765 |
-
.toast-notification
|
| 766 |
-
position:fixed;
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
font-family:'Inter',sans-serif; font-size:14px; font-weight:700;
|
| 770 |
-
display:flex; align-items:center; gap:8px;
|
| 771 |
box-shadow:0 8px 24px rgba(0,0,0,.5);
|
| 772 |
-
transition:transform .35s cubic-bezier(.34,1.56,.64,1),opacity .35s ease;
|
| 773 |
-
|
| 774 |
-
}
|
| 775 |
-
.toast-notification.
|
| 776 |
-
.toast-notification.
|
| 777 |
-
.toast-notification.
|
| 778 |
-
.toast-notification.
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
font-family:'Inter',sans-serif;
|
| 786 |
-
color:#
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
}
|
| 794 |
-
.btn-run
|
| 795 |
-
.btn-run svg {
|
| 796 |
-
#custom-run-btn,
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
.
|
| 802 |
-
.
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
}
|
| 810 |
-
.
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
}
|
| 815 |
-
.out-
|
| 816 |
-
.
|
| 817 |
-
|
| 818 |
-
|
| 819 |
-
|
| 820 |
-
|
| 821 |
-
|
| 822 |
-
|
| 823 |
-
|
| 824 |
-
.
|
| 825 |
-
|
| 826 |
-
|
| 827 |
-
}
|
| 828 |
-
.out-download-btn.visible
|
| 829 |
-
.out-download-btn svg
|
| 830 |
-
.out-download-btn:hover svg
|
| 831 |
-
|
| 832 |
-
/* ββ Loader ββ
|
| 833 |
-
.modern-loader
|
| 834 |
-
display:none;
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
}
|
| 844 |
-
|
| 845 |
-
.
|
| 846 |
-
|
| 847 |
-
.
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
}
|
| 860 |
-
.
|
| 861 |
-
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
box-shadow:0 2px 6px rgba(
|
| 872 |
-
}
|
| 873 |
-
.slider-row
|
| 874 |
-
|
| 875 |
-
|
| 876 |
-
border-radius:
|
| 877 |
-
}
|
| 878 |
-
.
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
.
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
padding:
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
.
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
}
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
}
|
| 909 |
-
.
|
| 910 |
-
.
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
::-webkit-scrollbar
|
| 917 |
-
|
| 918 |
-
|
|
|
|
|
|
|
|
|
|
| 919 |
@media(max-width:860px){
|
| 920 |
-
.app-main-row
|
| 921 |
-
.app-main-right
|
| 922 |
-
.app-main-left
|
| 923 |
}
|
| 924 |
"""
|
| 925 |
|
|
@@ -950,34 +827,32 @@ function init() {
|
|
| 950 |
let selectedIdx = -1;
|
| 951 |
let toastTimer = null;
|
| 952 |
|
| 953 |
-
/* ββ Force dark styles on elements that browsers may override ββ */
|
| 954 |
function enforceDarkStyles() {
|
| 955 |
-
/* LoRA card */
|
| 956 |
const loraCard = document.querySelector('.lora-selector-card');
|
| 957 |
const loraBody = document.querySelector('.lora-selector-body');
|
| 958 |
const loraLabel = document.querySelector('.lora-select-label');
|
| 959 |
const loraEl = document.getElementById('custom-lora-select');
|
| 960 |
-
if (loraCard) { loraCard.style.setProperty('background','#
|
| 961 |
-
if (loraBody) { loraBody.style.setProperty('background','#
|
| 962 |
if (loraLabel) {
|
| 963 |
-
loraLabel.style.setProperty('color','#
|
| 964 |
-
loraLabel.style.setProperty('-webkit-text-fill-color','#
|
| 965 |
}
|
| 966 |
if (loraEl) {
|
| 967 |
loraEl.style.setProperty('background-color','#09090b','important');
|
| 968 |
-
loraEl.style.setProperty('color','#
|
| 969 |
-
loraEl.style.setProperty('-webkit-text-fill-color','#
|
| 970 |
-
loraEl.style.setProperty('border-color','#
|
| 971 |
}
|
| 972 |
|
| 973 |
-
/* GitHub button */
|
| 974 |
const ghBtn = document.querySelector('.gh-btn');
|
| 975 |
if (ghBtn) {
|
| 976 |
-
ghBtn.style.setProperty('background','#
|
| 977 |
ghBtn.style.setProperty('color','#ffffff','important');
|
| 978 |
ghBtn.style.setProperty('-webkit-text-fill-color','#ffffff','important');
|
| 979 |
-
ghBtn.style.setProperty('border-color','rgba(255,255,255,.
|
| 980 |
-
ghBtn.style.setProperty('box-shadow','0 2px
|
| 981 |
const svg = ghBtn.querySelector('svg');
|
| 982 |
if (svg) svg.style.setProperty('fill','#ffffff','important');
|
| 983 |
const span = ghBtn.querySelector('span');
|
|
@@ -987,41 +862,39 @@ function init() {
|
|
| 987 |
}
|
| 988 |
}
|
| 989 |
|
| 990 |
-
/* Shell sections */
|
| 991 |
const shell = document.querySelector('.app-shell');
|
| 992 |
const header = document.querySelector('.app-header');
|
| 993 |
const toolbar = document.querySelector('.app-toolbar');
|
| 994 |
-
if (shell) shell.style.setProperty('background','#
|
| 995 |
-
if (header) header.style.setProperty('background','#
|
| 996 |
-
if (toolbar) toolbar.style.setProperty('background','#
|
| 997 |
}
|
| 998 |
|
| 999 |
enforceDarkStyles();
|
| 1000 |
-
setInterval(enforceDarkStyles,
|
| 1001 |
|
| 1002 |
-
/* GitHub button hover interaction */
|
| 1003 |
const ghBtn = document.querySelector('.gh-btn');
|
| 1004 |
if (ghBtn) {
|
| 1005 |
ghBtn.addEventListener('mouseenter', () => {
|
| 1006 |
-
ghBtn.style.setProperty('background','#
|
| 1007 |
ghBtn.style.setProperty('color','#ffffff','important');
|
| 1008 |
ghBtn.style.setProperty('-webkit-text-fill-color','#ffffff','important');
|
| 1009 |
ghBtn.style.setProperty('transform','translateY(-1px)','important');
|
| 1010 |
-
ghBtn.style.setProperty('box-shadow','0
|
| 1011 |
});
|
| 1012 |
ghBtn.addEventListener('mouseleave', () => {
|
| 1013 |
-
ghBtn.style.setProperty('background','#
|
| 1014 |
ghBtn.style.setProperty('color','#ffffff','important');
|
| 1015 |
ghBtn.style.setProperty('-webkit-text-fill-color','#ffffff','important');
|
| 1016 |
ghBtn.style.setProperty('transform','translateY(0)','important');
|
| 1017 |
-
ghBtn.style.setProperty('box-shadow','0 2px
|
| 1018 |
});
|
| 1019 |
ghBtn.addEventListener('mousedown', () => {
|
| 1020 |
-
ghBtn.style.setProperty('background','#
|
| 1021 |
ghBtn.style.setProperty('transform','translateY(0)','important');
|
| 1022 |
});
|
| 1023 |
ghBtn.addEventListener('mouseup', () => {
|
| 1024 |
-
ghBtn.style.setProperty('background','#
|
| 1025 |
});
|
| 1026 |
}
|
| 1027 |
|
|
@@ -1377,23 +1250,25 @@ watchExampleResults();
|
|
| 1377 |
}
|
| 1378 |
"""
|
| 1379 |
|
| 1380 |
-
|
| 1381 |
-
|
| 1382 |
-
|
| 1383 |
-
|
| 1384 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1385 |
|
| 1386 |
-
|
| 1387 |
-
REMOVE_SVG = '<svg class="tb-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'
|
| 1388 |
-
CLEAR_SVG = '<svg class="tb-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>'
|
| 1389 |
-
DOWNLOAD_SVG = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 16l-5-5h3V4h4v7h3l-5 5z" fill="currentColor"/><path d="M20 18H4v2h16v-2z" fill="currentColor"/></svg>'
|
| 1390 |
-
GITHUB_SVG = '<svg width="15" height="15" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>'
|
| 1391 |
|
| 1392 |
LORA_OPTIONS_HTML = "\n".join(
|
| 1393 |
f'<option value="{html_lib.escape(name)}">{html_lib.escape(name)}</option>'
|
| 1394 |
for name in ADAPTER_NAMES
|
| 1395 |
)
|
| 1396 |
|
|
|
|
| 1397 |
with gr.Blocks() as demo:
|
| 1398 |
|
| 1399 |
hidden_images_b64 = gr.Textbox(value="[]", elem_id="hidden-images-b64", elem_classes="hidden-input", container=False)
|
|
@@ -1415,13 +1290,12 @@ with gr.Blocks() as demo:
|
|
| 1415 |
<!-- Header -->
|
| 1416 |
<div class="app-header">
|
| 1417 |
<div class="app-header-left">
|
| 1418 |
-
<div class="app-logo">{
|
| 1419 |
<span class="app-title">Qwen-Image-Edit</span>
|
| 1420 |
<span class="app-badge">2511</span>
|
| 1421 |
<span class="app-badge fast">4-Step Fast</span>
|
| 1422 |
</div>
|
| 1423 |
|
| 1424 |
-
<!-- GitHub button: highlighted orange, same in light & dark -->
|
| 1425 |
<a href="https://github.com/PRITHIVSAKTHIUR/Qwen-Image-Edit-2511-LoRAs-Fast-Lazy-Load"
|
| 1426 |
target="_blank"
|
| 1427 |
class="gh-btn">
|
|
@@ -1456,11 +1330,11 @@ with gr.Blocks() as demo:
|
|
| 1456 |
<div id="upload-click-area" class="upload-click-area">
|
| 1457 |
<svg viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 1458 |
<rect x="8" y="14" width="64" height="52" rx="6" fill="none"
|
| 1459 |
-
stroke="#
|
| 1460 |
<polygon points="12,62 30,40 42,50 54,34 68,62"
|
| 1461 |
-
fill="rgba(
|
| 1462 |
<circle cx="28" cy="30" r="6"
|
| 1463 |
-
fill="rgba(
|
| 1464 |
</svg>
|
| 1465 |
<span class="upload-main-text">Click or drag images here</span>
|
| 1466 |
<span class="upload-sub-text">Supports multiple images for reference-based editing and guided manipulation</span>
|
|
@@ -1531,9 +1405,8 @@ with gr.Blocks() as demo:
|
|
| 1531 |
|
| 1532 |
<div style="padding:14px 18px 6px;">
|
| 1533 |
<button id="custom-run-btn" class="btn-run">
|
| 1534 |
-
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
| 1535 |
-
<path d="M12
|
| 1536 |
-
<circle cx="12" cy="13" r="2"/>
|
| 1537 |
</svg>
|
| 1538 |
<span id="run-btn-label">Edit Image</span>
|
| 1539 |
</button>
|
|
|
|
| 355 |
|
| 356 |
css = r"""
|
| 357 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');
|
|
|
|
| 358 |
*{box-sizing:border-box;margin:0;padding:0}
|
| 359 |
+
body,.gradio-container{
|
| 360 |
+
background:#0f0f13!important;font-family:'Inter',system-ui,-apple-system,sans-serif!important;
|
| 361 |
+
font-size:14px!important;color:#e4e4e7!important;min-height:100vh;
|
| 362 |
+
}
|
| 363 |
+
.dark body,.dark .gradio-container{background:#0f0f13!important;color:#e4e4e7!important}
|
| 364 |
+
footer{display:none!important}
|
| 365 |
+
.hidden-input{display:none!important;height:0!important;overflow:hidden!important;margin:0!important;padding:0!important}
|
| 366 |
+
|
| 367 |
+
#example-load-btn{
|
| 368 |
+
position:absolute!important;left:-9999px!important;top:-9999px!important;
|
| 369 |
+
width:1px!important;height:1px!important;opacity:0.01!important;
|
| 370 |
+
pointer-events:none!important;overflow:hidden!important;
|
| 371 |
+
}
|
| 372 |
+
#gradio-run-btn{
|
| 373 |
+
position:absolute;left:-9999px;top:-9999px;width:1px;height:1px;
|
| 374 |
+
opacity:0.01;pointer-events:none;overflow:hidden;
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
/* ββ App shell ββ */
|
| 378 |
+
.app-shell{
|
| 379 |
+
background:#18181b;border:1px solid #27272a;border-radius:16px;
|
| 380 |
+
margin:12px auto;max-width:1440px;overflow:hidden;
|
| 381 |
+
box-shadow:0 25px 50px -12px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.03);
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
/* ββ Header ββ */
|
| 385 |
+
.app-header{
|
| 386 |
+
background:linear-gradient(135deg,#18181b,#1e1e24);border-bottom:1px solid #27272a;
|
| 387 |
+
padding:14px 24px;display:flex;align-items:center;justify-content:space-between;
|
| 388 |
+
flex-wrap:wrap;gap:12px;
|
| 389 |
+
}
|
| 390 |
+
.app-header-left{display:flex;align-items:center;gap:12px}
|
| 391 |
+
.app-logo{
|
| 392 |
+
width:38px;height:38px;background:linear-gradient(135deg,#1E90FF,#47A3FF,#7CB8FF);
|
| 393 |
+
border-radius:11px;display:flex;align-items:center;justify-content:center;
|
| 394 |
+
box-shadow:0 4px 12px rgba(30,144,255,.35);flex-shrink:0;
|
| 395 |
+
}
|
| 396 |
+
.app-logo svg{width:20px;height:20px;fill:#fff;flex-shrink:0}
|
| 397 |
+
.app-title{
|
| 398 |
+
font-size:18px;font-weight:800;background:linear-gradient(135deg,#e4e4e7,#a1a1aa);
|
| 399 |
+
-webkit-background-clip:text;-webkit-text-fill-color:transparent;letter-spacing:-.3px;
|
| 400 |
+
}
|
| 401 |
+
.app-badge{
|
| 402 |
+
font-size:11px;font-weight:700;padding:3px 10px;border-radius:20px;
|
| 403 |
+
background:rgba(30,144,255,.15);color:#47A3FF;border:1px solid rgba(30,144,255,.25);letter-spacing:.3px;
|
| 404 |
+
}
|
| 405 |
+
.app-badge.fast{background:rgba(34,197,94,.12);color:#4ade80;border:1px solid rgba(34,197,94,.25)}
|
| 406 |
+
|
| 407 |
+
/* ββ GitHub button ββ */
|
| 408 |
+
.gh-btn{
|
| 409 |
+
display:inline-flex!important;align-items:center!important;gap:7px!important;
|
| 410 |
+
padding:7px 16px!important;border-radius:8px!important;text-decoration:none!important;
|
| 411 |
+
font-family:'Inter',sans-serif!important;font-size:13px!important;font-weight:700!important;
|
| 412 |
+
letter-spacing:.1px!important;background:#1E90FF!important;
|
| 413 |
+
color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
|
| 414 |
+
border:1px solid rgba(255,255,255,.18)!important;
|
| 415 |
+
box-shadow:0 2px 10px rgba(30,144,255,.45),0 1px 0 rgba(255,255,255,.1) inset!important;
|
| 416 |
+
transition:transform .15s ease,box-shadow .15s ease,background .15s ease!important;
|
| 417 |
+
cursor:pointer!important;flex-shrink:0!important;
|
| 418 |
+
}
|
| 419 |
+
.gh-btn:hover{
|
| 420 |
+
background:#47A3FF!important;color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
|
| 421 |
+
transform:translateY(-1px)!important;
|
| 422 |
+
box-shadow:0 5px 18px rgba(30,144,255,.6),0 1px 0 rgba(255,255,255,.12) inset!important;
|
| 423 |
+
}
|
| 424 |
+
.gh-btn:active{
|
| 425 |
+
background:#1873CC!important;transform:translateY(0)!important;
|
| 426 |
+
box-shadow:0 1px 5px rgba(30,144,255,.35)!important;
|
| 427 |
+
}
|
| 428 |
+
.gh-btn svg{fill:#ffffff!important;flex-shrink:0;width:15px!important;height:15px!important}
|
| 429 |
+
.gh-btn span{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important}
|
| 430 |
+
|
| 431 |
+
@media (prefers-color-scheme: light){
|
| 432 |
+
.gh-btn{background:#1E90FF!important;color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;border-color:rgba(255,255,255,.18)!important}
|
| 433 |
+
.gh-btn:hover{background:#47A3FF!important}
|
| 434 |
+
.gh-btn svg{fill:#ffffff!important}
|
| 435 |
+
.gh-btn span{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important}
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
/* ββ Toolbar ββ */
|
| 439 |
+
.app-toolbar{
|
| 440 |
+
background:#18181b;border-bottom:1px solid #27272a;padding:8px 16px;
|
| 441 |
+
display:flex;gap:4px;align-items:center;flex-wrap:wrap;
|
| 442 |
+
}
|
| 443 |
+
.tb-sep{width:1px;height:28px;background:#27272a;margin:0 8px}
|
| 444 |
+
.modern-tb-btn{
|
| 445 |
+
display:inline-flex;align-items:center;justify-content:center;gap:6px;
|
| 446 |
+
min-width:32px;height:34px;background:transparent;border:1px solid transparent;
|
| 447 |
+
border-radius:8px;cursor:pointer;font-size:13px;font-weight:600;padding:0 12px;
|
| 448 |
+
font-family:'Inter',sans-serif;color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
|
| 449 |
+
transition:all .15s ease;
|
| 450 |
+
}
|
| 451 |
+
.modern-tb-btn:hover{background:rgba(30,144,255,.15);border-color:rgba(30,144,255,.3)}
|
| 452 |
+
.modern-tb-btn:active,.modern-tb-btn.active{background:rgba(30,144,255,.25);border-color:rgba(30,144,255,.45)}
|
| 453 |
+
.modern-tb-btn .tb-label{font-size:13px;color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;font-weight:600}
|
| 454 |
+
.modern-tb-btn .tb-svg{width:15px;height:15px;flex-shrink:0;color:#ffffff!important}
|
| 455 |
+
.modern-tb-btn .tb-svg,
|
| 456 |
+
.modern-tb-btn .tb-svg *{stroke:#ffffff!important;fill:none!important}
|
| 457 |
+
.tb-info{font-family:'JetBrains Mono',monospace;font-size:12px;color:#71717a;padding:0 8px;display:flex;align-items:center}
|
| 458 |
+
|
| 459 |
+
body:not(.dark) .modern-tb-btn,body:not(.dark) .modern-tb-btn *{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important}
|
| 460 |
+
body:not(.dark) .modern-tb-btn .tb-svg,body:not(.dark) .modern-tb-btn .tb-svg *{stroke:#ffffff!important}
|
| 461 |
+
.dark .modern-tb-btn,.dark .modern-tb-btn *{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important}
|
| 462 |
+
.dark .modern-tb-btn .tb-svg,.dark .modern-tb-btn .tb-svg *{stroke:#ffffff!important}
|
| 463 |
+
.gradio-container .modern-tb-btn,.gradio-container .modern-tb-btn *{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important}
|
| 464 |
+
.gradio-container .modern-tb-btn .tb-svg,.gradio-container .modern-tb-btn .tb-svg *{stroke:#ffffff!important}
|
| 465 |
+
|
| 466 |
+
/* ββ Main layout ββ */
|
| 467 |
+
.app-main-row{display:flex;gap:0;flex:1;overflow:hidden}
|
| 468 |
+
.app-main-left{flex:1;display:flex;flex-direction:column;min-width:0;border-right:1px solid #27272a}
|
| 469 |
+
.app-main-right{width:440px;display:flex;flex-direction:column;flex-shrink:0;background:#18181b}
|
| 470 |
+
|
| 471 |
+
/* ββ Drop zone ββ */
|
| 472 |
+
#gallery-drop-zone{position:relative;background:#09090b;min-height:440px;overflow:auto}
|
| 473 |
+
#gallery-drop-zone.drag-over{outline:2px solid #1E90FF;outline-offset:-2px;background:rgba(30,144,255,.04)}
|
| 474 |
+
|
| 475 |
+
.upload-prompt-modern{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:20}
|
| 476 |
+
.upload-click-area{
|
| 477 |
+
display:flex;flex-direction:column;align-items:center;justify-content:center;
|
| 478 |
+
cursor:pointer;padding:36px 52px;border:2px dashed #3f3f46;border-radius:16px;
|
| 479 |
+
background:rgba(30,144,255,.03);transition:all .2s ease;gap:8px;
|
| 480 |
+
}
|
| 481 |
+
.upload-click-area:hover{background:rgba(30,144,255,.08);border-color:#1E90FF;transform:scale(1.03)}
|
| 482 |
+
.upload-click-area:active{background:rgba(30,144,255,.12);transform:scale(.98)}
|
| 483 |
+
.upload-click-area svg{width:80px;height:80px}
|
| 484 |
+
.upload-main-text{color:#71717a;font-size:14px;font-weight:500;margin-top:4px}
|
| 485 |
+
.upload-sub-text{color:#52525b;font-size:12px;text-align:center;max-width:280px;line-height:1.5}
|
| 486 |
+
|
| 487 |
+
/* ββ Gallery grid ββ */
|
| 488 |
+
.image-gallery-grid{
|
| 489 |
+
display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
|
| 490 |
+
gap:12px;padding:16px;align-content:start;
|
| 491 |
+
}
|
| 492 |
+
.gallery-thumb{
|
| 493 |
+
position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;
|
| 494 |
+
cursor:pointer;border:2px solid #27272a;transition:all .2s ease;background:#18181b;
|
| 495 |
+
}
|
| 496 |
+
.gallery-thumb:hover{border-color:#3f3f46;transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.4)}
|
| 497 |
+
.gallery-thumb.selected{border-color:#1E90FF!important;box-shadow:0 0 0 3px rgba(30,144,255,.2)}
|
| 498 |
+
.gallery-thumb img{width:100%;height:100%;object-fit:cover}
|
| 499 |
+
.thumb-badge{
|
| 500 |
+
position:absolute;top:6px;left:6px;background:#1E90FF;color:#fff;
|
| 501 |
+
padding:2px 8px;border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:11px;font-weight:600;
|
| 502 |
+
}
|
| 503 |
+
.thumb-remove{
|
| 504 |
+
position:absolute;top:6px;right:6px;width:24px;height:24px;background:rgba(0,0,0,.75);
|
| 505 |
+
color:#fff;border:1px solid rgba(255,255,255,.15);border-radius:50%;cursor:pointer;
|
| 506 |
+
display:none;align-items:center;justify-content:center;font-size:12px;transition:all .15s;line-height:1;
|
| 507 |
+
}
|
| 508 |
+
.gallery-thumb:hover .thumb-remove{display:flex}
|
| 509 |
+
.thumb-remove:hover{background:#1E90FF;border-color:#1E90FF}
|
| 510 |
+
.gallery-add-card{
|
| 511 |
+
aspect-ratio:1;border-radius:10px;border:2px dashed #3f3f46;
|
| 512 |
+
display:flex;flex-direction:column;align-items:center;justify-content:center;
|
| 513 |
+
cursor:pointer;transition:all .2s ease;background:rgba(30,144,255,.03);gap:4px;
|
| 514 |
+
}
|
| 515 |
+
.gallery-add-card:hover{border-color:#1E90FF;background:rgba(30,144,255,.08)}
|
| 516 |
+
.gallery-add-card .add-icon{font-size:28px;color:#71717a;font-weight:300}
|
| 517 |
+
.gallery-add-card .add-text{font-size:12px;color:#71717a;font-weight:500}
|
| 518 |
+
|
| 519 |
+
/* ββ Hint bar ββ */
|
| 520 |
+
.hint-bar{
|
| 521 |
+
background:rgba(30,144,255,.06);border-top:1px solid #27272a;border-bottom:1px solid #27272a;
|
| 522 |
+
padding:10px 20px;font-size:13px;color:#a1a1aa;line-height:1.7;
|
| 523 |
+
}
|
| 524 |
+
.hint-bar b{color:#7CB8FF;font-weight:600}
|
| 525 |
+
.hint-bar kbd{
|
| 526 |
+
display:inline-block;padding:1px 6px;background:#27272a;border:1px solid #3f3f46;
|
| 527 |
+
border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:11px;color:#a1a1aa;
|
| 528 |
+
}
|
| 529 |
+
|
| 530 |
+
/* ββ Suggestions ββ */
|
| 531 |
+
.suggestions-section{border-top:1px solid #27272a;padding:12px 16px}
|
| 532 |
+
.suggestions-title,.examples-title{
|
| 533 |
+
font-size:12px;font-weight:600;color:#71717a;text-transform:uppercase;
|
| 534 |
+
letter-spacing:.8px;margin-bottom:10px;
|
| 535 |
+
}
|
| 536 |
+
.suggestions-wrap{display:flex;flex-wrap:wrap;gap:6px}
|
| 537 |
+
.suggestion-chip{
|
| 538 |
+
display:inline-flex;align-items:center;gap:4px;padding:5px 12px;
|
| 539 |
+
background:rgba(30,144,255,.08);border:1px solid rgba(30,144,255,.2);border-radius:20px;
|
| 540 |
+
color:#7CB8FF;font-size:12px;font-weight:500;font-family:'Inter',sans-serif;
|
| 541 |
+
cursor:pointer;transition:all .15s;white-space:nowrap;
|
| 542 |
+
}
|
| 543 |
+
.suggestion-chip:hover{background:rgba(30,144,255,.15);border-color:rgba(30,144,255,.35);color:#47A3FF;transform:translateY(-1px)}
|
| 544 |
+
|
| 545 |
+
/* ββ Examples ββ */
|
| 546 |
+
.examples-section{border-top:1px solid #27272a;padding:12px 16px}
|
| 547 |
+
.examples-scroll{display:flex;gap:10px;overflow-x:auto;padding-bottom:8px}
|
| 548 |
+
.examples-scroll::-webkit-scrollbar{height:6px}
|
| 549 |
+
.examples-scroll::-webkit-scrollbar-track{background:#09090b;border-radius:3px}
|
| 550 |
+
.examples-scroll::-webkit-scrollbar-thumb{background:#27272a;border-radius:3px}
|
| 551 |
+
.examples-scroll::-webkit-scrollbar-thumb:hover{background:#3f3f46}
|
| 552 |
+
.example-card{
|
| 553 |
+
flex-shrink:0;width:220px;background:#09090b;border:1px solid #27272a;
|
| 554 |
+
border-radius:10px;overflow:hidden;cursor:pointer;transition:all .2s ease;
|
| 555 |
+
}
|
| 556 |
+
.example-card:hover{border-color:#1E90FF;transform:translateY(-2px);box-shadow:0 4px 12px rgba(30,144,255,.15)}
|
| 557 |
+
.example-card.loading{opacity:.5;pointer-events:none}
|
| 558 |
+
.example-thumbs{display:flex;height:110px;overflow:hidden;background:#18181b}
|
| 559 |
+
.example-thumbs img{flex:1;object-fit:cover;min-width:0;border-bottom:1px solid #27272a}
|
| 560 |
+
.example-thumb-placeholder{
|
| 561 |
+
flex:1;display:flex;align-items:center;justify-content:center;
|
| 562 |
+
background:#18181b;color:#3f3f46;font-size:11px;min-width:0;
|
| 563 |
+
}
|
| 564 |
+
.example-meta{padding:6px 10px 2px;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
|
| 565 |
+
.example-badge{
|
| 566 |
+
display:inline-flex;padding:2px 7px;background:rgba(30,144,255,.1);border-radius:4px;
|
| 567 |
+
font-size:10px;font-weight:600;color:#47A3FF;font-family:'JetBrains Mono',monospace;white-space:nowrap;
|
| 568 |
+
}
|
| 569 |
+
.example-lora-badge{
|
| 570 |
+
display:inline-flex;padding:2px 7px;background:rgba(255,255,255,.06);border-radius:4px;
|
| 571 |
+
font-size:10px;font-weight:600;color:#a1a1aa;font-family:'JetBrains Mono',monospace;
|
| 572 |
+
white-space:nowrap;border:1px solid #27272a;max-width:130px;overflow:hidden;text-overflow:ellipsis;
|
| 573 |
+
}
|
| 574 |
+
.example-prompt-text{
|
| 575 |
+
padding:4px 10px 8px;font-size:11px;color:#a1a1aa;line-height:1.4;
|
| 576 |
+
display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
/* ββ Right panel ββ */
|
| 580 |
+
.panel-card{border-bottom:1px solid #27272a}
|
| 581 |
+
.panel-card-title{
|
| 582 |
+
padding:12px 20px;font-size:12px;font-weight:600;color:#71717a;
|
| 583 |
+
text-transform:uppercase;letter-spacing:.8px;border-bottom:1px solid rgba(39,39,42,.6);
|
| 584 |
+
}
|
| 585 |
+
.panel-card-body{padding:16px 20px;display:flex;flex-direction:column;gap:8px}
|
| 586 |
+
.modern-label{font-size:13px;font-weight:500;color:#a1a1aa;margin-bottom:4px;display:block}
|
| 587 |
+
.modern-textarea{
|
| 588 |
+
width:100%;background:#09090b;border:1px solid #27272a;border-radius:8px;
|
| 589 |
+
padding:10px 14px;font-family:'Inter',sans-serif;font-size:14px;color:#e4e4e7;
|
| 590 |
+
resize:vertical;outline:none;min-height:42px;transition:border-color .2s;
|
| 591 |
+
}
|
| 592 |
+
.modern-textarea:focus{border-color:#1E90FF;box-shadow:0 0 0 3px rgba(30,144,255,.15)}
|
| 593 |
+
.modern-textarea::placeholder{color:#3f3f46}
|
| 594 |
+
.modern-textarea.error-flash{
|
| 595 |
+
border-color:#ef4444!important;box-shadow:0 0 0 3px rgba(239,68,68,.2)!important;animation:shake .4s ease;
|
| 596 |
+
}
|
| 597 |
+
@keyframes shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-4px)}40%,80%{transform:translateX(4px)}}
|
| 598 |
+
|
| 599 |
+
/* ββ LoRA selector ββ */
|
| 600 |
+
.lora-selector-card{border-bottom:1px solid #27272a!important;background:#0f0f13!important}
|
| 601 |
+
.lora-selector-body{padding:14px 20px!important;background:#0f0f13!important}
|
| 602 |
+
.lora-select-label{
|
| 603 |
+
font-size:12px!important;font-weight:600!important;
|
| 604 |
+
color:#71717a!important;-webkit-text-fill-color:#71717a!important;
|
| 605 |
+
text-transform:uppercase!important;letter-spacing:.8px!important;
|
| 606 |
+
margin-bottom:8px!important;display:flex!important;align-items:center!important;
|
| 607 |
+
gap:6px!important;font-family:'Inter',sans-serif!important;
|
| 608 |
+
}
|
| 609 |
+
.lora-select-label::before{
|
| 610 |
+
content:'';display:inline-block;width:8px;height:8px;
|
| 611 |
+
background:#1E90FF;border-radius:50%;flex-shrink:0;
|
| 612 |
+
}
|
| 613 |
+
.lora-native-select{
|
| 614 |
+
width:100%!important;background:#09090b!important;
|
| 615 |
+
border:1px solid #3f3f46!important;border-radius:8px!important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 616 |
padding:9px 36px 9px 14px!important;
|
| 617 |
font-family:'Inter',sans-serif!important;
|
| 618 |
+
font-size:13px!important;font-weight:600!important;
|
| 619 |
+
color:#e4e4e7!important;-webkit-text-fill-color:#e4e4e7!important;
|
| 620 |
+
outline:none!important;appearance:none!important;-webkit-appearance:none!important;
|
| 621 |
+
background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231E90FF' d='M6 8L1 3h10z'/%3E%3C/svg%3E")!important;
|
| 622 |
+
background-repeat:no-repeat!important;background-position:right 12px center!important;
|
| 623 |
+
cursor:pointer!important;transition:border-color .2s!important;color-scheme:dark!important;
|
| 624 |
+
}
|
| 625 |
+
.lora-native-select:focus{border-color:#1E90FF!important;box-shadow:0 0 0 3px rgba(30,144,255,.15)!important}
|
| 626 |
+
.lora-native-select option{background:#18181b!important;color:#e4e4e7!important}
|
| 627 |
+
|
| 628 |
+
@media (prefers-color-scheme: light){
|
| 629 |
+
.lora-selector-card{background:#0f0f13!important}
|
| 630 |
+
.lora-selector-body{background:#0f0f13!important}
|
| 631 |
+
.lora-select-label{color:#71717a!important;-webkit-text-fill-color:#71717a!important}
|
| 632 |
+
.lora-native-select{
|
| 633 |
+
background:#09090b!important;color:#e4e4e7!important;
|
| 634 |
+
-webkit-text-fill-color:#e4e4e7!important;
|
| 635 |
+
border-color:#3f3f46!important;color-scheme:dark!important;
|
| 636 |
}
|
| 637 |
+
.lora-native-select option{background:#18181b!important;color:#e4e4e7!important}
|
| 638 |
}
|
| 639 |
|
| 640 |
+
/* ββ Toast ββ */
|
| 641 |
+
.toast-notification{
|
| 642 |
+
position:fixed;top:24px;left:50%;transform:translateX(-50%) translateY(-120%);
|
| 643 |
+
z-index:9999;padding:10px 24px;border-radius:10px;font-family:'Inter',sans-serif;
|
| 644 |
+
font-size:14px;font-weight:600;display:flex;align-items:center;gap:8px;
|
|
|
|
|
|
|
| 645 |
box-shadow:0 8px 24px rgba(0,0,0,.5);
|
| 646 |
+
transition:transform .35s cubic-bezier(.34,1.56,.64,1),opacity .35s ease;opacity:0;pointer-events:none;
|
| 647 |
+
}
|
| 648 |
+
.toast-notification.visible{transform:translateX(-50%) translateY(0);opacity:1;pointer-events:auto}
|
| 649 |
+
.toast-notification.error{background:linear-gradient(135deg,#dc2626,#b91c1c);color:#fff;border:1px solid rgba(255,255,255,.15)}
|
| 650 |
+
.toast-notification.warning{background:linear-gradient(135deg,#d97706,#b45309);color:#fff;border:1px solid rgba(255,255,255,.15)}
|
| 651 |
+
.toast-notification.info{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border:1px solid rgba(255,255,255,.15)}
|
| 652 |
+
.toast-notification .toast-icon{font-size:16px;line-height:1}
|
| 653 |
+
.toast-notification .toast-text{line-height:1.3}
|
| 654 |
+
|
| 655 |
+
/* ββ Run button ββ */
|
| 656 |
+
.btn-run{
|
| 657 |
+
display:flex;align-items:center;justify-content:center;gap:8px;width:100%;
|
| 658 |
+
background:linear-gradient(135deg,#1E90FF,#1873CC);border:none;border-radius:10px;
|
| 659 |
+
padding:12px 24px;cursor:pointer;font-size:15px;font-weight:600;font-family:'Inter',sans-serif;
|
| 660 |
+
color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;transition:all .2s ease;letter-spacing:-.2px;
|
| 661 |
+
box-shadow:0 4px 16px rgba(30,144,255,.3),inset 0 1px 0 rgba(255,255,255,.1);
|
| 662 |
+
}
|
| 663 |
+
.btn-run:hover{
|
| 664 |
+
background:linear-gradient(135deg,#47A3FF,#1E90FF);transform:translateY(-1px);
|
| 665 |
+
box-shadow:0 6px 24px rgba(30,144,255,.45),inset 0 1px 0 rgba(255,255,255,.15);
|
| 666 |
+
}
|
| 667 |
+
.btn-run:active{transform:translateY(0);box-shadow:0 2px 8px rgba(30,144,255,.3)}
|
| 668 |
+
.btn-run svg{width:18px;height:18px;fill:#ffffff!important}
|
| 669 |
+
.btn-run svg path{fill:#ffffff!important}
|
| 670 |
+
#custom-run-btn,#custom-run-btn *,#custom-run-btn span,#custom-run-btn svg,
|
| 671 |
+
#custom-run-btn svg path,#run-btn-label,.btn-run,.btn-run *{
|
| 672 |
+
color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;fill:#ffffff!important;
|
| 673 |
+
}
|
| 674 |
+
body:not(.dark) .btn-run,body:not(.dark) .btn-run *,body:not(.dark) #custom-run-btn,
|
| 675 |
+
body:not(.dark) #custom-run-btn *{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;fill:#ffffff!important}
|
| 676 |
+
.dark .btn-run,.dark .btn-run *,.dark #custom-run-btn,.dark #custom-run-btn *{
|
| 677 |
+
color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;fill:#ffffff!important;
|
| 678 |
+
}
|
| 679 |
+
.gradio-container .btn-run,.gradio-container .btn-run *,.gradio-container #custom-run-btn,
|
| 680 |
+
.gradio-container #custom-run-btn *{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;fill:#ffffff!important}
|
| 681 |
+
|
| 682 |
+
/* ββ Output ββ */
|
| 683 |
+
.output-frame{border-bottom:1px solid #27272a;display:flex;flex-direction:column;position:relative}
|
| 684 |
+
.output-frame .out-title{
|
| 685 |
+
padding:10px 20px;font-size:13px;font-weight:700;color:#ffffff!important;
|
| 686 |
+
-webkit-text-fill-color:#ffffff!important;text-transform:uppercase;letter-spacing:.8px;
|
| 687 |
+
border-bottom:1px solid rgba(39,39,42,.6);display:flex;align-items:center;justify-content:space-between;
|
| 688 |
+
}
|
| 689 |
+
.output-frame .out-title span{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important}
|
| 690 |
+
.output-frame .out-body{
|
| 691 |
+
flex:1;background:#09090b;display:flex;align-items:center;justify-content:center;
|
| 692 |
+
overflow:hidden;min-height:240px;position:relative;
|
| 693 |
+
}
|
| 694 |
+
.output-frame .out-body img{max-width:100%;max-height:460px;image-rendering:auto}
|
| 695 |
+
.output-frame .out-placeholder{color:#3f3f46;font-size:13px;text-align:center;padding:20px}
|
| 696 |
+
.out-download-btn{
|
| 697 |
+
display:none;align-items:center;justify-content:center;background:rgba(30,144,255,.1);
|
| 698 |
+
border:1px solid rgba(30,144,255,.2);border-radius:6px;cursor:pointer;padding:3px 10px;
|
| 699 |
+
font-size:11px;font-weight:500;color:#7CB8FF!important;gap:4px;height:24px;transition:all .15s;
|
| 700 |
+
}
|
| 701 |
+
.out-download-btn:hover{background:rgba(30,144,255,.2);border-color:rgba(30,144,255,.35);color:#ffffff!important}
|
| 702 |
+
.out-download-btn.visible{display:inline-flex}
|
| 703 |
+
.out-download-btn svg{width:12px;height:12px;fill:#7CB8FF}
|
| 704 |
+
.out-download-btn:hover svg{fill:#ffffff}
|
| 705 |
+
|
| 706 |
+
/* ββ Loader ββ */
|
| 707 |
+
.modern-loader{
|
| 708 |
+
display:none;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(9,9,11,.92);
|
| 709 |
+
z-index:15;flex-direction:column;align-items:center;justify-content:center;gap:16px;backdrop-filter:blur(4px);
|
| 710 |
+
}
|
| 711 |
+
.modern-loader.active{display:flex}
|
| 712 |
+
.modern-loader .loader-spinner{
|
| 713 |
+
width:36px;height:36px;border:3px solid #27272a;border-top-color:#1E90FF;
|
| 714 |
+
border-radius:50%;animation:spin .8s linear infinite;
|
| 715 |
+
}
|
| 716 |
+
@keyframes spin{to{transform:rotate(360deg)}}
|
| 717 |
+
.modern-loader .loader-text{font-size:13px;color:#a1a1aa;font-weight:500}
|
| 718 |
+
.loader-bar-track{width:200px;height:4px;background:#27272a;border-radius:2px;overflow:hidden}
|
| 719 |
+
.loader-bar-fill{
|
| 720 |
+
height:100%;background:linear-gradient(90deg,#1E90FF,#47A3FF,#1E90FF);
|
| 721 |
+
background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:2px;
|
| 722 |
+
}
|
| 723 |
+
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
|
| 724 |
+
|
| 725 |
+
/* ββ Settings ββ */
|
| 726 |
+
.settings-group{border:1px solid #27272a;border-radius:10px;margin:12px 16px;padding:0;overflow:hidden}
|
| 727 |
+
.settings-group-title{
|
| 728 |
+
font-size:12px;font-weight:600;color:#71717a;text-transform:uppercase;letter-spacing:.8px;
|
| 729 |
+
padding:10px 16px;border-bottom:1px solid #27272a;background:rgba(24,24,27,.5);
|
| 730 |
+
}
|
| 731 |
+
.settings-group-body{padding:14px 16px;display:flex;flex-direction:column;gap:12px}
|
| 732 |
+
.slider-row{display:flex;align-items:center;gap:10px;min-height:28px}
|
| 733 |
+
.slider-row label{font-size:13px;font-weight:500;color:#a1a1aa;min-width:72px;flex-shrink:0}
|
| 734 |
+
.slider-row input[type="range"]{
|
| 735 |
+
flex:1;-webkit-appearance:none;appearance:none;height:6px;background:#27272a;
|
| 736 |
+
border-radius:3px;outline:none;min-width:0;
|
| 737 |
+
}
|
| 738 |
+
.slider-row input[type="range"]::-webkit-slider-thumb{
|
| 739 |
+
-webkit-appearance:none;width:16px;height:16px;background:linear-gradient(135deg,#1E90FF,#1873CC);
|
| 740 |
+
border-radius:50%;cursor:pointer;box-shadow:0 2px 6px rgba(30,144,255,.4);transition:transform .15s;
|
| 741 |
+
}
|
| 742 |
+
.slider-row input[type="range"]::-webkit-slider-thumb:hover{transform:scale(1.2)}
|
| 743 |
+
.slider-row input[type="range"]::-moz-range-thumb{
|
| 744 |
+
width:16px;height:16px;background:linear-gradient(135deg,#1E90FF,#1873CC);
|
| 745 |
+
border-radius:50%;cursor:pointer;border:none;box-shadow:0 2px 6px rgba(30,144,255,.4);
|
| 746 |
+
}
|
| 747 |
+
.slider-row .slider-val{
|
| 748 |
+
min-width:52px;text-align:right;font-family:'JetBrains Mono',monospace;font-size:12px;
|
| 749 |
+
font-weight:500;padding:3px 8px;background:#09090b;border:1px solid #27272a;
|
| 750 |
+
border-radius:6px;color:#a1a1aa;flex-shrink:0;
|
| 751 |
+
}
|
| 752 |
+
.checkbox-row{display:flex;align-items:center;gap:8px;font-size:13px;color:#a1a1aa}
|
| 753 |
+
.checkbox-row input[type="checkbox"]{accent-color:#1E90FF;width:16px;height:16px;cursor:pointer}
|
| 754 |
+
.checkbox-row label{color:#a1a1aa;font-size:13px;cursor:pointer}
|
| 755 |
+
|
| 756 |
+
/* ββ Status bar ββ */
|
| 757 |
+
.app-statusbar{
|
| 758 |
+
background:#18181b;border-top:1px solid #27272a;padding:6px 20px;
|
| 759 |
+
display:flex;gap:12px;height:34px;align-items:center;font-size:12px;
|
| 760 |
+
}
|
| 761 |
+
.app-statusbar .sb-section{
|
| 762 |
+
padding:0 12px;flex:1;display:flex;align-items:center;font-family:'JetBrains Mono',monospace;
|
| 763 |
+
font-size:12px;color:#52525b;overflow:hidden;white-space:nowrap;
|
| 764 |
+
}
|
| 765 |
+
.app-statusbar .sb-section.sb-fixed{
|
| 766 |
+
flex:0 0 auto;min-width:90px;text-align:center;justify-content:center;
|
| 767 |
+
padding:3px 12px;background:rgba(30,144,255,.08);border-radius:6px;color:#47A3FF;font-weight:500;
|
| 768 |
+
}
|
| 769 |
+
|
| 770 |
+
/* ββ Footer note ββ */
|
| 771 |
+
.exp-note{
|
| 772 |
+
padding:10px 20px;font-size:12px;color:#52525b;
|
| 773 |
+
border-top:1px solid #27272a;text-align:center;font-weight:500;
|
| 774 |
+
background:#18181b;font-family:'Inter',sans-serif;
|
| 775 |
+
}
|
| 776 |
+
.exp-note a{color:#47A3FF;text-decoration:none}
|
| 777 |
+
.exp-note a:hover{text-decoration:underline}
|
| 778 |
+
|
| 779 |
+
/* ββ Dark overrides ββ */
|
| 780 |
+
.dark .app-shell{background:#18181b}
|
| 781 |
+
.dark .upload-prompt-modern{background:transparent}
|
| 782 |
+
.dark .panel-card{background:#18181b}
|
| 783 |
+
.dark .settings-group{background:#18181b}
|
| 784 |
+
.dark .output-frame .out-title{color:#ffffff!important}
|
| 785 |
+
.dark .output-frame .out-title span{color:#ffffff!important}
|
| 786 |
+
.dark .out-download-btn{color:#7CB8FF!important}
|
| 787 |
+
.dark .out-download-btn:hover{color:#ffffff!important}
|
| 788 |
+
|
| 789 |
+
/* ββ Scrollbars ββ */
|
| 790 |
+
::-webkit-scrollbar{width:8px;height:8px}
|
| 791 |
+
::-webkit-scrollbar-track{background:#09090b}
|
| 792 |
+
::-webkit-scrollbar-thumb{background:#27272a;border-radius:4px}
|
| 793 |
+
::-webkit-scrollbar-thumb:hover{background:#3f3f46}
|
| 794 |
+
|
| 795 |
+
/* ββ Responsive ββ */
|
| 796 |
@media(max-width:860px){
|
| 797 |
+
.app-main-row{flex-direction:column}
|
| 798 |
+
.app-main-right{width:100%}
|
| 799 |
+
.app-main-left{border-right:none;border-bottom:1px solid #27272a}
|
| 800 |
}
|
| 801 |
"""
|
| 802 |
|
|
|
|
| 827 |
let selectedIdx = -1;
|
| 828 |
let toastTimer = null;
|
| 829 |
|
| 830 |
+
/* ββ Force dark + blue styles on elements that browsers may override ββ */
|
| 831 |
function enforceDarkStyles() {
|
|
|
|
| 832 |
const loraCard = document.querySelector('.lora-selector-card');
|
| 833 |
const loraBody = document.querySelector('.lora-selector-body');
|
| 834 |
const loraLabel = document.querySelector('.lora-select-label');
|
| 835 |
const loraEl = document.getElementById('custom-lora-select');
|
| 836 |
+
if (loraCard) { loraCard.style.setProperty('background','#0f0f13','important'); }
|
| 837 |
+
if (loraBody) { loraBody.style.setProperty('background','#0f0f13','important'); }
|
| 838 |
if (loraLabel) {
|
| 839 |
+
loraLabel.style.setProperty('color','#71717a','important');
|
| 840 |
+
loraLabel.style.setProperty('-webkit-text-fill-color','#71717a','important');
|
| 841 |
}
|
| 842 |
if (loraEl) {
|
| 843 |
loraEl.style.setProperty('background-color','#09090b','important');
|
| 844 |
+
loraEl.style.setProperty('color','#e4e4e7','important');
|
| 845 |
+
loraEl.style.setProperty('-webkit-text-fill-color','#e4e4e7','important');
|
| 846 |
+
loraEl.style.setProperty('border-color','#3f3f46','important');
|
| 847 |
}
|
| 848 |
|
|
|
|
| 849 |
const ghBtn = document.querySelector('.gh-btn');
|
| 850 |
if (ghBtn) {
|
| 851 |
+
ghBtn.style.setProperty('background','#1E90FF','important');
|
| 852 |
ghBtn.style.setProperty('color','#ffffff','important');
|
| 853 |
ghBtn.style.setProperty('-webkit-text-fill-color','#ffffff','important');
|
| 854 |
+
ghBtn.style.setProperty('border-color','rgba(255,255,255,.18)','important');
|
| 855 |
+
ghBtn.style.setProperty('box-shadow','0 2px 10px rgba(30,144,255,.45)','important');
|
| 856 |
const svg = ghBtn.querySelector('svg');
|
| 857 |
if (svg) svg.style.setProperty('fill','#ffffff','important');
|
| 858 |
const span = ghBtn.querySelector('span');
|
|
|
|
| 862 |
}
|
| 863 |
}
|
| 864 |
|
|
|
|
| 865 |
const shell = document.querySelector('.app-shell');
|
| 866 |
const header = document.querySelector('.app-header');
|
| 867 |
const toolbar = document.querySelector('.app-toolbar');
|
| 868 |
+
if (shell) shell.style.setProperty('background','#18181b','important');
|
| 869 |
+
if (header) header.style.setProperty('background','#18181b','important');
|
| 870 |
+
if (toolbar) toolbar.style.setProperty('background','#18181b','important');
|
| 871 |
}
|
| 872 |
|
| 873 |
enforceDarkStyles();
|
| 874 |
+
setInterval(enforceDarkStyles, 1000);
|
| 875 |
|
|
|
|
| 876 |
const ghBtn = document.querySelector('.gh-btn');
|
| 877 |
if (ghBtn) {
|
| 878 |
ghBtn.addEventListener('mouseenter', () => {
|
| 879 |
+
ghBtn.style.setProperty('background','#47A3FF','important');
|
| 880 |
ghBtn.style.setProperty('color','#ffffff','important');
|
| 881 |
ghBtn.style.setProperty('-webkit-text-fill-color','#ffffff','important');
|
| 882 |
ghBtn.style.setProperty('transform','translateY(-1px)','important');
|
| 883 |
+
ghBtn.style.setProperty('box-shadow','0 5px 18px rgba(30,144,255,.6)','important');
|
| 884 |
});
|
| 885 |
ghBtn.addEventListener('mouseleave', () => {
|
| 886 |
+
ghBtn.style.setProperty('background','#1E90FF','important');
|
| 887 |
ghBtn.style.setProperty('color','#ffffff','important');
|
| 888 |
ghBtn.style.setProperty('-webkit-text-fill-color','#ffffff','important');
|
| 889 |
ghBtn.style.setProperty('transform','translateY(0)','important');
|
| 890 |
+
ghBtn.style.setProperty('box-shadow','0 2px 10px rgba(30,144,255,.45)','important');
|
| 891 |
});
|
| 892 |
ghBtn.addEventListener('mousedown', () => {
|
| 893 |
+
ghBtn.style.setProperty('background','#1873CC','important');
|
| 894 |
ghBtn.style.setProperty('transform','translateY(0)','important');
|
| 895 |
});
|
| 896 |
ghBtn.addEventListener('mouseup', () => {
|
| 897 |
+
ghBtn.style.setProperty('background','#47A3FF','important');
|
| 898 |
});
|
| 899 |
}
|
| 900 |
|
|
|
|
| 1250 |
}
|
| 1251 |
"""
|
| 1252 |
|
| 1253 |
+
# ββ SVG assets (same family/style as the FireRed-Image-Edit app, recolored via CSS) ββ
|
| 1254 |
+
FIRE_LOGO_SVG = '<svg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M12 23c-3.6 0-8-2.69-8-7.5 0-3.5 3-6.5 4.5-8 .27-.27.75-.08.75.28v2.44c0 .42.5.63.72.28C12.28 7.5 13 3 13 1c0-.42.48-.64.8-.35C18 4.5 20 9 20 12c0 5.5-3.5 11-8 11z"/></svg>'
|
| 1255 |
+
|
| 1256 |
+
DOWNLOAD_SVG = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 16l-5-5h3V4h4v7h3l-5 5z"/><path d="M20 18H4v2h16v-2z"/></svg>'
|
| 1257 |
+
|
| 1258 |
+
UPLOAD_SVG = '<svg class="tb-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>'
|
| 1259 |
+
|
| 1260 |
+
REMOVE_SVG = '<svg class="tb-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'
|
| 1261 |
+
|
| 1262 |
+
CLEAR_SVG = '<svg class="tb-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>'
|
| 1263 |
|
| 1264 |
+
GITHUB_SVG = '<svg width="15" height="15" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>'
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1265 |
|
| 1266 |
LORA_OPTIONS_HTML = "\n".join(
|
| 1267 |
f'<option value="{html_lib.escape(name)}">{html_lib.escape(name)}</option>'
|
| 1268 |
for name in ADAPTER_NAMES
|
| 1269 |
)
|
| 1270 |
|
| 1271 |
+
# ββ Gradio app βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1272 |
with gr.Blocks() as demo:
|
| 1273 |
|
| 1274 |
hidden_images_b64 = gr.Textbox(value="[]", elem_id="hidden-images-b64", elem_classes="hidden-input", container=False)
|
|
|
|
| 1290 |
<!-- Header -->
|
| 1291 |
<div class="app-header">
|
| 1292 |
<div class="app-header-left">
|
| 1293 |
+
<div class="app-logo">{FIRE_LOGO_SVG}</div>
|
| 1294 |
<span class="app-title">Qwen-Image-Edit</span>
|
| 1295 |
<span class="app-badge">2511</span>
|
| 1296 |
<span class="app-badge fast">4-Step Fast</span>
|
| 1297 |
</div>
|
| 1298 |
|
|
|
|
| 1299 |
<a href="https://github.com/PRITHIVSAKTHIUR/Qwen-Image-Edit-2511-LoRAs-Fast-Lazy-Load"
|
| 1300 |
target="_blank"
|
| 1301 |
class="gh-btn">
|
|
|
|
| 1330 |
<div id="upload-click-area" class="upload-click-area">
|
| 1331 |
<svg viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 1332 |
<rect x="8" y="14" width="64" height="52" rx="6" fill="none"
|
| 1333 |
+
stroke="#1E90FF" stroke-width="2" stroke-dasharray="4 3"/>
|
| 1334 |
<polygon points="12,62 30,40 42,50 54,34 68,62"
|
| 1335 |
+
fill="rgba(30,144,255,0.15)" stroke="#1E90FF" stroke-width="1.5"/>
|
| 1336 |
<circle cx="28" cy="30" r="6"
|
| 1337 |
+
fill="rgba(30,144,255,0.2)" stroke="#1E90FF" stroke-width="1.5"/>
|
| 1338 |
</svg>
|
| 1339 |
<span class="upload-main-text">Click or drag images here</span>
|
| 1340 |
<span class="upload-sub-text">Supports multiple images for reference-based editing and guided manipulation</span>
|
|
|
|
| 1405 |
|
| 1406 |
<div style="padding:14px 18px 6px;">
|
| 1407 |
<button id="custom-run-btn" class="btn-run">
|
| 1408 |
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="18" height="18">
|
| 1409 |
+
<path d="M12 23c-3.6 0-8-2.69-8-7.5 0-3.5 3-6.5 4.5-8 .27-.27.75-.08.75.28v2.44c0 .42.5.63.72.28C12.28 7.5 13 3 13 1c0-.42.48-.64.8-.35C18 4.5 20 9 20 12c0 5.5-3.5 11-8 11z" fill="white"/>
|
|
|
|
| 1410 |
</svg>
|
| 1411 |
<span id="run-btn-label">Edit Image</span>
|
| 1412 |
</button>
|