cortico-world-fish-sing 0.4.23 → 0.4.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循语义化。
4
4
 
5
+ ## [0.4.25] - 2026-11-26
6
+
7
+ ### 数据可信
8
+ - manifest 白名单生成训练集;缓存按样本名检查。
9
+ - 切片逐个 sha256 绑进 `dataset_binding.json`,路径必须在 `slices/` 下,空文件 / 重名 / 缺文件直接报错。
10
+ - 无声切片剔除;F0 分析失败单独标记 `f0_analysis_failed`(需复查,不混进静音)。
11
+ - 修正 FLOAT 音频长度桶估算(`getsize // (3*hop)` → `sf.info().frames // hop`)。
12
+
13
+ ### 训练可靠
14
+ - **从头训练拒绝复用旧实验**;同名实验默认不覆盖,续训必须校验数据集内容指纹与增强参数,并显式控制 G/D 恢复,找不到配对存档就报错、**失败不回退底模**。
15
+ - 子进程无输出时也能取消:停止整个进程树并等待退出。
16
+ - 训练结束后校验最终模型确实生成,否则明确报错(不再"假成功")。
17
+ - 默认与教程统一为 **40~70 轮**基线,修正轮次显示多算一轮的问题。
18
+
19
+ ### 选模与可观测
20
+ - **独立低、中、高音三段干声选模**,关闭检索;试听完成后才自动清理中间档。
21
+ - 音域加权显示桶内抽样估计与每轮采样计划;增强源片及副本权重保持合计不变。
22
+
23
+
24
+ ## [0.4.24] - 2026-11-12
25
+
26
+ ### 修复
27
+ - **她嘴里那句「还缺 2 个模型权重、现在唱不了」**:环境提示词的装机判断也在数全部权重文件,把可选的出厂模型 dfy2 算成了必需。结果她能唱(用 dfy7)却按提示词说自己唱不了,直接拒绝唱歌。现在只数必需组件(hubert / rmvpe / 两个底模),并且把这段判断抽成 `missingRequiredCount()` 一处实现——面板、环境提示词、自检三处共用,避免再漏。
28
+
29
+ ### 新增
30
+ - **和声堆叠(可配置)**:同一音色再唱 1~2 条叠上去,副歌立刻有"后面有人在唱"的厚度——唱片里的主唱都这么干,单轨再干净也薄。
31
+ - 配置「换声」组新增三项:**和声堆叠**(off / 三度 / 三度+五度)、**和声音量**(默认 0.22)、**和声范围**(只叠副歌 / 整首)
32
+ - 实现:和声轨用同一模型按 +3 / +7 半音各转一遍,110Hz 高通、三度偏左五度偏右、按主轨响度做门限(默认只出现在唱得响的段落,避免整段叠显电子味)
33
+ - 代价:每多一条和声,转换时间大约翻倍(默认关闭,不用的人不受影响)
34
+
5
35
  ## [0.4.23] - 2026-11-12
6
36
 
7
37
  ### 修复
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # cortico-world-fish-sing · 大肥鱼唱歌
2
2
 
3
3
  让她真的开口唱:**B 站点歌 / 本地文件 → 人声分离 → RVC 换声 → 混音 → 本机出声或发 QQ 语音条**。
4
+
5
+ ### 训练行为更新(0.4.25)
6
+
7
+ 从头训练必须使用新实验名;断点续训要求切片内容、增强参数与原实验一致,旧版无数据指纹的实验请使用新名字重训。训练轮次统一先以 40~70 轮为基线。
8
+ 选模使用另外提供的低、中、高音三段独立干声(关闭检索),不再拿训练切片自测。权重面板按长度桶估计抽样比例,训练页提供实际采样计划。完整用法以 [训练教程](docs/TRAINING.md) 为准。
4
9
  附带一套训练面板:选素材 → 分离 → 切片 → **按音域调权重** → 训练 → 出模型,全程点按钮。
5
10
 
