Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -68,21 +68,38 @@ def stop_loading():
|
|
68 |
|
69 |
|
70 |
# Настройка темы и CSS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
css = """
|
72 |
-
/*
|
|
|
|
|
|
|
73 |
body, .gr-block, .gr-container {
|
74 |
background-color: #191a1e !important;
|
75 |
color: #FFFFFF !important;
|
76 |
font-family: 'Poppins', sans-serif !important;
|
77 |
}
|
78 |
|
79 |
-
/*
|
80 |
-
h1, h2, h3, h4, h5, h6, p, label
|
81 |
-
color: #FFFFFF !important;
|
82 |
font-weight: bold !important;
|
|
|
83 |
}
|
84 |
|
85 |
-
/* Стили кнопки Generate */
|
86 |
.gr-button {
|
87 |
background-color: #5271FF !important;
|
88 |
color: #FFFFFF !important;
|
@@ -118,13 +135,15 @@ h1, h2, h3, h4, h5, h6, p, label, .gr-slider-label, .gr-checkbox {
|
|
118 |
100% { transform: translate(-50%, -50%) rotate(360deg); }
|
119 |
}
|
120 |
|
121 |
-
/*
|
122 |
-
|
123 |
background-color: #191a1e !important;
|
124 |
-
|
|
|
125 |
}
|
126 |
|
127 |
-
|
|
|
128 |
background-color: #191a1e !important;
|
129 |
border: 1px dashed #FFFFFF !important;
|
130 |
}
|
@@ -134,31 +153,11 @@ gr-image-upload {
|
|
134 |
color: #FFFFFF !important;
|
135 |
font-size: 1rem;
|
136 |
font-weight: bold;
|
137 |
-
text-align: center;
|
138 |
-
}
|
139 |
-
|
140 |
-
/* Значение слайдера */
|
141 |
-
.gr-slider span {
|
142 |
-
color: #FFFFFF !important;
|
143 |
-
font-weight: bold !important;
|
144 |
-
}
|
145 |
-
|
146 |
-
/* Фон и текст вкладок */
|
147 |
-
.gr-tab {
|
148 |
-
background-color: #191a1e !important;
|
149 |
-
border: 1px solid #FFFFFF !important;
|
150 |
-
border-radius: 5px;
|
151 |
-
margin-top: 10px;
|
152 |
-
}
|
153 |
-
|
154 |
-
.gr-tab label {
|
155 |
-
color: #FFFFFF !important;
|
156 |
-
font-weight: bold !important;
|
157 |
}
|
158 |
"""
|
159 |
|
160 |
# Интерфейс
|
161 |
-
with gr.Blocks(css=css) as demo:
|
162 |
with gr.Column():
|
163 |
gr.Markdown("**Upload and Process Your Image**")
|
164 |
with gr.Row():
|
@@ -215,4 +214,8 @@ with gr.Blocks(css=css) as demo:
|
|
215 |
)
|
216 |
|
217 |
# Запуск приложения
|
218 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
|
70 |
# Настройка темы и CSS
|
71 |
+
class CustomTheme(gr.themes.Base):
|
72 |
+
def __init__(self):
|
73 |
+
super().__init__()
|
74 |
+
self.primary_hue = "#191a1e"
|
75 |
+
self.background_fill_primary = "#191a1e"
|
76 |
+
self.background_fill_secondary = "#191a1e"
|
77 |
+
self.background_fill_tertiary = "#191a1e"
|
78 |
+
self.text_color_primary = "#FFFFFF"
|
79 |
+
self.text_color_secondary = "#FFFFFF"
|
80 |
+
self.text_color_tertiary = "#FFFFFF"
|
81 |
+
self.input_background_fill = "#191a1e"
|
82 |
+
self.input_text_color = "#FFFFFF"
|
83 |
+
|
84 |
+
|
85 |
css = """
|
86 |
+
/* Подключение шрифта */
|
87 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');
|
88 |
+
|
89 |
+
/* Фон и общий стиль */
|
90 |
body, .gr-block, .gr-container {
|
91 |
background-color: #191a1e !important;
|
92 |
color: #FFFFFF !important;
|
93 |
font-family: 'Poppins', sans-serif !important;
|
94 |
}
|
95 |
|
96 |
+
/* Стиль заголовков */
|
97 |
+
h1, h2, h3, h4, h5, h6, p, label {
|
|
|
98 |
font-weight: bold !important;
|
99 |
+
color: #FFFFFF !important;
|
100 |
}
|
101 |
|
102 |
+
/* Стили для кнопки Generate */
|
103 |
.gr-button {
|
104 |
background-color: #5271FF !important;
|
105 |
color: #FFFFFF !important;
|
|
|
135 |
100% { transform: translate(-50%, -50%) rotate(360deg); }
|
136 |
}
|
137 |
|
138 |
+
/* Стиль для текстовых полей */
|
139 |
+
input, textarea {
|
140 |
background-color: #191a1e !important;
|
141 |
+
color: #FFFFFF !important;
|
142 |
+
border: 1px solid #FFFFFF !important;
|
143 |
}
|
144 |
|
145 |
+
/* Области загрузки изображений */
|
146 |
+
gr-image-upload {
|
147 |
background-color: #191a1e !important;
|
148 |
border: 1px dashed #FFFFFF !important;
|
149 |
}
|
|
|
153 |
color: #FFFFFF !important;
|
154 |
font-size: 1rem;
|
155 |
font-weight: bold;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
"""
|
158 |
|
159 |
# Интерфейс
|
160 |
+
with gr.Blocks(theme=CustomTheme(), css=css) as demo:
|
161 |
with gr.Column():
|
162 |
gr.Markdown("**Upload and Process Your Image**")
|
163 |
with gr.Row():
|
|
|
214 |
)
|
215 |
|
216 |
# Запуск приложения
|
217 |
+
demo.launch(
|
218 |
+
server_name="0.0.0.0",
|
219 |
+
server_port=7860,
|
220 |
+
share=True,
|
221 |
+
)
|