Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -223,40 +223,37 @@ css = """
|
|
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;
|
232 |
gap: 20px;
|
233 |
align-items: flex-start;
|
|
|
|
|
234 |
}
|
235 |
|
236 |
-
/* Левая и правая колонки */
|
237 |
.gr-column {
|
238 |
flex: 1 1 auto;
|
239 |
min-width: 300px;
|
240 |
display: flex;
|
241 |
flex-direction: column;
|
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,13 +264,14 @@ css = """
|
|
267 |
border-radius: 0.3em !important;
|
268 |
}
|
269 |
|
270 |
-
/* Примеры
|
271 |
-
.examples
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
|
|
277 |
}
|
278 |
|
279 |
.gr-examples img {
|
@@ -328,7 +326,13 @@ with gr.Blocks(theme=CustomTheme(), css=css) as demo:
|
|
328 |
elem_classes="generate-button",
|
329 |
)
|
330 |
|
331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
output_3d = LitModel3D(
|
333 |
label="3D Model",
|
334 |
visible=False,
|
@@ -364,13 +368,6 @@ with gr.Blocks(theme=CustomTheme(), css=css) as demo:
|
|
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,
|
376 |
inputs=[input_img, foreground_ratio],
|
|
|
223 |
background-color: #191a1e !important;
|
224 |
display: flex;
|
225 |
flex-direction: column;
|
226 |
+
width: 100%;
|
227 |
}
|
228 |
|
229 |
+
/* Ряды и колонки */
|
230 |
.gr-row {
|
231 |
display: flex;
|
232 |
flex-wrap: wrap;
|
233 |
gap: 20px;
|
234 |
align-items: flex-start;
|
235 |
+
width: 100%;
|
236 |
+
box-sizing: border-box;
|
237 |
}
|
238 |
|
|
|
239 |
.gr-column {
|
240 |
flex: 1 1 auto;
|
241 |
min-width: 300px;
|
242 |
display: flex;
|
243 |
flex-direction: column;
|
244 |
gap: 10px;
|
245 |
+
width: 100%;
|
246 |
+
box-sizing: border-box;
|
247 |
}
|
248 |
|
249 |
+
/* Уменьшаем размеры изображений */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
.gr-image img {
|
251 |
max-width: 300px !important;
|
252 |
max-height: 300px !important;
|
253 |
object-fit: contain;
|
254 |
}
|
255 |
|
256 |
+
/* Кнопка */
|
257 |
.generate-button {
|
258 |
background-color: #5271FF !important;
|
259 |
color: #FFFFFF !important;
|
|
|
264 |
border-radius: 0.3em !important;
|
265 |
}
|
266 |
|
267 |
+
/* Примеры сразу под кнопкой Run */
|
268 |
+
.gr-examples {
|
269 |
+
display: flex !important;
|
270 |
+
flex-wrap: wrap !important;
|
271 |
+
gap: 10px !important;
|
272 |
+
justify-content: flex-start !important;
|
273 |
+
align-items: center !important;
|
274 |
+
/* Так как примеры теперь в том же контейнере, они будут автоматически подстраиваться */
|
275 |
}
|
276 |
|
277 |
.gr-examples img {
|
|
|
326 |
elem_classes="generate-button",
|
327 |
)
|
328 |
|
329 |
+
# Примеры теперь находятся прямо под кнопкой Run
|
330 |
+
examples = gr.Examples(
|
331 |
+
examples=example_files,
|
332 |
+
inputs=input_img,
|
333 |
+
)
|
334 |
+
|
335 |
+
with gr.Column():
|
336 |
output_3d = LitModel3D(
|
337 |
label="3D Model",
|
338 |
visible=False,
|
|
|
368 |
outputs=[output_3d],
|
369 |
)
|
370 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
input_img.change(
|
372 |
requires_bg_remove,
|
373 |
inputs=[input_img, foreground_ratio],
|