Spaces:
Running on Zero
Running on Zero
update app
Browse files
app.py
CHANGED
|
@@ -15,8 +15,8 @@ from gradio.themes.utils import colors, fonts, sizes
|
|
| 15 |
|
| 16 |
colors.orange_red = colors.Color(
|
| 17 |
name="orange_red",
|
| 18 |
-
c50="#
|
| 19 |
-
c100="#
|
| 20 |
c200="#FFC299",
|
| 21 |
c300="#FFA366",
|
| 22 |
c400="#FF8533",
|
|
@@ -740,12 +740,353 @@ class LightingControl3D(gr.HTML):
|
|
| 740 |
**kwargs
|
| 741 |
)
|
| 742 |
|
| 743 |
-
css="""
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
.
|
| 748 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 749 |
"""
|
| 750 |
|
| 751 |
with gr.Blocks() as demo:
|
|
@@ -882,5 +1223,4 @@ with gr.Blocks() as demo:
|
|
| 882 |
|
| 883 |
if __name__ == "__main__":
|
| 884 |
head = '<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>'
|
| 885 |
-
css = '.fillable{max-width: 1200px !important}'
|
| 886 |
demo.launch(head=head, css=css, theme=orange_red_theme, mcp_server=True, ssr_mode=False, show_error=True)
|
|
|
|
| 15 |
|
| 16 |
colors.orange_red = colors.Color(
|
| 17 |
name="orange_red",
|
| 18 |
+
c50="#FFF5F0",
|
| 19 |
+
c100="#FFE8E0",
|
| 20 |
c200="#FFC299",
|
| 21 |
c300="#FFA366",
|
| 22 |
c400="#FF8533",
|
|
|
|
| 740 |
**kwargs
|
| 741 |
)
|
| 742 |
|
| 743 |
+
css = """
|
| 744 |
+
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
|
| 745 |
+
|
| 746 |
+
/* Background grid pattern - Orange Red theme */
|
| 747 |
+
body, .gradio-container {
|
| 748 |
+
background-color: #FFF5F0 !important;
|
| 749 |
+
background-image:
|
| 750 |
+
linear-gradient(#FFC299 1px, transparent 1px),
|
| 751 |
+
linear-gradient(90deg, #FFC299 1px, transparent 1px) !important;
|
| 752 |
+
background-size: 40px 40px !important;
|
| 753 |
+
font-family: 'Outfit', sans-serif !important;
|
| 754 |
+
}
|
| 755 |
+
|
| 756 |
+
/* Dark mode grid */
|
| 757 |
+
.dark body, .dark .gradio-container {
|
| 758 |
+
background-color: #1a1a1a !important;
|
| 759 |
+
background-image:
|
| 760 |
+
linear-gradient(rgba(255, 69, 0, 0.1) 1px, transparent 1px),
|
| 761 |
+
linear-gradient(90deg, rgba(255, 69, 0, 0.1) 1px, transparent 1px) !important;
|
| 762 |
+
background-size: 40px 40px !important;
|
| 763 |
+
}
|
| 764 |
+
|
| 765 |
+
#col-container {
|
| 766 |
+
margin: 0 auto;
|
| 767 |
+
max-width: 1200px;
|
| 768 |
+
}
|
| 769 |
+
|
| 770 |
+
/* Main title styling */
|
| 771 |
+
#main-title {
|
| 772 |
+
text-align: center !important;
|
| 773 |
+
padding: 1rem 0 0.5rem 0;
|
| 774 |
+
}
|
| 775 |
+
|
| 776 |
+
#main-title h1 {
|
| 777 |
+
font-size: 2.4em !important;
|
| 778 |
+
font-weight: 700 !important;
|
| 779 |
+
background: linear-gradient(135deg, #FF4500 0%, #FF8533 50%, #E63E00 100%);
|
| 780 |
+
background-size: 200% 200%;
|
| 781 |
+
-webkit-background-clip: text;
|
| 782 |
+
-webkit-text-fill-color: transparent;
|
| 783 |
+
background-clip: text;
|
| 784 |
+
animation: gradient-shift 4s ease infinite;
|
| 785 |
+
letter-spacing: -0.02em;
|
| 786 |
+
}
|
| 787 |
+
|
| 788 |
+
@keyframes gradient-shift {
|
| 789 |
+
0%, 100% { background-position: 0% 50%; }
|
| 790 |
+
50% { background-position: 100% 50%; }
|
| 791 |
+
}
|
| 792 |
+
|
| 793 |
+
/* Subtitle styling */
|
| 794 |
+
#subtitle {
|
| 795 |
+
text-align: center !important;
|
| 796 |
+
margin-bottom: 1.5rem;
|
| 797 |
+
}
|
| 798 |
+
|
| 799 |
+
#subtitle p {
|
| 800 |
+
margin: 0 auto;
|
| 801 |
+
color: #666666;
|
| 802 |
+
font-size: 1rem;
|
| 803 |
+
}
|
| 804 |
+
|
| 805 |
+
#subtitle a {
|
| 806 |
+
color: #FF4500 !important;
|
| 807 |
+
text-decoration: none;
|
| 808 |
+
font-weight: 500;
|
| 809 |
+
}
|
| 810 |
+
|
| 811 |
+
#subtitle a:hover {
|
| 812 |
+
text-decoration: underline;
|
| 813 |
+
}
|
| 814 |
+
|
| 815 |
+
/* Card styling */
|
| 816 |
+
.gradio-group {
|
| 817 |
+
background: rgba(255, 255, 255, 0.9) !important;
|
| 818 |
+
border: 2px solid #FFC299 !important;
|
| 819 |
+
border-radius: 12px !important;
|
| 820 |
+
box-shadow: 0 4px 24px rgba(255, 69, 0, 0.08) !important;
|
| 821 |
+
backdrop-filter: blur(10px);
|
| 822 |
+
transition: all 0.3s ease;
|
| 823 |
+
}
|
| 824 |
+
|
| 825 |
+
.gradio-group:hover {
|
| 826 |
+
box-shadow: 0 8px 32px rgba(255, 69, 0, 0.12) !important;
|
| 827 |
+
border-color: #FF8533 !important;
|
| 828 |
+
}
|
| 829 |
+
|
| 830 |
+
.dark .gradio-group {
|
| 831 |
+
background: rgba(30, 30, 30, 0.9) !important;
|
| 832 |
+
border-color: rgba(255, 69, 0, 0.3) !important;
|
| 833 |
+
}
|
| 834 |
+
|
| 835 |
+
/* Image upload area */
|
| 836 |
+
.gradio-image {
|
| 837 |
+
border-radius: 10px !important;
|
| 838 |
+
overflow: hidden;
|
| 839 |
+
border: 2px dashed #FF8533 !important;
|
| 840 |
+
transition: all 0.3s ease;
|
| 841 |
+
}
|
| 842 |
+
|
| 843 |
+
.gradio-image:hover {
|
| 844 |
+
border-color: #FF4500 !important;
|
| 845 |
+
background: rgba(255, 69, 0, 0.02) !important;
|
| 846 |
+
}
|
| 847 |
+
|
| 848 |
+
/* Radio buttons */
|
| 849 |
+
.gradio-radio {
|
| 850 |
+
border-radius: 8px !important;
|
| 851 |
+
}
|
| 852 |
+
|
| 853 |
+
.gradio-radio label {
|
| 854 |
+
border-radius: 6px !important;
|
| 855 |
+
transition: all 0.2s ease !important;
|
| 856 |
+
border: 1px solid transparent !important;
|
| 857 |
+
}
|
| 858 |
+
|
| 859 |
+
.gradio-radio label:hover {
|
| 860 |
+
background: rgba(255, 69, 0, 0.05) !important;
|
| 861 |
+
}
|
| 862 |
+
|
| 863 |
+
.gradio-radio label.selected {
|
| 864 |
+
background: rgba(255, 69, 0, 0.1) !important;
|
| 865 |
+
border-color: #FF4500 !important;
|
| 866 |
+
}
|
| 867 |
+
|
| 868 |
+
/* Primary button */
|
| 869 |
+
.primary {
|
| 870 |
+
border-radius: 8px !important;
|
| 871 |
+
font-weight: 600 !important;
|
| 872 |
+
letter-spacing: 0.02em !important;
|
| 873 |
+
transition: all 0.3s ease !important;
|
| 874 |
+
}
|
| 875 |
+
|
| 876 |
+
.primary:hover {
|
| 877 |
+
transform: translateY(-2px) !important;
|
| 878 |
+
}
|
| 879 |
+
|
| 880 |
+
/* Tabs styling */
|
| 881 |
+
.tab-nav {
|
| 882 |
+
border-bottom: 2px solid #FFC299 !important;
|
| 883 |
+
}
|
| 884 |
+
|
| 885 |
+
.tab-nav button {
|
| 886 |
+
font-weight: 500 !important;
|
| 887 |
+
padding: 10px 18px !important;
|
| 888 |
+
border-radius: 8px 8px 0 0 !important;
|
| 889 |
+
transition: all 0.2s ease !important;
|
| 890 |
+
}
|
| 891 |
+
|
| 892 |
+
.tab-nav button.selected {
|
| 893 |
+
background: rgba(255, 69, 0, 0.1) !important;
|
| 894 |
+
border-bottom: 2px solid #FF4500 !important;
|
| 895 |
+
}
|
| 896 |
+
|
| 897 |
+
/* Output textbox */
|
| 898 |
+
.gradio-textbox textarea {
|
| 899 |
+
font-family: 'IBM Plex Mono', monospace !important;
|
| 900 |
+
font-size: 0.95rem !important;
|
| 901 |
+
line-height: 1.7 !important;
|
| 902 |
+
background: rgba(255, 255, 255, 0.95) !important;
|
| 903 |
+
border: 1px solid #FFC299 !important;
|
| 904 |
+
border-radius: 8px !important;
|
| 905 |
+
}
|
| 906 |
+
|
| 907 |
+
.dark .gradio-textbox textarea {
|
| 908 |
+
background: rgba(30, 30, 30, 0.95) !important;
|
| 909 |
+
border-color: rgba(255, 69, 0, 0.2) !important;
|
| 910 |
+
}
|
| 911 |
+
|
| 912 |
+
/* Markdown output */
|
| 913 |
+
.gradio-markdown {
|
| 914 |
+
font-family: 'Outfit', sans-serif !important;
|
| 915 |
+
line-height: 1.7 !important;
|
| 916 |
+
}
|
| 917 |
+
|
| 918 |
+
.gradio-markdown code {
|
| 919 |
+
font-family: 'IBM Plex Mono', monospace !important;
|
| 920 |
+
background: rgba(255, 69, 0, 0.08) !important;
|
| 921 |
+
padding: 2px 6px !important;
|
| 922 |
+
border-radius: 4px !important;
|
| 923 |
+
color: #CC3700 !important;
|
| 924 |
+
}
|
| 925 |
+
|
| 926 |
+
.gradio-markdown pre {
|
| 927 |
+
background: rgba(255, 69, 0, 0.05) !important;
|
| 928 |
+
border: 1px solid #FFC299 !important;
|
| 929 |
+
border-radius: 8px !important;
|
| 930 |
+
padding: 1rem !important;
|
| 931 |
+
}
|
| 932 |
+
|
| 933 |
+
/* Examples section */
|
| 934 |
+
.gradio-examples {
|
| 935 |
+
border-radius: 10px !important;
|
| 936 |
+
}
|
| 937 |
+
|
| 938 |
+
.gradio-examples .gallery-item {
|
| 939 |
+
border: 2px solid #FFC299 !important;
|
| 940 |
+
border-radius: 8px !important;
|
| 941 |
+
transition: all 0.2s ease !important;
|
| 942 |
+
}
|
| 943 |
+
|
| 944 |
+
.gradio-examples .gallery-item:hover {
|
| 945 |
+
border-color: #FF4500 !important;
|
| 946 |
+
transform: translateY(-2px) !important;
|
| 947 |
+
box-shadow: 0 4px 12px rgba(255, 69, 0, 0.15) !important;
|
| 948 |
+
}
|
| 949 |
+
|
| 950 |
+
/* Scrollbar styling */
|
| 951 |
+
::-webkit-scrollbar {
|
| 952 |
+
width: 8px;
|
| 953 |
+
height: 8px;
|
| 954 |
+
}
|
| 955 |
+
|
| 956 |
+
::-webkit-scrollbar-track {
|
| 957 |
+
background: rgba(255, 69, 0, 0.05);
|
| 958 |
+
border-radius: 4px;
|
| 959 |
+
}
|
| 960 |
+
|
| 961 |
+
::-webkit-scrollbar-thumb {
|
| 962 |
+
background: linear-gradient(135deg, #FF4500, #FF8533);
|
| 963 |
+
border-radius: 4px;
|
| 964 |
+
}
|
| 965 |
+
|
| 966 |
+
::-webkit-scrollbar-thumb:hover {
|
| 967 |
+
background: linear-gradient(135deg, #E63E00, #FF4500);
|
| 968 |
+
}
|
| 969 |
+
|
| 970 |
+
/* Accordion styling */
|
| 971 |
+
.gradio-accordion {
|
| 972 |
+
border-radius: 10px !important;
|
| 973 |
+
border: 1px solid #FFC299 !important;
|
| 974 |
+
}
|
| 975 |
+
|
| 976 |
+
.gradio-accordion > .label-wrap {
|
| 977 |
+
background: rgba(255, 69, 0, 0.03) !important;
|
| 978 |
+
border-radius: 10px !important;
|
| 979 |
+
}
|
| 980 |
+
|
| 981 |
+
/* Hide footer */
|
| 982 |
+
footer {
|
| 983 |
+
display: none !important;
|
| 984 |
+
}
|
| 985 |
+
|
| 986 |
+
/* Animations */
|
| 987 |
+
@keyframes fadeIn {
|
| 988 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 989 |
+
to { opacity: 1; transform: translateY(0); }
|
| 990 |
+
}
|
| 991 |
+
|
| 992 |
+
.gradio-row {
|
| 993 |
+
animation: fadeIn 0.4s ease-out;
|
| 994 |
+
}
|
| 995 |
+
|
| 996 |
+
/* Label styling */
|
| 997 |
+
label {
|
| 998 |
+
font-weight: 600 !important;
|
| 999 |
+
color: #333 !important;
|
| 1000 |
+
}
|
| 1001 |
+
|
| 1002 |
+
.dark label {
|
| 1003 |
+
color: #eee !important;
|
| 1004 |
+
}
|
| 1005 |
+
|
| 1006 |
+
/* Dropdown styling */
|
| 1007 |
+
.gradio-dropdown {
|
| 1008 |
+
border-radius: 8px !important;
|
| 1009 |
+
}
|
| 1010 |
+
|
| 1011 |
+
.gradio-dropdown select, .gradio-dropdown input {
|
| 1012 |
+
border: 1px solid #FFC299 !important;
|
| 1013 |
+
border-radius: 8px !important;
|
| 1014 |
+
transition: all 0.2s ease !important;
|
| 1015 |
+
}
|
| 1016 |
+
|
| 1017 |
+
.gradio-dropdown select:focus, .gradio-dropdown input:focus {
|
| 1018 |
+
border-color: #FF4500 !important;
|
| 1019 |
+
box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.1) !important;
|
| 1020 |
+
}
|
| 1021 |
+
|
| 1022 |
+
/* Slider styling */
|
| 1023 |
+
.gradio-slider input[type="range"] {
|
| 1024 |
+
accent-color: #FF4500 !important;
|
| 1025 |
+
}
|
| 1026 |
+
|
| 1027 |
+
.gradio-slider .range-slider {
|
| 1028 |
+
background: #FFC299 !important;
|
| 1029 |
+
}
|
| 1030 |
+
|
| 1031 |
+
.gradio-slider .range-slider .handle {
|
| 1032 |
+
background: #FF4500 !important;
|
| 1033 |
+
border-color: #FF4500 !important;
|
| 1034 |
+
}
|
| 1035 |
+
|
| 1036 |
+
/* 3D Control styling */
|
| 1037 |
+
#lighting-3d-control {
|
| 1038 |
+
min-height: 450px;
|
| 1039 |
+
border: 2px solid #FFC299 !important;
|
| 1040 |
+
border-radius: 12px !important;
|
| 1041 |
+
overflow: hidden;
|
| 1042 |
+
}
|
| 1043 |
+
|
| 1044 |
+
/* Progress bar */
|
| 1045 |
+
.dark .progress-text {
|
| 1046 |
+
color: white !important;
|
| 1047 |
+
}
|
| 1048 |
+
|
| 1049 |
+
.progress-bar {
|
| 1050 |
+
background: linear-gradient(90deg, #FF4500, #FF8533) !important;
|
| 1051 |
+
}
|
| 1052 |
+
|
| 1053 |
+
/* Checkbox styling */
|
| 1054 |
+
.gradio-checkbox input[type="checkbox"]:checked {
|
| 1055 |
+
background-color: #FF4500 !important;
|
| 1056 |
+
border-color: #FF4500 !important;
|
| 1057 |
+
}
|
| 1058 |
+
|
| 1059 |
+
/* Number input styling */
|
| 1060 |
+
.gradio-number input {
|
| 1061 |
+
border: 1px solid #FFC299 !important;
|
| 1062 |
+
border-radius: 8px !important;
|
| 1063 |
+
}
|
| 1064 |
+
|
| 1065 |
+
.gradio-number input:focus {
|
| 1066 |
+
border-color: #FF4500 !important;
|
| 1067 |
+
box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.1) !important;
|
| 1068 |
+
}
|
| 1069 |
+
|
| 1070 |
+
/* Gallery styling */
|
| 1071 |
+
.gradio-gallery {
|
| 1072 |
+
border-radius: 10px !important;
|
| 1073 |
+
}
|
| 1074 |
+
|
| 1075 |
+
.gradio-gallery .gallery-item {
|
| 1076 |
+
border: 2px solid #FFC299 !important;
|
| 1077 |
+
border-radius: 8px !important;
|
| 1078 |
+
transition: all 0.2s ease !important;
|
| 1079 |
+
}
|
| 1080 |
+
|
| 1081 |
+
.gradio-gallery .gallery-item:hover {
|
| 1082 |
+
border-color: #FF4500 !important;
|
| 1083 |
+
box-shadow: 0 4px 12px rgba(255, 69, 0, 0.15) !important;
|
| 1084 |
+
}
|
| 1085 |
+
|
| 1086 |
+
/* Fillable container */
|
| 1087 |
+
.fillable {
|
| 1088 |
+
max-width: 1200px !important;
|
| 1089 |
+
}
|
| 1090 |
"""
|
| 1091 |
|
| 1092 |
with gr.Blocks() as demo:
|
|
|
|
| 1223 |
|
| 1224 |
if __name__ == "__main__":
|
| 1225 |
head = '<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>'
|
|
|
|
| 1226 |
demo.launch(head=head, css=css, theme=orange_red_theme, mcp_server=True, ssr_mode=False, show_error=True)
|