@lingjingai/lj-awb-cli 0.4.1 → 0.4.3
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/build/_shared.mjs +54 -5
- package/build/prod.mjs +12 -3
- package/package.json +1 -1
- package/packages/awb-cli/package.json +2 -2
- package/packages/awb-core/package.json +1 -1
- package/packages/awb-core/src/api.js +14 -0
- package/packages/awb-core/src/commands.js +52 -3
- package/packages/awb-core/src/common.js +8 -0
- package/packages/awb-core/src/output.js +77 -4
- package/packages/awb-core/src/services.js +994 -80
- package/packages/awb-core/src/standalone.js +36 -6
- package/skills/lj-awb/SKILL.md +4 -3
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/asset.md +10 -1
- package/skills/lj-awb/modules/create.md +4 -2
- package/skills/lj-awb/modules/task.md +4 -1
- package/skills/lj-awb/modules/upload.md +1 -1
- package/skills/lj-awb/modules/video.md +7 -0
- package/skills/lj-awb/modules/workflows.md +3 -1
- package/skills/lj-awb/references/output-fields.md +3 -1
|
@@ -187,10 +187,14 @@ function commandInvocation(commandName, kwargs = {}, options = {}) {
|
|
|
187
187
|
return parts.join(' ');
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
function buildOutputContext(command, kwargs = {}) {
|
|
190
|
+
function buildOutputContext(command, kwargs = {}, data = {}) {
|
|
191
191
|
const optionKeys = new Set((command.args || []).map((arg) => normalizeKey(arg.name)));
|
|
192
192
|
const canSuggestDryRunExecution = command.name !== 'auth login';
|
|
193
193
|
const withoutDryRun = { omit: ['dryRun'] };
|
|
194
|
+
const confirmSet = { yes: true };
|
|
195
|
+
if (command.name === 'create asset' && data?.conversionPlan && !toBool(kwargs.autoConvert)) {
|
|
196
|
+
confirmSet.autoConvert = true;
|
|
197
|
+
}
|
|
194
198
|
const isModelList = command.name === 'model image-models' || command.name === 'model video-models';
|
|
195
199
|
const modelListAll = isModelList && toBool(kwargs.all);
|
|
196
200
|
const modelListLimit = isModelList
|
|
@@ -205,7 +209,7 @@ function buildOutputContext(command, kwargs = {}) {
|
|
|
205
209
|
outputKind: buildCommandWorkflow(command).outputKind,
|
|
206
210
|
executeCommand: canSuggestDryRunExecution && toBool(kwargs.dryRun) ? commandInvocation(command.name, kwargs, withoutDryRun) : null,
|
|
207
211
|
confirmCommand: canSuggestDryRunExecution && toBool(kwargs.dryRun) && optionKeys.has('yes')
|
|
208
|
-
? commandInvocation(command.name, kwargs, { omit: ['dryRun'], set:
|
|
212
|
+
? commandInvocation(command.name, kwargs, { omit: ['dryRun'], set: confirmSet })
|
|
209
213
|
: null,
|
|
210
214
|
...(isModelList ? { listLimit: modelListLimit, moreCommand: modelListMoreCommand } : {}),
|
|
211
215
|
};
|
|
@@ -358,6 +362,9 @@ const RENAMED_COMMAND_HINTS = {
|
|
|
358
362
|
'video create-batch': 'create video-batch',
|
|
359
363
|
'video status': 'task video-status',
|
|
360
364
|
'video subtitle-remove': 'create video-subtitle-removal',
|
|
365
|
+
'video super-resolution': 'create video-super-resolution',
|
|
366
|
+
'video super-resolution-fee': 'create video-super-resolution-fee',
|
|
367
|
+
'video super-resolution-status': 'task video-super-resolution-status',
|
|
361
368
|
'video subtitle-status': 'task video-subtitle-status',
|
|
362
369
|
asset: 'create asset',
|
|
363
370
|
'asset match-actor': 'create asset-match-actor',
|
|
@@ -540,6 +547,7 @@ const GROUP_EXAMPLES = {
|
|
|
540
547
|
'lj-awb create image-fee --model-group-code <code> --prompt "一只小狗"',
|
|
541
548
|
'lj-awb create video --model-group-code <code> --prompt "镜头推进" --resource image:first_frame=./actor.png --dry-run',
|
|
542
549
|
'lj-awb create video-fee --model-group-code <code> --prompt "雨夜奔跑" --duration 5',
|
|
550
|
+
'lj-awb create video-super-resolution --object-name material/video-super/example.mp4 --dry-run',
|
|
543
551
|
'lj-awb create subject --model-code tx --name 女主 --resource primary:./three-view.png --dry-run',
|
|
544
552
|
'lj-awb create subject-wait --element-id <elementId> --wait-seconds 300',
|
|
545
553
|
'lj-awb create asset --group-id <id> --platform JIMENG --file ./actor.png --name "女主正面" --dry-run',
|
|
@@ -550,6 +558,7 @@ const GROUP_EXAMPLES = {
|
|
|
550
558
|
'lj-awb task image-status --task-id <imageTaskId>',
|
|
551
559
|
'lj-awb task video-status --task-id <videoTaskId>',
|
|
552
560
|
'lj-awb task video-subtitle-status --task-id <subtitleTaskId>',
|
|
561
|
+
'lj-awb task video-super-resolution-status --task-id <superResolutionTaskId>',
|
|
553
562
|
'lj-awb task wait --task-id <id> --task-type IMAGE_CREATE --wait-seconds 180',
|
|
554
563
|
'lj-awb task records --task-record-file .awb/tasks.jsonl',
|
|
555
564
|
],
|
|
@@ -574,8 +583,11 @@ const COMMAND_REQUIRED_OPTIONS = {
|
|
|
574
583
|
'create video-fee': ['modelGroupCode'],
|
|
575
584
|
'create video': ['modelGroupCode'],
|
|
576
585
|
'create video-batch': ['inputFile', 'modelGroupCode'],
|
|
586
|
+
'create video-super-resolution-fee': ['objectName'],
|
|
587
|
+
'create video-super-resolution': ['objectName'],
|
|
577
588
|
'task video-status': ['taskId'],
|
|
578
589
|
'task video-subtitle-status': ['taskId'],
|
|
590
|
+
'task video-super-resolution-status': ['taskId'],
|
|
579
591
|
'task wait': ['taskId', 'taskType'],
|
|
580
592
|
'create asset-match-actor': ['description'],
|
|
581
593
|
'create asset-groups': ['platform'],
|
|
@@ -625,6 +637,8 @@ const COMMAND_REQUIRED_ANY_OPTIONS = {
|
|
|
625
637
|
'upload files': [['file', 'files', 'filesJson']],
|
|
626
638
|
'create video-fee': [['prompt', 'resource', 'resourcesJson']],
|
|
627
639
|
'create video': [['prompt', 'resource', 'resourcesJson']],
|
|
640
|
+
'create video-super-resolution-fee': [['objectName']],
|
|
641
|
+
'create video-super-resolution': [['objectName']],
|
|
628
642
|
'create video-subtitle-removal': [['sourceTaskId']],
|
|
629
643
|
'create asset-group-update': [['name', 'description', 'projectName']],
|
|
630
644
|
'create asset': [['file', 'url', 'backendPath']],
|
|
@@ -690,6 +704,7 @@ const CONFIRMATION_COMMANDS = new Set([
|
|
|
690
704
|
'create image-batch',
|
|
691
705
|
'create video',
|
|
692
706
|
'create video-batch',
|
|
707
|
+
'create video-super-resolution',
|
|
693
708
|
'create video-subtitle-removal',
|
|
694
709
|
'create asset-group',
|
|
695
710
|
'create asset-group-update',
|
|
@@ -705,6 +720,7 @@ const COST_COMMANDS = new Set([
|
|
|
705
720
|
'create image-batch',
|
|
706
721
|
'create video',
|
|
707
722
|
'create video-batch',
|
|
723
|
+
'create video-super-resolution',
|
|
708
724
|
'create video-subtitle-removal',
|
|
709
725
|
]);
|
|
710
726
|
|
|
@@ -719,6 +735,7 @@ const REMOTE_WRITE_COMMANDS = new Set([
|
|
|
719
735
|
'create image-batch',
|
|
720
736
|
'create video',
|
|
721
737
|
'create video-batch',
|
|
738
|
+
'create video-super-resolution',
|
|
722
739
|
'create video-subtitle-removal',
|
|
723
740
|
'create asset-group',
|
|
724
741
|
'create asset-group-update',
|
|
@@ -771,9 +788,12 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
771
788
|
'create video-fee': 'fee_estimate',
|
|
772
789
|
'create video': 'task_submission',
|
|
773
790
|
'create video-batch': 'batch_task_submission',
|
|
791
|
+
'create video-super-resolution-fee': 'fee_estimate',
|
|
792
|
+
'create video-super-resolution': 'task_submission',
|
|
774
793
|
'task video-status': 'task_status',
|
|
775
794
|
'create video-subtitle-removal': 'subtitle_task_submission',
|
|
776
795
|
'task video-subtitle-status': 'subtitle_task_status',
|
|
796
|
+
'task video-super-resolution-status': 'task_status',
|
|
777
797
|
'task list': 'task_list',
|
|
778
798
|
'task wait': 'task_status',
|
|
779
799
|
'task records': 'local_task_records',
|
|
@@ -849,6 +869,8 @@ const PREFLIGHTS_BY_COMMAND = {
|
|
|
849
869
|
'create image-batch': ['doctor --verify', 'model image-models', 'model options', 'model create-spec', 'prepare JSONL input', 'create image-batch --dry-run'],
|
|
850
870
|
'create video': ['doctor --verify', 'model video-models', 'model options', 'model create-spec', 'confirm missing key params', 'create video-fee', 'create video --dry-run'],
|
|
851
871
|
'create video-batch': ['doctor --verify', 'model video-models', 'model options', 'model create-spec', 'prepare JSONL input', 'create video-batch --dry-run'],
|
|
872
|
+
'create video-super-resolution-fee': ['doctor --verify', 'create video-super-resolution-fee --object-name <objectName>'],
|
|
873
|
+
'create video-super-resolution': ['doctor --verify', 'create video-super-resolution --object-name <objectName> --dry-run'],
|
|
852
874
|
'create subject': ['doctor --verify', 'create subject --model-code tx|vidu --dry-run'],
|
|
853
875
|
'create subject-batch': ['doctor --verify', 'prepare JSONL input with modelCode', 'create subject-batch --dry-run'],
|
|
854
876
|
'create video-subtitle-removal': ['doctor --verify', 'create video-subtitle-removal --source-task-id <videoTaskId> --dry-run'],
|
|
@@ -936,6 +958,9 @@ function buildCommandWorkflow(command) {
|
|
|
936
958
|
if (command.name === 'create video') {
|
|
937
959
|
next.push('读取 data.taskId 和 data.nextCommand', '立即运行响应里的 nextCommand,或 task wait --task-type VIDEO_GROUP 等待结果');
|
|
938
960
|
}
|
|
961
|
+
if (command.name === 'create video-super-resolution') {
|
|
962
|
+
next.push('读取 data.taskId 和 data.nextCommand', '运行响应里的 task video-super-resolution-status 命令查询结果');
|
|
963
|
+
}
|
|
939
964
|
if (command.name === 'create video-subtitle-removal') {
|
|
940
965
|
next.push('读取 data.taskId 和 data.nextCommand', '运行 task video-subtitle-status 或响应里的 nextCommand 等待结果');
|
|
941
966
|
}
|
|
@@ -946,7 +971,7 @@ function buildCommandWorkflow(command) {
|
|
|
946
971
|
next.push('读取 data.voiceRecordId / data.externalId', 'externalId 为空时立刻运行 create subject-voice-wait 获取 nextVoiceArg');
|
|
947
972
|
}
|
|
948
973
|
if (command.name === 'create asset') {
|
|
949
|
-
next.push('读取 data.assetPath', '若后端返回审核 taskId,再运行 task wait --task-type ASSET_REGISTER');
|
|
974
|
+
next.push('读取 data.assetType / data.assetPath', 'data.conversionRequired=true 时先确认是否转码;正式执行可交互确认或追加 --auto-convert', '若后端返回审核 taskId,再运行 task wait --task-type ASSET_REGISTER');
|
|
950
975
|
}
|
|
951
976
|
if (command.name === 'model image-models' || command.name === 'model video-models') {
|
|
952
977
|
next.push('读取 data.models[] 得到全部候选;用户给了模型口语名时保留同族全部候选,不只取第一个');
|
|
@@ -1159,7 +1184,7 @@ function buildAgentContract() {
|
|
|
1159
1184
|
'supportsDryRun=true 的写入 / 扣费命令先 dry-run,确认后 yes;不要把 dry-run 当参数探索工具反复跑。',
|
|
1160
1185
|
'用户给出多条同模型同参数任务时优先 batch + task-record-file,不要单条循环 create。',
|
|
1161
1186
|
'命令返回 nextCommand / nextRefSubject / nextVoiceArg 时优先复用返回值,不手拼等价命令。',
|
|
1162
|
-
'素材加白平台先通过 model asset-review-models 或用户明确输入确定;create asset-* 必须显式传 --platform,不要依赖默认平台。',
|
|
1187
|
+
'素材加白平台先通过 model asset-review-models 或用户明确输入确定;create asset-* 必须显式传 --platform,不要依赖默认平台。create asset 会自动判断 assetType=Image/Video/Audio,本地文件会用 ffprobe 校验图片/视频尺寸、视频时长/FPS/像素数和音频时长;不合法素材正式执行时会询问是否转码,非交互场景可追加 --auto-convert;macOS + Homebrew 环境缺失时 CLI 会自动安装 ffmpeg。',
|
|
1163
1188
|
'旧根域 image / video / asset / subject 已移除;只使用 create / task / artifact 等 schema 暴露的 domain。',
|
|
1164
1189
|
],
|
|
1165
1190
|
canonicalFields: {
|
|
@@ -1232,6 +1257,7 @@ function buildAgentContract() {
|
|
|
1232
1257
|
taskTypes: {
|
|
1233
1258
|
image: 'IMAGE_CREATE',
|
|
1234
1259
|
video: 'VIDEO_GROUP',
|
|
1260
|
+
videoSuperResolution: 'VIDEO_SUPER_RESOLUTION',
|
|
1235
1261
|
subtitleRemoval: 'VIDEO_SUBTITLE_REMOVAL',
|
|
1236
1262
|
assetRegister: 'ASSET_REGISTER',
|
|
1237
1263
|
},
|
|
@@ -1476,7 +1502,7 @@ function validateCommandOptions(command, kwargs, kwargRawFlags = {}) {
|
|
|
1476
1502
|
const allowed = new Set(allowedKeys);
|
|
1477
1503
|
const unknown = Object.keys(kwargs).filter((key) => (
|
|
1478
1504
|
!allowed.has(key)
|
|
1479
|
-
&& !(command.allowDynamicModelParams && key
|
|
1505
|
+
&& !(command.allowDynamicModelParams && isAllowedDynamicModelParamFlag(key))
|
|
1480
1506
|
));
|
|
1481
1507
|
if (!unknown.length) return;
|
|
1482
1508
|
const displayFlag = (key) => kwargRawFlags[key] || formatOptionName(key);
|
|
@@ -1525,6 +1551,10 @@ function normalizeDynamicModelParamFlags(command, kwargs = {}, kwargRawFlags = {
|
|
|
1525
1551
|
}
|
|
1526
1552
|
}
|
|
1527
1553
|
|
|
1554
|
+
function isAllowedDynamicModelParamFlag(key) {
|
|
1555
|
+
return /^(generation|prompt|negative|seed|style|mode|cfg|guidance|aspect|image|video|audio|subject|output|response|media|safety|watermark|camera|motion|strength|steps)_/i.test(String(key || ''));
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1528
1558
|
function printData(data, format, meta = {}, context = {}) {
|
|
1529
1559
|
const outputFormat = resolveOutputFormat(format);
|
|
1530
1560
|
if (outputFormat === 'json') {
|
|
@@ -1654,7 +1684,7 @@ export async function runStandaloneCli(argv = process.argv.slice(2)) {
|
|
|
1654
1684
|
: await command.func({ command }, kwargs);
|
|
1655
1685
|
const meta = { command: command.name, elapsedMs: Date.now() - startedAt };
|
|
1656
1686
|
if (updateNotice) meta._notice = { update: updateNotice };
|
|
1657
|
-
printData(data, outputFormat, meta, buildOutputContext(command, kwargs));
|
|
1687
|
+
printData(data, outputFormat, meta, buildOutputContext(command, kwargs, data));
|
|
1658
1688
|
if (outputFormat !== 'json' && outputFormat !== 'yaml') printUpdateNotice(updateNotice);
|
|
1659
1689
|
} catch (error) {
|
|
1660
1690
|
const cliError = error instanceof LingjingAwbCliError
|
package/skills/lj-awb/SKILL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lj-awb
|
|
3
|
-
version: 0.4.
|
|
4
|
-
description: "灵境 AWB CLI skill。使用 `lj-awb` 命令调用动漫平台 / AWB 云端能力,覆盖认证、项目组、积分、模型发现、上传、统一 create
|
|
3
|
+
version: 0.4.3
|
|
4
|
+
description: "灵境 AWB CLI skill。使用 `lj-awb` 命令调用动漫平台 / AWB 云端能力,覆盖认证、项目组、积分、模型发现、上传、统一 create 创建域、任务查询、视频超分、最终产物 artifact CRUD 与本地 JSON 导入。用户说生图、生视频、视频超分、主体、音色、素材加白、去字幕、artifact 写入或查询时使用。正式生成、切换项目组、清空认证、artifact 写入等写入或扣费动作前必须确认。"
|
|
5
5
|
metadata:
|
|
6
6
|
bootstrap:
|
|
7
7
|
package: "@lingjingai/lj-awb-cli"
|
|
8
|
-
version: "0.4.
|
|
8
|
+
version: "0.4.3"
|
|
9
9
|
bin: "lj-awb"
|
|
10
10
|
cliHelp: "lj-awb --help"
|
|
11
11
|
---
|
|
@@ -87,6 +87,7 @@ schema 查询必须先返回,再组织业务命令;不要把 schema 查询
|
|
|
87
87
|
| “有哪些模型 / 推荐模型 / 用某某模型” | [`modules/model.md`](modules/model.md),模型口语名默认是平台模型,不是本地工具 |
|
|
88
88
|
| “生图 / 生成图片 / 参考图生图” | [`modules/driver.md`](modules/driver.md) 创作链条 + [`modules/create-contract.md`](modules/create-contract.md) |
|
|
89
89
|
| “生视频 / 首帧 / 首尾帧 / 音频参考 / 让图动起来” | [`modules/driver.md`](modules/driver.md) 创作链条 + [`modules/task-manual.md`](modules/task-manual.md) |
|
|
90
|
+
| “超分 / 放大到 2K / 1080P” | [`modules/video.md`](modules/video.md),传 `objectName` 走 material 视频超分任务体系 |
|
|
90
91
|
| “固定角色 / 主体 / 同一个人 / 可灵或 Vidu 角色一致” | [`modules/subject.md`](modules/subject.md) |
|
|
91
92
|
| “主体音色 / 音色克隆 / 给主体配音色” | [`modules/subject.md`](modules/subject.md) |
|
|
92
93
|
| “素材加白 / 白名单 / 过审 / 素材组” | [`modules/asset.md`](modules/asset.md) |
|
package/skills/lj-awb/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.3
|
|
@@ -12,8 +12,11 @@
|
|
|
12
12
|
| `lj-awb create asset-group --platform JIMENG --name "<name>" --dry-run` | 预览创建素材组 |
|
|
13
13
|
| `lj-awb create asset-group --platform JIMENG --name "<name>" --yes` | 创建素材组(云端写入) |
|
|
14
14
|
| `lj-awb create asset-group-update --group-id <id> --platform JIMENG --name "<name>" --yes` | 改指定平台素材组名 |
|
|
15
|
-
| `lj-awb create asset --group-id <id> --platform JIMENG --url "asset-review/a.png" --name "女主正面" --yes` |
|
|
15
|
+
| `lj-awb create asset --group-id <id> --platform JIMENG --url "asset-review/a.png" --name "女主正面" --yes` | 注册已上传素材;CLI 自动按扩展名传 `assetType` |
|
|
16
16
|
| `lj-awb create asset --group-id <id> --platform JIMENG --file ./a.png --name "女主正面" --yes` | 先上传到 asset-review 场景再注册(一步完成) |
|
|
17
|
+
| `lj-awb create asset --group-id <id> --platform JIMENG --file ./clip.mp4 --name "参考视频" --dry-run` | 视频素材加白,自动传 `assetType=Video` |
|
|
18
|
+
| `lj-awb create asset --group-id <id> --platform JIMENG --file ./voice.wav --name "参考音频" --dry-run` | 音频素材加白,自动传 `assetType=Audio` |
|
|
19
|
+
| `lj-awb create asset --group-id <id> --platform JIMENG --file ./clip.mov --name "参考视频" --auto-convert --yes` | 本地素材不合法时自动转码为加白规格后上传 |
|
|
17
20
|
| `lj-awb create asset-match-actor --description "..." --tags-json '[{"tagId":"o_102"}]'` | 候选匹配(角色画风 / 标签) |
|
|
18
21
|
|
|
19
22
|
## 什么时候用 match-actor
|
|
@@ -47,6 +50,12 @@ lj-awb create video --model-group-code <videoModelGroupCode> \
|
|
|
47
50
|
|
|
48
51
|
- `create asset-group` / `create asset-group-update` / `create asset` 都是云端写入,**必须确认**后追加 `--yes`。
|
|
49
52
|
- `create asset-*` 平台必须显式传 `--platform JIMENG|BYTEPLUS`;不要依赖默认平台,不要传中文名、小写名或供应商别名。
|
|
53
|
+
- `create asset` 会自动判断并传入 `assetType=Image|Video|Audio`;不要让用户手填资产类型。本地 `--file` 会在提交前校验格式、大小、尺寸、时长、帧率等规则。
|
|
54
|
+
- 本地图片限制:格式 jpeg/jpg、png、webp、bmp、tiff/tif、gif、heic/heif;宽高比(宽/高)在 [0.4,2.5];宽和高都在 [300,6000] px;单张图片小于 30MB。
|
|
55
|
+
- 本地视频限制:格式 mp4、mov;时长 [2,15] 秒;宽高比(宽/高)在 [0.4,2.5];宽和高都在 [300,6000] px;总像素数在 [409600,927408];单个视频不超过 50MB;FPS 在 [24,60]。平台文档里的 480p / 720p 体现在自动转码目标会压到合法像素区间,不再用“短边必须等于 480/720”作为源文件硬过滤。
|
|
56
|
+
- 本地音频限制:格式 wav、mp3;时长 [2,15] 秒。
|
|
57
|
+
- 本地素材不合法时,`--dry-run` 不上传,会返回 `conversionRequired=true` 和 `conversionPlan`;正式执行会询问是否自动转码为合法规格后继续。非交互脚本可追加 `--auto-convert --yes`。
|
|
58
|
+
- 如果本机缺少 `ffprobe` / `ffmpeg`,CLI 在 macOS + Homebrew 环境下会自动运行 `brew install ffmpeg`;其他环境会提示安装命令。需要关闭自动安装时设置 `LINGJING_AWB_AUTO_INSTALL_FFPROBE=0`。
|
|
50
59
|
- `model asset-review-models` 只做发现,不自动创建资产组或素材;不要把 `modelGroupCode` 塞进资产创建命令。
|
|
51
60
|
- 不使用 `/assets/submissions` 这类隐式自动补组流程;资产组是否复用、是否新建由当前任务显式决定。
|
|
52
61
|
- 主体 element(视频里的"同一个人"概念)优先走 `create subject`,不要把素材组 / 素材 ID 当 subjectId 用——两者对应平台不同业务实体。
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
| `lj-awb create video ...` | 提交单条生视频任务 |
|
|
13
13
|
| `lj-awb create video-batch ...` | 批量提交生视频任务 |
|
|
14
14
|
| `lj-awb create video-fee ...` | 生视频估价;关键参数确认后只跑一次 |
|
|
15
|
+
| `lj-awb create video-super-resolution ...` | 基于 objectName 提交视频超分任务 |
|
|
16
|
+
| `lj-awb create video-super-resolution-fee ...` | 视频超分估价;先确认 objectName |
|
|
15
17
|
| `lj-awb create video-subtitle-removal --source-task-id <videoTaskId> ...` | 基于 material 来源视频任务提交去字幕 |
|
|
16
18
|
| `lj-awb create subject-list ...` | 查询可复用主体,避免重复发布 |
|
|
17
19
|
| `lj-awb create subject --model-code tx|vidu ...` | 创建可复用主体 element |
|
|
@@ -30,8 +32,8 @@
|
|
|
30
32
|
## 编排
|
|
31
33
|
|
|
32
34
|
- 图片 / 视频创建参数和资源绑定仍按 [`create-contract.md`](create-contract.md) 校验。
|
|
33
|
-
- 估价也在 `create` 域:`create image-fee` / `create video-fee`;只在关键参数确认后执行。
|
|
34
|
-
- 状态和等待仍在查询域:`task image-status` / `task video-status` / `task wait` / `create subject-wait` / `create subject-voice-wait` / `task video-subtitle-status`。
|
|
35
|
+
- 估价也在 `create` 域:`create image-fee` / `create video-fee` / `create video-super-resolution-fee`;只在关键参数确认后执行。
|
|
36
|
+
- 状态和等待仍在查询域:`task image-status` / `task video-status` / `task wait` / `create subject-wait` / `create subject-voice-wait` / `task video-subtitle-status` / `task video-super-resolution-status`。
|
|
35
37
|
- 所有 `create` 写入或扣费命令正式执行前必须先 `--dry-run`,用户确认后再 `--yes`。
|
|
36
38
|
- 查询型 create 子命令(`subject-list`、`subject-voice-list`、`asset-groups`、`asset-group-get`、`asset-match-actor`)是为了避免重复创建;创建前优先查重。
|
|
37
39
|
- `asset-groups` / `asset-group-get` / `asset-group` / `asset-group-update` / `asset` 都必须显式传 `--platform`;平台先由 `model asset-review-models` 或用户选择确定。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Task Module
|
|
2
2
|
|
|
3
|
-
任务模块负责图片 / 视频 /
|
|
3
|
+
任务模块负责图片 / 视频 / 字幕 / 超分等异步任务的等待、查询和台账恢复。图片 / 视频任务可用 `task wait`,去字幕和视频超分优先使用创建响应里的专用 `nextCommand`;主体 / 音色回填用 `create subject-wait` / `create subject-voice-wait`,不要误走 `task wait`。
|
|
4
4
|
|
|
5
5
|
## 命令
|
|
6
6
|
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|------|------|
|
|
9
9
|
| `lj-awb task list --task-type IMAGE_CREATE --project-group-no <no>` | 列出远端任务(按类型过滤) |
|
|
10
10
|
| `lj-awb task wait --task-id <id> --task-type IMAGE_CREATE --wait-seconds 180` | 等待单个任务进入终态 |
|
|
11
|
+
| `lj-awb task video-subtitle-status --task-id <id>` | 查询去字幕 material 任务 |
|
|
12
|
+
| `lj-awb task video-super-resolution-status --task-id <id>` | 查询视频超分 material 任务 |
|
|
11
13
|
| `lj-awb task records --task-record-file .awb/tasks.jsonl` | 读本地任务台账(未指定 `--task-record-file` 默认 `.awb/tasks.jsonl`) |
|
|
12
14
|
| `lj-awb task records --pending-only --task-record-file .awb/tasks.jsonl` | 只看未终态记录 |
|
|
13
15
|
| `lj-awb task record-poll --task-record-file .awb/tasks.jsonl --wait-seconds 180` | 一次性轮询台账里所有未终态任务 |
|
|
@@ -72,6 +74,7 @@ CLI 当前**不暴露 task cancel**;用户问"能不能停掉这个任务"时
|
|
|
72
74
|
- `task wait` 返回 `task_still_running` 时复述 hint,不要误报失败;`taskStatus=FAILED` 或 `errorMessage` 非空才是真失败。
|
|
73
75
|
- **`task wait` 成功 ≠ 素材库立刻可读**:后端在事务提交后**异步**执行 `saveResourceToMaterial`(`afterCommit` 钩子),即使 `taskStatus=SUCCESS` 拿到 `resultUrls`,对应的 `material` / `asset` 行也可能还没落库。需要立刻复用结果时,优先使用 `resultUrls` / `assetPath` / `taskRecordId` 直接推进;非要查素材库时先 sleep 2-3 秒,不要靠 list 接口密集轮询。
|
|
74
76
|
- 输出字段只提取 `taskId / taskStatus / isTerminal / resultUrls / errorMessage`,详见 [`../references/output-fields.md`](../references/output-fields.md) 的"生图 / 生视频"和"任务台账"小节。
|
|
77
|
+
- `create video-subtitle-removal` / `create video-super-resolution` 返回 `nextCommand` 时直接执行该命令;不要把它改写成通用 `task wait`。
|
|
75
78
|
- 不要把大型 raw JSON 整段塞回上下文。
|
|
76
79
|
- `task list` 是远端查询、`task records` 是本地台账;两者覆盖范围不同(台账只有本机创建的任务)。
|
|
77
80
|
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
- 生视频首帧 / 尾帧 / 参考图:`lj-awb create video ... --resource image:first_frame=material/...`
|
|
30
30
|
- 视频参考音频:`lj-awb create video ... --resource audio:reference=material/...`
|
|
31
31
|
- 主体发布参考图:`lj-awb create subject ... --resource primary:material/...`
|
|
32
|
-
- 注册到素材库(素材加白):优先让 `lj-awb create asset --group-id <id> --platform <platform> --file ./a.png --name "..." --yes` 自动上传到 `asset-review`
|
|
32
|
+
- 注册到素材库(素材加白):优先让 `lj-awb create asset --group-id <id> --platform <platform> --file ./a.png --name "..." --yes` 自动上传到 `asset-review` 场景;CLI 会按文件类型传 `assetType=Image|Video|Audio`,并对本地文件做图片/视频/音频加白规格预检。不合法时正式执行会询问是否转码,非交互脚本可用 `--auto-convert --yes`。若已单独上传,使用 `--backend-path asset-review/...` 或 `--url asset-review/...`,这类远程路径只能按扩展名推断类型,尺寸 / 帧率 / 时长交给后端校验。
|
|
33
33
|
|
|
34
34
|
> `create image` / `create video` / `create subject` 传 `--file` / 本地路径时**会自动 upload**——只有需要"先看 backendPath / 跨任务复用同一份素材"时才单独跑 `upload files`。
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
| `lj-awb create video-batch --input-file ./video.jsonl --model-group-code <code> --yes` | 批量生视频 |
|
|
15
15
|
| `lj-awb task video-status --task-id <id>` | 查询生视频任务 |
|
|
16
16
|
| `lj-awb task wait --task-id <id> --task-type VIDEO_GROUP --wait-seconds 300` | 等待生视频结果 |
|
|
17
|
+
| `lj-awb create video-super-resolution --object-name <objectName> --yes` | 基于 material objectName 提交视频超分任务 |
|
|
18
|
+
| `lj-awb create video-super-resolution-fee --object-name <objectName>` | 计算视频超分预计积分 |
|
|
19
|
+
| `lj-awb task video-super-resolution-status --task-id <id>` | 查询视频超分任务 |
|
|
17
20
|
| `lj-awb create video-subtitle-removal --source-task-id <videoTaskId> --yes` | 基于来源视频任务提交去字幕任务 |
|
|
18
21
|
| `lj-awb task video-subtitle-status --task-id <subtitleTaskId>` | 查询去字幕任务 |
|
|
19
22
|
|
|
@@ -83,15 +86,19 @@ lj-awb create video \
|
|
|
83
86
|
- 批量 JSON/JSONL 每项只写 `prompt`、`ratio`、`quality`、`duration`、`need_audio`、`resources`、`resource`、`model_params`、`customBizId`,也可直接写模型配置下划线参数;其中 `need_audio` 表示是否需要输出音效,音频素材仍写入 `resources`。
|
|
84
87
|
- **批量是 best-effort**:`create-batch` 子任务**单条失败不会回滚整批**,已成功项依然扣分并产生 taskId。提交后必读响应里每项的 `status` / `taskId` / `error`,给用户汇总"成功 N / 失败 M",对失败项单独 fix + 重跑(不要全批重跑)。
|
|
85
88
|
- 视频任务默认可能耗时较长,批量和复杂任务应异步提交并记录 task id。
|
|
89
|
+
- 视频超分直接传 `objectName`,通常是 material backendPath 或 COS 对象路径;正式提交前先跑 `create video-super-resolution-fee`,再 `--dry-run`,确认后 `--yes`,返回后按 `nextCommand` 或 `task video-super-resolution-status` 查询。
|
|
86
90
|
- **多镜头 / 多分镜时主动建议并行**:用户一次给出 ≥2 个同模型同参数的视频任务(典型场景:分镜流水线、批量首尾帧动画)时,Agent 必须先告知"这批可以用 `create video-batch --concurrency N` 并行执行(n 个任务,预计耗时 / 单次估价 × n)",并询问用户是否要并行。用户同意 → 走 batch;用户希望逐条审稿 → 继续单条 create。**不要默认一条一条串行还不告知**。
|
|
91
|
+
- 视频超分不走 model options/create-spec;它是 material 的对象路径任务,和生视频模型选择链路分离。
|
|
87
92
|
- 去字幕统一走 material 任务体系:用已成功的视频来源任务 ID `create video-subtitle-removal --source-task-id <videoTaskId> --dry-run`,不要直连外部服务;`task video-subtitle-status` 只接收 material 去字幕任务的 `--task-id`。
|
|
88
93
|
- 输出字段速查见 [`../references/output-fields.md`](../references/output-fields.md) 的"生图 / 生视频"小节;错误恢复(积分 / 模型 / 资源约束)见 [`../references/error-codes.md`](../references/error-codes.md)。
|
|
89
94
|
|
|
90
95
|
## 下一步
|
|
91
96
|
|
|
92
97
|
- `create video` 返回 `taskId` + `nextCommand` → 立刻 `task wait --task-id <id> --task-type VIDEO_GROUP --wait-seconds 300`。
|
|
98
|
+
- `create video-super-resolution` 返回 `taskId` + `nextCommand` → 立刻运行返回的 `task video-super-resolution-status --task-id <id>`。
|
|
93
99
|
- `create video-batch` 写 `.awb/tasks.jsonl`,用 [`task.md`](task.md) → `task record-poll` 批量等。
|
|
94
100
|
- 任务终态 `resultUrls` → 通常按集 / 场 / 镜头回写到 [`artifact/video.md`](artifact/video.md):`artifact video update-clip-urls --project-id <id> --episode-id ... --scene-id ... --clip-id ... --video-urls-json '[...]'`。
|
|
95
101
|
- 任务 `SUCCESS` 后**立刻**用素材库接口找这条视频时可能查不到——后端 `saveResourceToMaterial` 是事务提交后异步执行,详见 [`task.md`](task.md) 规则。优先用 `resultUrls` 直接消费;非要列素材库时先 sleep 2-3 秒。
|
|
96
102
|
- Seedance 原始视频带英文字幕 → 对成功的视频任务运行 `create video-subtitle-removal --source-task-id <videoTaskId> --yes` → `task video-subtitle-status --task-id <subtitleTaskId>`。
|
|
103
|
+
- 需要对现有视频做清晰度提升 → 先确认 `objectName`(material backendPath 或 COS 对象路径),再 `create video-super-resolution-fee` 和 `create video-super-resolution`。
|
|
97
104
|
- 想长期复用同一角色(避免每次都传图) → [`subject.md`](subject.md) 先 `create subject` + `wait` 拿 externalId。
|
|
@@ -238,7 +238,9 @@ lj-awb create asset-groups --platform JIMENG --name "项目X-角色"
|
|
|
238
238
|
lj-awb create asset-group --platform JIMENG --name "项目X-角色" --dry-run
|
|
239
239
|
lj-awb create asset-group --platform JIMENG --name "项目X-角色" --yes
|
|
240
240
|
|
|
241
|
-
# 2.
|
|
241
|
+
# 2. 注册参考素材(本地文件版,--file 在 --yes 阶段自动上传 + 注册一步完成)
|
|
242
|
+
# CLI 会自动按扩展名传 assetType=Image/Video/Audio;本地文件会先校验加白规格。
|
|
243
|
+
# 不合法素材正式执行时会询问是否转码;非交互脚本可追加 --auto-convert。
|
|
242
244
|
lj-awb create asset \
|
|
243
245
|
--group-id <groupId> \
|
|
244
246
|
--platform JIMENG \
|
|
@@ -56,6 +56,8 @@
|
|
|
56
56
|
| `fee_estimate` | `create image-fee` / `create video-fee` | `pointCost`、`billingPointBalance`、`billingPointRemainingAfter` | — | budget 嵌套 |
|
|
57
57
|
| `task_submission` | `create image` / `create video` | `taskId`、`pointCost`、`billingPointRemainingAfter`、`nextCommand` | `taskId`、`taskType`(喂给 `task wait`) | uploads 数组、modelGroupCode |
|
|
58
58
|
| `batch_task_submission` | `create image-batch` / `create video-batch` | 成功 / 失败计数、首条 `taskId` 用于追踪 | `tasks[]` 每条 taskId + status | localFiles 详情 |
|
|
59
|
+
| `fee_estimate` | `create video-super-resolution-fee` | `pointCost`、`billingPointBalance`、`billingPointRemainingAfter` | — | budget 嵌套 |
|
|
60
|
+
| `task_submission` | `create video-super-resolution` | `taskId`、`pointCost`、`billingPointRemainingAfter`、`nextCommand` | `taskId`、`nextCommand`(喂给 `task video-super-resolution-status`) | request 嵌套 |
|
|
59
61
|
| `task_status` | `task wait` / `task image-status` / `task video-status` | `taskStatus`、`isTerminal`、`resultUrls`、`errorMessage` | `isTerminal`(false → 续 wait)、`timedOut` | `waitedMs`、`gmtCreate` |
|
|
60
62
|
| `subtitle_task_submission` | `create video-subtitle-removal` | `submitted`、`taskId`、`pointCost`、`nextCommand` | `taskId`、`sourceTaskId` | budget 嵌套 |
|
|
61
63
|
| `subtitle_task_status` | `task video-subtitle-status` | `taskStatus`、`isTerminal`、`resultUrls`、`errorMessage` | `taskId` | `gmtCreate` |
|
|
@@ -94,7 +96,7 @@
|
|
|
94
96
|
| `asset_group_list` | `create asset-groups` | `platform`、`count` + 组名 | `groupId`(下游 register 必填) | — |
|
|
95
97
|
| `asset_group_detail` | `create asset-group-get` | `platform`、组名、成员数 | `groupId` | — |
|
|
96
98
|
| `asset_group_write_result` | `create asset-group / group-update` | `created/updated`、`groupId`、`platform` | — | — |
|
|
97
|
-
| `asset_register_result` | `create asset` | `registered`、`assetId`、`assetPath`、`platform` | `assetId`(下游引用) | upload 嵌套 |
|
|
99
|
+
| `asset_register_result` | `create asset` | `registered`、`assetId`、`assetPath`、`platform`、`assetType` | `assetId`(下游引用) | upload 嵌套 |
|
|
98
100
|
|
|
99
101
|
## Artifact(产物 CRUD)
|
|
100
102
|
|