Spaces:
Running on Zero
Running on Zero
app.py
CHANGED
|
@@ -289,48 +289,10 @@ CUSTOM_CSS = """
|
|
| 289 |
--border: #30363d;
|
| 290 |
}
|
| 291 |
|
| 292 |
-
/* ========== 1. TOP GRADIENT BAR ========== */
|
| 293 |
-
/* Inject a full-width gradient strip at the very top of the page */
|
| 294 |
-
body > gradio-app::before,
|
| 295 |
-
.gradio-container > *:first-child::before {
|
| 296 |
-
content: '';
|
| 297 |
-
display: block;
|
| 298 |
-
height: 0;
|
| 299 |
-
}
|
| 300 |
-
|
| 301 |
-
/* Use a pseudo-element on the outermost wrapper Gradio renders */
|
| 302 |
-
.app.svelte-182fdeq::before,
|
| 303 |
-
footer ~ *::before {
|
| 304 |
-
display: none;
|
| 305 |
-
}
|
| 306 |
-
|
| 307 |
-
/* Reliable approach: prepend a fixed bar via the container's outline */
|
| 308 |
.gradio-container {
|
| 309 |
font-family: 'DM Sans', sans-serif !important;
|
| 310 |
max-width: 1100px !important;
|
| 311 |
margin: auto !important;
|
| 312 |
-
/* top gradient bar using outline trick */
|
| 313 |
-
outline: none;
|
| 314 |
-
position: relative;
|
| 315 |
-
}
|
| 316 |
-
|
| 317 |
-
.gradio-container::before {
|
| 318 |
-
content: '';
|
| 319 |
-
display: block;
|
| 320 |
-
position: absolute;
|
| 321 |
-
top: 0;
|
| 322 |
-
left: 0;
|
| 323 |
-
right: 0;
|
| 324 |
-
height: 5px;
|
| 325 |
-
background: linear-gradient(90deg,
|
| 326 |
-
#FE9EC7 0%,
|
| 327 |
-
#F9F6C4 33%,
|
| 328 |
-
#89D4FF 66%,
|
| 329 |
-
#44ACFF 100%
|
| 330 |
-
);
|
| 331 |
-
border-radius: 3px 3px 0 0;
|
| 332 |
-
z-index: 100;
|
| 333 |
-
pointer-events: none;
|
| 334 |
}
|
| 335 |
|
| 336 |
/* ---------- Badge links ---------- */
|
|
@@ -554,7 +516,7 @@ def build_ui():
|
|
| 554 |
# ================================================================
|
| 555 |
with gr.Row(equal_height=True):
|
| 556 |
with gr.Column(scale=1):
|
| 557 |
-
gr.Markdown("🎙️ 音频输入 / Audio Inputs"
|
| 558 |
ref_audio = gr.Audio(
|
| 559 |
label="参考音频 / Reference Audio(提供音色 / Provides timbre)",
|
| 560 |
type="filepath",
|
|
@@ -564,7 +526,7 @@ def build_ui():
|
|
| 564 |
type="filepath",
|
| 565 |
)
|
| 566 |
with gr.Column(scale=1):
|
| 567 |
-
gr.Markdown("✏️ 歌词输入 / Lyrics"
|
| 568 |
ref_text = gr.Textbox(
|
| 569 |
label="参考音频歌词 / Reference Lyrics",
|
| 570 |
placeholder="例如 / e.g.:该体谅的不执着|如果那天我",
|
|
@@ -580,19 +542,19 @@ def build_ui():
|
|
| 580 |
# ROW 2 – 预设示例
|
| 581 |
# ================================================================
|
| 582 |
gr.HTML("<hr style='border-color:#30363d; margin: 16px 0 12px;'>")
|
| 583 |
-
gr.Markdown("🎵 预设示例 / Example Presets"
|
| 584 |
gr.Markdown(
|
| 585 |
"<small style='color:#8b949e;'>点击任意行自动填入上方输入区域 / Click any row to auto-fill the inputs above</small>"
|
| 586 |
)
|
| 587 |
|
| 588 |
with gr.Row(visible=False):
|
| 589 |
-
_sep_flag_ex = gr.Checkbox(value=True)
|
| 590 |
-
_mix_flag_ex = gr.Checkbox(value=False)
|
| 591 |
-
_sil_ex = gr.Number(value=0.5)
|
| 592 |
-
_tshift_ex = gr.Number(value=0.5)
|
| 593 |
-
_nfe_ex = gr.Number(value=32)
|
| 594 |
-
_cfg_ex = gr.Number(value=3.0)
|
| 595 |
-
_seed_ex = gr.Number(value=-1, precision=0)
|
| 596 |
|
| 597 |
_example_inputs = [
|
| 598 |
ref_audio, melody_audio, ref_text, target_text,
|
|
@@ -620,7 +582,7 @@ def build_ui():
|
|
| 620 |
# ROW 3 – 伴奏分离
|
| 621 |
# ================================================================
|
| 622 |
gr.HTML("<hr style='border-color:#30363d; margin: 16px 0 12px;'>")
|
| 623 |
-
gr.Markdown("🎚️ 伴奏分离 / Vocal Separation"
|
| 624 |
|
| 625 |
# CHANGE 4: Use inline style colors for 参考音频 and 旋律音频
|
| 626 |
# so they render correctly regardless of CSS specificity issues
|
|
|
|
| 289 |
--border: #30363d;
|
| 290 |
}
|
| 291 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
.gradio-container {
|
| 293 |
font-family: 'DM Sans', sans-serif !important;
|
| 294 |
max-width: 1100px !important;
|
| 295 |
margin: auto !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
}
|
| 297 |
|
| 298 |
/* ---------- Badge links ---------- */
|
|
|
|
| 516 |
# ================================================================
|
| 517 |
with gr.Row(equal_height=True):
|
| 518 |
with gr.Column(scale=1):
|
| 519 |
+
gr.Markdown("#### 🎙️ 音频输入 / Audio Inputs")
|
| 520 |
ref_audio = gr.Audio(
|
| 521 |
label="参考音频 / Reference Audio(提供音色 / Provides timbre)",
|
| 522 |
type="filepath",
|
|
|
|
| 526 |
type="filepath",
|
| 527 |
)
|
| 528 |
with gr.Column(scale=1):
|
| 529 |
+
gr.Markdown("#### ✏️ 歌词输入 / Lyrics")
|
| 530 |
ref_text = gr.Textbox(
|
| 531 |
label="参考音频歌词 / Reference Lyrics",
|
| 532 |
placeholder="例如 / e.g.:该体谅的不执着|如果那天我",
|
|
|
|
| 542 |
# ROW 2 – 预设示例
|
| 543 |
# ================================================================
|
| 544 |
gr.HTML("<hr style='border-color:#30363d; margin: 16px 0 12px;'>")
|
| 545 |
+
gr.Markdown("#### 🎵 预设示例 / Example Presets")
|
| 546 |
gr.Markdown(
|
| 547 |
"<small style='color:#8b949e;'>点击任意行自动填入上方输入区域 / Click any row to auto-fill the inputs above</small>"
|
| 548 |
)
|
| 549 |
|
| 550 |
with gr.Row(visible=False):
|
| 551 |
+
_sep_flag_ex = gr.Checkbox(value=True, label="分离人声 / Separate Vocals")
|
| 552 |
+
_mix_flag_ex = gr.Checkbox(value=False, label="混入伴奏 / Mix Accomp.")
|
| 553 |
+
_sil_ex = gr.Number(value=0.5, label="静音 / Silence (s)")
|
| 554 |
+
_tshift_ex = gr.Number(value=0.5, label="t-shift")
|
| 555 |
+
_nfe_ex = gr.Number(value=32, label="NFE Steps")
|
| 556 |
+
_cfg_ex = gr.Number(value=3.0, label="CFG")
|
| 557 |
+
_seed_ex = gr.Number(value=-1, precision=0, label="Seed")
|
| 558 |
|
| 559 |
_example_inputs = [
|
| 560 |
ref_audio, melody_audio, ref_text, target_text,
|
|
|
|
| 582 |
# ROW 3 – 伴奏分离
|
| 583 |
# ================================================================
|
| 584 |
gr.HTML("<hr style='border-color:#30363d; margin: 16px 0 12px;'>")
|
| 585 |
+
gr.Markdown("#### 🎚️ 伴奏分离 / Vocal Separation")
|
| 586 |
|
| 587 |
# CHANGE 4: Use inline style colors for 参考音频 and 旋律音频
|
| 588 |
# so they render correctly regardless of CSS specificity issues
|