6
11
  给 [Coopanion](https://github.com/Pal-AI-Lab/cortico-extensions) 用的 World 扩展。
@@ -182,7 +187,7 @@ RVC 本来是**均匀采样**:唱得高的片和唱得低的片被抽中的概
182
187
 
183
188
  「已有模型」下拉选一个本机训练过的实验 → 点「导入已训练模型的数据」,
184
189
  它 `logs/<exp>/0_gt_wavs` 里的切片会**硬链接**成数据集(不占空间),
185
- 然后勾着「追加到当前数据集」把新素材加进去,音域分布和权重按合并后的总量重算。
190
+ 然后勾着「追加到当前数据集」把新素材加进去,音域分布和权重按合并后的总量重算。数据变化后请使用新实验名从底模训练;“断点续训”只适用于数据完全一致的实验。
186
191
 
187
192
  > 前提:那个实验的切片还在。清理过 `logs/<exp>/0_gt_wavs` 就只能从原始音频重建。
188
193
  > 用本插件建的会保留 `sep/vocals.wav`,不会丢。
package/describe.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "name": "cortico-world-fish-sing",
4
- "version": "0.1.0",
4
+ "version": "0.4.25",
5
5
  "describe": {
6
6
  "tools": [
7
7
  {
@@ -986,8 +986,17 @@ function mountTrain(ctx) {
986
986
  let wRefs = [];
987
987
 
988
988
  const afterShares = () => {
989
- const total = wrows.reduce((n, r) => n + r.seconds * (wcfg.bands[r.id] ?? 1), 0) || 1;
990
- return wrows.map((r) => (r.seconds * (wcfg.bands[r.id] ?? 1)) / total);
989
+ const counts = wrows.map(() => 0);
990
+ let total = 0;
991
+ for (let bucket = 0; bucket < 8; bucket++) {
992
+ const n = wrows.reduce((sum, r) => sum + (r.buckets?.[bucket] || 0), 0);
993
+ if (!n) continue;
994
+ const draws = Math.ceil(n / 4) * 4;
995
+ const denominator = wrows.reduce((sum, r) => sum + (r.buckets?.[bucket] || 0) * (wcfg.bands[r.id] ?? 1), 0);
996
+ wrows.forEach((r, i) => { counts[i] += draws * (r.buckets?.[bucket] || 0) * (wcfg.bands[r.id] ?? 1) / denominator; });
997
+ total += draws;
998
+ }
999
+ return counts.map(n => n / (total || 1));
991
1000
  };
992
1001
 
993
1002
  const paintWeightNumbers = () => {
@@ -1090,7 +1099,7 @@ function mountTrain(ctx) {
1090
1099
  /* 错误已显示 */
1091
1100
  }
1092
1101
  });
1093
- foot.append(saveBtn, el('span', 'fs-meta', '保存后训练会用这套权重:同一档的片段被抽到的概率按倍数放大,每轮步数不变'));
1102
+ foot.append(saveBtn, el('span', 'fs-meta', '预览为桶内抽样片数占比(非增强 / batch4),不是时长占比;以训练采样报告为准,增强副本按原片音域归组'));
1094
1103
  weightBox.append(foot);
1095
1104
 
1096
1105
  paintWeightNumbers();
@@ -1242,7 +1251,7 @@ function mountTrain(ctx) {
1242
1251
  epIn.type = 'number';
1243
1252
  epIn.min = '10';
1244
1253
  epIn.max = '600';
1245
- epIn.value = '200';
1254
+ epIn.value = '70';
1246
1255
  const bsSel = el('select', 'fs-tin');
1247
1256
  for (const v of [2, 4, 6, 8]) {
1248
1257
  const o = el('option', '', `batch ${v}`);
@@ -1271,8 +1280,8 @@ function mountTrain(ctx) {
1271
1280
  };
1272
1281
 
1273
1282
  tForm.append(
1274
- mkField('实验名', expIn, '产物会落在 logs/<实验名>,同名会复用目录'),
1275
- mkField('轮次', epIn, '200 轮 / 33 分钟数据约 3 小时'),
1283
+ mkField('实验名', expIn, '从头训练使用新实验名;同名仅允许数据一致的断点续训'),
1284
+ mkField('轮次', epIn, '先训练 40~70 轮,使用独立试听选模,增加轮次不保证更好'),
1276
1285
  mkField('批大小', bsSel, '8G 显存用 4,爆显存就降到 2'),
1277
1286
  mkField('每 N 轮存档', seIn, '每 N 轮导出一个小模型到「模型」页'),
1278
1287
  );
@@ -1292,7 +1301,7 @@ function mountTrain(ctx) {
1292
1301
  abChk.checked = false; // 用户要求:不默认勾,想要就自己点
1293
1302
  const abLbl = el('label', 'fs-meta', '训练完生成选模对比');
1294
1303
  abLbl.prepend(abChk);
1295
- abLbl.title = '用同一句训练切片,final 和最后两个中间档各唱一遍,进作品库对比听';
1304
+ abLbl.title = '用下面独立的低、中、高音干声对比 final 和最后两个中间档,关闭检索';
1296
1305
  const lowChk = el('input', 'fs-ck');
1297
1306
  lowChk.type = 'checkbox';
1298
1307
  lowChk.checked = false; // 用户要求:不默认勾(实测只是有限改善)
@@ -1301,6 +1310,14 @@ function mountTrain(ctx) {
1301
1310
  lowLbl.title = '有限改善:把每个切片合成 -2/-4 半音的副本一起训练。实测只能缓解、不能根治"低音不像"(模型在低音区本来就没有音色记忆),且 F0/特征提取时间约 ×3';
1302
1311
  chkRow.append(resumeLbl, rebuildLbl, pruneAfterLbl, abLbl, lowLbl, el('span', 'fs-grow'), startT, stopT);
1303
1312
 
1313
+ const evaluationInputs = ['低音', '中音', '高音'].map(band => {
1314
+ const input = el('input', 'fs-tin');
1315
+ input.placeholder = `${band}独立干声路径(未参与训练,含长音,建议10~30秒)`;
1316
+ return input;
1317
+ });
1318
+ const evaluationBox = el('div', 'fs-list');
1319
+ evaluationBox.append(el('div', 'fs-meta', '选模素材:固定低、中、高音三段独立干声。请确认没有同一首歌的片段进入训练集。'), ...evaluationInputs);
1320
+ const samplingText = el('div', 'fs-meta');
1304
1321
  const tProg = el('div', 'fs-prog');
1305
1322
  const tFill = el('i');
1306
1323
  tProg.append(tFill);
@@ -1320,10 +1337,10 @@ function mountTrain(ctx) {
1320
1337
  const pruneBtn = el('button', 'fs-btn', '清理中间档');
1321
1338
  pruneBtn.title = '只删 assets/weights/<exp>_eN_sX.pth 这种导出的小模型;完整存档、索引、最终模型都不动';
1322
1339
  const abBtn = el('button', 'fs-btn', '生成选模对比');
1323
- abBtn.title = '用当前实验的存档(final + 最后两个中间档)各唱同一句训练切片,生成对比试听进作品库';
1340
+ abBtn.title = '用独立低、中、高音干声对比 final 和最后两个中间档,关闭检索';
1324
1341
  ckptBar.append(el('span', 'fs-meta', '中间档:'), ckptMeta, el('span', 'fs-meta', '每'),
1325
1342
  keepIn, el('span', 'fs-meta', '轮留一个'), el('span', 'fs-grow'), abBtn, pruneBtn);
1326
- trainBox.append(tTitle, tForm, chkRow, tProg, tMsg, losses, lossAxis, tModels, ckptBar);
1343
+ trainBox.append(tTitle, tForm, chkRow, evaluationBox, tProg, tMsg, samplingText, losses, lossAxis, tModels, ckptBar);
1327
1344
 
1328
1345
  let trainExp = '';
1329
1346
  let trainTimer = null;
@@ -1347,7 +1364,7 @@ function mountTrain(ctx) {
1347
1364
  abBtn.disabled = true;
1348
1365
  abBtn.textContent = '生成中…';
1349
1366
  try {
1350
- const r = await ctx.invoke('trainAbTest', [{ exp }]);
1367
+ const r = await ctx.invoke('trainAbTest', [{ exp, evaluationPaths: evaluationInputs.map(input => input.value.trim()) }]);
1351
1368
  tMsg.textContent = (r && r.text) || `选模对比已生成(${exp})`;
1352
1369
  } catch (e) {
1353
1370
  tMsg.textContent = `选模对比失败:${(e && e.message) || e}`;
@@ -1422,6 +1439,11 @@ function mountTrain(ctx) {
1422
1439
  };
1423
1440
 
1424
1441
  const paintTrain = (st) => {
1442
+ const report = st.sampling;
1443
+ const sampleTotal = Object.values(report?.counts || {}).reduce((sum, n) => sum + Number(n), 0);
1444
+ samplingText.textContent = report ? `第 ${report.epoch} 轮采样计划:${sampleTotal} 次 / ${Object.keys(report.counts || {}).length} 个不同切片;` +
1445
+ Object.entries(report.bands || {}).map(([band, n]) => `${({low:'低', mid:'中', high:'偏高', top:'高', unknown:'未知'})[band] || band} ${(Number(n) / (sampleTotal || 1) * 100).toFixed(1)}%`).join(' · ') +
1446
+ (report.replicas > 1 ? '(仅 rank0)' : '') : '实际采样报告:训练启动后显示';
1425
1447
  const job = st.job;
1426
1448
  // 有 job 就看 job;没有但日志还在写 = 重启前留下的训练还在跑,一样要当成「进行中」
1427
1449
  const owned = Boolean(job && job.id);
@@ -1549,13 +1571,14 @@ function mountTrain(ctx) {
1549
1571
  try {
1550
1572
  const r = await call('trainStart', [{
1551
1573
  exp: String(expIn.value || '').trim(),
1552
- epochs: Number(epIn.value) || 200,
1574
+ epochs: Number(epIn.value) || 70,
1553
1575
  batch: Number(bsSel.value) || 4,
1554
1576
  saveEvery: Number(seIn.value) || 10,
1555
1577
  resume: resumeChk.checked,
1556
1578
  rebuild: rebuildChk.checked,
1557
1579
  pruneAfter: pruneAfterChk.checked,
1558
1580
  abTest: abChk.checked,
1581
+ evaluationPaths: evaluationInputs.map(input => input.value.trim()),
1559
1582
  augment: lowChk.checked,
1560
1583
  keepEvery: Math.max(1, Number(keepIn.value) || 50),
1561
1584
  }]);
package/dist/webui.js CHANGED
@@ -986,8 +986,17 @@ function mountTrain(ctx) {
986
986
  let wRefs = [];
987
987
 
988
988
  const afterShares = () => {
989
- const total = wrows.reduce((n, r) => n + r.seconds * (wcfg.bands[r.id] ?? 1), 0) || 1;
990
- return wrows.map((r) => (r.seconds * (wcfg.bands[r.id] ?? 1)) / total);
989
+ const counts = wrows.map(() => 0);
990
+ let total = 0;
991
+ for (let bucket = 0; bucket < 8; bucket++) {
992
+ const n = wrows.reduce((sum, r) => sum + (r.buckets?.[bucket] || 0), 0);
993
+ if (!n) continue;
994
+ const draws = Math.ceil(n / 4) * 4;
995
+ const denominator = wrows.reduce((sum, r) => sum + (r.buckets?.[bucket] || 0) * (wcfg.bands[r.id] ?? 1), 0);
996
+ wrows.forEach((r, i) => { counts[i] += draws * (r.buckets?.[bucket] || 0) * (wcfg.bands[r.id] ?? 1) / denominator; });
997
+ total += draws;
998
+ }
999
+ return counts.map(n => n / (total || 1));
991
1000
  };
992
1001
 
993
1002
  const paintWeightNumbers = () => {
@@ -1090,7 +1099,7 @@ function mountTrain(ctx) {
1090
1099
  /* 错误已显示 */
1091
1100
  }
1092
1101
  });
1093
- foot.append(saveBtn, el('span', 'fs-meta', '保存后训练会用这套权重:同一档的片段被抽到的概率按倍数放大,每轮步数不变'));
1102
+ foot.append(saveBtn, el('span', 'fs-meta', '预览为桶内抽样片数占比(非增强 / batch4),不是时长占比;以训练采样报告为准,增强副本按原片音域归组'));
1094
1103
  weightBox.append(foot);
1095
1104
 
1096
1105
  paintWeightNumbers();
@@ -1242,7 +1251,7 @@ function mountTrain(ctx) {
1242
1251
  epIn.type = 'number';
1243
1252
  epIn.min = '10';
1244
1253
  epIn.max = '600';
1245
- epIn.value = '200';
1254
+ epIn.value = '70';
1246
1255
  const bsSel = el('select', 'fs-tin');
1247
1256
  for (const v of [2, 4, 6, 8]) {
1248
1257
  const o = el('option', '', `batch ${v}`);
@@ -1271,8 +1280,8 @@ function mountTrain(ctx) {
1271
1280
  };
1272
1281
 
1273
1282
  tForm.append(
1274
- mkField('实验名', expIn, '产物会落在 logs/<实验名>,同名会复用目录'),
1275
- mkField('轮次', epIn, '200 轮 / 33 分钟数据约 3 小时'),
1283
+ mkField('实验名', expIn, '从头训练使用新实验名;同名仅允许数据一致的断点续训'),
1284
+ mkField('轮次', epIn, '先训练 40~70 轮,使用独立试听选模,增加轮次不保证更好'),
1276
1285
  mkField('批大小', bsSel, '8G 显存用 4,爆显存就降到 2'),
1277
1286
  mkField('每 N 轮存档', seIn, '每 N 轮导出一个小模型到「模型」页'),
1278
1287
  );
@@ -1292,7 +1301,7 @@ function mountTrain(ctx) {
1292
1301
  abChk.checked = false; // 用户要求:不默认勾,想要就自己点
1293
1302
  const abLbl = el('label', 'fs-meta', '训练完生成选模对比');
1294
1303
  abLbl.prepend(abChk);
1295
- abLbl.title = '用同一句训练切片,final 和最后两个中间档各唱一遍,进作品库对比听';
1304
+ abLbl.title = '用下面独立的低、中、高音干声对比 final 和最后两个中间档,关闭检索';
1296
1305
  const lowChk = el('input', 'fs-ck');
1297
1306
  lowChk.type = 'checkbox';
1298
1307
  lowChk.checked = false; // 用户要求:不默认勾(实测只是有限改善)
@@ -1301,6 +1310,14 @@ function mountTrain(ctx) {
1301
1310
  lowLbl.title = '有限改善:把每个切片合成 -2/-4 半音的副本一起训练。实测只能缓解、不能根治"低音不像"(模型在低音区本来就没有音色记忆),且 F0/特征提取时间约 ×3';
1302
1311
  chkRow.append(resumeLbl, rebuildLbl, pruneAfterLbl, abLbl, lowLbl, el('span', 'fs-grow'), startT, stopT);
1303
1312
 
1313
+ const evaluationInputs = ['低音', '中音', '高音'].map(band => {
1314
+ const input = el('input', 'fs-tin');
1315
+ input.placeholder = `${band}独立干声路径(未参与训练,含长音,建议10~30秒)`;
1316
+ return input;
1317
+ });
1318
+ const evaluationBox = el('div', 'fs-list');
1319
+ evaluationBox.append(el('div', 'fs-meta', '选模素材:固定低、中、高音三段独立干声。请确认没有同一首歌的片段进入训练集。'), ...evaluationInputs);
1320
+ const samplingText = el('div', 'fs-meta');
1304
1321
  const tProg = el('div', 'fs-prog');
1305
1322
  const tFill = el('i');
1306
1323
  tProg.append(tFill);
@@ -1320,10 +1337,10 @@ function mountTrain(ctx) {
1320
1337
  const pruneBtn = el('button', 'fs-btn', '清理中间档');
1321
1338
  pruneBtn.title = '只删 assets/weights/<exp>_eN_sX.pth 这种导出的小模型;完整存档、索引、最终模型都不动';
1322
1339
  const abBtn = el('button', 'fs-btn', '生成选模对比');
1323
- abBtn.title = '用当前实验的存档(final + 最后两个中间档)各唱同一句训练切片,生成对比试听进作品库';
1340
+ abBtn.title = '用独立低、中、高音干声对比 final 和最后两个中间档,关闭检索';
1324
1341
  ckptBar.append(el('span', 'fs-meta', '中间档:'), ckptMeta, el('span', 'fs-meta', '每'),
1325
1342
  keepIn, el('span', 'fs-meta', '轮留一个'), el('span', 'fs-grow'), abBtn, pruneBtn);
1326
- trainBox.append(tTitle, tForm, chkRow, tProg, tMsg, losses, lossAxis, tModels, ckptBar);
1343
+ trainBox.append(tTitle, tForm, chkRow, evaluationBox, tProg, tMsg, samplingText, losses, lossAxis, tModels, ckptBar);
1327
1344
 
1328
1345
  let trainExp = '';
1329
1346
  let trainTimer = null;
@@ -1347,7 +1364,7 @@ function mountTrain(ctx) {
1347
1364
  abBtn.disabled = true;
1348
1365
  abBtn.textContent = '生成中…';
1349
1366
  try {
1350
- const r = await ctx.invoke('trainAbTest', [{ exp }]);
1367
+ const r = await ctx.invoke('trainAbTest', [{ exp, evaluationPaths: evaluationInputs.map(input => input.value.trim()) }]);
1351
1368
  tMsg.textContent = (r && r.text) || `选模对比已生成(${exp})`;
1352
1369
  } catch (e) {
1353
1370
  tMsg.textContent = `选模对比失败:${(e && e.message) || e}`;
@@ -1422,6 +1439,11 @@ function mountTrain(ctx) {
1422
1439
  };
1423
1440
 
1424
1441
  const paintTrain = (st) => {
1442
+ const report = st.sampling;
1443
+ const sampleTotal = Object.values(report?.counts || {}).reduce((sum, n) => sum + Number(n), 0);
1444
+ samplingText.textContent = report ? `第 ${report.epoch} 轮采样计划:${sampleTotal} 次 / ${Object.keys(report.counts || {}).length} 个不同切片;` +
1445
+ Object.entries(report.bands || {}).map(([band, n]) => `${({low:'低', mid:'中', high:'偏高', top:'高', unknown:'未知'})[band] || band} ${(Number(n) / (sampleTotal || 1) * 100).toFixed(1)}%`).join(' · ') +
1446
+ (report.replicas > 1 ? '(仅 rank0)' : '') : '实际采样报告:训练启动后显示';
1425
1447
  const job = st.job;
1426
1448
  // 有 job 就看 job;没有但日志还在写 = 重启前留下的训练还在跑,一样要当成「进行中」
1427
1449
  const owned = Boolean(job && job.id);
@@ -1549,13 +1571,14 @@ function mountTrain(ctx) {
1549
1571
  try {
1550
1572
  const r = await call('trainStart', [{
1551
1573
  exp: String(expIn.value || '').trim(),
1552
- epochs: Number(epIn.value) || 200,
1574
+ epochs: Number(epIn.value) || 70,
1553
1575
  batch: Number(bsSel.value) || 4,
1554
1576
  saveEvery: Number(seIn.value) || 10,
1555
1577
  resume: resumeChk.checked,
1556
1578
  rebuild: rebuildChk.checked,
1557
1579
  pruneAfter: pruneAfterChk.checked,
1558
1580
  abTest: abChk.checked,
1581
+ evaluationPaths: evaluationInputs.map(input => input.value.trim()),
1559
1582
  augment: lowChk.checked,
1560
1583
  keepEvery: Math.max(1, Number(keepIn.value) || 50),
1561
1584
  }]);
package/docs/TRAINING.md CHANGED
@@ -36,7 +36,7 @@
36
36
 
37
37
  | 参数 | 怎么填 | 说明 |
38
38
  |---|---|---|
39
- | 实验名 | 随便,已预填 `fishMMDD` | 同名会复用目录;产物在 `logs/<实验名>/` |
39
+ | 实验名 | 已预填 `fishMMDD` | 从头训练必须使用新实验名;产物在 `logs/<实验名>/` |
40
40
  | 轮次 | **40~70**(推荐) | 越多越久;数据量 30 分钟左右,40 轮就能用,70 轮更稳。200 轮一般没必要 |
41
41
  | 批大小 | 4 | 8G 显存用 4;爆显存降到 2 |
42
42
  | 每 N 轮存档 | 10 | 每 10 轮导出一个中间模型到「模型」页,用于选模对比 |
@@ -45,17 +45,17 @@
45
45
 
46
46
  | 勾选 | 什么时候勾 |
47
47
  |---|---|
48
- | 从上次存档继续 | 上次训练中断过、想接着练。面板检测到没训完的记录时会**自动帮你勾上** |
48
+ | 从上次存档继续 | 仅用于数据和增强参数完全一致的断点续训,需要配对 G/D 存档。轮次填目标总轮次。旧实验没有数据指纹时请换新实验名重训 |
49
49
  | 重算特征 | 数据集换过素材、或上次特征提取失败时 |
50
50
  | 训练完自动清理中间档 | 磁盘紧张才勾。**想跑选模对比就别勾**(对比要靠中间档) |
51
- | 训练完生成选模对比 | 推荐勾:训完自动用同一句话把 final / e60 / e50 各唱一遍,进作品库 |
51
+ | 训练完生成选模对比 | 需填写低、中、高音三段独立干声路径,建议每段 10~30 秒并含长音。final 和最后两个中间档使用同样素材,关闭检索后进入作品库 |
52
52
  | 低音增强 | **别指望它治低音**。实测只是有限改善(把切片降 2/4 半音合成副本),特征提取时间 ×3 |
53
53
 
54
54
  点「开始训练」后:
55
55
 
56
56
  - 顶部进度条实时显示 `轮次 · 秒/轮 · 预计剩余时间`
57
- - **mel 曲线往下走 = 在进步**;数字稳定在低位、不再下降 = 已经收敛
58
- - 训练期间 **GPU 被占满,唱不了歌**(会自动排队/抢占),正常
57
+ - mel 曲线反映训练集拟合程度;下降不保证没学过的歌曲效果更好,选模以固定独立试听为准
58
+ - 训练期间 GPU 被占用,唱歌请求会被拒绝
59
59
  - 想停就点「停止训练」——会真正停掉进程(不是假装停),最近一次存档保留
60
60
 
61
61
  ### 时长参考(8G 显存 / batch 4)
@@ -70,7 +70,7 @@
70
70
  ## 3. 训练完之后
71
71
 
72
72
  1. **模型**页会列出 `fishxxxx.pth`(最终)和 `fishxxxx_eN_sX.pth`(每 N 轮一个的中间档)。
73
- 2. **选模对比**:训练完(若勾了)会自动生成——同一句训练切片,final 和最后两个中间档各唱一遍,进作品库。听完选最喜欢的那档。
73
+ 2. **选模对比**:训练完(若勾了)使用三段独立干声,final 和最后两个中间档各唱一遍,进作品库。低音、中音、高音和长音一起听,不用训练切片自测。系统校验文件内容重复,但无法识别同一首歌的不同片段,请自行避免素材泄漏。
74
74
  3. 在「模型」页**手动切换**到新模型(不会自动切)。
75
75
  4. 中间档不听了的,在训练页底部「清理中间档」删掉(每个 ~53 MB)。
76
76
 
@@ -94,12 +94,18 @@
94
94
  | 训练中断:查不到任务 | 0.4.15 已修(网络抖动误报)。若再出现且训练日志也没在动,才需要真排查 |
95
95
  | 训练完「模型」页没有新模型 | 看②里的进度信息是否真的到了 70 轮;`logs/<实验名>/` 里应有 `*.pth` |
96
96
  | 低音还是不像 | 素材里低音太少(<2 分钟基本学不会)。**别靠低音增强硬堆**,只能缓解。根治要等真实低音素材 |
97
- | 想从头重训 | 用新实验名(或删掉 `logs/<实验名>/`)。同实验名 + 勾「从上次存档继续」= 接着练 |
97
+ | 想从头重训 | 用新实验名保留旧实验。同实验名只允许数据一致的断点续训;增加素材后请换新实验名 |
98
98
  | 训练中断:已取消 | 你自己点的停止,不是故障 |
99
99
 
100
100
  ---
101
101
 
102
102
  ## 6. 想深入
103
103
 
104
+ - 训练只使用 manifest 中标为保留的切片,以内容 SHA-256 和增强参数绑定实验。换素材不能复用旧切片和特征。
105
+ - 音高分析失败单独计入“需复查”,完全无发声帧的切片不会进入训练。
106
+ - 权重面板是按长度桶估计的抽样片数比例(非增强、batch4),不是时长比例。训练页另显示当前轮采样计划的音域比例及不同切片数,多卡时报告仅代表 rank0。
107
+ - 低音增强把源片及其副本权重一起除以份数,合计保持原片权重;全体权重相同走均匀采样。副本统计归入原片音域。
108
+ - 同时勾选选模和自动清理时,先完成试听再清理;试听失败保留中间档。
109
+
104
110
  - 音域加权(③ 高级)的原理与实测数据见 [README「训练自己的音色」](../README.md#训练自己的音色)
105
111
  - 版本间的行为变化见 [CHANGELOG](../CHANGELOG.md)
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
- {
2
- "name": "cortico-world-fish-sing",
3
- "version": "0.4.23",
4
- "description": "让她真的开口唱:B 站点歌或本地文件 → 分离 → 换声 → 混音,本机出声或发 QQ 语音条",
5
- "type": "module",
6
- "main": "./src/index.ts",
7
- "license": "MIT",
8
- "author": "FXYXL",
9
- "keywords": [
10
- "cortico-world",
11
- "cortico",
12
- "coo",
13
- "sing",
14
- "rvc",
15
- "music",
16
- "qq"
17
- ],
18
- "engines": {
19
- "node": ">=22.6"
20
- },
21
- "homepage": "https://github.com/FXYXL/cortico-world-fish-sing#readme",
22
- "repository": {
23
- "type": "git",
24
- "url": "git+https://github.com/FXYXL/cortico-world-fish-sing.git"
25
- },
26
- "bugs": {
27
- "url": "https://github.com/FXYXL/cortico-world-fish-sing/issues"
28
- },
29
- "cortico": {
30
- "kind": "world",
31
- "api": 6,
32
- "label": "大肥鱼唱歌",
33
- "tags": [
34
- "music",
35
- "qq",
36
- "local"
37
- ],
38
- "describe": "describe.json",
39
- "webUiClient": "dist/webui-b69dd33a.js"
40
- },
41
- "scripts": {
42
- "doctor": "node tools/doctor.mjs"
43
- },
44
- "dependencies": {}
45
- }
1
+ {
2
+ "name": "cortico-world-fish-sing",
3
+ "version": "0.4.25",
4
+ "description": "让她真的开口唱:B 站点歌或本地文件 → 分离 → 换声 → 混音,本机出声或发 QQ 语音条",
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "license": "MIT",
8
+ "author": "FXYXL",
9
+ "keywords": [
10
+ "cortico-world",
11
+ "cortico",
12
+ "coo",
13
+ "sing",
14
+ "rvc",
15
+ "music",
16
+ "qq"
17
+ ],
18
+ "engines": {
19
+ "node": ">=22.6"
20
+ },
21
+ "homepage": "https://github.com/FXYXL/cortico-world-fish-sing#readme",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/FXYXL/cortico-world-fish-sing.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/FXYXL/cortico-world-fish-sing/issues"
28
+ },
29
+ "cortico": {
30
+ "kind": "world",
31
+ "api": 6,
32
+ "label": "大肥鱼唱歌",
33
+ "tags": [
34
+ "music",
35
+ "qq",
36
+ "local"
37
+ ],
38
+ "describe": "describe.json",
39
+ "webUiClient": "dist/webui-79775549.js"
40
+ },
41
+ "scripts": {
42
+ "doctor": "node tools/doctor.mjs"
43
+ },
44
+ "dependencies": {}
45
+ }
package/src/config.ts CHANGED
@@ -34,6 +34,12 @@ export interface FishSingConfigSection {
34
34
  * 0 = 完全跟随原唱(轻唱就是轻唱);1 = 完全用模型自己的音量(轻唱会被唱满)。
35
35
  */
36
36
  rmsMixRate: number;
37
+ /** 和声堆叠:同一音色再唱几条叠上去(单轨再干净也薄) */
38
+ harmony: 'off' | 'third' | 'third+fifth';
39
+ /** 和声音量(主轨=1.0 的倍数),0.15~0.30 比较自然 */
40
+ harmonyGain: number;
41
+ /** 和声只叠在唱得响的段落(副歌),免得整段都在叠显得电子味 */
42
+ harmonyScope: 'chorus' | 'all';
37
43
  /** full = 带伴奏;vocals = 只要人声 */
38
44
  mode: 'full' | 'vocals';
39
45
  };
@@ -109,6 +115,9 @@ export const FISHSING_DEFAULTS: FishSingConfigSection = {
109
115
  // 0 = 严格跟随原唱的音量起伏。用户实测:温柔的原唱用 0 最好听;
110
116
  // 老版本这里是 1.0(等于放弃跟随),轻唱段落会被唱满。
111
117
  rmsMixRate: 0,
118
+ harmony: 'off',
119
+ harmonyGain: 0.22,
120
+ harmonyScope: 'chorus',
112
121
  mode: 'full',
113
122
  },
114
123
  play: {
@@ -208,6 +217,32 @@ export function fishsingConfigGroups(): ConfigGroup[] {
208
217
  maximum: 1,
209
218
  'x-hot': true,
210
219
  },
220
+ [at('voice.harmony')]: {
221
+ type: 'string',
222
+ title: '和声堆叠',
223
+ description:
224
+ '同一音色再唱几条叠在一起,副歌立刻有"后面有人在唱"的厚度(唱片里的主唱都这么做)。'
225
+ + 'off = 关;third = 叠一条三度;third+fifth = 三度 + 五度(更满,也更容易显电子味)。'
226
+ + '注意:每多一条,转换时间就多一倍左右。',
227
+ enum: ['off', 'third', 'third+fifth'],
228
+ 'x-hot': true,
229
+ },
230
+ [at('voice.harmonyGain')]: {
231
+ type: 'number',
232
+ title: '和声音量',
233
+ description: '主轨为 1.0 的相对音量。0.15 很含蓄;0.22 自然(推荐);0.35 以上容易显"合成味"。',
234
+ minimum: 0,
235
+ maximum: 0.6,
236
+ 'x-hot': true,
237
+ },
238
+ [at('voice.harmonyScope')]: {
239
+ type: 'string',
240
+ title: '和声范围',
241
+ description:
242
+ 'chorus = 只叠在唱得响的段落(按响度自动判断,推荐);all = 整首都在叠(容易电子味重)。',
243
+ enum: ['chorus', 'all'],
244
+ 'x-hot': true,
245
+ },
211
246
  [at('voice.mode')]: {
212
247
  type: 'string',
213
248
  title: '默认输出',
package/src/library.ts CHANGED
@@ -20,6 +20,10 @@ export interface SingParams {
20
20
  pitch: number | 'auto';
21
21
  /** 音量跟随原唱的程度 0~1(0 = 完全跟随,轻唱不会被唱满) */
22
22
  rmsMixRate?: number;
23
+ /** 和声堆叠档位 */
24
+ harmony?: 'off' | 'third' | 'third+fifth';
25
+ harmonyGain?: number;
26
+ harmonyScope?: 'chorus' | 'all';
23
27
  mode: string;
24
28
  }
25
29
 
package/src/setup.ts CHANGED
@@ -57,6 +57,13 @@ export function loadManifest(): Manifest {
57
57
  return JSON.parse(readFileSync(MODELS_MANIFEST, 'utf8')) as Manifest;
58
58
  }
59
59
 
60
+ /** 还缺几个「必需」组件(hubert / rmvpe / 两个底模)。
61
+ * 出厂默认模型 dfy2 是可选的示例,用户换过模型后删掉很正常——不能算进"缺"里。
62
+ * 面板、环境提示词、自检三处都该用这一个函数,别再各写一遍(之前就漏过两处)。 */
63
+ export function missingRequiredCount(models: ReadonlyArray<{ ready?: boolean; required?: boolean }>): number {
64
+ return models.filter((m) => !m.ready && m.required !== false).length;
65
+ }
66
+
60
67
  function dirCount(p: string): number {
61
68
  if (!existsSync(p)) return 0;
62
69
  try {
package/src/sing.ts CHANGED
@@ -64,6 +64,8 @@ export interface SingRequest {
64
64
  protect?: number;
65
65
  /** 音量跟随原唱的程度 0~1(0 = 完全跟随,轻唱不会被唱满) */
66
66
  rmsMixRate?: number;
67
+ /** 和声堆叠:off / third / third+fifth */
68
+ harmony?: 'off' | 'third' | 'third+fifth';
67
69
  start?: number;
68
70
  duration?: number;
69
71
  /** 跳过缓存(想重唱一遍时用) */
@@ -270,6 +272,10 @@ export async function singSong(req: SingRequest, deps: SingDeps): Promise<SingRe
270
272
  protect: Number(req.protect ?? deps.voice.protect),
271
273
  // 0 = 完全跟随原唱音量;1 = 完全用模型自己的(轻唱被唱满)。越界/NaN 一律退回配置值。
272
274
  rmsMixRate: clamp01(req.rmsMixRate ?? deps.voice.rmsMixRate),
275
+ harmony: (req.harmony ?? deps.voice.harmony) === 'third+fifth' ? 'third+fifth'
276
+ : (req.harmony ?? deps.voice.harmony) === 'third' ? 'third' : 'off',
277
+ harmonyGain: Math.min(0.6, Math.max(0, Number(deps.voice.harmonyGain ?? 0.22))),
278
+ harmonyScope: deps.voice.harmonyScope === 'all' ? 'all' : 'chorus',
273
279
  // 不传 pitch = 按配置默认(配置默认 'auto' = 按音域自动推荐)
274
280
  pitch: req.pitch === undefined || req.pitch === 'auto'
275
281
  ? (deps.voice.pitch ?? 'auto')
@@ -319,6 +325,11 @@ export async function singSong(req: SingRequest, deps: SingDeps): Promise<SingRe
319
325
  index_rate: params.indexRate,
320
326
  protect: params.protect,
321
327
  rms_mix_rate: params.rmsMixRate,
328
+ harmony: params.harmony === 'off' ? null : {
329
+ semis: params.harmony === 'third+fifth' ? [3, 7] : [3],
330
+ gain: params.harmonyGain,
331
+ scope: params.harmonyScope,
332
+ },
322
333
  });
323
334
  let lastLog = 0;
324
335
  const job = await deps.worker.wait(jobId, (p, msg) => {