@ninkch/dsh-infinite-canvas 0.19.18 → 0.19.20
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/assets/canvas-director/genres/absurd-parable.md +33 -35
- package/assets/canvas-director/genres/action-mission.md +36 -24
- package/assets/canvas-director/genres/adventure.md +34 -35
- package/assets/canvas-director/genres/broken-mirror-reunion.md +35 -77
- package/assets/canvas-director/genres/class-vertical.md +36 -36
- package/assets/canvas-director/genres/counterattack.md +35 -24
- package/assets/canvas-director/genres/county-drift.md +35 -35
- package/assets/canvas-director/genres/crime-police.md +36 -35
- package/assets/canvas-director/genres/family-melodrama.md +35 -35
- package/assets/canvas-director/genres/family-relation.md +38 -24
- package/assets/canvas-director/genres/fantasy.md +37 -38
- package/assets/canvas-director/genres/gambling-den.md +35 -35
- package/assets/canvas-director/genres/gunstandoff.md +35 -35
- package/assets/canvas-director/genres/hk-retro.md +35 -35
- package/assets/canvas-director/genres/identity-swap.md +37 -24
- package/assets/canvas-director/genres/institutional-eccentric.md +35 -35
- package/assets/canvas-director/genres/mo-lei-tau.md +36 -37
- package/assets/canvas-director/genres/modern-urban.md +34 -35
- package/assets/canvas-director/genres/multi-thread-caper.md +35 -35
- package/assets/canvas-director/genres/neon-dystopia.md +36 -35
- package/assets/canvas-director/genres/parent-child-secret.md +40 -75
- package/assets/canvas-director/genres/period-power-struggle.md +38 -24
- package/assets/canvas-director/genres/rebirth-transmigration.md +37 -24
- package/assets/canvas-director/genres/revenge-face-slap.md +38 -24
- package/assets/canvas-director/genres/shanhaijing-myth.md +150 -0
- package/assets/canvas-director/genres/slice-of-life.md +36 -24
- package/assets/canvas-director/genres/smalltown-uncanny.md +35 -35
- package/assets/canvas-director/genres/social-traverse.md +34 -35
- package/assets/canvas-director/genres/survival-fate.md +35 -35
- package/assets/canvas-director/genres/suspense-rule.md +38 -24
- package/assets/canvas-director/genres/system-flow.md +38 -24
- package/assets/canvas-director/genres/wasteland-chase.md +35 -35
- package/assets/canvas-director/genres/wealthy-romance.md +38 -24
- package/assets/canvas-director/genres/workplace-comedy.md +37 -24
- package/assets/canvas-director/genres/wuxia.md +36 -35
- package/assets/canvas-director/genres/xianxia-cultivation.md +39 -24
- package/assets/canvas-director/genres/youth-distance.md +35 -35
- package/assets/canvas-director/looks/dark-myth-cg.md +1 -0
- package/assets/canvas-director/looks/east-epic-3d.md +1 -0
- package/assets/canvas-director/looks/guoman-3d-xianxia.md +1 -0
- package/assets/canvas-director/looks/saturated-epic.md +1 -0
- package/assets/canvas-director/manifest.json +17 -0
- package/assets/canvas-director/pack.js +3 -2
- package/client.js +365 -89
- package/index.js +12 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -297,7 +297,7 @@ function revealCanvasInRight() {
|
|
|
297
297
|
const MULTI_INPUT_PORTS = new Set(['ref', 'char', 'scene', 'prop']);
|
|
298
298
|
// 分镜端口期望的资产分类(仅用于连接时的非阻断提示)
|
|
299
299
|
const PORT_CATEGORY = { char: 'character', scene: 'scene', prop: 'prop' };
|
|
300
|
-
const CATEGORIES = ['character', 'scene', 'prop', 'script', 'storyboard', 'audio', 'finalcut', '
|
|
300
|
+
const CATEGORIES = ['character', 'scene', 'prop', 'script', 'storyboard', 'audio', 'finalcut', 'general'];
|
|
301
301
|
const RATIOS = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9'];
|
|
302
302
|
const IMAGE_SIZES = ['1K', '2K', '4K'];
|
|
303
303
|
// 时长选项放宽到 30s(万相 3.0 等支持长视频);各厂商上限不同——超限由接口报错,系统不做静默截断
|
|
@@ -882,7 +882,7 @@ function revealCanvasInRight() {
|
|
|
882
882
|
'projectName': '项目名称',
|
|
883
883
|
'renameHint': '双击名称重命名',
|
|
884
884
|
'delProjectHint': '删除项目及其资产',
|
|
885
|
-
'import': '
|
|
885
|
+
'import': '导入',
|
|
886
886
|
'addAssetNode': '添加到画布',
|
|
887
887
|
'download': '下载',
|
|
888
888
|
'viewOriginal': '查看原图',
|
|
@@ -942,6 +942,7 @@ function revealCanvasInRight() {
|
|
|
942
942
|
'modeGenerations': '生图 /images/generations(支持多参考图)',
|
|
943
943
|
'modeEdits': '参考图编辑 /images/edits(多参考图上传)',
|
|
944
944
|
'modeCompshare': '优云智算任务式 /image/v1/tasks(Qwen-Image,参考图登记 + 提示词优化)',
|
|
945
|
+
'modeSanbao': '三宝图片任务 /openapi/v1/images(异步任务,任务 id 可回查;baseUrl 命中 sanbaobeauty.com 自动生效)',
|
|
945
946
|
'catMismatch': '提示:资产分类为「{a}」,端口期望「{b}」,已保留连接',
|
|
946
947
|
'nStoryboard': '分镜表',
|
|
947
948
|
'nScript': '剧本',
|
|
@@ -1071,7 +1072,7 @@ function revealCanvasInRight() {
|
|
|
1071
1072
|
'shotsUnit': '镜',
|
|
1072
1073
|
'savedOk': '已存为资产',
|
|
1073
1074
|
'warnUnregistered': '未在设定集/资产中登记',
|
|
1074
|
-
'
|
|
1075
|
+
'warnShotsOverCapacity': '本分镜已生成 {n} 镜,超过单个分镜的镜头容量(100 镜):请按场景拆分为多个场景剧本节点(每个分镜只连一个场景剧本)',
|
|
1075
1076
|
'warnEmptyDesc': '已登记但描述为空(待补全)',
|
|
1076
1077
|
'catMention': '提及',
|
|
1077
1078
|
'assetCategoriesFixed': '已按命名规范纠正 {n} 个资产的分类',
|
|
@@ -1828,7 +1829,7 @@ function revealCanvasInRight() {
|
|
|
1828
1829
|
'projectName': 'Project name',
|
|
1829
1830
|
'renameHint': 'Double-click to rename',
|
|
1830
1831
|
'delProjectHint': 'Delete project and its assets',
|
|
1831
|
-
'import': 'Import
|
|
1832
|
+
'import': 'Import',
|
|
1832
1833
|
'addAssetNode': 'Add to canvas',
|
|
1833
1834
|
'download': 'Download',
|
|
1834
1835
|
'viewOriginal': 'View original',
|
|
@@ -1888,6 +1889,7 @@ function revealCanvasInRight() {
|
|
|
1888
1889
|
'modeGenerations': 'image /images/generations (with references)',
|
|
1889
1890
|
'modeEdits': 'image edit /images/edits (multi-reference upload)',
|
|
1890
1891
|
'modeCompshare': 'Compshare task /image/v1/tasks (Qwen-Image, reference upload)',
|
|
1892
|
+
'modeSanbao': 'Sanbao image task /openapi/v1/images (async task with queryable task id; auto-enabled when baseUrl hits sanbaobeauty.com)',
|
|
1891
1893
|
'catMismatch': 'Note: asset category is "{a}", port expects "{b}". Connected anyway.',
|
|
1892
1894
|
'nStoryboard': 'Storyboard',
|
|
1893
1895
|
'nScript': 'Script',
|
|
@@ -2018,7 +2020,7 @@ function revealCanvasInRight() {
|
|
|
2018
2020
|
'shotsUnit': 'shots',
|
|
2019
2021
|
'savedOk': 'Saved as asset',
|
|
2020
2022
|
'warnUnregistered': 'not in bible/assets',
|
|
2021
|
-
'
|
|
2023
|
+
'warnShotsOverCapacity': "This storyboard generated {n} shots - beyond one storyboard's shot capacity (100 shots): split the script into multiple scene script nodes (each storyboard takes ONE scene)",
|
|
2022
2024
|
'warnEmptyDesc': 'registered but description is empty (fill it in)',
|
|
2023
2025
|
'catMention': 'Mention',
|
|
2024
2026
|
'assetCategoriesFixed': 'Re-categorized {n} assets by naming convention',
|
|
@@ -2757,6 +2759,12 @@ body[data-ds-dark-theme] .dshic-studio-modal{border-color:var(--dsw-alias-border
|
|
|
2757
2759
|
.dshic-asset-pageinput:focus{outline:none;border-color:var(--dsw-alias-brand-primary);box-shadow:var(--dshic-shadow-sel);}
|
|
2758
2760
|
.dshic-asset-pagetotal,.dshic-asset-pagecount{font-variant-numeric:tabular-nums;white-space:nowrap;}
|
|
2759
2761
|
.dshic-asset-pagecount{opacity:.75;}
|
|
2762
|
+
/* 搜索行:搜索框(≈2/3,右侧内嵌放大镜)+ 项目选择(≈1/3)同行;窄窗口自动换行 */
|
|
2763
|
+
.dshic-asset-searchrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
|
|
2764
|
+
.dshic-asset-search{position:relative;flex:2 1 320px;min-width:220px;}
|
|
2765
|
+
.dshic-asset-search .dshic-input{width:100%;padding-right:26px;box-sizing:border-box;}
|
|
2766
|
+
.dshic-asset-scope{flex:1.1 1 200px;min-width:180px;display:flex;}
|
|
2767
|
+
.dshic-asset-scope .dshic-msel{width:100%;}
|
|
2760
2768
|
/* 设定集条目:行 + 已绑定资产缩略图 */
|
|
2761
2769
|
.dshic-bible-item{display:flex;flex-direction:column;gap:4px;padding:5px 0;border-bottom:1px dashed var(--dsw-alias-border-l1);}
|
|
2762
2770
|
.dshic-bible-thumbs{display:flex;gap:5px;flex-wrap:wrap;padding-left:4px;}
|
|
@@ -4088,6 +4096,8 @@ body[data-ds-dark-theme] .dshic-pick-item.is-on{background:color-mix(in srgb,var
|
|
|
4088
4096
|
new_character: 'new_character', newchar: 'new_character', '新角色': 'new_character', '入场': 'new_character',
|
|
4089
4097
|
scene_change: 'scene_change', scene: 'scene_change', '换场': 'scene_change', '转场': 'scene_change',
|
|
4090
4098
|
closeup: 'closeup', insert: 'closeup', '特写': 'closeup', '插入': 'closeup',
|
|
4099
|
+
// 同机位状态跳变:切前不在/切后在(灯闪现身、影子凭空在场、影化实)——奇幻特效叙事的合法段落
|
|
4100
|
+
state_jump: 'state_jump', jump: 'state_jump', '跳变': 'state_jump', '状态跳变': 'state_jump',
|
|
4091
4101
|
};
|
|
4092
4102
|
let seg = SEG_ALIAS[segRaw] || '';
|
|
4093
4103
|
const boxed = (k) => String(s[k] || '').trim();
|
|
@@ -4099,8 +4109,8 @@ body[data-ds-dark-theme] .dshic-pick-item.is-on{background:color-mix(in srgb,var
|
|
|
4099
4109
|
else seg = 'continuation';
|
|
4100
4110
|
}
|
|
4101
4111
|
if (seg === 'opening' && prevShot) seg = 'continuation'; // 首段只能在第 1 镜;后面标"开场"视为续帧
|
|
4102
|
-
//
|
|
4103
|
-
const join = (seg === 'scene_change' || seg === 'new_character') ? 'loose' : seg === 'closeup' ? 'cut' : 'strict';
|
|
4112
|
+
// 接缝档位:换场/新角色入场都放宽(新角色段本就不承接上段画面),特写插入与状态跳变允许跳切
|
|
4113
|
+
const join = (seg === 'scene_change' || seg === 'new_character') ? 'loose' : (seg === 'closeup' || seg === 'state_jump') ? 'cut' : 'strict';
|
|
4104
4114
|
// 只有真正需要画面承接的段落才接力尾帧;新角色入场首帧若来自上一段,新角色反而无从进入
|
|
4105
4115
|
const chain = seg === 'continuation' && !!prevShot;
|
|
4106
4116
|
// ownTail = 本镜的接点尾态(留给**下一镜**);cam = 本镜运镜(同样留给下一镜延续)
|
|
@@ -4159,7 +4169,16 @@ body[data-ds-dark-theme] .dshic-pick-item.is-on{background:color-mix(in srgb,var
|
|
|
4159
4169
|
let kindLine = '';
|
|
4160
4170
|
if (p.seg === 'scene_change') kindLine = zh ? '段落类型:换场(不承接上一镜画面,直接建立新空间;环境声可延续)' : 'Segment type: scene change (do not continue the previous frame; establish the new space; ambience may carry over)';
|
|
4161
4171
|
else if (p.seg === 'closeup') kindLine = zh ? '段落类型:特写/细节插入(可与上一镜跳切,不要求画面连续)' : 'Segment type: insert close-up (jump cut allowed, no frame continuity required)';
|
|
4162
|
-
else if (p.seg === '
|
|
4172
|
+
else if (p.seg === 'state_jump') kindLine = zh
|
|
4173
|
+
? '段落类型:同机位状态跳变(机位/构图与上一镜完全一致,不推不摇;区别只是**状态**——主体/特效在第 1 帧已完整在场且静止;绝不允许演出进入/飞入/移动/变形过程,也不得回退到上一镜状态)'
|
|
4174
|
+
: 'Segment type: same-framing state jump (framing identical to the previous shot, camera locked; the ONLY difference is state - the subject/effect is already fully present and STATIC in frame 1; never animate an entrance/fly-in/move/morph, never fall back to the previous state)';
|
|
4175
|
+
else if (p.seg === 'new_character') kindLine = zh
|
|
4176
|
+
? ((p.fxEntry || /凝聚|凭空|灯闪|黑场|影子|化实|现身|浮现/.test(String(p.start || '') + String(p.note || '')))
|
|
4177
|
+
? '段落类型:新角色入场(以特效方式进入:灯闪/黑场后已在场、从影子凝聚立起、浮现成形——不得缓慢走入)'
|
|
4178
|
+
: '段落类型:新角色入场(新角色须在画面中自然进入,不得凭空出现)')
|
|
4179
|
+
: ((p.fxEntry || /凝聚|凭空|灯闪|黑场|影子|化实|现身|浮现/.test(String(p.start || '') + String(p.note || '')))
|
|
4180
|
+
? 'Segment type: new character enters via an effect (appears after a flash/black frame, rises from a shadow, condenses into form - never walks in slowly)'
|
|
4181
|
+
: 'Segment type: new character enters (must enter naturally, never pop in)');
|
|
4163
4182
|
else if (p.seg === 'continuation') kindLine = zh
|
|
4164
4183
|
? (isFirst ? '段落类型:承接上一个分镜表(本分镜第 1 镜从上一镜结尾继续,不重演、不重新建立场景)' : '段落类型:续帧(从上一镜结尾继续,不重演)')
|
|
4165
4184
|
: (isFirst ? 'Segment type: continues the previous storyboard (no re-establishing, no replay)' : 'Segment type: continuation (continue from the previous shot, no replay)');
|
|
@@ -4174,8 +4193,9 @@ body[data-ds-dark-theme] .dshic-pick-item.is-on{background:color-mix(in srgb,var
|
|
|
4174
4193
|
} else if (p.start && p.seg === 'continuation') {
|
|
4175
4194
|
parts.push((zh ? '本镜起始态:' : 'Start state: ') + p.start);
|
|
4176
4195
|
}
|
|
4177
|
-
// 运镜延续:优先用上一镜的运镜(本镜要接着走);没有则用本镜自己写的 cam
|
|
4178
|
-
|
|
4196
|
+
// 运镜延续:优先用上一镜的运镜(本镜要接着走);没有则用本镜自己写的 cam。
|
|
4197
|
+
// state_jump 同机位跳变除外:机位必须锁死,不承接上一镜的运动。
|
|
4198
|
+
if (p.cam && p.seg !== 'state_jump') parts.push((zh ? '运镜延续:' : 'Camera continues: ') + p.cam + (zh ? '(方向与速度保持,不反向、不突变)' : ' (same direction and speed; no reversal, no sudden change)'));
|
|
4179
4199
|
// 本镜的接点尾态单独提示,明确它是留给下一段的(同时提醒不要在片尾收成定格)
|
|
4180
4200
|
if (p.tail && p.seg === 'continuation') {
|
|
4181
4201
|
parts.push((zh ? '本镜接点(片尾停在此状态,保持动作进行中,不要演完站定)' : 'End this shot on this hand-off state, still mid-motion; do not settle to a static pose') + ':' + p.tail);
|
|
@@ -4183,9 +4203,13 @@ body[data-ds-dark-theme] .dshic-pick-item.is-on{background:color-mix(in srgb,var
|
|
|
4183
4203
|
if (p.note) parts.push((zh ? '接戏要求:' : 'Continuity requirement: ') + p.note);
|
|
4184
4204
|
if (!kindLine && !parts.length) return '';
|
|
4185
4205
|
const head = zh ? '【衔接】' : '[Continuity] ';
|
|
4186
|
-
const end =
|
|
4187
|
-
?
|
|
4188
|
-
|
|
4206
|
+
const end = p.seg === 'state_jump'
|
|
4207
|
+
? (zh
|
|
4208
|
+
? '除状态差外,机位、构图、光线基调与上一镜保持一致;本镜只呈现这一次状态跳变'
|
|
4209
|
+
: 'Except for the state change, keep framing/composition/light identical to the previous shot; this cut renders exactly one state jump')
|
|
4210
|
+
: (zh
|
|
4211
|
+
? '禁止重启姿态、禁止重新建立场景、禁止改变人物朝向与站位(除非剧情明确要求)'
|
|
4212
|
+
: 'Never reset posture, never re-establish the scene, never change facing or blocking unless the story demands it');
|
|
4189
4213
|
const body = [kindLine].concat(parts, [end]).filter(Boolean);
|
|
4190
4214
|
// 统一标点:拼接前去掉各自尾部标点,避免出现「。;」这种叠标点
|
|
4191
4215
|
const clean = body.map((x) => String(x).replace(/[。;;.、\s]+$/, '')).filter(Boolean);
|
|
@@ -4226,9 +4250,10 @@ body[data-ds-dark-theme] .dshic-pick-item.is-on{background:color-mix(in srgb,var
|
|
|
4226
4250
|
// 同时给这段打 seamRisk:'forced'(UI 要如实显示"这段是硬切的",不静默);
|
|
4227
4251
|
// ⑤ 只有 ① 之外的情况(上一段末镜与本段首镜同为 continuation)才需要尾帧接力。
|
|
4228
4252
|
// ============================================================
|
|
4229
|
-
/** 该 seg 是否构成一个"可以安全开始新生成段"的切点。opening 只在全表第 1 镜成立。
|
|
4253
|
+
/** 该 seg 是否构成一个"可以安全开始新生成段"的切点。opening 只在全表第 1 镜成立。
|
|
4254
|
+
* state_jump(同机位状态跳变)也是合法切点:跳变本身就是"切"——前后镜只差状态、不接动作。 */
|
|
4230
4255
|
function isCutPoint(seg) {
|
|
4231
|
-
return seg === 'scene_change' || seg === 'closeup' || seg === 'new_character' || seg === 'opening';
|
|
4256
|
+
return seg === 'scene_change' || seg === 'closeup' || seg === 'new_character' || seg === 'opening' || seg === 'state_jump';
|
|
4232
4257
|
}
|
|
4233
4258
|
/**
|
|
4234
4259
|
* 把一张分镜表的镜头按「真实镜头边界」切成若干生成段。
|
|
@@ -5761,6 +5786,12 @@ function queueThumb(assetId) {
|
|
|
5761
5786
|
// 协议自动路由:优云智算的图片 API 只有任务式(/image/v1/tasks)——误配成通用模式
|
|
5762
5787
|
// 会在 /v1/images/generations 上拿到 401 "invalid api key"(该面不存在),按域名自动切任务式
|
|
5763
5788
|
try { if (/compshare\.cn$/i.test(new URL(base).hostname)) return await compshareImageTask(prompt, refs, { ...s, extra: extraSrc }, opts); } catch { /* URL 异常由后续流程报错 */ }
|
|
5789
|
+
// 三宝影像工坊:图片走**异步任务协议**(POST /openapi/v1/images 拿任务 id → 轮询 → 下载)。
|
|
5790
|
+
// 通用同步格式在该厂商出图 >120s 会吃代理 504,且手里没有任务 id、已扣费也无法回查;
|
|
5791
|
+
// 域名命中自动切任务式(与优云同款),也可在图片 API 模式下拉显式选「三宝图片任务」。
|
|
5792
|
+
let sanbaoRoute = s.mode === 'sanbao';
|
|
5793
|
+
if (!sanbaoRoute) { try { sanbaoRoute = /(^|\.)sanbaobeauty\.com$/i.test(new URL(base).hostname); } catch { /* URL 异常由后续流程报错 */ } }
|
|
5794
|
+
if (sanbaoRoute) return await sanbaoImageTask(prompt, refs, s, opts);
|
|
5764
5795
|
const upstreamTimeout = Number(s.timeoutMs) > 0 ? Number(s.timeoutMs) : 120000; // 商汤等同步接口 20s+,默认 120s
|
|
5765
5796
|
// 参考图编辑模式:multipart 上传到 /images/edits(OpenAI gpt-image-1 兼容)
|
|
5766
5797
|
if (refs.length && s.mode === 'edits') {
|
|
@@ -5817,6 +5848,14 @@ function queueThumb(assetId) {
|
|
|
5817
5848
|
body: b, timeoutMs: upstreamTimeout, label,
|
|
5818
5849
|
});
|
|
5819
5850
|
let res = await send(body, '图片 API');
|
|
5851
|
+
// 瞬态兜底(通用格式):上游慢/冷启动导致 502/503/504/429/408 时补一次尝试;
|
|
5852
|
+
// 401/400/405 是配置错误绝不重试(retryableDownloadError 与视频/下载同一判定口径)
|
|
5853
|
+
if (!res.ok && retryableDownloadError({ status: res.status })) {
|
|
5854
|
+
if (genAborted()) throw new Error(T('stoppedNote'));
|
|
5855
|
+
try { console.info('[IC] image api not ready (HTTP ' + res.status + ') — retry 1/1'); } catch { /* 忽略 */ }
|
|
5856
|
+
await sleep(20000);
|
|
5857
|
+
res = await send(body, '图片 API(瞬态重试)');
|
|
5858
|
+
}
|
|
5820
5859
|
if (!res.ok && res.status === 400) {
|
|
5821
5860
|
const bad = unsupportedFieldName(res.text);
|
|
5822
5861
|
if (bad && Object.prototype.hasOwnProperty.call(body, bad)) {
|
|
@@ -6490,6 +6529,93 @@ function queueThumb(assetId) {
|
|
|
6490
6529
|
if (st === 'failed') return { state: 'fail', error: sanbaoErrorOf(j) || st };
|
|
6491
6530
|
return { state: 'wait' };
|
|
6492
6531
|
}
|
|
6532
|
+
// —— 三宝图片任务协议(/openapi/v1/images,异步):通用同步格式在该厂商会 504
|
|
6533
|
+
// (出图 >120s 时代理 abort,且手里没有任务 id,远程已扣费也无法回查)。
|
|
6534
|
+
// 任务式与视频同构:提交拿 id → 轮询 → 下载,钱花了必须能凭 id 找回。——
|
|
6535
|
+
/** 三宝图片请求体(纯函数供回归断言):model/prompt/aspect_ratio/images/quality;
|
|
6536
|
+
* images 为公网 URL 数组(本地参考图先经 uploads/raw 转公网);uploadKey 绝不进请求体。 */
|
|
6537
|
+
function buildSanbaoImageBody(base, media) {
|
|
6538
|
+
const b = base || {};
|
|
6539
|
+
const m = media || {};
|
|
6540
|
+
const out = {
|
|
6541
|
+
model: String(b.model || ''),
|
|
6542
|
+
prompt: String(b.prompt || ''),
|
|
6543
|
+
aspect_ratio: String(b.aspect_ratio || 'auto'),
|
|
6544
|
+
quality: String(b.quality || 'high'),
|
|
6545
|
+
};
|
|
6546
|
+
const images = (Array.isArray(m.refUrls) ? m.refUrls : []).map(String).filter(Boolean);
|
|
6547
|
+
if (images.length) out.images = images;
|
|
6548
|
+
return out;
|
|
6549
|
+
}
|
|
6550
|
+
/** 三宝图片结果地址(纯函数):succeeded 后从 data.image_url / data.images[0](字符串或 {url})/
|
|
6551
|
+
* data.download_url 逐级取第一个 http(s) 地址;顶层兜底兼容。 */
|
|
6552
|
+
function sanbaoImageResultOf(j) {
|
|
6553
|
+
if (!j || typeof j !== 'object') return '';
|
|
6554
|
+
const d = (j.data && typeof j.data === 'object') ? j.data : null;
|
|
6555
|
+
const imgs = ((d && Array.isArray(d.images) ? d.images : (Array.isArray(j.images) ? j.images : []))
|
|
6556
|
+
.map((x) => (typeof x === 'string' ? x : (x && x.url)))
|
|
6557
|
+
.find((u) => typeof u === 'string' && /^https?:/.test(u))) || '';
|
|
6558
|
+
return [d && (d.image_url || d.download_url || d.url), imgs, j.image_url, j.download_url]
|
|
6559
|
+
.find((u) => typeof u === 'string' && /^https?:/.test(u)) || '';
|
|
6560
|
+
}
|
|
6561
|
+
/** 三宝图片轮询判定:queued/processing 及未知状态 = 继续;succeeded → 图片地址;failed → error。 */
|
|
6562
|
+
function sanbaoImagePollState(j) {
|
|
6563
|
+
const st = sanbaoStatusOf(j);
|
|
6564
|
+
if (st === 'succeeded') {
|
|
6565
|
+
const url = sanbaoImageResultOf(j);
|
|
6566
|
+
return url ? { state: 'done', url } : { state: 'fail', error: '成功但无图片地址' };
|
|
6567
|
+
}
|
|
6568
|
+
if (st === 'failed') return { state: 'fail', error: sanbaoErrorOf(j) || st };
|
|
6569
|
+
return { state: 'wait' };
|
|
6570
|
+
}
|
|
6571
|
+
/** 三宝图片任务运行器:提交(本地参考图先经 uploads/raw 转公网)→ 轮询 → 带重试下载。
|
|
6572
|
+
* aspect_ratio:供应商设置填了 size(具体尺寸值)则原样传,否则节点比例(16:9 等),缺省 auto。
|
|
6573
|
+
* quality 默认 high,扩展参数可覆盖;uploadKey 只用于上传,绝不进任务请求体。 */
|
|
6574
|
+
async function sanbaoImageTask(prompt, refBlobs, s, opts) {
|
|
6575
|
+
const base = vendorBase(s.baseUrl, VIDEO_VENDORS.sanbao.base);
|
|
6576
|
+
const headers = { 'Content-Type': 'application/json', Authorization: 'Bearer ' + (s.apiKey || '') };
|
|
6577
|
+
const o = opts || {};
|
|
6578
|
+
const rawRefs = refBlobs || [];
|
|
6579
|
+
// 扩展参数:逃生舱;uploadKey 专用上传 key 只用于 /uploads/raw,绝不进任务请求体
|
|
6580
|
+
let uploadKey = s.apiKey || '';
|
|
6581
|
+
let extra = null;
|
|
6582
|
+
try {
|
|
6583
|
+
const ex = parseExtraParams(s.extra || '');
|
|
6584
|
+
if (ex) { uploadKey = String(ex.uploadKey || uploadKey); extra = { ...ex }; delete extra.uploadKey; }
|
|
6585
|
+
} catch (e) { throw new Error('三宝扩展参数配置有误:' + ((e && e.message) || e)); }
|
|
6586
|
+
// 参考图:本地 blob → uploads/raw 公网 URL;已是 http(s) 的引用原样透传
|
|
6587
|
+
const refUrls = [];
|
|
6588
|
+
for (const b of rawRefs) {
|
|
6589
|
+
const raw = (b && b.blob) ? b.blob : b;
|
|
6590
|
+
if (typeof raw === 'string' && /^https?:/i.test(raw)) { refUrls.push(raw); continue; }
|
|
6591
|
+
if (!raw) continue;
|
|
6592
|
+
refUrls.push(await sanbaoUploadRaw(base, uploadKey, raw, 'image'));
|
|
6593
|
+
}
|
|
6594
|
+
const aspect = String(s.size || '').trim() || String(o.ratio || '').trim() || 'auto';
|
|
6595
|
+
const body = buildSanbaoImageBody({ model: s.model || '', prompt, aspect_ratio: aspect, quality: 'high' }, { refUrls });
|
|
6596
|
+
if (extra) Object.assign(body, extra);
|
|
6597
|
+
const r1 = await fetchViaProxy(base + '/openapi/v1/images', { headers, body, timeoutMs: 120000, label: 'Sanbao 图片提交' });
|
|
6598
|
+
if (!r1.ok) throw new Error('Sanbao 图片提交 HTTP ' + r1.status + ' @ ' + base + ':' + r1.text.slice(0, 300));
|
|
6599
|
+
let j1 = null; try { j1 = JSON.parse(r1.text); } catch { throw new Error('Sanbao 图片响应非 JSON:' + r1.text.slice(0, 200)); }
|
|
6600
|
+
const tid = sanbaoTaskIdOf(j1);
|
|
6601
|
+
if (!tid) throw new Error('Sanbao 图片响应中没有任务 id:' + r1.text.slice(0, 200));
|
|
6602
|
+
const taskUrl = base + '/openapi/v1/images/' + encodeURIComponent(tid);
|
|
6603
|
+
if (o.onTask) { try { o.onTask(tid, taskUrl); } catch { /* 持久化失败不影响生成 */ } }
|
|
6604
|
+
const url = await vendorPoll('Sanbao', 5000, async () => {
|
|
6605
|
+
const r = await fetchViaProxy(taskUrl, { method: 'GET', headers: { Authorization: 'Bearer ' + (s.apiKey || '') }, timeoutMs: 60000, label: 'Sanbao 图片查询' });
|
|
6606
|
+
if (!r || !r.ok) return { state: 'wait' };
|
|
6607
|
+
let j = null; try { j = JSON.parse(r.text); } catch { return { state: 'wait' }; }
|
|
6608
|
+
return sanbaoImagePollState(j);
|
|
6609
|
+
});
|
|
6610
|
+
// 链接是签名直链(约 24h 有效),拿到就立即下载;下载带瞬态重试(缓存未就绪 502 同视频口径)
|
|
6611
|
+
return await downloadVideoWithRetry(url, {}, {
|
|
6612
|
+
windowMs: SANBAO_DOWNLOAD_RETRY_MS,
|
|
6613
|
+
stepMs: SANBAO_DOWNLOAD_RETRY_STEP_MS,
|
|
6614
|
+
onRetry: (e, n) => {
|
|
6615
|
+
try { console.info('[IC] sanbao image download not ready (' + ((e && e.message) || e) + ') — retry ' + n); } catch { /* 忽略 */ }
|
|
6616
|
+
},
|
|
6617
|
+
});
|
|
6618
|
+
}
|
|
6493
6619
|
/** 三宝图片字段兜底触发:只认「图片/素材/格式/URL」类错误。
|
|
6494
6620
|
* 余额(402/余额不足/credits)、鉴权(401/api key)、限流(429/频繁)、账号限制(403)绝不重试。 */
|
|
6495
6621
|
function needsSanbaoMediaRetry(errText) {
|
|
@@ -7504,6 +7630,23 @@ function queueThumb(assetId) {
|
|
|
7504
7630
|
URL.revokeObjectURL(url);
|
|
7505
7631
|
}
|
|
7506
7632
|
}
|
|
7633
|
+
/** 尾帧入库决策(纯函数):一次生成只入一张尾帧。
|
|
7634
|
+
* 优先"最佳选帧"(续帧接力用的是它);best 缺失或与 last 同一张 → 用 last(命名"尾帧");
|
|
7635
|
+
* best 与 last 是两张不同画面 → 只存 best(命名"尾帧选帧"),真·最后一帧不再单独入库。
|
|
7636
|
+
* 历史事故:生成路径与媒体节点体兜底两条管线各存一张,一次生成冒出三张尾帧资产。 */
|
|
7637
|
+
function tailFrameDecision(tail) {
|
|
7638
|
+
const t = tail || {};
|
|
7639
|
+
const last = t.last || null;
|
|
7640
|
+
const best = t.best || null;
|
|
7641
|
+
if (!last && !best) return null;
|
|
7642
|
+
const same = !best || best === last;
|
|
7643
|
+
return {
|
|
7644
|
+
blob: same ? last : best,
|
|
7645
|
+
isPick: !same,
|
|
7646
|
+
t: Number(t.bestT) || 0,
|
|
7647
|
+
score: Number(t.bestScore) || 0,
|
|
7648
|
+
};
|
|
7649
|
+
}
|
|
7507
7650
|
/** 缩略灰度(接缝校验用):任意图 Blob → 32×32 RGBA。 */
|
|
7508
7651
|
async function grayThumb(blob, size) {
|
|
7509
7652
|
const n = Math.max(8, Math.min(128, Number(size) || 32));
|
|
@@ -8938,6 +9081,8 @@ function queueThumb(assetId) {
|
|
|
8938
9081
|
const bible = bibleBlock(loadBible(S.activeId));
|
|
8939
9082
|
const zh = effLang() !== 'en';
|
|
8940
9083
|
const contOn = !(opts && opts.cont === false); // 分镜衔接开关(默认开)
|
|
9084
|
+
// 特效演绎开关:任一所选题材/影调卡 fx_motion:true → 追加特效演绎扩展块(见 FX_RULES)
|
|
9085
|
+
const fxOn = await fxMotionEnabledFor(S.activeId);
|
|
8941
9086
|
const contFields = (() => {
|
|
8942
9087
|
if (zh) {
|
|
8943
9088
|
return contOn
|
|
@@ -8948,6 +9093,25 @@ function queueThumb(assetId) {
|
|
|
8948
9093
|
? '{"title":"…","visual":"…","motion":"…","timeBeats":["0s …","mid …","end …"],"camera":"…","vfx":"…","negative":"…","tail":"…","cam":"…","start":"…","seg":"continuation","characters":["…"],"scene":"…","props":["…"],"duration":3,"dialogue":[{"role":"Chen","line":"…"}],"sfx":"zipper snap, paper tear"}'
|
|
8949
9094
|
: '{"title":"…","visual":"…","motion":"…","timeBeats":["0s …","mid …","end …"],"camera":"…","vfx":"…","negative":"…","characters":["…"],"scene":"…","props":["…"],"duration":3,"dialogue":[{"role":"Chen","line":"…"}],"sfx":"zipper snap, paper tear"}';
|
|
8950
9095
|
})();
|
|
9096
|
+
/** 特效演绎扩展块(fx_motion 卡开启时注入):动作承担者中立 / 画面状态节拍 / 奇幻特效词表 /
|
|
9097
|
+
* 角色特效签名 / 速度铁律 / state_jump / 关键帧建议。写实项目(无 fx 卡)完全不受影响。 */
|
|
9098
|
+
const FX_RULES = !fxOn ? [] : (zh ? [
|
|
9099
|
+
'- **【特效演绎·动作承担者】动作的承担者由画面内容决定:角色身体、特效、光影、环境物皆可。特效主导镜的标准写法 = 本体静止 + 一道特效运动(例:人物立于桥头不动,一道兽形暗影贴地掠过画面;真气自掌心汇聚击出)。visual 写明本体状态(静止/仅衣袂微动),motion 写特效的运动轨迹与速度——"人物本体没动,一道特效动了"是完全合法的镜头;',
|
|
9100
|
+
'- **【特效镜节拍·覆盖】vfx/motion 写明"本体静止、特效运动"的镜头,timeBeats 改为**画面状态节拍**:按时间写可见的画面状态推进(例:["0s 桥面空景,第九灯稳定","1s 灯闪过曝一帧","1.5s 兽形暗影已横在桥面,静止"]),拍数 1–3 由内容定,**不受"必须三拍"限制**;身体动作镜仍按"起势→发力→落点"三拍执行;',
|
|
9101
|
+
'- **【vfx 必填·奇幻词表】每镜 vfx 至少 1 项,按需取用——氛围/环境:光尘浮游、雾气漫卷、热浪扭曲、落叶逆卷;发光体:器物幽光、符文亮起、眼瞳竖光;能量:真气/灵气光晕环绕、流光尾迹、粒子凝聚成形、光束击发、冲击波荡开、地面龟裂尘浪、草木伏倒;变化:灯闪过曝一帧、黑场跳变、影化实(影子立起成实体)、实化影(实体缩回影子)、凭空在场(切前不在切后在)、瞬移残影;异兽:剪影飞掠、局部呈现(角/爪/眼/尾)、尺度参照物(桶/门框/马对照);',
|
|
9102
|
+
'- **【角色特效签名·硬性】每个动用特效的角色/异兽,设定集 desc 必须带「特效签名:颜色 + 形态母题 + 粒子质地」(例:特效签名:青色流云纹真气,龙形招式,细雾粒子);缺失时先用 canvas_update_bible 补设定集再写分镜;本镜 vfx 涉及该角色时**必须逐字带出签名**——不同角色的光效颜色/形态必须可区分,跨镜头绝不漂色;',
|
|
9103
|
+
'- **【速度铁律·硬性】模型演不出"快":瞬时事件(一闪而过/瞬移/现身/消失)绝不在本镜内演出过程,一律写成切点两侧的状态差;速度感只允许三种来源:①硬切跳变 ②静止主体+光效突变 ③甩镜+运动模糊。禁止写"高速掠过/瞬间冲过去"让主体在镜内位移——改成三镜:空景 → 灯闪 → 已在场;',
|
|
9104
|
+
'- **【state_jump·同机位状态跳变】seg 可用 `state_jump`:切前不在/切后在(灯闪现身、影子凭空在场、影化实)。机位与上一镜完全一致且静止,不写 tail(尾态就是"静止完整在场")。「假换场」禁令不适用于 state_jump——假换场指既无状态变化又无叙事目的的乱跳;',
|
|
9105
|
+
'- **【关键帧建议】具象化招式/变身镜(龙形光效、法相、影化实)的 vfx 要写成**可直接出设定图的画面**(构图+形态+颜色+粒子);这类镜铺开生成时优先"先出关键帧设定图 → 图生视频(hard 首帧)";',
|
|
9106
|
+
] : [
|
|
9107
|
+
'- **[FX-DRIVEN - ACTION BEARER] what carries the motion is decided by the picture: the character body, an effect, light or the environment are all valid. The standard FX-led shot = still body + one moving effect (e.g. the character stands still on the bridge while a beast-shaped shadow skims past; qi condenses from a palm and strikes). visual states the body state (still / only clothes stirring), motion describes the effect trajectory and speed - "body unmoved, an effect moves" is a fully legal shot;',
|
|
9108
|
+
'- **[FX BEATS - OVERRIDE] for shots whose vfx/motion say "body still, effect moves", timeBeats become PICTURE-STATE beats: visible state progression over time (e.g. ["0s empty bridge, ninth lantern steady","1s lantern flash overexposes one frame","1.5s the beast shadow is already lying across the deck, static"]), 1-3 beats as content dictates, exempt from the mandatory three-beat rule; body-action shots still use wind-up -> drive -> settle;',
|
|
9109
|
+
'- **[VFX REQUIRED - FANTASY LEXICON] at least 1 vfx per shot: ambience - drifting light dust, rolling mist, heat-haze shimmer, leaves sucked upward; glow - faint object luminescence, runes igniting, vertical slit pupils; energy - qi halo orbiting the body, light-trail, particles condensing into form, beam strike, shockwave ripple, cracked ground and dust wave, flattened grass; transformations - one-frame lantern flash, black-frame jump, shadow-to-solid (a shadow rises into a body), solid-to-shadow, already-present (absent before the cut, present after), teleport afterimage; beasts - silhouette streak, partial reveal (horn/claw/eye/tail), scale reference (bucket/door frame/horse);',
|
|
9110
|
+
'- **[CHARACTER FX SIGNATURE - HARD] every character/beast that uses effects must carry in its bible desc "特效签名:colour + motif + particle texture" (e.g. 特效签名:青色流云纹真气,龙形招式,细雾粒子); if missing, update the bible first; whenever a shot involves that character, its vfx must quote the signature VERBATIM - colours/motifs must stay distinguishable between characters and never drift across shots;',
|
|
9111
|
+
'- **[SPEED IRON LAW - HARD] video models cannot act "fast": instantaneous events (a flash-past / teleport / appearance / vanishing) must NEVER be performed inside a shot; write them as state differences across a cut. Speed may come only from: (1) a hard-cut jump, (2) a still subject plus a sudden light change, (3) a whip pan with motion blur. Never write "streaks past at high speed" expecting the subject to move within the shot - use three shots: empty frame -> flash -> already there;',
|
|
9112
|
+
'- **[STATE_JUMP] `state_jump` segment type: absent before the cut / present after (lantern-flash reveal, a shadow already there, shadow-to-solid). Framing identical to the previous shot and locked; no tail (the tail state IS "fully present, static"). The fake-scene-change ban does not apply to state_jump - a fake scene change is a jump with no state change and no narrative purpose;',
|
|
9113
|
+
'- **[KEYFRAME TIP] for materialized-technique / transformation shots (dragon-shaped light, dharma form, shadow-to-solid) write vfx as a picture that could be generated directly as a keyframe still (composition + form + colour + particles); when expanding, prefer keyframe-then-video (hard first frame) for these shots;',
|
|
9114
|
+
]);
|
|
8951
9115
|
const jsonContract = zh
|
|
8952
9116
|
? [
|
|
8953
9117
|
'把剧本拆解为「按镜头切段生成」的分镜脚本:铺开时系统会按真实镜头边界把分镜切成若干次生成,每次只把本段的镜头写进同一条提示词,由视频模型生成那一段(镜头间由模型直接硬切,不是一镜一视频再拼接)。',
|
|
@@ -8955,10 +9119,10 @@ function queueThumb(assetId) {
|
|
|
8955
9119
|
'规则:',
|
|
8956
9120
|
'- visual 是本镜画面描述(景别、人物外观与站位、场景、光线、构图,60 字内);',
|
|
8957
9121
|
'- **visual 与 motion 里的角色/场景/道具必须写成 @资产名@ 引用形式**(前后各一个 @ 精确包裹,如「@陈拾@ 在 @城市街头@ 的围挡旁拿起 @奇怪快递件@」);名称必须与设定集/资产**逐字一致**;剧本原文里已出现的 @资产名@ 锚点要在镜头中原样保留(名称逐字一致);名称内不得含 @、空格或标点;@ 后绝不允许直接跟其他文字(必须以 @ 闭合)——系统会隐藏两个 @ 并把名称显示为蓝色加粗,未登记的 @名称@ 会被一致性检查提示补充;',
|
|
8958
|
-
'- motion 是本镜动作与运镜(主体动作节拍、机位运动方向与速度、情绪节奏,50 字内);与 visual
|
|
9122
|
+
'- motion 是本镜动作与运镜(主体动作节拍、机位运动方向与速度、情绪节奏,50 字内);与 visual 不重复;动作的承担者由画面内容决定——角色身体、特效、光影、环境物皆可(特效演绎项目见下方扩展条款);',
|
|
8959
9123
|
'- **【动作层次·硬性】timeBeats 是本镜的三个时间节拍(数组,按时间顺序)**:把"一个动作"拆成 **起势 → 发力 → 落点** 三拍,每拍写**可见的**身体/道具状态,如 ["0s 右手抬到一半、指节收紧","1.2s 手继续抬到胸口、肩线前压","3s 停在信封贴住心口、雨珠从指缝滑落"]。**只写一个节拍 = 模型只会演一个姿势(用户实测:动作极简、只会平移)**;凡 ≥2s 的镜头必须写满 3 拍,≤1s 的快切镜可以只写 1 拍。**每一拍都必须能拍出来,不写"他感到/他意识到"**;',
|
|
8960
9124
|
'- **camera 是本镜的机位/焦段/运镜三件套**(不是只写"推近/平移"):写成「景别 + 焦段光圈 + 运镜起点→终点」,如「中近景 50mm f/2.0,从腰高缓推至面部,匀速、到面部前 0.2 秒减速停住」。**禁止只写"推近/拉远/平移"这类空模板**(那是用户看到的"只会平移"的直接来源);**一镜只能有一个主运镜**,要两个就拆镜;',
|
|
8961
|
-
'- **vfx
|
|
9125
|
+
'- **vfx 是本镜必须可见的特效/细节**(不写就没有,模型不会自己加):按题材点名 1–3 项——雨丝斜打 / 尘粒在光柱中浮动 / 雪片近大远小 / 逆光镜头光斑 / 路灯钠黄溢光 / 闪电瞬时照亮 / 衣角被风掀起 / 水面涟漪扩散 / 纸张翻飞 / 轻微手持晃动 / 运动模糊拖影 / 烟雾弥漫 / 蒸汽升腾。写**可呈现的画面现象**,不写"画面很唯美"这类空话;**每场至少 3 镜要有 vfx**;',
|
|
8962
9126
|
'- **【色调·逐镜显式】把本镜色调写进 visual(主色/色温/明暗对比,按影调色彩命题取值,如「钠黄主光、青绿补色、高对比」)——色调是逐镜的画面事实,不得只写"电影感/有质感"这类空话**;',
|
|
8963
9127
|
'- characters/scene/props 使用剧本与设定集中的名称(不带 @),便于匹配资产;无道具给空数组;',
|
|
8964
9128
|
'- **dialogue 是本镜的角色台词**:把剧本中落在这一镜的对白逐行搬进来({"role":"角色名","line":"台词原文"}),台词必须**逐字来自剧本**、不新写不改写;本镜无台词给空数组;一镜尽量只放一个角色的台词(单说话人镜头利于声音参考提取);',
|
|
@@ -8973,13 +9137,13 @@ function queueThumb(assetId) {
|
|
|
8973
9137
|
'- **按情绪选景别**:孤独/绝望/宏大危机=远景;对峙/动作/关系建立=全景;对话/试探/信息交换=中景;震惊/怀疑/内心动摇=近景;崩溃/嘶吼/情绪爆发=特写;关键细节/道具揭示=大特写——冲突用全景、揭秘转近景、爆发给特写、反转可拉远,景别变化本身在讲情绪;',
|
|
8974
9138
|
'- **快切镜头(<1.5s)的 visual/motion 要极短**(一个动作、一句画内信息),信息量大的镜头才配长时长——时长与内容量必须匹配;',
|
|
8975
9139
|
'- 只输出 JSON,不要输出任何其他内容。',
|
|
8976
|
-
].concat(contOn ? [
|
|
9140
|
+
].concat(FX_RULES, contOn ? [
|
|
8977
9141
|
'',
|
|
8978
9142
|
'**【分镜衔接·硬性】成片是分段生成的,每段模型看不到上一段画面——衔接只能靠写在分镜里的"接点"。除末镜外,每镜都必须写 tail 与 cam:**',
|
|
8979
9143
|
'- **tail(接点尾态)**:本镜**最后一刻**的状态,一行写清——人物姿势停在哪个动作的中途、朝向、视线落点、手持物位置、位置关系(如「右手抬到胸口一半,视线仍锁在 @陈拾@ 脸上,@糯糯@ 停在他左后方半步」「已侧身转到 3/4 面,还没完全转身面对对方」)。**必须是"动作进行中"的状态,不能写成"已经完成/站定/看向"**——切点停在静止定格,下一镜就没有动作可接,接缝必然暴露;',
|
|
8980
9144
|
'- **cam(运镜延续)**:本镜运镜的方向与速度,写成下一镜可以直接"接着走"的形式(如「右移横移,匀速,未停」「缓推向面部,接近停住」);末镜写「收束静止」;**全片避免相邻镜反向运镜**(上一镜右移、下一镜突然左移 = 观众立刻感觉跳),需要反向时把切点设计成遮挡/过肩/特写插入;',
|
|
8981
9145
|
'- **start(仅第 1 镜或 seg 非续帧的镜头需要)**:本镜起始状态;续帧镜头不写 start(它会自动承接上一镜 tail);',
|
|
8982
|
-
'- **seg(段落类型)**:`continuation` 续帧(默认,绝大多数镜头)、`scene_change` 换场/切换地点时间、`new_character` 新角色首次出场、`closeup` 特写/细节插入(允许跳切)、`opening` 仅第 1
|
|
9146
|
+
'- **seg(段落类型)**:`continuation` 续帧(默认,绝大多数镜头)、`scene_change` 换场/切换地点时间、`new_character` 新角色首次出场、`closeup` 特写/细节插入(允许跳切)、`opening` 仅第 1 镜且无上游承接时、`state_jump` 同机位状态跳变(切前不在/切后在,如灯闪现身;仅特效演绎时使用);',
|
|
8983
9147
|
'- **一镜只做一个主动作**:转身、走路、推镜、换表情不要塞进同一镜——模型只会执行前半段,下一镜就对不上;',
|
|
8984
9148
|
'- **一段一运镜**:不要又推又横移又摇;',
|
|
8985
9149
|
'- **大位移拆镜**:人物横移超过画面 1/4、或场景大换位,就再拆一镜(用不同景别接,而不是一镜硬走);',
|
|
@@ -8991,10 +9155,10 @@ function queueThumb(assetId) {
|
|
|
8991
9155
|
'Rules:',
|
|
8992
9156
|
'- visual = the shot\'s frame description (shot size, wardrobe, staging, light, framing, <=60 words);',
|
|
8993
9157
|
'- **characters/scenes/props inside visual and motion must be written as @Name@ references** (an @ on each side, e.g. "@Chen@ picks up @Parcel@ by @Street@"); names must match the bible/assets VERBATIM, with no @, space or punctuation inside; an @ must never be followed directly by other text (always close with @) - the UI hides the @s and shows the name in blue bold; unregistered @Name@ is flagged by the consistency check;',
|
|
8994
|
-
'- motion = action & camera for the shot (action beats, camera move, emotional rhythm, <=50 words); do not repeat visual;',
|
|
9158
|
+
'- motion = action & camera for the shot (action beats, camera move, emotional rhythm, <=50 words); do not repeat visual; what carries the motion is decided by the picture - the body, an effect, light or the environment are all valid (FX projects: see the extension clauses below);',
|
|
8995
9159
|
'- **[ACTION LAYERING - HARD] timeBeats is this shot\'s three time beats (array, in order)**: split "one action" into **wind-up -> drive -> settle**, each beat describing a VISIBLE body/prop state, e.g. ["0s right hand half-way up, knuckles tightening","1.2s hand reaches the chest, shoulder line pressing forward","3s it settles over the envelope, a raindrop sliding off the fingers"]. **A single beat means the model performs a single pose (measured user feedback: minimal motion, pan-only)**; any shot >=2s must carry 3 beats, rapid cuts <=1s may carry 1. **Every beat must be filmable - never "he feels / he realizes"**;',
|
|
8996
9160
|
'- **camera = body/lens/move for this shot** (not just "push in / pan"): write "shot size + focal length & aperture + move start->end", e.g. "medium close-up 50mm f/2.0, slow push from waist height to the face, constant speed, decelerating to a stop 0.2s before the face". **Never use empty template verbs like push in / pull out / pan alone** (that is exactly what produces the "pan-only" result); **one primary camera move per shot** - if you need two, split the shot;',
|
|
8997
|
-
'- **vfx = physical effects/details that must be visible in this shot** (if unwritten they simply do not exist; the model will not add them): name 1-3 per shot by genre - slanted rain / dust motes floating in a light shaft / snowflakes near-to-far / backlit lens flare / sodium-vapour streetlamp spill / lightning flash lighting the set / coat hem lifted by wind / ripples spreading on water / paper sheets tumbling / subtle handheld shake / motion-blur trails / drifting smoke / rising steam. Write **
|
|
9161
|
+
'- **vfx = physical effects/details that must be visible in this shot** (if unwritten they simply do not exist; the model will not add them): name 1-3 per shot by genre - slanted rain / dust motes floating in a light shaft / snowflakes near-to-far / backlit lens flare / sodium-vapour streetlamp spill / lightning flash lighting the set / coat hem lifted by wind / ripples spreading on water / paper sheets tumbling / subtle handheld shake / motion-blur trails / drifting smoke / rising steam. Write **renderable picture phenomena**, never "a beautiful frame"; **at least 3 shots per scene must carry vfx**;',
|
|
8998
9162
|
'- **[TONE - PER SHOT] write this shot\'s dominant colour / colour temperature / contrast into visual per the look\'s colour thesis (e.g. "sodium-amber key, teal fill, high contrast") - tone is a per-shot fact, never just "cinematic"**;',
|
|
8999
9163
|
'- characters/scene/props arrays must use plain names from the script and series bible (no @) so assets match; empty props array if none;',
|
|
9000
9164
|
'- **dialogue = the character lines that fall in this shot**, moved verbatim from the script ({"role":"Name","line":"exact line"}); never rewrite lines; empty array if none; keep one speaker per shot when possible (helps voice-reference extraction);',
|
|
@@ -9009,13 +9173,13 @@ function queueThumb(assetId) {
|
|
|
9009
9173
|
'- **Pick the shot size by emotion**: loneliness/despair/grand crisis = wide; confrontation/action/relationship = full; dialogue/probing/info exchange = medium; shock/suspicion/inner shake = close-up; breakdown/screaming/emotional burst = extreme close-up; key detail/prop reveal = big close-up — conflicts play wide, reveals move close, bursts go extreme, reversals can pull wide; the changing distance itself tells the emotion;',
|
|
9010
9174
|
'- **Rapid cuts (<1.5s) get minimal visual/motion** (one action, one piece of in-frame information); long durations are earned by information density — duration must match content;',
|
|
9011
9175
|
'- Output JSON only.',
|
|
9012
|
-
].concat(contOn ? [
|
|
9176
|
+
].concat(FX_RULES, contOn ? [
|
|
9013
9177
|
'',
|
|
9014
9178
|
'**[CONTINUITY - HARD] the film is generated in segments and each segment cannot see the previous one, so the "hand-off point" must be written into the storyboard. Every shot except the last MUST carry tail and cam:**',
|
|
9015
9179
|
'- **tail (hand-off tail state)**: the state at the LAST instant of this shot, in one line - where the posture stops mid-motion, facing, gaze target, hand/prop position, blocking (e.g. "right hand half-way up to the chest, eyes still locked on @Chen@, @Nuonuo@ half a step behind his left shoulder"). It MUST be a mid-motion state, never a settled/completed pose: a cut on a static freeze leaves nothing for the next shot to continue, which is exactly what makes the seam visible;',
|
|
9016
9180
|
'- **cam (camera carry-over)**: the move direction and speed of this shot, written so the next shot can continue it (e.g. "lateral right, constant speed, never stops"; "slow push-in, almost settled"). Last shot: "settle to static". Avoid reversing direction on adjacent shots (right pan then sudden left pan reads as a jump); if you need a reversal, make the cut a wipe/over-shoulder/insert close-up;',
|
|
9017
9181
|
'- **start**: the start state, needed only for shot 1 or shots whose seg is not a continuation; continuation shots omit it (they inherit the previous tail);',
|
|
9018
|
-
'- **seg (segment type)**: `continuation` (default, most shots), `scene_change` (new place/time), `new_character` (a character appears for the first time), `closeup` (insert/detail, jump cut allowed), `opening` (only shot 1 with no upstream continuation);',
|
|
9182
|
+
'- **seg (segment type)**: `continuation` (default, most shots), `scene_change` (new place/time), `new_character` (a character appears for the first time), `closeup` (insert/detail, jump cut allowed), `opening` (only shot 1 with no upstream continuation), `state_jump` (same-framing state jump: absent before the cut / present after, e.g. a lantern-flash reveal; FX projects only);',
|
|
9019
9183
|
'- **one primary action per shot**: never pack a turn + walk + push-in + expression change into one shot - the model only executes the first half and the next shot cannot match it;',
|
|
9020
9184
|
'- **one camera move per shot**;',
|
|
9021
9185
|
'- **split big displacements**: if a character crosses more than 1/4 of the frame, or the staging changes a lot, break it into another shot (different shot size) instead of one long move;',
|
|
@@ -9927,6 +10091,12 @@ function queueThumb(assetId) {
|
|
|
9927
10091
|
};
|
|
9928
10092
|
return map[c] || c;
|
|
9929
10093
|
}
|
|
10094
|
+
/** 资产分类归一(纯函数供回归):「图片」分类已移除——角色/道具/场景本来就是图片,
|
|
10095
|
+
* 其余一律归「通用」。历史已标 image 的资产在展示/过滤/搜索层归一,不迁移数据库。 */
|
|
10096
|
+
function normCat(c) {
|
|
10097
|
+
const v = String(c || '').trim();
|
|
10098
|
+
return !v || v === 'image' ? 'general' : v;
|
|
10099
|
+
}
|
|
9930
10100
|
function portWorldPos(nodeId, portId, dir) {
|
|
9931
10101
|
const n = S.graph.nodes[nodeId];
|
|
9932
10102
|
if (!n) return { x: 0, y: 0 };
|
|
@@ -10033,6 +10203,14 @@ function queueThumb(assetId) {
|
|
|
10033
10203
|
? '标注「台词」的对白必须由**画面内可见的角色当场开口说出**(口型与台词同步、语气贴合情绪、面部朝镜头可见);严禁处理成画外音/旁白;同步音频开启时按台词生成人声。'
|
|
10034
10204
|
: 'Dialogue must be SPOKEN ON SCREEN by the visible character (lip-synced to the line, matching emotion, face toward camera); never render it as voice-over/narration; generate speech when synced audio is on.');
|
|
10035
10205
|
}
|
|
10206
|
+
// 状态跳变段(奇幻特效叙事):镜头之间是"状态硬切"——后一镜的主体/特效在第 1 帧已完整在场。
|
|
10207
|
+
// 负向词里的"凭空出现"对这类段不适用,替换为更精确的禁令(见下方 negation 组装)。
|
|
10208
|
+
const hasStateJump = shots.some((s) => String(s.seg || '').trim().toLowerCase() === 'state_jump');
|
|
10209
|
+
if (hasStateJump) {
|
|
10210
|
+
lines.push(zh
|
|
10211
|
+
? '本段含同机位状态跳变镜:跳变靠**硬切**呈现——跳变镜的主体/特效在第 1 帧就已完整在场(静止),前后镜之间不演出任何进入/飞入/移动/凝聚的中间过程;运动可以由特效承担,人物/生物本体允许全程静止。'
|
|
10212
|
+
: 'This segment contains same-framing state-jump shots: the jump is a HARD CUT - in a jump shot the subject/effect is already fully present and STATIC in frame 1; no entrance/fly-in/movement/condensation is ever animated in between; motion may be carried by the effect while the character/creature body stays still.');
|
|
10213
|
+
}
|
|
10036
10214
|
shots.forEach((s, i) => {
|
|
10037
10215
|
const dur = durOf(s);
|
|
10038
10216
|
const parts = [];
|
|
@@ -10046,7 +10224,7 @@ function queueThumb(assetId) {
|
|
|
10046
10224
|
const cam = String(s.camera || '').trim();
|
|
10047
10225
|
if (cam) parts.push((zh ? '机位/焦段/运镜' : 'Camera/lens/move') + ':' + cam);
|
|
10048
10226
|
const vfx = String(s.vfx || '').trim();
|
|
10049
|
-
if (vfx) parts.push((zh ? '
|
|
10227
|
+
if (vfx) parts.push((zh ? '特效(必须可见)' : 'VFX (must be visible)') + ':' + vfx);
|
|
10050
10228
|
const dls = (s.dialogue || []).map((d) => String(d && d.role || '').trim() + ':' + String(d && d.line || '').trim()).filter((x) => x.replace(':', '').trim());
|
|
10051
10229
|
if (dls.length) {
|
|
10052
10230
|
parts.push(zh
|
|
@@ -10056,14 +10234,21 @@ function queueThumb(assetId) {
|
|
|
10056
10234
|
if (String(s.sfx || '').trim()) parts.push((zh ? '音效:' : 'SFX: ') + String(s.sfx).trim());
|
|
10057
10235
|
lines.push((zh ? `镜头${i + 1}(${dur}s):` : `Shot ${i + 1} (${dur}s): `) + parts.join(zh ? ';' : '; '));
|
|
10058
10236
|
});
|
|
10059
|
-
//
|
|
10237
|
+
// 段级负向要求:模型默认会漂移、穿模、闪烁,不点名就一定会出现。
|
|
10238
|
+
// 含状态跳变镜的段:「凭空出现」恰好是这类段要的效果,替换为更精确的禁令。
|
|
10060
10239
|
const negAll = shots.map((s) => String(s.negative || '').trim()).filter(Boolean);
|
|
10061
10240
|
const negLine = negAll.length
|
|
10062
10241
|
? [...new Set(negAll.join('、').split(/[、,,;;]/).map((x) => x.trim()).filter(Boolean))].join('、')
|
|
10063
10242
|
: '';
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10243
|
+
if (hasStateJump) {
|
|
10244
|
+
lines.push(zh
|
|
10245
|
+
? '禁止:换脸、五官漂移、服装变化、手部畸形、多指、穿模、画面闪烁、风格突变、动作僵硬、口型与台词不同步、主体未在首帧完整在场、主体缓慢走入或移入画面、跳变过程被演成动画' + (negLine ? '、' + negLine : '') + '。'
|
|
10246
|
+
: 'Never: face swap, facial drift, wardrobe change, deformed hands, extra fingers, clipping, flicker, style jump, stiff motion, lip-sync mismatch, subject not fully present in frame 1, subject walking or drifting slowly into frame, the jump animated as a morph' + (negLine ? ', ' + negLine : '') + '.');
|
|
10247
|
+
} else {
|
|
10248
|
+
lines.push(zh
|
|
10249
|
+
? '禁止:换脸、五官漂移、服装变化、手部畸形、多指、穿模、画面闪烁、风格突变、动作僵硬、人物凭空出现或消失、口型与台词不同步' + (negLine ? '、' + negLine : '') + '。'
|
|
10250
|
+
: 'Never: face swap, facial drift, wardrobe change, deformed hands, extra fingers, clipping, flicker, style jump, stiff motion, characters popping in or out, lip-sync mismatch' + (negLine ? ', ' + negLine : '') + '.');
|
|
10251
|
+
}
|
|
10067
10252
|
return lines.join('\n');
|
|
10068
10253
|
}
|
|
10069
10254
|
function resolvePrompt(n) {
|
|
@@ -10264,11 +10449,11 @@ function queueThumb(assetId) {
|
|
|
10264
10449
|
// 先自动补录缺失条目(空描述),再算一致性告警:否则告警标志的条目其实马上就被自动补录了,"未登记"语义会误导用户与对话侧
|
|
10265
10450
|
try { await autoRegisterBibleEntries(shots); } catch { /* 补录失败不影响分镜 */ }
|
|
10266
10451
|
const warnings = await checkShotConsistency(shots);
|
|
10267
|
-
//
|
|
10268
|
-
//
|
|
10269
|
-
|
|
10270
|
-
if (
|
|
10271
|
-
warnings.push(T('
|
|
10452
|
+
// 容量告警:按**实际生成的镜头数**判断(MAX_STORYBOARD_SHOTS,与生成端解析/UI 自定义输入一致)。
|
|
10453
|
+
// 字数与镜头数没有换算关系——914 字的单场剧本正常产出 9~15 镜;旧口径按剧本字数(>600 字)
|
|
10454
|
+
// 判容量,特效分镜镜头写得更详细后每场都超,是纯误报,已废弃。时长本身不设上限,不做压缩。
|
|
10455
|
+
if (shots.length > MAX_STORYBOARD_SHOTS) {
|
|
10456
|
+
warnings.push(T('warnShotsOverCapacity').replace('{n}', String(shots.length)));
|
|
10272
10457
|
}
|
|
10273
10458
|
update((s) => {
|
|
10274
10459
|
const nd = s.graph.nodes[n.id];
|
|
@@ -10423,7 +10608,14 @@ function queueThumb(assetId) {
|
|
|
10423
10608
|
const cases = [];
|
|
10424
10609
|
for (let i = 0; i < want; i++) {
|
|
10425
10610
|
if (want > 1) update((s) => { const nd = s.graph.nodes[n.id]; if (nd) nd.data.progress = (i + 1) + '/' + want; });
|
|
10426
|
-
const blob = await apiImage(p, metas, mcfg, {
|
|
10611
|
+
const blob = await apiImage(p, metas, mcfg, {
|
|
10612
|
+
size: n.data.size, ratio: n.data.ratio, nodeExtra: n.data.imgExtra, warn: addWarn,
|
|
10613
|
+
// 任务式厂商(三宝图片):任务 id 就是凭证——代理超时/页面关闭后仍可凭 id 回查(与视频同口径)
|
|
10614
|
+
onTask: (tid, qurl) => {
|
|
10615
|
+
update((s) => { const nd = s.graph.nodes[n.id]; if (nd) { nd.data.taskId = String(tid || ''); nd.data.taskQueryUrl = String(qurl || ''); } });
|
|
10616
|
+
flushSave();
|
|
10617
|
+
},
|
|
10618
|
+
});
|
|
10427
10619
|
const rec = await saveAssetRecord(S.activeId, 'image', blob, {
|
|
10428
10620
|
name: assetNameFor(n, entities, 'image'),
|
|
10429
10621
|
prompt: stripMentionMarks(prompt), effectivePrompt: p,
|
|
@@ -10531,7 +10723,16 @@ function queueThumb(assetId) {
|
|
|
10531
10723
|
} else if (plan.seg === 'scene_change') {
|
|
10532
10724
|
bits.push(zh ? '本段换场:不承接上一段画面,但环境声/情绪可延续' : 'Scene change: do not continue the previous frame; ambience and mood may carry over');
|
|
10533
10725
|
} else if (plan.seg === 'new_character') {
|
|
10534
|
-
|
|
10726
|
+
// 特效入场(灯闪现身/影子凝聚/影化实)合法:首镜 vfx/start 写明特效进入时不逼"走入"
|
|
10727
|
+
const fxEntry = /凝聚|凭空|灯闪|黑场|影子|化实|现身|浮现/.test(
|
|
10728
|
+
String(st.vfx || '') + String(st.start || '') + String(st.visual || '') + String(st.motion || ''));
|
|
10729
|
+
bits.push(zh
|
|
10730
|
+
? (fxEntry
|
|
10731
|
+
? '本段有新角色入场(特效进入):灯闪/黑场后已在场、从影子凝聚立起、浮现成形——不得缓慢走入'
|
|
10732
|
+
: '本段有新角色入场:新角色必须从画面内自然进入(走入/被带入),不得凭空出现')
|
|
10733
|
+
: (fxEntry
|
|
10734
|
+
? 'A new character enters via an effect: already there after a flash/black frame, rises from a shadow, condenses into form - never walks in slowly'
|
|
10735
|
+
: 'A new character enters: they must enter naturally from within the frame, never pop in'));
|
|
10535
10736
|
}
|
|
10536
10737
|
return bits.join(zh ? ';' : '; ');
|
|
10537
10738
|
})();
|
|
@@ -10618,33 +10819,38 @@ function queueThumb(assetId) {
|
|
|
10618
10819
|
} catch { /* 探测失败不影响生成 */ }
|
|
10619
10820
|
// 尾帧抽取(续帧接力的关键):末段多帧候选里选「动作进行中/清晰/不抖」的一帧,
|
|
10620
10821
|
// 而不是机械取最后一帧(最后一帧常在动作顶点/模糊/抖动上)。
|
|
10822
|
+
// 【单一所有者】入库前先写 tailPending 占位(封锁媒体节点体的兜底提取 effect):
|
|
10823
|
+
// 两条管线曾各自入库,一次生成冒出两张相同尾帧 + 一张最佳帧 = 三张尾帧资产。
|
|
10621
10824
|
try {
|
|
10825
|
+
update((s) => { const nd = s.graph.nodes[n.id]; if (nd) nd.data.tailPending = rec.id; });
|
|
10622
10826
|
const tail = await extractTailFrames(blob, { count: 9, span: 0.8 });
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10827
|
+
const dec = tailFrameDecision(tail);
|
|
10828
|
+
if (dec && dec.blob) {
|
|
10829
|
+
const recT = await saveAssetRecord(S.activeId, 'image', dec.blob, {
|
|
10830
|
+
name: (dec.isPick ? T('tailPick') : T('lastFrame')) + '-' + (n.data.label || n.id.slice(-4)),
|
|
10831
|
+
prompt: (dec.isPick ? 'continuity tail pick t=' + Number(dec.t).toFixed(2) + 's; ' : 'last frame of ') + prompt.slice(0, 60),
|
|
10832
|
+
source: 'api', category: 'image',
|
|
10627
10833
|
});
|
|
10628
|
-
// 最佳选帧单独存一份(last 口保持"真·最后一帧"语义,接力用"最佳帧")
|
|
10629
|
-
let pickRec = null;
|
|
10630
|
-
if (tail.best && tail.best !== tail.last) {
|
|
10631
|
-
pickRec = await saveAssetRecord(S.activeId, 'image', tail.best, {
|
|
10632
|
-
name: T('tailPick') + '-' + (n.data.label || n.id.slice(-4)),
|
|
10633
|
-
prompt: 'continuity tail pick t=' + Number(tail.bestT || 0).toFixed(2) + 's; ' + prompt.slice(0, 40),
|
|
10634
|
-
source: 'api', category: 'image',
|
|
10635
|
-
});
|
|
10636
|
-
}
|
|
10637
10834
|
update((s) => {
|
|
10638
10835
|
const nd = s.graph.nodes[n.id];
|
|
10639
10836
|
if (nd) {
|
|
10640
|
-
|
|
10641
|
-
nd.data.
|
|
10642
|
-
nd.data.
|
|
10837
|
+
// 一张尾帧服务两个口:last / tailpick 指向同一资产(自动续帧与手动连线都优先 tailpick)
|
|
10838
|
+
nd.data.lastAssetId = recT.id;
|
|
10839
|
+
nd.data.lastPickAssetId = recT.id;
|
|
10840
|
+
nd.data.lastAssetVideo = rec.id;
|
|
10841
|
+
nd.data.tailPickMeta = { t: Number(dec.t) || 0, score: Math.round((Number(dec.score) || 0) * 100) / 100 };
|
|
10842
|
+
nd.data.tailPending = null;
|
|
10643
10843
|
}
|
|
10644
10844
|
s.assetsTick++;
|
|
10645
10845
|
});
|
|
10646
10846
|
}
|
|
10647
|
-
} catch {
|
|
10847
|
+
} catch {
|
|
10848
|
+
// 抽帧/入库失败:解锁占位,让媒体节点体的兜底提取可以重试(外部导入视频仍走兜底)
|
|
10849
|
+
update((s) => {
|
|
10850
|
+
const nd = s.graph.nodes[n.id];
|
|
10851
|
+
if (nd && nd.data.tailPending === rec.id && nd.data.lastAssetVideo !== rec.id) nd.data.tailPending = null;
|
|
10852
|
+
});
|
|
10853
|
+
}
|
|
10648
10854
|
// 接缝校验:本段首帧 vs 上一段尾帧(续帧段才有意义)。不达标 → 节点上可见告警(不静默)
|
|
10649
10855
|
if (useFrame && plan.chain) {
|
|
10650
10856
|
try {
|
|
@@ -12687,10 +12893,13 @@ function queueThumb(assetId) {
|
|
|
12687
12893
|
* 空节点不放任何生成按钮(生成动作在 GenComposer 的发送按钮)。点击节点任意位置打开面板。 */
|
|
12688
12894
|
function MediaNodeBodyInner({ n, kind, refSig }) {
|
|
12689
12895
|
void refSig;
|
|
12690
|
-
// 视频产物自动提取尾帧(含外部注入/导入的视频):last 口与跨镜衔接不依赖"必须由本节点生成"
|
|
12896
|
+
// 视频产物自动提取尾帧(含外部注入/导入的视频):last 口与跨镜衔接不依赖"必须由本节点生成"。
|
|
12897
|
+
// 【守卫】lastAssetVideo 匹配 = 本节点已登记这条视频(生成管线独占负责,见 tailPending 占位);
|
|
12898
|
+
// tailPending 匹配 = 生成管线正在抽帧入库——两者都跳过,绝不与生成路径重复入库。
|
|
12691
12899
|
useEffect(() => {
|
|
12692
12900
|
if (kind !== 'video' || !n.data.assetId) return;
|
|
12693
|
-
if (n.data.
|
|
12901
|
+
if (n.data.lastAssetVideo === n.data.assetId) return;
|
|
12902
|
+
if (n.data.tailPending === n.data.assetId) return;
|
|
12694
12903
|
let cancelled = false;
|
|
12695
12904
|
(async () => {
|
|
12696
12905
|
try {
|
|
@@ -14466,6 +14675,29 @@ function queueThumb(assetId) {
|
|
|
14466
14675
|
return PACK_MANIFEST;
|
|
14467
14676
|
}
|
|
14468
14677
|
|
|
14678
|
+
/** 项目是否开启「特效演绎」(fx_motion):任一所选题材/影调卡的 frontmatter 带 fx_motion: true。
|
|
14679
|
+
* 开启后分镜契约追加特效演绎扩展块(动作承担者中立 / 画面状态节拍 / 奇幻特效词表 / state_jump /
|
|
14680
|
+
* 速度铁律 / 关键帧建议)。未配置技能包或卡未标记 → false(写实项目行为完全不变)。 */
|
|
14681
|
+
async function fxMotionEnabledFor(pid) {
|
|
14682
|
+
const id = pid || S.activeId;
|
|
14683
|
+
if (!id) return false;
|
|
14684
|
+
const manifest = await loadPackManifest();
|
|
14685
|
+
if (!manifest) return false;
|
|
14686
|
+
const profile = loadSkillProfile(id);
|
|
14687
|
+
const picks = [];
|
|
14688
|
+
if (profile.lens) picks.push(['lens', profile.lens, 'lenses']);
|
|
14689
|
+
for (const g of (profile.genres || [])) picks.push(['genre', g, 'genres']);
|
|
14690
|
+
if (profile.form) picks.push(['form', profile.form, 'forms']);
|
|
14691
|
+
if (profile.look) picks.push(['look', profile.look, 'looks']);
|
|
14692
|
+
for (const [layer, cardId, listKey] of picks) {
|
|
14693
|
+
const entry = (manifest[listKey] || []).find((x) => x.id === cardId);
|
|
14694
|
+
if (!entry) continue;
|
|
14695
|
+
const md = await readPackCard(layer, entry.file);
|
|
14696
|
+
if (md && /(^|\n)\s*fx_motion:\s*true\s*(\n|$)/.test(md)) return true;
|
|
14697
|
+
}
|
|
14698
|
+
return false;
|
|
14699
|
+
}
|
|
14700
|
+
|
|
14469
14701
|
/** 按层+id 读一张卡的 markdown(缓存)。 */
|
|
14470
14702
|
async function readPackCard(layer, file) {
|
|
14471
14703
|
const key = layer + '/' + file;
|
|
@@ -14593,6 +14825,11 @@ function queueThumb(assetId) {
|
|
|
14593
14825
|
});
|
|
14594
14826
|
const KIND = { script: ['剧本', 'script'], storyboard: ['分镜', 'storyboard'], prompt: ['提示词', 'prompt'], assets: ['资产设定图', 'asset sheet'] };
|
|
14595
14827
|
const kl = (KIND[kind] || [kind])[zh ? 0 : 1];
|
|
14828
|
+
// 剧本能力切片的总纲:机制库条目 = 可自由组合的零件,绝不规定唯一走向;
|
|
14829
|
+
// 素材优先级:已有小说/剧本原文与设定集 > 题材素材库(库条目供二次创作借形)。
|
|
14830
|
+
const scriptDoctrine = zh
|
|
14831
|
+
? '【机制与素材】题材卡的机制库条目是可自由组合的零件:按当下故事的需要选择、改造、混搭或不用,事件与走向由剧本决定,条目绝不规定唯一走向,也绝不要求"用某设定就必须叠加某机制"。【素材优先级】已有小说/剧本原文与设定集设定 > 题材素材库:库条目仅供二次创作借形,绝不替代或改写既有设定。风格基调与导演运镜始终有效。'
|
|
14832
|
+
: '[Mechanics & material] Genre mechanism entries are freely combinable parts: pick, adapt, mix or skip per the story at hand - events and direction belong to the script, entries never mandate a single direction, and no entry implies "use X therefore Y". [Material precedence] Existing novel/script text and the series bible outrank the genre library: library entries are optional shapes for adaptation, never replacements for established settings. Style and camera direction always apply.';
|
|
14596
14833
|
if (zh) {
|
|
14597
14834
|
return [
|
|
14598
14835
|
'【画布技能包 · ' + kl + '】',
|
|
@@ -14601,6 +14838,7 @@ function queueThumb(assetId) {
|
|
|
14601
14838
|
+ ' 规格:' + (nameOf('forms', profile.form) || '未选')
|
|
14602
14839
|
+ ' 影调:' + (profile.look ? nameOf('looks', profile.look) : '跟随导演'),
|
|
14603
14840
|
'优先级:用户显式指令 > 导演透镜 > 规格(仅单镜时长与结构上压过透镜;画幅由视频节点生成时决定,不在此列)> 题材 > 影调。以下为对应切片,写提示词时按它执行;与本块冲突的通用规则让位于本块。',
|
|
14841
|
+
...(kind === 'script' ? [scriptDoctrine] : []),
|
|
14604
14842
|
].join('\n');
|
|
14605
14843
|
}
|
|
14606
14844
|
return [
|
|
@@ -14610,6 +14848,7 @@ function queueThumb(assetId) {
|
|
|
14610
14848
|
+ ' Spec: ' + (nameOf('forms', profile.form) || 'none')
|
|
14611
14849
|
+ ' Look: ' + (profile.look ? nameOf('looks', profile.look) : 'follow the lens'),
|
|
14612
14850
|
'Precedence: explicit user instruction > director lens > spec (clip length and structure only; aspect is set on the video node) > genre > look. The slices below are binding; generic rules that disagree give way.',
|
|
14851
|
+
...(kind === 'script' ? [scriptDoctrine] : []),
|
|
14613
14852
|
].join('\n');
|
|
14614
14853
|
}
|
|
14615
14854
|
|
|
@@ -14820,6 +15059,10 @@ function queueThumb(assetId) {
|
|
|
14820
15059
|
if (md) addNegs(P.negativePhrases(md));
|
|
14821
15060
|
}
|
|
14822
15061
|
if (negs.length) push('必须排除:', negs.slice(0, 6).join(', '));
|
|
15062
|
+
// 特效演绎项目(fx_motion 卡):注入速度铁律——与分镜契约同口径,锁住"模型演快必变慢走"的失败形态
|
|
15063
|
+
if (await fxMotionEnabledFor(pid)) {
|
|
15064
|
+
push('速度与特效:', '瞬时事件(一闪/瞬移/现身)=切点两侧的状态差;速度感只来自硬切、静止主体+光效突变、甩镜;禁止镜内高速位移。');
|
|
15065
|
+
}
|
|
14823
15066
|
|
|
14824
15067
|
if (!parts.length) return '';
|
|
14825
15068
|
const head = '[全片风格锚] 以下为全片级总控;逐镜画面与动作以正文为准:';
|
|
@@ -18107,7 +18350,10 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18107
18350
|
if (a.kind === 'text') {
|
|
18108
18351
|
const c = worldCenter();
|
|
18109
18352
|
const nd = addNodeAt('text', { x: c.x - 120, y: c.y - 60 });
|
|
18110
|
-
update((s) => {
|
|
18353
|
+
update((s) => {
|
|
18354
|
+
const n2 = s.graph.nodes[nd.id];
|
|
18355
|
+
if (n2) { n2.data.text = a.text || ''; n2.data.label = a.name || n2.data.label; } // 节点名 = 资产名
|
|
18356
|
+
});
|
|
18111
18357
|
return;
|
|
18112
18358
|
}
|
|
18113
18359
|
const c = worldCenter();
|
|
@@ -18115,7 +18361,7 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18115
18361
|
const n = addNodeAt(type, { x: c.x + (Math.random() * 60 - 30), y: c.y + (Math.random() * 60 - 30) });
|
|
18116
18362
|
update((s) => {
|
|
18117
18363
|
const nd = s.graph.nodes[n.id];
|
|
18118
|
-
if (nd) { nd.data.assetId = a.id; nd.data.status = 'done'; }
|
|
18364
|
+
if (nd) { nd.data.assetId = a.id; nd.data.status = 'done'; nd.data.label = a.name || nd.data.label; } // 节点名 = 资产名
|
|
18119
18365
|
});
|
|
18120
18366
|
};
|
|
18121
18367
|
const changeCategory = (a, category) => {
|
|
@@ -18130,13 +18376,22 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18130
18376
|
let failed = 0;
|
|
18131
18377
|
for (const f of files) {
|
|
18132
18378
|
const kind = f.type.startsWith('video/') ? 'video' : f.type.startsWith('image/') ? 'image' : null;
|
|
18133
|
-
if (!kind) continue;
|
|
18134
18379
|
try {
|
|
18135
|
-
|
|
18380
|
+
// 文本(.txt/.md):入库为文本资产(名称=文件名去扩展名,分类=剧本,归属=当前项目)——
|
|
18381
|
+
// 多集小说/剧本一键导入,入库后在资产面板多选批量铺画布(text 节点可直接连分镜表当剧本源)
|
|
18382
|
+
if (!kind && /\.(txt|md|markdown)$/i.test(f.name)) {
|
|
18383
|
+
const text = await f.text();
|
|
18384
|
+
await saveTextAssetRecord(S.activeId, {
|
|
18385
|
+
name: f.name.replace(/\.(txt|md|markdown)$/i, ''),
|
|
18386
|
+
text, category: 'script', source: 'upload',
|
|
18387
|
+
});
|
|
18388
|
+
} else if (kind) {
|
|
18389
|
+
await saveAssetRecord(S.activeId, kind, f, { name: f.name, source: 'upload', category: 'general' });
|
|
18390
|
+
} else { continue; }
|
|
18136
18391
|
} catch { failed++; } // 单个失败不影响其余文件
|
|
18137
18392
|
}
|
|
18138
18393
|
if (failed) toast(T('uploadFailed') + '(' + failed + '/' + files.length + ')');
|
|
18139
|
-
if (files.length) bumpView();
|
|
18394
|
+
if (files.length) { bumpView(); update((s) => { s.assetsTick++; }); }
|
|
18140
18395
|
};
|
|
18141
18396
|
const del = async (a) => {
|
|
18142
18397
|
// 服务端删除(SQL:行 + FTS + CAS 引用计数;JSON:文件 + assets.json),随后清本地缓存
|
|
@@ -18187,6 +18442,7 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18187
18442
|
const nd = newNode(a.kind === 'text' ? 'text' : a.kind, pts[k]);
|
|
18188
18443
|
if (a.kind === 'text') nd.data.text = a.text || '';
|
|
18189
18444
|
else { nd.data.assetId = a.id; nd.data.status = 'done'; }
|
|
18445
|
+
nd.data.label = a.name || nd.data.label; // 节点名 = 资产名(不再叫 图片1/视频2/文本1)
|
|
18190
18446
|
s.graph.nodes[nd.id] = nd;
|
|
18191
18447
|
newIds.push(nd.id);
|
|
18192
18448
|
});
|
|
@@ -18234,11 +18490,14 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18234
18490
|
toast(T('craftSyncDone').replace('{ok}', String(okN)).replace('{fail}', String(failN)));
|
|
18235
18491
|
};
|
|
18236
18492
|
const filtered = assets.filter((a) => {
|
|
18237
|
-
|
|
18238
|
-
|
|
18493
|
+
// 严格项目隔离:scope=具体项目 → 只见该项目资产;通用项目(GENERAL_PID)资产不再
|
|
18494
|
+
// 混入其他项目(旧口径"通用资产多项目共享"改为显式——要看通用资产请把 scope 切到
|
|
18495
|
+
// 「通用项目」或「全部」;跨项目取素材的功能面(@引用/设定集绑定)不受影响)。
|
|
18496
|
+
if (scope !== 'all' && a.projectId !== scope) return false;
|
|
18497
|
+
if (filter !== 'all' && normCat(a.category) !== filter) return false;
|
|
18239
18498
|
if (!q) return true;
|
|
18240
18499
|
const hay = [
|
|
18241
|
-
a.name, a.prompt || '', a.text || '', catLabel(a.category
|
|
18500
|
+
a.name, a.prompt || '', a.text || '', catLabel(normCat(a.category)),
|
|
18242
18501
|
projectName(a.projectId), a.kind === 'image' ? T('kindImage') : a.kind === 'video' ? T('kindVideo') : 'text',
|
|
18243
18502
|
].join(' ').toLowerCase();
|
|
18244
18503
|
return hay.includes(q);
|
|
@@ -18268,18 +18527,24 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18268
18527
|
onClick: () => setFilter(c.id),
|
|
18269
18528
|
}, c.label)),
|
|
18270
18529
|
),
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
-
|
|
18282
|
-
|
|
18530
|
+
// 搜索行:搜索框(≈2/3,右侧内嵌放大镜)+ 项目选择(≈1/3)同行;窄窗口自动换行
|
|
18531
|
+
h('div', { key: 'searchrow', className: 'dshic-asset-searchrow', 'data-role': 'assets-searchrow' },
|
|
18532
|
+
h('div', { className: 'dshic-asset-search' },
|
|
18533
|
+
h('input', {
|
|
18534
|
+
className: 'dshic-input', value: search,
|
|
18535
|
+
placeholder: T('searchLabel'),
|
|
18536
|
+
onChange: (e) => setSearch(e.target.value),
|
|
18537
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
18538
|
+
}),
|
|
18539
|
+
h('span', { className: 'dshic-search-ic', 'aria-hidden': 'true' }, Ic('search', 12))),
|
|
18540
|
+
h('div', { className: 'dshic-asset-scope' },
|
|
18541
|
+
h(MiniSelect, {
|
|
18542
|
+
value: scope, title: T('projectFilter'),
|
|
18543
|
+
options: [{ value: 'all', label: T('allProjects') }, { value: GENERAL_PID, label: T('generalProject') }]
|
|
18544
|
+
.concat(S.projects.map((p) => ({ value: p.id, label: p.name }))),
|
|
18545
|
+
onChange: (v) => setScope(v),
|
|
18546
|
+
})),
|
|
18547
|
+
),
|
|
18283
18548
|
// 工具栏(项目下一行):所有操作按钮 + 分页集中在一行,窄窗口自动换行、分页始终靠右。
|
|
18284
18549
|
// 按钮统一「透明底 + 1px 线框 + 文字」(UI-RULES:禁止灰底色块)。
|
|
18285
18550
|
h('div', { key: 'toolbar', className: 'dshic-asset-toolbar', 'data-role': 'assets-toolbar' },
|
|
@@ -18335,7 +18600,7 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18335
18600
|
h('span', { className: 'dshic-asset-pagecount', 'data-role': 'assets-page-info' }, T('assetsTotalCount').replace('{n}', String(filtered.length))),
|
|
18336
18601
|
),
|
|
18337
18602
|
),
|
|
18338
|
-
h('input', { key: 'file', ref: fileRef, type: 'file', accept: 'image/*,video
|
|
18603
|
+
h('input', { key: 'file', ref: fileRef, type: 'file', accept: 'image/*,video/*,.txt,.md,text/plain,text/markdown', multiple: true, style: { display: 'none' }, onChange: onImport }),
|
|
18339
18604
|
loading && !assets.length
|
|
18340
18605
|
? h('div', { key: 'loading', className: 'dshic-hint' }, T('aiRunning'))
|
|
18341
18606
|
: shown.length === 0
|
|
@@ -18424,6 +18689,17 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18424
18689
|
onClick: startRename,
|
|
18425
18690
|
}, Ic('pencil', 11));
|
|
18426
18691
|
const downloadName = (a.name || 'asset') + extForDownload(a.mime, a.name, a.kind);
|
|
18692
|
+
// 项目归属下拉(全部资产同款,含文本资产):看归属 + 就地改归属(onMove 服务端写回)
|
|
18693
|
+
const projSel = h('select', {
|
|
18694
|
+
className: 'dshic-asset-project', title: T('projectFilter'),
|
|
18695
|
+
value: a.projectId || GENERAL_PID,
|
|
18696
|
+
onClick: (e) => e.stopPropagation(),
|
|
18697
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
18698
|
+
onChange: (e) => { e.stopPropagation(); onMove(a, e.target.value); },
|
|
18699
|
+
},
|
|
18700
|
+
h('option', { value: GENERAL_PID }, T('generalProject')),
|
|
18701
|
+
S.projects.map((pp) => h('option', { key: pp.id, value: pp.id }, pp.name)),
|
|
18702
|
+
);
|
|
18427
18703
|
return h('div', {
|
|
18428
18704
|
className: cls('dshic-asset', checked && 'is-checked'),
|
|
18429
18705
|
onClick: () => onToggleSel(a),
|
|
@@ -18457,16 +18733,7 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18457
18733
|
renameBtn)
|
|
18458
18734
|
: null,
|
|
18459
18735
|
a.kind !== 'text'
|
|
18460
|
-
?
|
|
18461
|
-
className: 'dshic-asset-project', title: T('projectFilter'),
|
|
18462
|
-
value: a.projectId || GENERAL_PID,
|
|
18463
|
-
onClick: (e) => e.stopPropagation(),
|
|
18464
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
18465
|
-
onChange: (e) => { e.stopPropagation(); onMove(a, e.target.value); },
|
|
18466
|
-
},
|
|
18467
|
-
h('option', { value: GENERAL_PID }, T('generalProject')),
|
|
18468
|
-
S.projects.map((pp) => h('option', { key: pp.id, value: pp.id }, pp.name)),
|
|
18469
|
-
)
|
|
18736
|
+
? projSel
|
|
18470
18737
|
: null,
|
|
18471
18738
|
h('div', { className: 'dshic-asset-actions' },
|
|
18472
18739
|
(a.kind === 'image' || a.kind === 'video')
|
|
@@ -18506,8 +18773,10 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18506
18773
|
? h('audio', { src: url, controls: true, style: { width: '100%', height: 30 }, onPointerDown: (e) => e.stopPropagation(), onClick: (e) => e.stopPropagation(), preload: 'metadata' })
|
|
18507
18774
|
: null,
|
|
18508
18775
|
h('div', { className: 'dshic-asset-meta' },
|
|
18776
|
+
// 文本资产:meta 行补项目下拉(媒体资产的下拉在名称行下,文本卡片放这里——位置不同、控件同款)
|
|
18777
|
+
a.kind === 'text' ? projSel : null,
|
|
18509
18778
|
h('select', {
|
|
18510
|
-
className: 'dshic-cat', title: T('catLabel'), value: a.category
|
|
18779
|
+
className: 'dshic-cat', title: T('catLabel'), value: normCat(a.category),
|
|
18511
18780
|
onClick: (e) => e.stopPropagation(),
|
|
18512
18781
|
onPointerDown: (e) => e.stopPropagation(),
|
|
18513
18782
|
onChange: (e) => { e.stopPropagation(); onCat(a, e.target.value); },
|
|
@@ -18704,7 +18973,8 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18704
18973
|
h('select', { className: 'dshic-select', value: p.mode || 'generations', onChange: (e) => patchProvider(p.id, 'mode', e.target.value), onPointerDown: (e) => e.stopPropagation() },
|
|
18705
18974
|
h('option', { value: 'generations' }, T('modeGenerations')),
|
|
18706
18975
|
h('option', { value: 'edits' }, T('modeEdits')),
|
|
18707
|
-
h('option', { value: 'compshare' }, T('modeCompshare'))
|
|
18976
|
+
h('option', { value: 'compshare' }, T('modeCompshare')),
|
|
18977
|
+
h('option', { value: 'sanbao' }, T('modeSanbao')))),
|
|
18708
18978
|
] : [
|
|
18709
18979
|
(detectVideoVendor(p) === 'openai' || detectVideoVendor(p) === 'seedance') ? h(Field, { key: 'of', label: T('vidOutFormat'), value: p.outputFormat || '', onChange: (v) => patchProvider(p.id, 'outputFormat', v), placeholder: 'mp4(留空不发送)' }) : null,
|
|
18710
18980
|
(detectVideoVendor(p) === 'openai' || detectVideoVendor(p) === 'seedance') ? h('label', { key: 'ga', className: 'dshic-row', style: { gap: 6, fontSize: 11 } },
|
|
@@ -18838,7 +19108,8 @@ const DIRECTOR_KEY_HELP = [
|
|
|
18838
19108
|
onPointerDown: (e) => e.stopPropagation(),
|
|
18839
19109
|
},
|
|
18840
19110
|
h('option', { value: 'generations' }, T('modeGenerations')),
|
|
18841
|
-
h('option', { value: 'edits' }, T('modeEdits'))
|
|
19111
|
+
h('option', { value: 'edits' }, T('modeEdits')),
|
|
19112
|
+
h('option', { value: 'sanbao' }, T('modeSanbao'))))
|
|
18842
19113
|
: null,
|
|
18843
19114
|
kind === 'video'
|
|
18844
19115
|
? h('div', { key: 'proto', className: 'dshic-field' },
|
|
@@ -19631,6 +19902,7 @@ const DIRECTOR_KEY_HELP = [
|
|
|
19631
19902
|
'crime-police': ['M4 9l3-4h10l3 4v6l-3 4H7l-3-4z', 'M12 7l1.8 4.2L18 13l-4.2 1.8L12 19l-1.8-4.2L6 13l4.2-1.8z'],
|
|
19632
19903
|
wuxia: ['M4 9l3-4h10l3 4v6l-3 4H7l-3-4z', 'M6 18L18 6M14 6h4v4'],
|
|
19633
19904
|
fantasy: ['M4 9l3-4h10l3 4v6l-3 4H7l-3-4z', 'M12 7l2 4 4 1-3 3 1 4-4-2-4 2 1-4-3-3 4-1z'],
|
|
19905
|
+
'shanhaijing-myth': ['M4 9l3-4h10l3 4v6l-3 4H7l-3-4z', 'M6 16c2-6 4-2 6-6s4 0 6-4M9 17h6'],
|
|
19634
19906
|
adventure: ['M4 9l3-4h10l3 4v6l-3 4H7l-3-4z', 'M6 17l6-9 6 9M9 17h6'],
|
|
19635
19907
|
'hk-retro': ['M4 9l3-4h10l3 4v6l-3 4H7l-3-4z', 'M8 8v8M16 8v8M8 12h8'],
|
|
19636
19908
|
// ── L2 行业题材:六边形 + 标记 ──
|
|
@@ -20745,6 +21017,10 @@ const DIRECTOR_KEY_HELP = [
|
|
|
20745
21017
|
layoutBatchColumns,
|
|
20746
21018
|
// 资产页分页跳转(页码输入 → 0-based 页;非法文本 null、越界夹取)
|
|
20747
21019
|
assetsPageIndex,
|
|
21020
|
+
// 尾帧入库决策(一次生成只入一张:best 优先,best=last 才用 last)
|
|
21021
|
+
tailFrameDecision,
|
|
21022
|
+
// 资产分类归一(image→general,空→general):「图片」分类已移除,展示/过滤/搜索层归一
|
|
21023
|
+
normCat,
|
|
20748
21024
|
// 历史条死条目裁剪 / 资产回链候选挑选与回链计划(纯函数,供回归测试直接断言)
|
|
20749
21025
|
pruneDeadHistory, repairPickAsset, repairPlan,
|
|
20750
21026
|
// 媒体节点指针空值保护(Host 合并不得用 null 覆盖本地有效 assetId/lastAssetId)
|
|
@@ -20796,7 +21072,7 @@ const DIRECTOR_KEY_HELP = [
|
|
|
20796
21072
|
// IC-04:参考图上传三件套的纯函数出口(供 scripts/test-image-upload.mjs 直接断言)
|
|
20797
21073
|
window.__DSH_IC_IMGREF__ = { rawImageDims, sniffImageEncoding, registerReferenceAsset };
|
|
20798
21074
|
// IC-03:视频厂商识别/前缀归一化的纯函数出口(供 scripts/test-vendor-detect.mjs 直接断言)
|
|
20799
|
-
window.__DSH_IC_VENDOR__ = { detectVideoVendor, gatewayPrefixFor, wanEndpoints, vendorBase, VIDEO_REF_CAPS, needsSimpleMediaRetry, buildSimpleMediaRetryBody, wanTaskIdOf, wanStatusOf, wanPollState, buildSanbaoVideoBody, sanbaoTaskIdOf, sanbaoPollState, needsSanbaoMediaRetry, retryableDownloadError, downloadVideoWithRetry, SANBAO_DOWNLOAD_RETRY_MS, SANBAO_DOWNLOAD_RETRY_STEP_MS, bibleStyleAnchor };
|
|
21075
|
+
window.__DSH_IC_VENDOR__ = { detectVideoVendor, gatewayPrefixFor, wanEndpoints, vendorBase, VIDEO_REF_CAPS, needsSimpleMediaRetry, buildSimpleMediaRetryBody, wanTaskIdOf, wanStatusOf, wanPollState, buildSanbaoVideoBody, sanbaoTaskIdOf, sanbaoPollState, needsSanbaoMediaRetry, retryableDownloadError, downloadVideoWithRetry, SANBAO_DOWNLOAD_RETRY_MS, SANBAO_DOWNLOAD_RETRY_STEP_MS, buildSanbaoImageBody, sanbaoImageResultOf, sanbaoImagePollState, bibleStyleAnchor };
|
|
20800
21076
|
// 按镜头切段(分段生成本身就是最容易出错的地方):规划器 + 强弱模型分流 + 节点段区间解析
|
|
20801
21077
|
// 供 scripts/test-segment-plan.mjs 直接断言
|
|
20802
21078
|
window.__DSH_IC_SEGMENT__ = { planShotSegments, isCutPoint, segmentNeedsHardFrame, videoSegmentOf, shotContinuityPlan };
|