From aac226ad496d9b7e6b85a040f56d4a44fed03a92 Mon Sep 17 00:00:00 2001 From: XucroYuri Date: Tue, 7 Jul 2026 13:21:35 +0800 Subject: [PATCH] =?UTF-8?q?style(webui):=20=E5=B8=83=E5=B1=80=E5=AF=B9?= =?UTF-8?q?=E9=BD=90=E7=BE=8E=E8=A7=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. html_center margin:100→8px 0 修复板块标题上下100px巨大空白, 改为紧凑8px, 整体视觉更聚合 (影响所有用 html_center 的板块标题: 模型切换/参考信息/目标文本等) 2. 模型切换板块两行 scale 统一总宽28: Row1: 模型名(20)+刷新模型列表(8) = 28 Row2: GPT(10)+SoVITS(10)+刷新模型路径(8) = 28 (原 Row1=21+7=28, Row2=14+14+14=42 不一致; 现两行等宽对齐) 验证: WebUI启动正常, margin:8px 0 生效, 端到端功能不受影响。 --- GPT_SoVITS/inference_webui.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GPT_SoVITS/inference_webui.py b/GPT_SoVITS/inference_webui.py index 3b3c931d..511c39a7 100644 --- a/GPT_SoVITS/inference_webui.py +++ b/GPT_SoVITS/inference_webui.py @@ -1194,7 +1194,7 @@ def process_text(texts): def html_center(text, label="p"): - return f"""
+ return f"""
<{label} style="margin: 0; padding: 0;">{text}
""" @@ -1453,25 +1453,25 @@ with gr.Blocks(title="GPT-SoVITS WebUI", analytics_enabled=False, js=js, css=css choices=[], value="", interactive=True, - scale=21, + scale=20, ) - refresh_models_btn = gr.Button(i18n("刷新模型列表"), variant="primary", scale=7) + refresh_models_btn = gr.Button(i18n("刷新模型列表"), variant="primary", scale=8) with gr.Row(): GPT_dropdown = gr.Dropdown( label=i18n("GPT模型列表"), choices=sorted(GPT_names, key=custom_sort_key), value=gpt_path, interactive=True, - scale=14, + scale=10, ) SoVITS_dropdown = gr.Dropdown( label=i18n("SoVITS模型列表"), choices=sorted(SoVITS_names, key=custom_sort_key), value=sovits_path, interactive=True, - scale=14, + scale=10, ) - refresh_button = gr.Button(i18n("刷新模型路径"), variant="primary", scale=14) + refresh_button = gr.Button(i18n("刷新模型路径"), variant="primary", scale=8) refresh_button.click(fn=change_choices, inputs=[], outputs=[SoVITS_dropdown, GPT_dropdown]) with gr.Group(): gr.Markdown(html_center(i18n("*请上传并填写参考信息"), "h3"))