Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -216,23 +216,16 @@ css = """
|
|
216 |
margin: 0 !important;
|
217 |
padding: 0 !important;
|
218 |
border: none !important;
|
219 |
-
width: 100% !important;
|
220 |
-
min-height: 100%;
|
221 |
}
|
222 |
|
223 |
/* Контейнер приложения */
|
224 |
.gradio-container, .gr-app {
|
225 |
background-color: #191a1e !important;
|
|
|
|
|
226 |
}
|
227 |
|
228 |
-
/*
|
229 |
-
.gr-image img {
|
230 |
-
max-width: 300px !important;
|
231 |
-
max-height: 300px !important;
|
232 |
-
object-fit: contain;
|
233 |
-
}
|
234 |
-
|
235 |
-
/* Адаптивная верстка */
|
236 |
.gr-row {
|
237 |
display: flex;
|
238 |
flex-wrap: wrap;
|
@@ -240,6 +233,7 @@ css = """
|
|
240 |
align-items: flex-start;
|
241 |
}
|
242 |
|
|
|
243 |
.gr-column {
|
244 |
flex: 1 1 auto;
|
245 |
min-width: 300px;
|
@@ -248,6 +242,21 @@ css = """
|
|
248 |
gap: 10px;
|
249 |
}
|
250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
.generate-button {
|
252 |
background-color: #5271FF !important;
|
253 |
color: #FFFFFF !important;
|
@@ -258,13 +267,13 @@ css = """
|
|
258 |
border-radius: 0.3em !important;
|
259 |
}
|
260 |
|
261 |
-
/* Примеры
|
262 |
-
.
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
}
|
269 |
|
270 |
.gr-examples img {
|
@@ -319,7 +328,7 @@ with gr.Blocks(theme=CustomTheme(), css=css) as demo:
|
|
319 |
elem_classes="generate-button",
|
320 |
)
|
321 |
|
322 |
-
with gr.Column():
|
323 |
output_3d = LitModel3D(
|
324 |
label="3D Model",
|
325 |
visible=False,
|
@@ -355,10 +364,12 @@ with gr.Blocks(theme=CustomTheme(), css=css) as demo:
|
|
355 |
outputs=[output_3d],
|
356 |
)
|
357 |
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
|
|
|
|
362 |
|
363 |
input_img.change(
|
364 |
requires_bg_remove,
|
|
|
216 |
margin: 0 !important;
|
217 |
padding: 0 !important;
|
218 |
border: none !important;
|
|
|
|
|
219 |
}
|
220 |
|
221 |
/* Контейнер приложения */
|
222 |
.gradio-container, .gr-app {
|
223 |
background-color: #191a1e !important;
|
224 |
+
display: flex;
|
225 |
+
flex-direction: column;
|
226 |
}
|
227 |
|
228 |
+
/* Делаем адаптивный ряд */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
.gr-row {
|
230 |
display: flex;
|
231 |
flex-wrap: wrap;
|
|
|
233 |
align-items: flex-start;
|
234 |
}
|
235 |
|
236 |
+
/* Левая и правая колонки */
|
237 |
.gr-column {
|
238 |
flex: 1 1 auto;
|
239 |
min-width: 300px;
|
|
|
242 |
gap: 10px;
|
243 |
}
|
244 |
|
245 |
+
/* Предварительно резервируем место для модели */
|
246 |
+
.model-container {
|
247 |
+
min-height: 600px; /* Задайте подходящее значение, чтобы при появлении 3D модели и HDR она не сдвигала верстку */
|
248 |
+
display: flex;
|
249 |
+
flex-direction: column;
|
250 |
+
gap: 10px;
|
251 |
+
}
|
252 |
+
|
253 |
+
/* Уменьшаем контейнеры с картинками */
|
254 |
+
.gr-image img {
|
255 |
+
max-width: 300px !important;
|
256 |
+
max-height: 300px !important;
|
257 |
+
object-fit: contain;
|
258 |
+
}
|
259 |
+
|
260 |
.generate-button {
|
261 |
background-color: #5271FF !important;
|
262 |
color: #FFFFFF !important;
|
|
|
267 |
border-radius: 0.3em !important;
|
268 |
}
|
269 |
|
270 |
+
/* Примеры в отдельном блоке снизу, чтобы не "прыгали" */
|
271 |
+
.examples-row {
|
272 |
+
margin-top: 20px;
|
273 |
+
display: flex;
|
274 |
+
justify-content: flex-start;
|
275 |
+
flex-wrap: wrap;
|
276 |
+
gap: 10px;
|
277 |
}
|
278 |
|
279 |
.gr-examples img {
|
|
|
328 |
elem_classes="generate-button",
|
329 |
)
|
330 |
|
331 |
+
with gr.Column(elem_id="model_container", elem_classes="model-container"):
|
332 |
output_3d = LitModel3D(
|
333 |
label="3D Model",
|
334 |
visible=False,
|
|
|
364 |
outputs=[output_3d],
|
365 |
)
|
366 |
|
367 |
+
# Примеры вынесены в отдельный блок ниже
|
368 |
+
with gr.Row(elem_id="examples_row", elem_classes="examples-row"):
|
369 |
+
examples = gr.Examples(
|
370 |
+
examples=example_files,
|
371 |
+
inputs=input_img,
|
372 |
+
)
|
373 |
|
374 |
input_img.change(
|
375 |
requires_bg_remove,
|