kingkont 0.20.20 → 0.20.21
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/package.json +1 -1
- package/renderer/generate.js +52 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kingkont",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.21",
|
|
4
4
|
"description": "KingKont \u00b7 Chatium \u2014 \u043d\u043e\u0434-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u0446\u0435\u043d \u0441 AI-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438/\u0432\u0438\u0434\u0435\u043e/\u0433\u043e\u043b\u043e\u0441/SFX/\u043c\u0443\u0437\u044b\u043a\u0430/\u0442\u0435\u043a\u0441\u0442)",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"bin": {
|
package/renderer/generate.js
CHANGED
|
@@ -1645,9 +1645,59 @@ $('genSubmit').addEventListener('click', async () => {
|
|
|
1645
1645
|
$('locPickRow').style.display = 'none';
|
|
1646
1646
|
$('genModal').classList.add('hidden');
|
|
1647
1647
|
if (saveOnly) {
|
|
1648
|
-
// Сохраняем правки
|
|
1649
|
-
|
|
1648
|
+
// Сохраняем правки ВСЕХ настроек модалки (промпт + модель + длина +
|
|
1649
|
+
// ratio + resolution + voiceId/tones для audio). Юзер: «иду в ноду А,
|
|
1650
|
+
// выставляю Kling O1, нажимаю Сохранить, иду в ноду Б, выставляю
|
|
1651
|
+
// Seedance Fast, возвращаюсь в А и вижу Seedance Fast». Раньше
|
|
1652
|
+
// сохранялись только rawPrompt+kind — модель/длина/aspect юзера
|
|
1653
|
+
// не закреплялись в ноде, и при следующем открытии regenerateNode
|
|
1654
|
+
// не находил их в g.modelKey → state.videoModel оставался "последний".
|
|
1655
|
+
const patch = { ...(target.generated || {}), rawPrompt, kind, prompt: rawPrompt };
|
|
1656
|
+
if (kind === 'video') {
|
|
1657
|
+
const modelMap = {
|
|
1658
|
+
'seedance-2': 'bytedance/seedance-2',
|
|
1659
|
+
'seedance-2-fast': 'bytedance/seedance-2-fast',
|
|
1660
|
+
'kling-o1': 'kwaivgi/kling-o1',
|
|
1661
|
+
'kling-3.0': 'kling-3.0/video',
|
|
1662
|
+
};
|
|
1663
|
+
const mk = state.videoModel || 'seedance-2';
|
|
1664
|
+
patch.modelKey = mk;
|
|
1665
|
+
patch.model = modelMap[mk] || 'bytedance/seedance-2';
|
|
1666
|
+
patch.duration = state.videoDuration;
|
|
1667
|
+
patch.resolution = state.videoResolution;
|
|
1668
|
+
patch.aspectRatio = state.videoAspect;
|
|
1669
|
+
} else if (kind === 'image') {
|
|
1670
|
+
const modelMap = {
|
|
1671
|
+
'grok': 'grok-imagine/text-to-image',
|
|
1672
|
+
'seedream': 'seedream/4.5-text-to-image',
|
|
1673
|
+
'seedream-5-lite': 'seedream/5-lite-text-to-image',
|
|
1674
|
+
'nano-banana-2': 'nano-banana-2',
|
|
1675
|
+
'nano-banana-pro': 'nano-banana-pro',
|
|
1676
|
+
'gpt-image-2': 'gpt-image-2-text-to-image',
|
|
1677
|
+
'gpt-image-1.5': 'gpt-image/1.5-text-to-image',
|
|
1678
|
+
'flux-schnell': 'flux/schnell',
|
|
1679
|
+
'sdxl-lightning': 'sdxl/lightning',
|
|
1680
|
+
};
|
|
1681
|
+
const mk = state.imageModel || 'nano-banana-2';
|
|
1682
|
+
patch.modelKey = mk;
|
|
1683
|
+
patch.model = modelMap[mk] || 'nano-banana-2';
|
|
1684
|
+
patch.aspectRatio = state.imageAspect;
|
|
1685
|
+
if (state.imageQuality) patch.quality = state.imageQuality;
|
|
1686
|
+
} else if (kind === 'audio') {
|
|
1687
|
+
const voiceId = $('genVoice').value || target.generated?.voiceId;
|
|
1688
|
+
if (voiceId) patch.voiceId = voiceId;
|
|
1689
|
+
if (state.ttsModel) patch.ttsModel = state.ttsModel;
|
|
1690
|
+
patch.tones = [...(state.activeTones || [])];
|
|
1691
|
+
}
|
|
1692
|
+
target.generated = patch;
|
|
1693
|
+
// Если у ноды нет explicit status — считаем её draft (юзер
|
|
1694
|
+
// подготовил параметры, но ещё не запускал).
|
|
1695
|
+
if (!target.status) target.status = 'draft';
|
|
1650
1696
|
scheduleSave();
|
|
1697
|
+
console.log('[regenerate saveOnly] persisted to node.generated:', {
|
|
1698
|
+
modelKey: patch.modelKey, duration: patch.duration,
|
|
1699
|
+
resolution: patch.resolution, aspectRatio: patch.aspectRatio,
|
|
1700
|
+
});
|
|
1651
1701
|
return;
|
|
1652
1702
|
}
|
|
1653
1703
|
await regenerateInto(target, kind, rawPrompt, { sourceRef, pickedSheets });
|