@lingjingai/lj-awb-cli 0.5.7 → 0.5.9
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/README.md +6 -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 +8 -0
- package/packages/awb-core/src/commands.js +73 -1
- package/packages/awb-core/src/common.js +6 -0
- package/packages/awb-core/src/output.js +26 -8
- package/packages/awb-core/src/services.js +293 -17
- package/packages/awb-core/src/standalone.js +27 -8
- package/skills/lj-awb/SKILL.md +6 -5
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/create.md +5 -2
- package/skills/lj-awb/modules/driver.md +7 -7
- package/skills/lj-awb/modules/model.md +6 -3
package/README.md
CHANGED
|
@@ -20,9 +20,9 @@ CLI 本身只负责平台调用、参数校验、人类友好输出、机器可
|
|
|
20
20
|
| 账号 | `account` | 用户、团队和登录上下文 |
|
|
21
21
|
| 项目 | `project` | 项目组查询、切换、创建和更新 |
|
|
22
22
|
| 积分 | `credits` | 可扣积分余额、项目组预算、任务用量统计 |
|
|
23
|
-
| 模型 | `model` | 生图 /
|
|
23
|
+
| 模型 | `model` | 生图 / 生视频 / 音频模型发现、模型参数白名单 |
|
|
24
24
|
| 上传 | `upload` | 本地图片 / 视频 / 音频上传为平台可访问素材 |
|
|
25
|
-
| 创建 | `create` |
|
|
25
|
+
| 创建 | `create` | 生图、生视频、音频、主体、音色、素材和去字幕提交 |
|
|
26
26
|
| 任务 | `task` | 任务列表、等待、任务台账和台账轮询 |
|
|
27
27
|
|
|
28
28
|
## 环境要求
|
|
@@ -165,6 +165,7 @@ lj-awb credits balance
|
|
|
165
165
|
lj-awb credits usage --project-group-no <no> --last-hours 24
|
|
166
166
|
lj-awb model image-models --model Banana
|
|
167
167
|
lj-awb model video-models --model Seedance
|
|
168
|
+
lj-awb model audio-models --model "Seed Audio"
|
|
168
169
|
lj-awb model input-guide
|
|
169
170
|
lj-awb model options --model-group-code <modelGroupCode>
|
|
170
171
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
@@ -175,6 +176,8 @@ lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
|
175
176
|
```bash
|
|
176
177
|
lj-awb create image ... --dry-run
|
|
177
178
|
lj-awb create image ... --yes
|
|
179
|
+
lj-awb create audio --model-group-code <modelGroupCode> --prompt "海浪与钢琴" --duration 12 --dry-run
|
|
180
|
+
lj-awb create audio --model-group-code <modelGroupCode> --prompt "海浪与钢琴" --duration 12 --yes
|
|
178
181
|
```
|
|
179
182
|
|
|
180
183
|
缺少 `--yes` 时,CLI 返回 `confirmation_required`,退出码为 `10`。`task wait` 超时返回 `task_still_running`,退出码为 `20`。
|
|
@@ -217,7 +220,7 @@ lj-awb model options --model-group-code <modelGroupCode>
|
|
|
217
220
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
218
221
|
```
|
|
219
222
|
|
|
220
|
-
`model input-guide` 返回跨模型统一参数、`resources` 字段和 `reference_key` 规则。`model options` 专门返回模型参数、资源媒体约束和条件约束,例如 `params[].values`、`params[].defaultValue`、`resources[].mediaType`、`resources[].usage`、`resources[].fileTypes`、`resources[].maxFiles`、`resources[].supportLastFrameOnly`、`resources[].minDurationMs/maxDurationMs`、`constraints[].target`、`constraints[].conditions`。`model create-spec` 专门返回如何创建任务,例如 `inputRequirement`、`supportedIntents`、`preflight` 和 `examples`。默认 text 已经覆盖常用决策字段;只有脚本严格解析或需要完整嵌套结构时才追加 `-f json`。Agent 应用 `options` 选参数值、校验素材并判断联动约束,再用 `create-spec` 组装 `create image` / `create video`,不要直接把平台旧参数传给 create。上传音频是 `resources` 素材输入,具体 `audio:reference` 写法看 `input-guide` / `create-spec`;是否需要输出音效才使用 `--need-audio true/false`。
|
|
223
|
+
`model input-guide` 返回跨模型统一参数、`resources` 字段和 `reference_key` 规则。`model options` 专门返回模型参数、资源媒体约束和条件约束,例如 `params[].values`、`params[].defaultValue`、`resources[].mediaType`、`resources[].usage`、`resources[].fileTypes`、`resources[].maxFiles`、`resources[].supportLastFrameOnly`、`resources[].minDurationMs/maxDurationMs`、`constraints[].target`、`constraints[].conditions`。`model create-spec` 专门返回如何创建任务,例如 `inputRequirement`、`supportedIntents`、`preflight` 和 `examples`。默认 text 已经覆盖常用决策字段;只有脚本严格解析或需要完整嵌套结构时才追加 `-f json`。Agent 应用 `options` 选参数值、校验素材并判断联动约束,再用 `create-spec` 组装 `create image` / `create video` / `create audio`,不要直接把平台旧参数传给 create。上传音频是 `resources` 素材输入,具体 `audio:reference` 写法看 `input-guide` / `create-spec`;是否需要输出音效才使用 `--need-audio true/false`。
|
|
221
224
|
|
|
222
225
|
## 示例:参考图生成视频
|
|
223
226
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-cli-bin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "Standalone CLI for Lingjing AWB",
|
|
5
5
|
"private": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"README.md"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@lingjingai/awb-core": "0.5.
|
|
16
|
+
"@lingjingai/awb-core": "0.5.9"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -236,6 +236,14 @@ export async function createVideoTask(payload = {}) {
|
|
|
236
236
|
return await apiFetch('/api/material/creation/videoCreate', { body: payload });
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
export async function fetchAudioFee(payload = {}) {
|
|
240
|
+
return await apiFetch('/api/material/creation/audioCreateFeeCalc', { body: payload });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export async function createAudioTask(payload = {}) {
|
|
244
|
+
return await apiFetch('/api/material/creation/audioCreate', { body: payload });
|
|
245
|
+
}
|
|
246
|
+
|
|
239
247
|
export async function fetchTaskInfo(taskId) {
|
|
240
248
|
return await apiFetch('/api/material/creation/task/info', {
|
|
241
249
|
method: 'GET',
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
assetGroupUpdate,
|
|
10
10
|
assetMatchActor,
|
|
11
11
|
assetReviewModels,
|
|
12
|
+
audioCreate,
|
|
13
|
+
audioFee,
|
|
12
14
|
assetRegister,
|
|
13
15
|
authLogin,
|
|
14
16
|
authLogout,
|
|
@@ -84,7 +86,7 @@ const MODEL_GROUP_ARG = { name: 'model-group-code', valueName: 'code', descripti
|
|
|
84
86
|
const ASSET_PLATFORM_ARG = { name: 'platform', valueName: 'platform', description: '素材加白平台,必须显式传 JIMENG 或 BYTEPLUS,不做别名推断' };
|
|
85
87
|
const MODEL_LIST_ARGS = [
|
|
86
88
|
{ name: 'model', valueName: 'keyword', description: '按模型名、编码、供应商或输入方式过滤;不传时查询全部' },
|
|
87
|
-
{ name: 'usage', valueName: 'usage', description: '模型用途:image
|
|
89
|
+
{ name: 'usage', valueName: 'usage', description: '模型用途:image=IMAGE_CREATE,video=VIDEO_CREATE,audio=AUDIO_CREATE。取值大小写不敏感' },
|
|
88
90
|
{ name: 'provider', valueName: 'keyword', description: '按厂商过滤(大小写不敏感子串,如 字节 / GPT / Google)' },
|
|
89
91
|
{ name: 'input-mode', valueName: 'mode', description: '按输入方式过滤(对模型 inputModes 做成员匹配,如 reference / prompt_only / frames)' },
|
|
90
92
|
{ name: 'supports', valueName: 'param', description: '按支持的可调参数过滤(对 params 做成员匹配,如 quality / ratio / duration / needAudio)' },
|
|
@@ -484,6 +486,15 @@ export function registerAwbCommands(cli) {
|
|
|
484
486
|
func: async (_ctx, kwargs) => listModels('video', kwargs),
|
|
485
487
|
});
|
|
486
488
|
|
|
489
|
+
cli({
|
|
490
|
+
name: 'model audio-models',
|
|
491
|
+
description: commandHelp('查询 CLI 可用音频生成模型', {
|
|
492
|
+
examples: ['lj-awb model audio-models', 'lj-awb model audio-models --all'],
|
|
493
|
+
}),
|
|
494
|
+
args: MODEL_LIST_ARGS,
|
|
495
|
+
func: async (_ctx, kwargs) => listModels('audio', kwargs),
|
|
496
|
+
});
|
|
497
|
+
|
|
487
498
|
cli({
|
|
488
499
|
name: 'model asset-review-models',
|
|
489
500
|
description: commandHelp('查询支持素材加白的模型组与平台平铺关系', {
|
|
@@ -716,6 +727,67 @@ export function registerAwbCommands(cli) {
|
|
|
716
727
|
func: async (_ctx, kwargs) => videoCreateBatch(kwargs),
|
|
717
728
|
});
|
|
718
729
|
|
|
730
|
+
cli({
|
|
731
|
+
name: 'create audio-fee',
|
|
732
|
+
description: commandHelp('计算音频生成预计积分', {
|
|
733
|
+
examples: [
|
|
734
|
+
'lj-awb create audio-fee --model-group-code <code> --prompt "海浪与钢琴" --duration 12',
|
|
735
|
+
],
|
|
736
|
+
hint: '积分按时长向上取整:每 1-6 秒 1 积分。默认输出 mp3。',
|
|
737
|
+
}),
|
|
738
|
+
args: [
|
|
739
|
+
MODEL_GROUP_ARG,
|
|
740
|
+
PROJECT_GROUP_ARG,
|
|
741
|
+
{ name: 'prompt', valueName: 'text', description: '音频生成提示词' },
|
|
742
|
+
{ name: 'duration', valueName: 'seconds', description: '生成时长,1-120 秒' },
|
|
743
|
+
{ name: 'audio-format', valueName: 'format', description: '输出格式:mp3(默认)、wav、pcm、ogg_opus' },
|
|
744
|
+
{ name: 'sample-rate', valueName: 'hz', description: '采样率,8000-48000' },
|
|
745
|
+
{ name: 'speech-rate', valueName: 'value', description: '语速调节,-50 到 100' },
|
|
746
|
+
{ name: 'loudness-rate', valueName: 'value', description: '响度调节,-50 到 100' },
|
|
747
|
+
{ name: 'pitch-rate', valueName: 'value', description: '音高调节,-12 到 12' },
|
|
748
|
+
{ name: 'enable-subtitle', valueName: 'bool', description: '是否生成字幕信息(true/false)' },
|
|
749
|
+
...MODEL_PARAM_ARGS,
|
|
750
|
+
RESOURCE_ARG,
|
|
751
|
+
RESOURCES_JSON_ARG,
|
|
752
|
+
FEE_DRY_RUN_ARG,
|
|
753
|
+
],
|
|
754
|
+
allowDynamicModelParams: true,
|
|
755
|
+
func: async (_ctx, kwargs) => audioFee(kwargs),
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
cli({
|
|
759
|
+
name: 'create audio',
|
|
760
|
+
description: commandHelp('提交音频生成任务;正式执行需要 --yes', {
|
|
761
|
+
examples: [
|
|
762
|
+
'lj-awb create audio --model-group-code <code> --prompt "海浪与钢琴" --duration 12 --dry-run',
|
|
763
|
+
'lj-awb create audio --model-group-code <code> --prompt "延续参考音频氛围" --duration 12 --resource audio:reference=./ref.mp3 --yes',
|
|
764
|
+
'lj-awb create audio --model-group-code <code> --prompt "根据画面生成环境声" --duration 8 --resource image:reference=./scene.png --yes',
|
|
765
|
+
],
|
|
766
|
+
hint: '最多 3 个参考音频或 1 张参考图,两类素材不能混用;默认输出 mp3。',
|
|
767
|
+
}),
|
|
768
|
+
args: [
|
|
769
|
+
MODEL_GROUP_ARG,
|
|
770
|
+
PROJECT_GROUP_ARG,
|
|
771
|
+
{ name: 'prompt', valueName: 'text', description: '音频生成提示词' },
|
|
772
|
+
{ name: 'duration', valueName: 'seconds', description: '生成时长,1-120 秒' },
|
|
773
|
+
{ name: 'audio-format', valueName: 'format', description: '输出格式:mp3(默认)、wav、pcm、ogg_opus' },
|
|
774
|
+
{ name: 'sample-rate', valueName: 'hz', description: '采样率,8000-48000' },
|
|
775
|
+
{ name: 'speech-rate', valueName: 'value', description: '语速调节,-50 到 100' },
|
|
776
|
+
{ name: 'loudness-rate', valueName: 'value', description: '响度调节,-50 到 100' },
|
|
777
|
+
{ name: 'pitch-rate', valueName: 'value', description: '音高调节,-12 到 12' },
|
|
778
|
+
{ name: 'enable-subtitle', valueName: 'bool', description: '是否生成字幕信息(true/false)' },
|
|
779
|
+
...MODEL_PARAM_ARGS,
|
|
780
|
+
RESOURCE_ARG,
|
|
781
|
+
RESOURCES_JSON_ARG,
|
|
782
|
+
TASK_RECORD_ARG,
|
|
783
|
+
...CREATE_WAIT_ARGS,
|
|
784
|
+
DRY_RUN_ARG,
|
|
785
|
+
YES_ARG,
|
|
786
|
+
],
|
|
787
|
+
allowDynamicModelParams: true,
|
|
788
|
+
func: async (_ctx, kwargs) => audioCreate(kwargs),
|
|
789
|
+
});
|
|
790
|
+
|
|
719
791
|
cli({
|
|
720
792
|
name: 'create video-subtitle-removal',
|
|
721
793
|
description: commandHelp('基于 material 来源视频任务提交去字幕任务', {
|
|
@@ -32,6 +32,7 @@ export const TASK_UPLOAD_SCENE = {
|
|
|
32
32
|
IMAGE_EDIT: 'material-image-edit',
|
|
33
33
|
VIDEO_CREATE: 'material-video-create',
|
|
34
34
|
VIDEO_GROUP: 'material-video-create',
|
|
35
|
+
AUDIO_CREATE: 'material-video-create',
|
|
35
36
|
SUBJECT: 'material-video-create',
|
|
36
37
|
ASSET_REVIEW: 'asset-review',
|
|
37
38
|
DEFAULT: 'material-image-draw',
|
|
@@ -345,6 +346,11 @@ export function guessMimeType(filePath) {
|
|
|
345
346
|
return 'audio/mpeg';
|
|
346
347
|
case '.wav':
|
|
347
348
|
return 'audio/wav';
|
|
349
|
+
case '.ogg':
|
|
350
|
+
case '.oga':
|
|
351
|
+
return 'audio/ogg';
|
|
352
|
+
case '.pcm':
|
|
353
|
+
return 'audio/L16';
|
|
348
354
|
case '.m4a':
|
|
349
355
|
return 'audio/mp4';
|
|
350
356
|
case '.mp4':
|
|
@@ -212,7 +212,7 @@ function normalizeDryRun(data = {}) {
|
|
|
212
212
|
|
|
213
213
|
function submissionStatusCommand(commandName, data = {}) {
|
|
214
214
|
if (!data?.taskId) return null;
|
|
215
|
-
if (commandName === 'create image' || commandName === 'create video') {
|
|
215
|
+
if (commandName === 'create image' || commandName === 'create video' || commandName === 'create audio') {
|
|
216
216
|
return `${commandPrefix()} task status --task-id ${data.taskId}`;
|
|
217
217
|
}
|
|
218
218
|
return null;
|
|
@@ -530,12 +530,14 @@ export function normalizeOutputData(commandName, data) {
|
|
|
530
530
|
switch (commandName) {
|
|
531
531
|
case 'create image':
|
|
532
532
|
case 'create video':
|
|
533
|
+
case 'create audio':
|
|
533
534
|
case 'create video-super-resolution':
|
|
534
535
|
return normalizeTaskSubmission(commandName, data);
|
|
535
536
|
case 'create video-subtitle-removal':
|
|
536
537
|
return normalizeSubtitleSubmission(data);
|
|
537
538
|
case 'create image-fee':
|
|
538
539
|
case 'create video-fee':
|
|
540
|
+
case 'create audio-fee':
|
|
539
541
|
case 'create video-super-resolution-fee':
|
|
540
542
|
return normalizeFee(data);
|
|
541
543
|
case 'account info':
|
|
@@ -569,6 +571,7 @@ export function normalizeOutputData(commandName, data) {
|
|
|
569
571
|
return normalizeAsset(data);
|
|
570
572
|
case 'model image-models':
|
|
571
573
|
case 'model video-models':
|
|
574
|
+
case 'model audio-models':
|
|
572
575
|
case 'model asset-review-models':
|
|
573
576
|
return normalizeList(data, ['models', 'items', 'rows']);
|
|
574
577
|
case 'account teams':
|
|
@@ -1234,6 +1237,7 @@ function formatModelInputGuideOutput(data = {}) {
|
|
|
1234
1237
|
lines.push('next:');
|
|
1235
1238
|
pushSectionKeyValue(lines, 'imageModels', `${commandPrefix()} model image-models --model <keyword>`);
|
|
1236
1239
|
pushSectionKeyValue(lines, 'videoModels', `${commandPrefix()} model video-models --model <keyword>`);
|
|
1240
|
+
pushSectionKeyValue(lines, 'audioModels', `${commandPrefix()} model audio-models --model <keyword>`);
|
|
1237
1241
|
pushSectionKeyValue(lines, 'options', `${commandPrefix()} model options --model-group-code <modelGroupCode>`);
|
|
1238
1242
|
return `${lines.join('\n')}\n`;
|
|
1239
1243
|
}
|
|
@@ -1243,7 +1247,7 @@ function defaultJsonCommand(commandName) {
|
|
|
1243
1247
|
}
|
|
1244
1248
|
|
|
1245
1249
|
function modelListNextCommand(commandName) {
|
|
1246
|
-
if (commandName === 'model image-models' || commandName === 'model video-models') {
|
|
1250
|
+
if (commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models') {
|
|
1247
1251
|
return `${commandPrefix()} model options --model-group-code <modelGroupCode>`;
|
|
1248
1252
|
}
|
|
1249
1253
|
if (commandName === 'model asset-review-models') {
|
|
@@ -1253,7 +1257,7 @@ function modelListNextCommand(commandName) {
|
|
|
1253
1257
|
}
|
|
1254
1258
|
|
|
1255
1259
|
function modelListAgentHint(commandName) {
|
|
1256
|
-
if (commandName !== 'model image-models' && commandName !== 'model video-models') return null;
|
|
1260
|
+
if (commandName !== 'model image-models' && commandName !== 'model video-models' && commandName !== 'model audio-models') return null;
|
|
1257
1261
|
return '对每个候选运行 model options,并把候选模型、参数取值、默认值和资源能力展示给用户后再推荐或进入 fee/dry-run。';
|
|
1258
1262
|
}
|
|
1259
1263
|
|
|
@@ -1296,6 +1300,7 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
1296
1300
|
'credits redeem': 'redeem_result',
|
|
1297
1301
|
'model image-models': 'model_list',
|
|
1298
1302
|
'model video-models': 'model_list',
|
|
1303
|
+
'model audio-models': 'model_list',
|
|
1299
1304
|
'model asset-review-models': 'asset_review_model_list',
|
|
1300
1305
|
'model options': 'model_options',
|
|
1301
1306
|
'model create-spec': 'model_create_spec',
|
|
@@ -1306,6 +1311,8 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
1306
1311
|
'create image-batch': 'batch_task_submission',
|
|
1307
1312
|
'create video-fee': 'fee_estimate',
|
|
1308
1313
|
'create video': 'task_submission',
|
|
1314
|
+
'create audio-fee': 'fee_estimate',
|
|
1315
|
+
'create audio': 'task_submission',
|
|
1309
1316
|
'create video-batch': 'batch_task_submission',
|
|
1310
1317
|
'create video-super-resolution-fee': 'fee_estimate',
|
|
1311
1318
|
'create video-super-resolution': 'task_submission',
|
|
@@ -1391,6 +1398,7 @@ const COMMAND_TITLES = {
|
|
|
1391
1398
|
'project ensure': '项目组确保结果',
|
|
1392
1399
|
'create image': '生图任务提交结果',
|
|
1393
1400
|
'create video': '生视频任务提交结果',
|
|
1401
|
+
'create audio': '音频任务提交结果',
|
|
1394
1402
|
'create image-batch': '批量生图提交结果',
|
|
1395
1403
|
'create video-batch': '批量生视频提交结果',
|
|
1396
1404
|
'create video-super-resolution-fee': '视频超分积分预估',
|
|
@@ -1636,6 +1644,7 @@ const DRY_RUN_FIELDS_BY_COMMAND = {
|
|
|
1636
1644
|
'upload files': ['dryRun', 'fileCount', 'localFileCount', 'resourceConversionCount'],
|
|
1637
1645
|
'create image': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'ratio', 'quality', 'generateNum', 'resourceCount', 'localFileCount', 'assetCount'],
|
|
1638
1646
|
'create video': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'duration', 'ratio', 'quality', 'needAudio', 'resourceCount', 'localFileCount', 'assetCount'],
|
|
1647
|
+
'create audio': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'duration', 'audioFormat', 'resourceCount', 'localFileCount'],
|
|
1639
1648
|
'create image-batch': ['dryRun', 'count', 'modelGroupCode', 'projectGroupNo'],
|
|
1640
1649
|
'create video-batch': ['dryRun', 'count', 'modelGroupCode', 'projectGroupNo'],
|
|
1641
1650
|
'create video-super-resolution-fee': ['dryRun', 'action', 'objectName', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter'],
|
|
@@ -2275,15 +2284,17 @@ function namedListTitle(listKey) {
|
|
|
2275
2284
|
function localizedTaskKind(value) {
|
|
2276
2285
|
if (value === 'image' || value === 'IMAGE_CREATE') return '图片生成';
|
|
2277
2286
|
if (value === 'video' || value === 'VIDEO_CREATE') return '视频生成';
|
|
2287
|
+
if (value === 'audio' || value === 'AUDIO_CREATE') return '音频生成';
|
|
2278
2288
|
return prettyValue(value);
|
|
2279
2289
|
}
|
|
2280
2290
|
|
|
2281
2291
|
function localizedInputMode(value, taskKind = '') {
|
|
2282
2292
|
const mode = String(value || '');
|
|
2283
2293
|
const isVideo = taskKind === 'video' || taskKind === 'VIDEO_CREATE';
|
|
2294
|
+
const isAudio = taskKind === 'audio' || taskKind === 'AUDIO_CREATE';
|
|
2284
2295
|
const labels = {
|
|
2285
|
-
prompt_only: isVideo ? '文本生成视频' : '文本生成图片',
|
|
2286
|
-
reference: isVideo ? '参考素材生成' : '参考图生成',
|
|
2296
|
+
prompt_only: isAudio ? '文本生成音频' : (isVideo ? '文本生成视频' : '文本生成图片'),
|
|
2297
|
+
reference: isAudio ? '参考素材生成音频' : (isVideo ? '参考素材生成' : '参考图生成'),
|
|
2287
2298
|
frames: '首帧/尾帧生成',
|
|
2288
2299
|
storyboard: '分镜多镜头',
|
|
2289
2300
|
keyframe: '关键帧生成',
|
|
@@ -2302,6 +2313,12 @@ function localizedParamKey(value) {
|
|
|
2302
2313
|
needAudio: '生成音频',
|
|
2303
2314
|
need_audio: '生成音频',
|
|
2304
2315
|
prompt_optimizer: '提示词增强',
|
|
2316
|
+
audio_format: '音频格式',
|
|
2317
|
+
sample_rate: '采样率',
|
|
2318
|
+
speech_rate: '语速',
|
|
2319
|
+
loudness_rate: '响度',
|
|
2320
|
+
pitch_rate: '音高',
|
|
2321
|
+
enable_subtitle: '生成字幕',
|
|
2305
2322
|
};
|
|
2306
2323
|
return labels[value] || value;
|
|
2307
2324
|
}
|
|
@@ -2589,7 +2606,7 @@ function pushReadableRecord(lines, record = {}, fields = [], options = {}) {
|
|
|
2589
2606
|
function formatPrettyModelList(commandName, data = {}, context = {}) {
|
|
2590
2607
|
const normalized = normalizeOutputData(commandName, data);
|
|
2591
2608
|
const rows = Array.isArray(normalized.models) ? normalized.models : [];
|
|
2592
|
-
const taskKind = commandName === 'model video-models' ? 'video' : 'image';
|
|
2609
|
+
const taskKind = commandName === 'model video-models' ? 'video' : (commandName === 'model audio-models' ? 'audio' : 'image');
|
|
2593
2610
|
const limit = listLimitFor(commandName, context, rows);
|
|
2594
2611
|
const visibleRows = rows.slice(0, Number.isFinite(limit) ? limit : rows.length);
|
|
2595
2612
|
const lines = [prettyTitle(commandName, 'model_list', normalized), ''];
|
|
@@ -2889,6 +2906,7 @@ function formatPrettyModelInputGuide(data = {}, context = {}) {
|
|
|
2889
2906
|
renderNextActions(lines, [
|
|
2890
2907
|
{ label: '生图模型', value: `${commandPrefix()} model image-models --model <keyword>` },
|
|
2891
2908
|
{ label: '生视频模型', value: `${commandPrefix()} model video-models --model <keyword>` },
|
|
2909
|
+
{ label: '音频模型', value: `${commandPrefix()} model audio-models --model <keyword>` },
|
|
2892
2910
|
{ label: '模型参数', value: `${commandPrefix()} model options --model-group-code <modelGroupCode>` },
|
|
2893
2911
|
...(context.textCommand ? [{ label: 'Agent 读取', value: context.textCommand }] : []),
|
|
2894
2912
|
...(context.jsonCommand ? [{ label: '完整 JSON', value: context.jsonCommand }] : []),
|
|
@@ -2929,7 +2947,7 @@ function formatPrettyGeneric(commandName, data, context = {}) {
|
|
|
2929
2947
|
export function formatPrettyOutput(commandName, data, context = {}) {
|
|
2930
2948
|
if (commandName === 'schema') return formatPrettySchema(data, context);
|
|
2931
2949
|
if (commandName === 'doctor') return formatPrettyEnvironment(data, context);
|
|
2932
|
-
if (commandName === 'model image-models' || commandName === 'model video-models') return formatPrettyModelList(commandName, data, context);
|
|
2950
|
+
if (commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models') return formatPrettyModelList(commandName, data, context);
|
|
2933
2951
|
if (commandName === 'model options') return formatPrettyModelOptions(data, context);
|
|
2934
2952
|
if (commandName === 'model create-spec') return formatPrettyModelCreateSpec(data, context);
|
|
2935
2953
|
if (commandName === 'model input-guide') return formatPrettyModelInputGuide(data, context);
|
|
@@ -3032,7 +3050,7 @@ export function formatTextOutput(commandName, data, context = {}) {
|
|
|
3032
3050
|
if (!isPlainObject(normalized)) return `ok ${commandName}\nvalue=${shortValue(normalized)}\n`;
|
|
3033
3051
|
const lines = [`ok ${commandName}`];
|
|
3034
3052
|
const list = firstList(normalized);
|
|
3035
|
-
const isModelList = commandName === 'model image-models' || commandName === 'model video-models';
|
|
3053
|
+
const isModelList = commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models';
|
|
3036
3054
|
const scalarLine = renderRecord(
|
|
3037
3055
|
normalized,
|
|
3038
3056
|
[
|
|
@@ -120,6 +120,18 @@ const CREATE_STANDARD_KWARG_KEYS = new Set([
|
|
|
120
120
|
'duration',
|
|
121
121
|
'needAudio',
|
|
122
122
|
'need_audio',
|
|
123
|
+
'audioFormat',
|
|
124
|
+
'audio_format',
|
|
125
|
+
'sampleRate',
|
|
126
|
+
'sample_rate',
|
|
127
|
+
'speechRate',
|
|
128
|
+
'speech_rate',
|
|
129
|
+
'loudnessRate',
|
|
130
|
+
'loudness_rate',
|
|
131
|
+
'pitchRate',
|
|
132
|
+
'pitch_rate',
|
|
133
|
+
'enableSubtitle',
|
|
134
|
+
'enable_subtitle',
|
|
123
135
|
'resource',
|
|
124
136
|
'resources',
|
|
125
137
|
'resourcesJson',
|
|
@@ -1098,6 +1110,14 @@ export async function creditsUsageSummary(kwargs = {}) {
|
|
|
1098
1110
|
|
|
1099
1111
|
function modelListMetadata(kind, paramKeys = [], rulesByKey = new Map()) {
|
|
1100
1112
|
const keys = new Set(paramKeys);
|
|
1113
|
+
if (kind === 'audio') {
|
|
1114
|
+
return {
|
|
1115
|
+
inputModes: keys.has('resources') ? ['prompt_only', 'reference'] : ['prompt_only'],
|
|
1116
|
+
controls: ['duration', 'audio_format', 'sample_rate', 'speech_rate', 'loudness_rate', 'pitch_rate', 'enable_subtitle']
|
|
1117
|
+
.filter((key) => keys.has(key)),
|
|
1118
|
+
resourceParams: keys.has('resources') ? ['resources'] : [],
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1101
1121
|
const imageReferenceParams = ['cref', 'sref', 'iref', 'resources'].filter((key) => keys.has(key));
|
|
1102
1122
|
const videoResourceParams = ['frames', 'multi_param', 'multi_prompt'].filter((key) => keys.has(key));
|
|
1103
1123
|
const inputModes = createSpecSupportedIntents(createSpecInputModes(kind, keys, rulesByKey), kind)
|
|
@@ -1196,6 +1216,7 @@ function normalizeModelRows(payload, kind, options = {}) {
|
|
|
1196
1216
|
const MODEL_USAGE_FAMILY = {
|
|
1197
1217
|
image: { default: 'IMAGE_CREATE', allow: new Set(['IMAGE_CREATE']) },
|
|
1198
1218
|
video: { default: 'VIDEO_CREATE', allow: new Set(['VIDEO_CREATE']) },
|
|
1219
|
+
audio: { default: 'AUDIO_CREATE', allow: new Set(['AUDIO_CREATE']) },
|
|
1199
1220
|
};
|
|
1200
1221
|
|
|
1201
1222
|
export function resolveModelUsage(kind, kwargs = {}) {
|
|
@@ -1343,9 +1364,10 @@ export async function assetReviewModels(kwargs = {}) {
|
|
|
1343
1364
|
|
|
1344
1365
|
async function findModelGroup(modelGroupCode, options = {}) {
|
|
1345
1366
|
const includeRaw = Boolean(options.includeRaw);
|
|
1346
|
-
const [imageResult, videoResult] = await Promise.allSettled([
|
|
1367
|
+
const [imageResult, videoResult, audioResult] = await Promise.allSettled([
|
|
1347
1368
|
awbApi.fetchModelsByUsage('IMAGE_CREATE', {}),
|
|
1348
1369
|
awbApi.fetchModelsByUsage('VIDEO_CREATE', {}),
|
|
1370
|
+
awbApi.fetchModelsByUsage('AUDIO_CREATE', {}),
|
|
1349
1371
|
]);
|
|
1350
1372
|
const imageModels = imageResult.status === 'fulfilled'
|
|
1351
1373
|
? normalizeModelRows(imageResult.value, 'image', { includeRaw, includeInternal: true }).map((item) => ({ ...item, kind: 'image' }))
|
|
@@ -1353,13 +1375,16 @@ async function findModelGroup(modelGroupCode, options = {}) {
|
|
|
1353
1375
|
const videoModels = videoResult.status === 'fulfilled'
|
|
1354
1376
|
? normalizeModelRows(videoResult.value, 'video', { includeRaw, includeInternal: true }).map((item) => ({ ...item, kind: 'video' }))
|
|
1355
1377
|
: [];
|
|
1356
|
-
|
|
1378
|
+
const audioModels = audioResult.status === 'fulfilled'
|
|
1379
|
+
? normalizeModelRows(audioResult.value, 'audio', { includeRaw, includeInternal: true }).map((item) => ({ ...item, kind: 'audio' }))
|
|
1380
|
+
: [];
|
|
1381
|
+
return [...imageModels, ...videoModels, ...audioModels].find((item) => item.modelGroupCode === modelGroupCode) ?? null;
|
|
1357
1382
|
}
|
|
1358
1383
|
|
|
1359
1384
|
function resolveTaskModel(kind, kwargs = {}) {
|
|
1360
1385
|
const modelGroupCode = trimToNull(kwargs.modelGroupCode);
|
|
1361
1386
|
if (!modelGroupCode) {
|
|
1362
|
-
throw argumentError('缺少模型组编码', '传 --model-group-code <code
|
|
1387
|
+
throw argumentError('缺少模型组编码', '传 --model-group-code <code>;推荐先运行对应的 model image-models / video-models / audio-models。');
|
|
1363
1388
|
}
|
|
1364
1389
|
return {
|
|
1365
1390
|
kind,
|
|
@@ -1956,7 +1981,7 @@ function constraintConditionMatches(condition = {}, promptParams = {}) {
|
|
|
1956
1981
|
return String(actual ?? '') === String(condition.value ?? '');
|
|
1957
1982
|
}
|
|
1958
1983
|
|
|
1959
|
-
function assertParamsAgainstModel(promptParams = {}, params = [], constraints = []) {
|
|
1984
|
+
function assertParamsAgainstModel(promptParams = {}, params = [], constraints = [], taskKind = null) {
|
|
1960
1985
|
const paramByKey = new Map(params.map((item) => [item.key, item]));
|
|
1961
1986
|
for (const key of providedPromptParamKeys(promptParams)) {
|
|
1962
1987
|
const param = paramByKey.get(key);
|
|
@@ -1970,6 +1995,18 @@ function assertParamsAgainstModel(promptParams = {}, params = [], constraints =
|
|
|
1970
1995
|
if (param.maxLength != null && typeof value === 'string' && value.length > param.maxLength) {
|
|
1971
1996
|
throw argumentError(`参数 ${key} 超过模型长度限制:${value.length}/${param.maxLength}`);
|
|
1972
1997
|
}
|
|
1998
|
+
if (taskKind === 'audio' && (param.minValue != null || param.maxValue != null)) {
|
|
1999
|
+
const numericValue = Number(value);
|
|
2000
|
+
if (!Number.isFinite(numericValue)) {
|
|
2001
|
+
throw argumentError(`参数 ${key} 必须是数字:${value}`);
|
|
2002
|
+
}
|
|
2003
|
+
if (param.minValue != null && numericValue < param.minValue) {
|
|
2004
|
+
throw argumentError(`参数 ${key} 小于模型最小值:${numericValue}/${param.minValue}`);
|
|
2005
|
+
}
|
|
2006
|
+
if (param.maxValue != null && numericValue > param.maxValue) {
|
|
2007
|
+
throw argumentError(`参数 ${key} 超过模型最大值:${numericValue}/${param.maxValue}`);
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
1973
2010
|
}
|
|
1974
2011
|
|
|
1975
2012
|
for (const constraint of constraints) {
|
|
@@ -1996,7 +2033,7 @@ async function validateCreateRequestAgainstModel(kind, modelGroupCode, promptPar
|
|
|
1996
2033
|
const params = modelOptionParams(context.options, context.taskKind);
|
|
1997
2034
|
const resources = modelOptionsResources(context.inputModes);
|
|
1998
2035
|
const effectiveResources = applyResourceLimitProfileConstraints(resources, context.constraints, resourceDetails);
|
|
1999
|
-
assertParamsAgainstModel(promptParams, params, context.constraints);
|
|
2036
|
+
assertParamsAgainstModel(promptParams, params, context.constraints, kind);
|
|
2000
2037
|
assertResourceShapeAgainstModel(resourceDetails, effectiveResources);
|
|
2001
2038
|
assertResourceCountsAgainstModel(resourceDetails, effectiveResources);
|
|
2002
2039
|
if (kind === 'video') {
|
|
@@ -2355,11 +2392,54 @@ function inferTaskKind(found, optionKeys) {
|
|
|
2355
2392
|
if (found?.kind) return found.kind;
|
|
2356
2393
|
if (found?.usage === 'IMAGE_CREATE') return 'image';
|
|
2357
2394
|
if (found?.usage === 'VIDEO_CREATE') return 'video';
|
|
2395
|
+
if (found?.usage === 'AUDIO_CREATE') return 'audio';
|
|
2358
2396
|
return ['generated_time', 'frames', 'multi_param', 'multi_prompt', 'generated_mode', 'need_audio']
|
|
2359
2397
|
.some((key) => optionKeys.has(key)) ? 'video' : 'image';
|
|
2360
2398
|
}
|
|
2361
2399
|
|
|
2362
2400
|
function createSpecInputModes(taskKind, optionKeys, rulesByKey = new Map()) {
|
|
2401
|
+
if (taskKind === 'audio') {
|
|
2402
|
+
const hasPrompt = optionKeys.has('prompt');
|
|
2403
|
+
const hasResources = optionKeys.has('resources');
|
|
2404
|
+
const resourceRules = rulesByKey.get('resources') || {};
|
|
2405
|
+
const typedResourceRules = Array.isArray(resourceRules.resources) ? resourceRules.resources : [];
|
|
2406
|
+
const supportsResourceType = (mediaType) => !typedResourceRules.length
|
|
2407
|
+
|| typedResourceRules.some((item) => String(item?.mediaType || '').toUpperCase() === mediaType);
|
|
2408
|
+
const resourceLimits = (mediaType) => typedResourceRules.length
|
|
2409
|
+
? mediaRuleFromMultiParam(resourceRules, mediaType)
|
|
2410
|
+
: normalizeMediaRule(resourceRules);
|
|
2411
|
+
return [
|
|
2412
|
+
{
|
|
2413
|
+
mode: 'prompt_only',
|
|
2414
|
+
supported: hasPrompt,
|
|
2415
|
+
intent: '文本生成音频',
|
|
2416
|
+
requiredArgs: ['--model-group-code', '--prompt', '--duration'],
|
|
2417
|
+
userInput: '提供 prompt 和生成时长,不提供参考素材。',
|
|
2418
|
+
},
|
|
2419
|
+
{
|
|
2420
|
+
mode: 'reference_audio',
|
|
2421
|
+
supported: hasResources && supportsResourceType('AUDIO'),
|
|
2422
|
+
intent: '参考音频生成',
|
|
2423
|
+
requiredArgs: ['--model-group-code', '--prompt', '--duration', '--resource audio:reference=...'],
|
|
2424
|
+
userInput: '最多提供三段参考音频。',
|
|
2425
|
+
resourceSyntax: ['audio:reference=./reference.mp3'],
|
|
2426
|
+
requiredResources: ['audio:reference'],
|
|
2427
|
+
sourceKinds: ['local_file', 'http_url', 'backendPath'],
|
|
2428
|
+
resourceLimits: resourceLimits('AUDIO'),
|
|
2429
|
+
},
|
|
2430
|
+
{
|
|
2431
|
+
mode: 'reference_image',
|
|
2432
|
+
supported: hasResources && supportsResourceType('IMAGE'),
|
|
2433
|
+
intent: '参考图片生成音频',
|
|
2434
|
+
requiredArgs: ['--model-group-code', '--prompt', '--duration', '--resource image:reference=...'],
|
|
2435
|
+
userInput: '提供一张参考图片,不能与参考音频混用。',
|
|
2436
|
+
resourceSyntax: ['image:reference=./reference.png'],
|
|
2437
|
+
requiredResources: ['image:reference'],
|
|
2438
|
+
sourceKinds: ['local_file', 'http_url', 'backendPath'],
|
|
2439
|
+
resourceLimits: resourceLimits('IMAGE'),
|
|
2440
|
+
},
|
|
2441
|
+
];
|
|
2442
|
+
}
|
|
2363
2443
|
const hasPrompt = optionKeys.has('prompt');
|
|
2364
2444
|
const hasImageReference = ['iref', 'cref', 'sref', 'resources'].some((key) => optionKeys.has(key));
|
|
2365
2445
|
const hasFrames = optionKeys.has('frames');
|
|
@@ -2570,6 +2650,17 @@ function createSpecSupportedIntents(inputModes, taskKind = null) {
|
|
|
2570
2650
|
promptBinding: 'none',
|
|
2571
2651
|
promptPlaceholder: '图片任务不使用 reference_key 或 <<<key>>>;在 prompt 中用自然语言指代参考图。',
|
|
2572
2652
|
}));
|
|
2653
|
+
} else if (taskKind === 'audio') {
|
|
2654
|
+
intents.push(compactRecord({
|
|
2655
|
+
mode: 'reference',
|
|
2656
|
+
intent: '参考素材生成音频',
|
|
2657
|
+
userInput: `用户提供${referenceLabels.join('、')}作为参考素材;参考音频与参考图片不能混用。`,
|
|
2658
|
+
requiredArgs: ['--model-group-code', '--prompt', '--duration', '--resource <audio|image>:reference=...'],
|
|
2659
|
+
resourceUsages: ['reference'],
|
|
2660
|
+
resourceSyntax: uniqueNonEmpty(referenceModes.flatMap((item) => item.resourceSyntax || [])),
|
|
2661
|
+
promptBinding: 'none',
|
|
2662
|
+
promptPlaceholder: '音频任务不使用 reference_key 或 <<<key>>>。',
|
|
2663
|
+
}));
|
|
2573
2664
|
} else {
|
|
2574
2665
|
intents.push(compactRecord({
|
|
2575
2666
|
mode: 'reference',
|
|
@@ -2746,16 +2837,20 @@ function createSpecParameterControls(createParams, inputModes = []) {
|
|
|
2746
2837
|
function createSpecAgentGuidance(taskKind, inputRequirement) {
|
|
2747
2838
|
const keyParamGuidance = taskKind === 'video'
|
|
2748
2839
|
? 'fee 或 create --dry-run 前,必须先确认用户未提供的价格 / 效果关键参数:quality、duration、约束后仍可选的 ratio;needAudio 普通模型只在用户明确要输出音效时确认。可灵 3o / Kling 3.0 支持 needAudio 时 CLI 默认开声音,用户明确不要声音时传 --need-audio false。不要静默使用 defaultValue 先估价。'
|
|
2749
|
-
:
|
|
2840
|
+
: (taskKind === 'audio'
|
|
2841
|
+
? 'fee 或 create --dry-run 前,必须确认 duration;audioFormat 未提供时默认 mp3,其余音频参数以 model options 为准。'
|
|
2842
|
+
: 'fee 或 create --dry-run 前,必须先确认用户未提供的价格 / 效果关键参数:quality、ratio、generateNum。不要静默使用 defaultValue 先估价。');
|
|
2750
2843
|
const guidance = [
|
|
2751
2844
|
'先用 model options 获取枚举值、文件类型、数量、大小、时长和条件约束;create-spec 只负责创建方式。',
|
|
2752
2845
|
'用 inputRequirement 和 supportedIntents 在 prompt_only、reference、frames、storyboard 中选择一种输入模式;不要按媒体类型拆成多个任务。',
|
|
2753
2846
|
];
|
|
2754
2847
|
if (taskKind === 'image') {
|
|
2755
2848
|
guidance.push('图片任务不使用 reference_key 或 <<<key>>>。参考图只用 --resource image:reference=... 传入,prompt 用“图一 / 图二 / 参考图 / 白发女 / 背景图”等自然语言指代。');
|
|
2756
|
-
} else {
|
|
2849
|
+
} else if (taskKind === 'video') {
|
|
2757
2850
|
guidance.push('reference_key 是视频参考资源的可选绑定;prompt 可以不写占位符。如果 prompt 写了 <<<key>>>,必须能匹配同名 reference 资源。');
|
|
2758
2851
|
guidance.push('只有 model options.resources[] 存在 media=AUDIO usage=reference 时,音频文件 / URL / asset 才能走 --resource audio:reference=...;是否需要输出音效才使用 --need-audio true/false。');
|
|
2852
|
+
} else {
|
|
2853
|
+
guidance.push('音频任务只接受 reference 用途的音频或图片;最多 3 个参考音频或 1 张参考图片,两类不能混用,也不使用 reference_key。');
|
|
2759
2854
|
}
|
|
2760
2855
|
guidance.push(
|
|
2761
2856
|
keyParamGuidance,
|
|
@@ -2781,16 +2876,21 @@ function createSpecValidationRules(taskKind) {
|
|
|
2781
2876
|
if (taskKind === 'video') {
|
|
2782
2877
|
rules.splice(4, 0, 'reference_key 仅用于视频 reference 资源的可选 prompt 占位符绑定;prompt 中出现 <<<key>>> 时,必须有同名 reference 资源。');
|
|
2783
2878
|
rules.push('subject reference 必须使用 asset:<externalId>,externalId 应来自 create subject + create subject-wait。');
|
|
2784
|
-
} else {
|
|
2879
|
+
} else if (taskKind === 'image') {
|
|
2785
2880
|
rules.push('图片任务 resources 只接受 image reference,且不接受 reference_key 或 <<<key>>>;请用自然 prompt 描述图一、图二、参考图、主体等映射。');
|
|
2881
|
+
} else {
|
|
2882
|
+
rules.push('音频任务 resources 只接受 audio/image reference;最多 3 个参考音频或 1 张参考图片,不能混用,也不接受 reference_key。');
|
|
2786
2883
|
}
|
|
2787
2884
|
return rules;
|
|
2788
2885
|
}
|
|
2789
2886
|
|
|
2790
2887
|
function createSpecPreflight(taskKind) {
|
|
2791
|
-
const
|
|
2792
|
-
|
|
2793
|
-
|
|
2888
|
+
const commands = {
|
|
2889
|
+
image: ['model image-models', 'create image-fee', 'create image'],
|
|
2890
|
+
video: ['model video-models', 'create video-fee', 'create video'],
|
|
2891
|
+
audio: ['model audio-models', 'create audio-fee', 'create audio'],
|
|
2892
|
+
};
|
|
2893
|
+
const [modelListCommand, feeCommand, createCommand] = commands[taskKind] || commands.image;
|
|
2794
2894
|
return [
|
|
2795
2895
|
'doctor --verify',
|
|
2796
2896
|
`${modelListCommand} --model <keyword>`,
|
|
@@ -2811,7 +2911,7 @@ function createSpecExamples(taskKind, supportedIntents) {
|
|
|
2811
2911
|
if (taskKind === 'image') {
|
|
2812
2912
|
if (hasIntent('prompt_only')) examples.push('lj-awb create image --model-group-code <code> --prompt "品牌吉祥物表情包四宫格" --ratio 1:1 --quality 1K --dry-run');
|
|
2813
2913
|
if (hasIntent('reference')) examples.push('lj-awb create image --model-group-code <code> --prompt "保持参考图主体,生成海报" --resource image:reference=./ref.png --dry-run');
|
|
2814
|
-
} else {
|
|
2914
|
+
} else if (taskKind === 'video') {
|
|
2815
2915
|
if (hasIntent('prompt_only')) examples.push('lj-awb create video --model-group-code <code> --prompt "机器人站在白色展台中央,缓慢转身" --duration 6 --dry-run');
|
|
2816
2916
|
if (hasIntent('reference')) {
|
|
2817
2917
|
const referenceIntent = supportedIntents.find((item) => item.mode === 'reference');
|
|
@@ -2829,6 +2929,9 @@ function createSpecExamples(taskKind, supportedIntents) {
|
|
|
2829
2929
|
}
|
|
2830
2930
|
}
|
|
2831
2931
|
if (hasIntent('storyboard')) examples.push('lj-awb create video --model-group-code <code> --resources-json ./storyboard.json --duration 5 --dry-run');
|
|
2932
|
+
} else {
|
|
2933
|
+
if (hasIntent('prompt_only')) examples.push('lj-awb create audio --model-group-code <code> --prompt "轻快明亮的电子音乐" --duration 6 --dry-run');
|
|
2934
|
+
if (hasIntent('reference')) examples.push('lj-awb create audio --model-group-code <code> --prompt "保持参考音色,生成舒缓配乐" --duration 6 --resource audio:reference=./reference.mp3 --dry-run');
|
|
2832
2935
|
}
|
|
2833
2936
|
return examples;
|
|
2834
2937
|
}
|
|
@@ -2854,6 +2957,12 @@ function modelOptionParams(options = [], taskKind = 'image') {
|
|
|
2854
2957
|
const maxLength = option.paramType === 'Prompt'
|
|
2855
2958
|
? ruleNumber(rules.maxValue ?? rules.maxLength ?? rules.maxPromptLength)
|
|
2856
2959
|
: undefined;
|
|
2960
|
+
const minValue = taskKind !== 'audio' || option.paramType === 'Prompt'
|
|
2961
|
+
? undefined
|
|
2962
|
+
: ruleNumber(rules.minValue ?? rules.min);
|
|
2963
|
+
const maxValue = taskKind !== 'audio' || option.paramType === 'Prompt'
|
|
2964
|
+
? undefined
|
|
2965
|
+
: ruleNumber(rules.maxValue ?? rules.max);
|
|
2857
2966
|
return compactRecord({
|
|
2858
2967
|
key: createParam.key,
|
|
2859
2968
|
label: option.paramName,
|
|
@@ -2862,6 +2971,8 @@ function modelOptionParams(options = [], taskKind = 'image') {
|
|
|
2862
2971
|
defaultValue,
|
|
2863
2972
|
defaultName: modelParamDefaultName(option),
|
|
2864
2973
|
maxLength,
|
|
2974
|
+
minValue,
|
|
2975
|
+
maxValue,
|
|
2865
2976
|
required,
|
|
2866
2977
|
cliArg: createParam.cliArg,
|
|
2867
2978
|
genericModelParam: createParam.genericModelParam || undefined,
|
|
@@ -3020,13 +3131,19 @@ export async function modelCreateSpec(kwargs = {}) {
|
|
|
3020
3131
|
const context = await loadModelOptionContext(modelGroupCode, { includeRaw });
|
|
3021
3132
|
const supportedIntents = createSpecSupportedIntents(context.inputModes, context.taskKind);
|
|
3022
3133
|
const inputRequirement = createSpecInputRequirement(context.taskKind, context.inputModes, supportedIntents);
|
|
3134
|
+
const commandByTaskKind = {
|
|
3135
|
+
image: { create: 'create image', fee: 'create image-fee', taskType: 'IMAGE_CREATE' },
|
|
3136
|
+
video: { create: 'create video', fee: 'create video-fee', taskType: 'VIDEO_GROUP' },
|
|
3137
|
+
audio: { create: 'create audio', fee: 'create audio-fee', taskType: 'AUDIO_CREATE' },
|
|
3138
|
+
};
|
|
3139
|
+
const commands = commandByTaskKind[context.taskKind] || commandByTaskKind.image;
|
|
3023
3140
|
return compactRecord({
|
|
3024
3141
|
schemaVersion: 1,
|
|
3025
3142
|
modelGroupCode,
|
|
3026
3143
|
taskKind: context.taskKind,
|
|
3027
|
-
createCommand:
|
|
3028
|
-
feeCommand:
|
|
3029
|
-
statusCommandTaskType:
|
|
3144
|
+
createCommand: commands.create,
|
|
3145
|
+
feeCommand: commands.fee,
|
|
3146
|
+
statusCommandTaskType: commands.taskType,
|
|
3030
3147
|
optionsCommand: `model options --model-group-code ${modelGroupCode}`,
|
|
3031
3148
|
model: context.model,
|
|
3032
3149
|
inputRequirement,
|
|
@@ -3064,6 +3181,7 @@ const AUDIO_VIDEO_EXTENSIONS = new Set([
|
|
|
3064
3181
|
'.oga',
|
|
3065
3182
|
'.ogg',
|
|
3066
3183
|
'.ogv',
|
|
3184
|
+
'.pcm',
|
|
3067
3185
|
'.wav',
|
|
3068
3186
|
'.webm',
|
|
3069
3187
|
]);
|
|
@@ -4219,7 +4337,7 @@ const RESOURCE_SOURCE_KEYS = new Set(['kind', 'value']);
|
|
|
4219
4337
|
const RESOURCE_TYPES = new Set(['image', 'video', 'audio', 'subject']);
|
|
4220
4338
|
const RESOURCE_USAGES = new Set(['reference', 'first_frame', 'last_frame', 'keyframe']);
|
|
4221
4339
|
|
|
4222
|
-
function parseIntegerParam(value, name, minValue) {
|
|
4340
|
+
function parseIntegerParam(value, name, minValue, maxValue = null) {
|
|
4223
4341
|
if (value == null || value === '') return null;
|
|
4224
4342
|
const text = String(value).trim();
|
|
4225
4343
|
if (!/^[+-]?\d+$/.test(text)) {
|
|
@@ -4232,6 +4350,9 @@ function parseIntegerParam(value, name, minValue) {
|
|
|
4232
4350
|
if (parsed < minValue) {
|
|
4233
4351
|
throw argumentError(`${name} 必须是${minValue === 0 ? '非负整数' : '正整数'}`);
|
|
4234
4352
|
}
|
|
4353
|
+
if (maxValue != null && parsed > maxValue) {
|
|
4354
|
+
throw argumentError(`${name} 不能超过 ${maxValue}`);
|
|
4355
|
+
}
|
|
4235
4356
|
return parsed;
|
|
4236
4357
|
}
|
|
4237
4358
|
|
|
@@ -4472,6 +4593,21 @@ async function collectResourceSpecs(kwargs = {}, options = {}) {
|
|
|
4472
4593
|
});
|
|
4473
4594
|
if (Array.isArray(resourcesJson)) items.push(...resourcesJson);
|
|
4474
4595
|
return items.map((item, index) => normalizeResourceObject(item, index)).filter((item) => {
|
|
4596
|
+
if (options.kind === 'audio') {
|
|
4597
|
+
if (!['audio', 'image'].includes(item.type)) {
|
|
4598
|
+
throw argumentError('音频任务 resource 只支持 type=audio 或 type=image');
|
|
4599
|
+
}
|
|
4600
|
+
if (item.usage !== 'reference') {
|
|
4601
|
+
throw argumentError('音频任务 resource 只支持 usage=reference');
|
|
4602
|
+
}
|
|
4603
|
+
if (item.reference_key) {
|
|
4604
|
+
throw argumentError('音频任务 reference 不支持 reference_key');
|
|
4605
|
+
}
|
|
4606
|
+
if (item._source.kind !== 'url') {
|
|
4607
|
+
throw argumentError('音频任务 resource 暂只支持 url,本地文件会自动上传为 url');
|
|
4608
|
+
}
|
|
4609
|
+
return true;
|
|
4610
|
+
}
|
|
4475
4611
|
if (options.kind !== 'image') return true;
|
|
4476
4612
|
if (item.type !== 'image') {
|
|
4477
4613
|
throw argumentError('图片任务 resource 只支持 type=image');
|
|
@@ -4935,7 +5071,7 @@ async function buildVideoRequest(kwargs = {}, options = {}) {
|
|
|
4935
5071
|
if (shouldDefaultNeedAudioForVideoModel(validation.context.model, validation.params, promptParams)) {
|
|
4936
5072
|
defaultParams.need_audio = true;
|
|
4937
5073
|
promptParams = normalizeUnifiedPromptParams(defaultParams);
|
|
4938
|
-
assertParamsAgainstModel(promptParams, validation.params, validation.context.constraints);
|
|
5074
|
+
assertParamsAgainstModel(promptParams, validation.params, validation.context.constraints, validation.context.taskKind);
|
|
4939
5075
|
}
|
|
4940
5076
|
const resolvedResources = await resolveResources(kwargs, {
|
|
4941
5077
|
dryRun,
|
|
@@ -5027,6 +5163,146 @@ export async function videoCreate(kwargs = {}) {
|
|
|
5027
5163
|
};
|
|
5028
5164
|
}
|
|
5029
5165
|
|
|
5166
|
+
async function buildAudioRequest(kwargs = {}, options = {}) {
|
|
5167
|
+
const dryRun = Boolean(options.dryRun);
|
|
5168
|
+
const model = resolveTaskModel('audio', kwargs);
|
|
5169
|
+
const prompt = trimToNull(kwargs.prompt);
|
|
5170
|
+
if (!prompt) throw argumentError('缺少音频生成提示词', '传 --prompt <text>。');
|
|
5171
|
+
|
|
5172
|
+
const duration = parseIntegerParam(kwargs.duration, '--duration', 1, 120);
|
|
5173
|
+
if (duration == null) throw argumentError('缺少音频生成时长', '传 --duration <seconds>,支持 1-120 秒。');
|
|
5174
|
+
|
|
5175
|
+
const validationResources = await resolveResources(kwargs, {
|
|
5176
|
+
dryRun: true,
|
|
5177
|
+
kind: 'audio',
|
|
5178
|
+
sceneType: TASK_UPLOAD_SCENE.AUDIO_CREATE,
|
|
5179
|
+
});
|
|
5180
|
+
const audioReferenceCount = validationResources.resources.filter((item) => item.type === 'audio').length;
|
|
5181
|
+
const imageReferenceCount = validationResources.resources.filter((item) => item.type === 'image').length;
|
|
5182
|
+
if (audioReferenceCount > 3) throw argumentError('参考音频最多支持 3 个');
|
|
5183
|
+
if (imageReferenceCount > 1) throw argumentError('参考图片最多支持 1 张');
|
|
5184
|
+
if (audioReferenceCount && imageReferenceCount) {
|
|
5185
|
+
throw argumentError('参考音频和参考图片不能混用');
|
|
5186
|
+
}
|
|
5187
|
+
const genericModelParams = await collectGenericModelParams(kwargs);
|
|
5188
|
+
const defaultParams = {
|
|
5189
|
+
...genericModelParams,
|
|
5190
|
+
prompt,
|
|
5191
|
+
duration,
|
|
5192
|
+
audio_format: trimToNull(kwargs.audioFormat ?? kwargs.audio_format) ?? 'mp3',
|
|
5193
|
+
resources: validationResources.resources,
|
|
5194
|
+
};
|
|
5195
|
+
const integerOptions = [
|
|
5196
|
+
['sample_rate', kwargs.sampleRate ?? kwargs.sample_rate, 1],
|
|
5197
|
+
['speech_rate', kwargs.speechRate ?? kwargs.speech_rate, -50],
|
|
5198
|
+
['loudness_rate', kwargs.loudnessRate ?? kwargs.loudness_rate, -50],
|
|
5199
|
+
['pitch_rate', kwargs.pitchRate ?? kwargs.pitch_rate, -12],
|
|
5200
|
+
];
|
|
5201
|
+
for (const [key, value, min] of integerOptions) {
|
|
5202
|
+
if (value != null && value !== '') defaultParams[key] = parseIntegerParam(value, `--${key.replaceAll('_', '-')}`, min);
|
|
5203
|
+
}
|
|
5204
|
+
const enableSubtitle = kwargs.enableSubtitle ?? kwargs.enable_subtitle;
|
|
5205
|
+
if (enableSubtitle != null && enableSubtitle !== '') defaultParams.enable_subtitle = toBool(enableSubtitle);
|
|
5206
|
+
|
|
5207
|
+
const promptParams = normalizeUnifiedPromptParams(defaultParams);
|
|
5208
|
+
const validation = await validateCreateRequestAgainstModel(
|
|
5209
|
+
'audio', model.modelGroupCode, promptParams, validationResources.resourceDetails,
|
|
5210
|
+
);
|
|
5211
|
+
const resolvedResources = await resolveResources(kwargs, {
|
|
5212
|
+
dryRun,
|
|
5213
|
+
kind: 'audio',
|
|
5214
|
+
sceneType: TASK_UPLOAD_SCENE.AUDIO_CREATE,
|
|
5215
|
+
resourceRules: validation.resourceRules,
|
|
5216
|
+
});
|
|
5217
|
+
const requestPromptParams = normalizeUnifiedPromptParams({
|
|
5218
|
+
...defaultParams,
|
|
5219
|
+
resources: resolvedResources.resources,
|
|
5220
|
+
});
|
|
5221
|
+
const projectGroupNo = await resolveProjectGroupNo(kwargs.projectGroupNo, {
|
|
5222
|
+
allowNull: dryRun,
|
|
5223
|
+
noNetwork: dryRun,
|
|
5224
|
+
noSave: dryRun,
|
|
5225
|
+
});
|
|
5226
|
+
return {
|
|
5227
|
+
model,
|
|
5228
|
+
projectGroupNo,
|
|
5229
|
+
uploads: resolvedResources.uploads,
|
|
5230
|
+
localFiles: resolvedResources.localFiles,
|
|
5231
|
+
resourceConversions: resolvedResources.resourceConversions,
|
|
5232
|
+
request: {
|
|
5233
|
+
requestSource: REQUEST_SOURCE_CLI,
|
|
5234
|
+
modelGroupCode: model.modelGroupCode,
|
|
5235
|
+
promptParams: requestPromptParams,
|
|
5236
|
+
...(projectGroupNo ? { projectGroupNo } : {}),
|
|
5237
|
+
},
|
|
5238
|
+
};
|
|
5239
|
+
}
|
|
5240
|
+
|
|
5241
|
+
export async function audioFee(kwargs = {}) {
|
|
5242
|
+
if (toBool(kwargs.dryRun)) {
|
|
5243
|
+
const built = await buildAudioRequest(kwargs, { dryRun: true });
|
|
5244
|
+
return compactRecord({
|
|
5245
|
+
dryRun: true,
|
|
5246
|
+
action: 'create audio-fee',
|
|
5247
|
+
request: built.request,
|
|
5248
|
+
...(built.resourceConversions.length ? { resourceConversions: built.resourceConversions } : {}),
|
|
5249
|
+
});
|
|
5250
|
+
}
|
|
5251
|
+
const built = await buildAudioRequest(kwargs);
|
|
5252
|
+
const payload = await awbApi.fetchAudioFee(built.request);
|
|
5253
|
+
return {
|
|
5254
|
+
data: payload,
|
|
5255
|
+
...(await pointEstimate(payload, built.projectGroupNo)),
|
|
5256
|
+
};
|
|
5257
|
+
}
|
|
5258
|
+
|
|
5259
|
+
export async function audioCreate(kwargs = {}) {
|
|
5260
|
+
if (toBool(kwargs.dryRun)) {
|
|
5261
|
+
const built = await buildAudioRequest(kwargs, { dryRun: true });
|
|
5262
|
+
return compactRecord({
|
|
5263
|
+
dryRun: true,
|
|
5264
|
+
action: 'create audio',
|
|
5265
|
+
request: built.request,
|
|
5266
|
+
...(built.localFiles.length ? { localFiles: built.localFiles } : {}),
|
|
5267
|
+
...(built.resourceConversions.length ? { resourceConversions: built.resourceConversions } : {}),
|
|
5268
|
+
});
|
|
5269
|
+
}
|
|
5270
|
+
ensureConfirmed(kwargs, '正式生成音频会消耗积分,需要确认', { action: 'create audio' });
|
|
5271
|
+
const built = await buildAudioRequest(kwargs);
|
|
5272
|
+
const feePayload = await awbApi.fetchAudioFee(built.request).catch(() => null);
|
|
5273
|
+
const estimate = await pointEstimate(feePayload, built.projectGroupNo).catch(() => ({}));
|
|
5274
|
+
const payload = await awbApi.createAudioTask(built.request);
|
|
5275
|
+
const result = normalizeCreatedTask(payload, {
|
|
5276
|
+
...estimate,
|
|
5277
|
+
projectGroupNo: built.projectGroupNo,
|
|
5278
|
+
modelGroupCode: built.request.modelGroupCode,
|
|
5279
|
+
...(built.uploads.length ? { uploads: normalizeCreateUploads(built.uploads) } : {}),
|
|
5280
|
+
});
|
|
5281
|
+
await appendTaskRecord(kwargs, {
|
|
5282
|
+
taskId: result.taskId,
|
|
5283
|
+
taskType: 'AUDIO_CREATE',
|
|
5284
|
+
projectGroupNo: built.projectGroupNo,
|
|
5285
|
+
modelGroupCode: built.request.modelGroupCode,
|
|
5286
|
+
promptSummary: taskPromptSummary({ prompt: built.request.promptParams?.prompt }),
|
|
5287
|
+
});
|
|
5288
|
+
if (toInt(kwargs.waitSeconds, 0) > 0 && result.taskId) {
|
|
5289
|
+
return {
|
|
5290
|
+
...result,
|
|
5291
|
+
waited: await waitTask({
|
|
5292
|
+
taskId: result.taskId,
|
|
5293
|
+
taskType: 'AUDIO_CREATE',
|
|
5294
|
+
projectGroupNo: built.projectGroupNo,
|
|
5295
|
+
waitSeconds: kwargs.waitSeconds,
|
|
5296
|
+
pollIntervalMs: kwargs.pollIntervalMs,
|
|
5297
|
+
}),
|
|
5298
|
+
};
|
|
5299
|
+
}
|
|
5300
|
+
return {
|
|
5301
|
+
...result,
|
|
5302
|
+
nextCommand: result.taskId ? `lj-awb task wait --task-id ${result.taskId} -f json` : null,
|
|
5303
|
+
};
|
|
5304
|
+
}
|
|
5305
|
+
|
|
5030
5306
|
export async function loadBatchItems(inputFile, mode = 'generic') {
|
|
5031
5307
|
const filePath = trimToNull(inputFile);
|
|
5032
5308
|
if (!filePath) throw argumentError('缺少批量输入文件', '传 --input-file <json|jsonl|txt>。');
|
|
@@ -195,7 +195,7 @@ function buildOutputContext(command, kwargs = {}, data = {}) {
|
|
|
195
195
|
if (command.name === 'create asset' && data?.conversionPlan && !toBool(kwargs.autoConvert)) {
|
|
196
196
|
confirmSet.autoConvert = true;
|
|
197
197
|
}
|
|
198
|
-
const isModelList = command.name === 'model image-models' || command.name === 'model video-models';
|
|
198
|
+
const isModelList = command.name === 'model image-models' || command.name === 'model video-models' || command.name === 'model audio-models';
|
|
199
199
|
const hasModelFilter = isModelList && !toBool(kwargs.all) && Boolean(
|
|
200
200
|
trimToNull(kwargs.model) || trimToNull(kwargs.usage) || trimToNull(kwargs.provider)
|
|
201
201
|
|| trimToNull(kwargs.inputMode) || trimToNull(kwargs.supports)
|
|
@@ -365,6 +365,9 @@ const RENAMED_COMMAND_HINTS = {
|
|
|
365
365
|
'video fee': 'create video-fee',
|
|
366
366
|
'video create': 'create video',
|
|
367
367
|
'video create-batch': 'create video-batch',
|
|
368
|
+
audio: 'create audio',
|
|
369
|
+
'audio fee': 'create audio-fee',
|
|
370
|
+
'audio create': 'create audio',
|
|
368
371
|
'video subtitle-remove': 'create video-subtitle-removal',
|
|
369
372
|
'video super-resolution': 'create video-super-resolution',
|
|
370
373
|
'video super-resolution-fee': 'create video-super-resolution-fee',
|
|
@@ -399,13 +402,14 @@ const RENAMED_COMMAND_HINTS = {
|
|
|
399
402
|
'credits buy': 'credits recharge',
|
|
400
403
|
};
|
|
401
404
|
|
|
402
|
-
const MODEL_LIST_GUESS_HINT =
|
|
405
|
+
const MODEL_LIST_GUESS_HINT = `按任务类型分开查询:生图用 ${'`'}model image-models${'`'},生视频用 ${'`'}model video-models${'`'},音频用 ${'`'}model audio-models${'`'}。`;
|
|
403
406
|
const COMMAND_GUESS_HINTS = {
|
|
404
407
|
'model list': MODEL_LIST_GUESS_HINT,
|
|
405
408
|
'model models': MODEL_LIST_GUESS_HINT,
|
|
406
409
|
'model ls': MODEL_LIST_GUESS_HINT,
|
|
407
410
|
'model image': MODEL_LIST_GUESS_HINT,
|
|
408
411
|
'model video': MODEL_LIST_GUESS_HINT,
|
|
412
|
+
'model audio': MODEL_LIST_GUESS_HINT,
|
|
409
413
|
'models': MODEL_LIST_GUESS_HINT,
|
|
410
414
|
};
|
|
411
415
|
|
|
@@ -517,6 +521,7 @@ const GROUP_EXAMPLES = {
|
|
|
517
521
|
model: [
|
|
518
522
|
'lj-awb model image-models --model Banana',
|
|
519
523
|
'lj-awb model video-models --model Seedance',
|
|
524
|
+
'lj-awb model audio-models',
|
|
520
525
|
'lj-awb model asset-review-models --platform JIMENG',
|
|
521
526
|
'lj-awb model input-guide',
|
|
522
527
|
'lj-awb model options --model-group-code <code>',
|
|
@@ -530,6 +535,7 @@ const GROUP_EXAMPLES = {
|
|
|
530
535
|
'lj-awb create image-fee --model-group-code <code> --prompt "一只小狗"',
|
|
531
536
|
'lj-awb create video --model-group-code <code> --prompt "镜头推进" --resource image:first_frame=./actor.png --dry-run',
|
|
532
537
|
'lj-awb create video-fee --model-group-code <code> --prompt "雨夜奔跑" --duration 5',
|
|
538
|
+
'lj-awb create audio --model-group-code <code> --prompt "海浪与钢琴" --duration 12 --dry-run',
|
|
533
539
|
'lj-awb create video-super-resolution --object-name material/video-super/example.mp4 --dry-run',
|
|
534
540
|
'lj-awb create subject --model-code tx --name 女主 --resource primary:./three-view.png --dry-run',
|
|
535
541
|
'lj-awb create subject-wait --element-id <elementId> --wait-seconds 300',
|
|
@@ -556,6 +562,8 @@ const COMMAND_REQUIRED_OPTIONS = {
|
|
|
556
562
|
'create video-fee': ['modelGroupCode'],
|
|
557
563
|
'create video': ['modelGroupCode'],
|
|
558
564
|
'create video-batch': ['inputFile', 'modelGroupCode'],
|
|
565
|
+
'create audio-fee': ['modelGroupCode', 'prompt', 'duration'],
|
|
566
|
+
'create audio': ['modelGroupCode', 'prompt', 'duration'],
|
|
559
567
|
'create video-super-resolution-fee': ['objectName'],
|
|
560
568
|
'create video-super-resolution': ['objectName'],
|
|
561
569
|
'task status': ['taskId'],
|
|
@@ -599,6 +607,7 @@ const CONFIRMATION_COMMANDS = new Set([
|
|
|
599
607
|
'create image-batch',
|
|
600
608
|
'create video',
|
|
601
609
|
'create video-batch',
|
|
610
|
+
'create audio',
|
|
602
611
|
'create video-super-resolution',
|
|
603
612
|
'create video-subtitle-removal',
|
|
604
613
|
'create asset-group',
|
|
@@ -614,6 +623,7 @@ const COST_COMMANDS = new Set([
|
|
|
614
623
|
'create image-batch',
|
|
615
624
|
'create video',
|
|
616
625
|
'create video-batch',
|
|
626
|
+
'create audio',
|
|
617
627
|
'create video-super-resolution',
|
|
618
628
|
'create video-subtitle-removal',
|
|
619
629
|
]);
|
|
@@ -630,6 +640,7 @@ const REMOTE_WRITE_COMMANDS = new Set([
|
|
|
630
640
|
'create image-batch',
|
|
631
641
|
'create video',
|
|
632
642
|
'create video-batch',
|
|
643
|
+
'create audio',
|
|
633
644
|
'create video-super-resolution',
|
|
634
645
|
'create video-subtitle-removal',
|
|
635
646
|
'create asset-group',
|
|
@@ -676,6 +687,7 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
676
687
|
'credits redeem': 'redeem_result',
|
|
677
688
|
'model image-models': 'model_list',
|
|
678
689
|
'model video-models': 'model_list',
|
|
690
|
+
'model audio-models': 'model_list',
|
|
679
691
|
'model asset-review-models': 'asset_review_model_list',
|
|
680
692
|
'model options': 'model_options',
|
|
681
693
|
'model create-spec': 'model_create_spec',
|
|
@@ -687,6 +699,8 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
687
699
|
'create video-fee': 'fee_estimate',
|
|
688
700
|
'create video': 'task_submission',
|
|
689
701
|
'create video-batch': 'batch_task_submission',
|
|
702
|
+
'create audio-fee': 'fee_estimate',
|
|
703
|
+
'create audio': 'task_submission',
|
|
690
704
|
'create video-super-resolution-fee': 'fee_estimate',
|
|
691
705
|
'create video-super-resolution': 'task_submission',
|
|
692
706
|
'create video-subtitle-removal': 'subtitle_task_submission',
|
|
@@ -714,6 +728,7 @@ const PREFLIGHTS_BY_COMMAND = {
|
|
|
714
728
|
'create image': ['doctor --verify', 'model image-models', 'model options', 'model create-spec', 'confirm missing key params', 'create image-fee', 'create image --dry-run'],
|
|
715
729
|
'create image-batch': ['doctor --verify', 'model image-models', 'model options', 'model create-spec', 'prepare JSONL input', 'create image-batch --dry-run'],
|
|
716
730
|
'create video': ['doctor --verify', 'model video-models', 'model options', 'model create-spec', 'confirm missing key params', 'create video-fee', 'create video --dry-run'],
|
|
731
|
+
'create audio': ['doctor --verify', 'model audio-models', 'model options', 'create audio-fee', 'create audio --dry-run'],
|
|
717
732
|
'create video-batch': ['doctor --verify', 'model video-models', 'model options', 'model create-spec', 'prepare JSONL input', 'create video-batch --dry-run'],
|
|
718
733
|
'create video-super-resolution-fee': ['doctor --verify', 'create video-super-resolution-fee --object-name <objectName>'],
|
|
719
734
|
'create video-super-resolution': ['doctor --verify', 'create video-super-resolution --object-name <objectName> --dry-run'],
|
|
@@ -812,6 +827,9 @@ function buildCommandWorkflow(command) {
|
|
|
812
827
|
if (command.name === 'create video') {
|
|
813
828
|
next.push('读取 data.taskId 和 data.nextCommand', '立即运行响应里的 nextCommand,或 task wait --task-id <id> 等待结果');
|
|
814
829
|
}
|
|
830
|
+
if (command.name === 'create audio') {
|
|
831
|
+
next.push('读取 data.taskId 和 data.nextCommand', '立即运行响应里的 nextCommand,或 task wait --task-id <id> 等待音频结果');
|
|
832
|
+
}
|
|
815
833
|
if (command.name === 'create video-super-resolution') {
|
|
816
834
|
next.push('读取 data.taskId 和 data.nextCommand', '运行响应里的 task status 命令查询结果');
|
|
817
835
|
}
|
|
@@ -827,7 +845,7 @@ function buildCommandWorkflow(command) {
|
|
|
827
845
|
if (command.name === 'create asset') {
|
|
828
846
|
next.push('读取 data.assetType / data.assetPath', 'data.conversionRequired=true 时先确认是否转码;正式执行可交互确认或追加 --auto-convert', '若后端返回审核 taskId,再运行 task wait --task-type ASSET_REGISTER');
|
|
829
847
|
}
|
|
830
|
-
if (command.name === 'model image-models' || command.name === 'model video-models') {
|
|
848
|
+
if (command.name === 'model image-models' || command.name === 'model video-models' || command.name === 'model audio-models') {
|
|
831
849
|
next.push('读取 data.models[] 得到全部候选;用户给了模型口语名时保留同族全部候选,不只取第一个');
|
|
832
850
|
next.push('对每个候选运行 model options --model-group-code <modelGroupCode> 查看真实参数和素材约束');
|
|
833
851
|
next.push('向用户展示候选模型 + 参数取值 + 资源能力后 STOP;等待用户选择或明确授权默认,未确认不得进入 create-spec/fee/dry-run/create');
|
|
@@ -971,7 +989,7 @@ function buildAgentBrief(commands, version = 'unknown') {
|
|
|
971
989
|
},
|
|
972
990
|
{
|
|
973
991
|
intent: '模型发现和创作任务',
|
|
974
|
-
start: ['model image-models', 'model video-models', 'model options', 'model create-spec'],
|
|
992
|
+
start: ['model image-models', 'model video-models', 'model audio-models', 'model options', 'model create-spec'],
|
|
975
993
|
rule: '先展示候选模型、真实参数和资源能力并 STOP;用户选择或明确授权默认后,关键参数确认,再只跑一次 fee、dry-run 和最终 --yes。',
|
|
976
994
|
},
|
|
977
995
|
{
|
|
@@ -1074,20 +1092,20 @@ function buildAgentContract() {
|
|
|
1074
1092
|
],
|
|
1075
1093
|
},
|
|
1076
1094
|
modelCandidatePresentation: {
|
|
1077
|
-
purpose: '把
|
|
1095
|
+
purpose: '把 image/video/audio 模型列表与每个候选的 model options 转成用户可见清单。',
|
|
1078
1096
|
trigger: '用户问有哪些模型、给出口语名、或模型列表返回候选时都触发;即使只有一个候选也要展示真实可选项。',
|
|
1079
1097
|
gateType: 'hard_stop',
|
|
1080
1098
|
stopAfterPresentation: true,
|
|
1081
1099
|
resumeCondition: '用户选择模型和关键参数,或明确说“按默认 / 你来选”。',
|
|
1082
1100
|
requiredVisibleFields: ['displayName', 'modelDesc', 'taskQueueNum', 'quality values/default', 'ratio values/default', 'duration or generateNum values/default', 'resource modes/media/usages', 'channel or fast/pro differences'],
|
|
1083
|
-
blockedBeforePresentation: ['model create-spec', 'create image-fee', 'create video-fee', 'create
|
|
1101
|
+
blockedBeforePresentation: ['model create-spec', 'create image-fee', 'create video-fee', 'create audio-fee', 'create image --dry-run', 'create video --dry-run', 'create audio --dry-run', 'create image', 'create video', 'create audio'],
|
|
1084
1102
|
},
|
|
1085
1103
|
modelOptions: {
|
|
1086
1104
|
command: `${commandPrefix()} model options --model-group-code <code>`,
|
|
1087
1105
|
textCommand: `${commandPrefix()} model options --model-group-code <code> -f text`,
|
|
1088
1106
|
jsonCommand: `${commandPrefix()} model options --model-group-code <code> -f json`,
|
|
1089
1107
|
purpose: '查询指定模型支持的 CLI 参数、枚举值、默认值、素材约束和条件约束。Agent 默认读 textCommand;只有程序化校验完整嵌套结构时读 jsonCommand。',
|
|
1090
|
-
useBefore: ['model create-spec', 'create image-fee', 'create image', 'create video-fee', 'create video'],
|
|
1108
|
+
useBefore: ['model create-spec', 'create image-fee', 'create image', 'create video-fee', 'create video', 'create audio-fee', 'create audio'],
|
|
1091
1109
|
keyFields: ['params[].key', 'params[].cliArg', 'params[].genericModelParam', 'params[].values', 'params[].defaultValue', 'resources[].mediaType', 'resources[].usage', 'resources[].fileTypes', 'resources[].maxFiles', 'resources[].supportLastFrameOnly', 'resources[].minDurationMs', 'resources[].maxDurationMs', 'constraints[].target', 'constraints[].conditions', 'constraints[].effect'],
|
|
1092
1110
|
},
|
|
1093
1111
|
modelCreateSpec: {
|
|
@@ -1095,7 +1113,7 @@ function buildAgentContract() {
|
|
|
1095
1113
|
textCommand: `${commandPrefix()} model create-spec --model-group-code <code> -f text`,
|
|
1096
1114
|
jsonCommand: `${commandPrefix()} model create-spec --model-group-code <code> -f json`,
|
|
1097
1115
|
purpose: '查看指定模型如何组织 create 命令:输入模式、素材绑定规则、示例和创建前检查项。Agent 默认读 textCommand;只有程序化校验完整嵌套结构时读 jsonCommand。',
|
|
1098
|
-
useBefore: ['create image-fee', 'create image', 'create video-fee', 'create video'],
|
|
1116
|
+
useBefore: ['create image-fee', 'create image', 'create video-fee', 'create video', 'create audio-fee', 'create audio'],
|
|
1099
1117
|
keyFields: ['inputRequirement', 'supportedIntents', 'validationRules', 'agentGuidance', 'preflight', 'examples'],
|
|
1100
1118
|
},
|
|
1101
1119
|
modelInputGuide: {
|
|
@@ -1108,6 +1126,7 @@ function buildAgentContract() {
|
|
|
1108
1126
|
taskTypes: {
|
|
1109
1127
|
image: 'IMAGE_CREATE',
|
|
1110
1128
|
video: 'VIDEO_GROUP',
|
|
1129
|
+
audio: 'AUDIO_CREATE',
|
|
1111
1130
|
videoSuperResolution: 'VIDEO_SUPER_RESOLUTION',
|
|
1112
1131
|
subtitleRemoval: 'VIDEO_SUBTITLE_REMOVAL',
|
|
1113
1132
|
assetRegister: 'ASSET_REGISTER',
|
package/skills/lj-awb/SKILL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lj-awb
|
|
3
|
-
version: 0.5.
|
|
4
|
-
description: "灵境 AWB CLI skill。使用 `lj-awb` 命令调用动漫平台 / AWB 云端能力,覆盖认证、项目组、积分余额/明细/用量(含充值购买与兑换码兑换)、模型发现、上传、统一 create
|
|
3
|
+
version: 0.5.9
|
|
4
|
+
description: "灵境 AWB CLI skill。使用 `lj-awb` 命令调用动漫平台 / AWB 云端能力,覆盖认证、项目组、积分余额/明细/用量(含充值购买与兑换码兑换)、模型发现、上传、统一 create 创建域、任务查询、视频超分。用户说生图、生视频、生成音频、积分明细、积分流水、充值记录、消耗记录、主体、音色、素材加白、去字幕时使用。正式生成、切换项目组、清空认证、兑换码等写入或扣费动作前必须确认。"
|
|
5
5
|
metadata:
|
|
6
6
|
bootstrap:
|
|
7
7
|
package: "@lingjingai/lj-awb-cli"
|
|
8
|
-
version: "0.5.
|
|
8
|
+
version: "0.5.9"
|
|
9
9
|
bin: "lj-awb"
|
|
10
10
|
cliHelp: "lj-awb --help"
|
|
11
11
|
---
|
|
@@ -82,7 +82,7 @@ schema 查询必须先返回,再组织业务命令;不要把 schema 查询
|
|
|
82
82
|
| 项目组、预算与积分明细上下文 | `project` / `credits` | [`modules/project.md`](modules/project.md)、[`modules/credits.md`](modules/credits.md) |
|
|
83
83
|
| 模型发现、参数约束、创建规格 | `model` | [`modules/model.md`](modules/model.md) |
|
|
84
84
|
| 本地文件上传为 backendPath | `upload` | [`modules/upload.md`](modules/upload.md) |
|
|
85
|
-
| 图片 / 视频 / 去字幕 / 主体 / 音色 / 素材创建 | `create` | [`modules/create.md`](modules/create.md)、[`modules/create-contract.md`](modules/create-contract.md) |
|
|
85
|
+
| 图片 / 视频 / 音频 / 去字幕 / 主体 / 音色 / 素材创建 | `create` | [`modules/create.md`](modules/create.md)、[`modules/create-contract.md`](modules/create-contract.md) |
|
|
86
86
|
| 异步任务等待与本地台账 | `task` | [`modules/task.md`](modules/task.md) |
|
|
87
87
|
|
|
88
88
|
## 触发分流
|
|
@@ -95,6 +95,7 @@ schema 查询必须先返回,再组织业务命令;不要把 schema 查询
|
|
|
95
95
|
| “有哪些模型 / 推荐模型 / 用某某模型” | [`modules/model.md`](modules/model.md),模型口语名默认是平台模型,不是本地工具 |
|
|
96
96
|
| “生图 / 生成图片 / 参考图生图” | [`modules/driver.md`](modules/driver.md) 创作链条 + [`modules/create-contract.md`](modules/create-contract.md);简单文生图(未点名模型、无参考图)默认走「简单生图一次性选择门」:模型+参数合并成一条让用户一次选好,没提到的用默认 |
|
|
97
97
|
| “生视频 / 首帧 / 首尾帧 / 音频参考 / 让图动起来” | [`modules/driver.md`](modules/driver.md) 创作链条 + [`modules/task-manual.md`](modules/task-manual.md);简单生视频(未点名模型、无主体/音色/音频参考)默认走「简单生视频一次性选择门」:统一菜单全列模型(默认即梦 3.0 Fast / 5秒 / 720P / 16:9),用户输什么传什么(文字→prompt、1图→首帧、2图→首尾帧),回数字选、没提到的用默认 |
|
|
98
|
+
| “生成音频 / 文生音频 / 参考音频生成” | [`modules/driver.md`](modules/driver.md) 创作链条 + [`modules/create.md`](modules/create.md);依次使用 `model audio-models`、`create audio-fee`、`create audio` |
|
|
98
99
|
| “超分 / 放大到 2K / 1080P” | [`modules/video.md`](modules/video.md),传 `objectName` 走 material 视频超分任务体系 |
|
|
99
100
|
| “固定角色 / 主体 / 同一个人 / 可灵或 Vidu 角色一致” | [`modules/subject.md`](modules/subject.md) |
|
|
100
101
|
| “主体音色 / 音色克隆 / 给主体配音色” | [`modules/subject.md`](modules/subject.md) |
|
|
@@ -112,7 +113,7 @@ schema 查询必须先返回,再组织业务命令;不要把 schema 查询
|
|
|
112
113
|
- 创作类命令在 fee / dry-run 前必须确认会影响价格或效果的关键参数;用户明确说“按默认”后才使用 defaultValue。**例外**:命中「简单生图一次性选择门」(见 [`modules/driver.md`](modules/driver.md))时,模型+参数合并成一条让用户一次选好,用户没提到的参数用 `defaultValue` 补齐,选完直接生成。
|
|
113
114
|
- Prompt 默认原文直出:用户提供明确 prompt / 创作描述时,禁止语义改写、润色、扩写或从参考图补画面细节;只有用户明确要求“优化 / 润色 / 扩写 / 你来写 prompt”时才允许改写,且改写后的最终 prompt 必须先展示并等待确认,之后才能 fee / dry-run / create。
|
|
114
115
|
- `fee` 是最终估价,不是参数探索工具。不要为多个 quality / duration / ratio / 渠道组合反复跑 fee。
|
|
115
|
-
- 正式图片 /
|
|
116
|
+
- 正式图片 / 视频 / 音频任务要带 `--project-group-no`,除非命令 schema 没有该参数。
|
|
116
117
|
- 命令返回 `nextCommand`、`nextRefSubject`、`nextVoiceArg` 时优先复用返回值,不手拼。
|
|
117
118
|
- 默认输出是面向人类的 pretty 表格;Agent 不要解析 pretty,默认显式传 `-f text` 读取稳定的分区 key=value。只有脚本严格解析或必须读完整嵌套结构时才用 `-f json`。
|
|
118
119
|
- 模型口语名命中后必须过“候选展示门”:先把候选模型、真实参数取值和资源能力转成用户可见清单,再推荐或追问;不能只在内部读完 `model options` 就直接代选默认模型 / 参数。
|
package/skills/lj-awb/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.9
|
|
@@ -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 audio ...` | 提交单条音频生成任务 |
|
|
16
|
+
| `lj-awb create audio-fee ...` | 音频生成估价;按生成时长计算 |
|
|
15
17
|
| `lj-awb create video-super-resolution ...` | 基于 objectName 提交视频超分任务 |
|
|
16
18
|
| `lj-awb create video-super-resolution-fee ...` | 视频超分估价;先确认 objectName |
|
|
17
19
|
| `lj-awb create video-subtitle-removal --source-task-id <videoTaskId> ...` | 基于 material 来源视频任务提交去字幕 |
|
|
@@ -31,8 +33,9 @@
|
|
|
31
33
|
|
|
32
34
|
## 编排
|
|
33
35
|
|
|
34
|
-
- 图片 /
|
|
35
|
-
- 估价也在 `create` 域:`create image-fee` / `create video-fee` / `create video-super-resolution-fee`;只在关键参数确认后执行。
|
|
36
|
+
- 图片 / 视频 / 音频创建参数和资源绑定仍按 [`create-contract.md`](create-contract.md) 校验。
|
|
37
|
+
- 估价也在 `create` 域:`create image-fee` / `create video-fee` / `create audio-fee` / `create video-super-resolution-fee`;只在关键参数确认后执行。
|
|
38
|
+
- 音频创建必须传 `prompt` 和 `duration`;默认 `audio-format=mp3`,最多 3 个参考音频或 1 张参考图,两类不能混用。
|
|
36
39
|
- 状态和等待仍在查询域:`task status` / `task wait` 按 `taskId` 查询统一任务状态;主体 / 音色使用 `create subject-wait` / `create subject-voice-wait`。
|
|
37
40
|
- 所有 `create` 写入或扣费命令正式执行前必须先 `--dry-run`,用户确认后再 `--yes`。
|
|
38
41
|
- 查询型 create 子命令(`subject-list`、`subject-voice-list`、`asset-groups`、`asset-group-get`、`asset-match-actor`)是为了避免重复创建;创建前优先查重。
|
|
@@ -24,7 +24,7 @@ Agent 在当前任务中记录这些值,后续直接复用:
|
|
|
24
24
|
| `commandSchema:<name>` | `lj-awb schema --domain <domain> --command <command> -f text` | CLI 版本变化或命令不匹配 |
|
|
25
25
|
| `auth/account/team` | `doctor --verify`、`account info` | 登录 / 团队切换 |
|
|
26
26
|
| `projectGroupNo` | `project current` 或用户指定 | 项目组切换 |
|
|
27
|
-
| `modelCandidates` | `model image-models` / `model video-models` | 任务类型或关键词变化 |
|
|
27
|
+
| `modelCandidates` | `model image-models` / `model video-models` / `model audio-models` | 任务类型或关键词变化 |
|
|
28
28
|
| `assetReviewModels` / `assetReviewPlatform` | `model asset-review-models` | `modelGroupCode` 或平台切换 |
|
|
29
29
|
| `modelOptions` / `createSpec` | `model options` / `model create-spec` | `modelGroupCode` 变化 |
|
|
30
30
|
| `backendPath` | `upload files` 或 create dry-run/yes 的 upload 输出 | 本地文件或远端 URL 变化 |
|
|
@@ -40,10 +40,10 @@ CLI 当前能力分为:
|
|
|
40
40
|
|
|
41
41
|
- `system`:`doctor`、`schema`。
|
|
42
42
|
- `auth/account/project/credits`:认证、团队、项目组、积分与预算上下文。
|
|
43
|
-
- `model`:发现图片 /
|
|
43
|
+
- `model`:发现图片 / 视频 / 音频模型,读取参数约束和创建规格。
|
|
44
44
|
- `upload`:把本地文件转成平台 `backendPath`。
|
|
45
|
-
- `create
|
|
46
|
-
- `task`:图片 / 视频 / 去字幕等异步任务状态、等待和本地台账。
|
|
45
|
+
- `create`:图片、视频、音频、视频去字幕、主体、主体音色、素材组和素材注册。
|
|
46
|
+
- `task`:图片 / 视频 / 音频 / 去字幕等异步任务状态、等待和本地台账。
|
|
47
47
|
|
|
48
48
|
不要把概念名当 command domain。图片、视频、主体、素材是业务对象;命令入口是 `create` / `task`。
|
|
49
49
|
|
|
@@ -53,13 +53,13 @@ CLI 当前能力分为:
|
|
|
53
53
|
|
|
54
54
|
0. **先分流**:如果命中「简单生图一次性选择门」(见下方专节),走那条——模型+参数合并成一条让用户一次选好,选完直接生成;否则按 1-9 标准链条走。
|
|
55
55
|
1. 若本轮未验证远端认证和项目组,运行 `doctor --verify`,必要时 `project current`。
|
|
56
|
-
2. 根据用户目标选任务类型:生图查 `model image-models`,生视频查 `model video-models`。
|
|
56
|
+
2. 根据用户目标选任务类型:生图查 `model image-models`,生视频查 `model video-models`,音频生成查 `model audio-models`。
|
|
57
57
|
3. 如果同一关键词已有候选,不重复查列表;只在用户换模型关键词时刷新。
|
|
58
58
|
4. 对候选跑 `model options`,通过”模型候选展示门”把真实参数和资源能力展示给用户,然后 STOP 等用户选择或明确授权默认;用户选定模型后补 `model create-spec`。
|
|
59
59
|
5. 按 [`task-manual.md`](task-manual.md) 选择资源模式,按 [`create-contract.md`](create-contract.md) 校验素材、占位符、`needAudio` 和模式互斥。
|
|
60
60
|
6. 只追问会影响价格 / 效果且用户未给出的关键参数;用户说“默认”才使用 defaultValue。
|
|
61
|
-
7.
|
|
62
|
-
8.
|
|
61
|
+
7. 参数确认后跑一次对应的 `create image-fee`、`create video-fee` 或 `create audio-fee`,不要用 fee 做多组合探索。
|
|
62
|
+
8. 跑一次对应的 `create image/video/audio --dry-run` 展示最终 prompt、资源、参数、积分。
|
|
63
63
|
9. 用户确认后 `--yes`。返回 `nextCommand` 时直接执行它等待结果。
|
|
64
64
|
|
|
65
65
|
对用户展示这条链路时只给阶段性摘要,不逐条列出 schema / model options / fee 命令和原始输出。
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|------|------|
|
|
9
9
|
| `lj-awb model image-models --model "<keyword>"` | 查询生图候选模型 |
|
|
10
10
|
| `lj-awb model video-models --model "<keyword>"` | 查询生视频候选模型 |
|
|
11
|
+
| `lj-awb model audio-models --model "<keyword>"` | 查询 CLI 音频生成候选模型 |
|
|
11
12
|
| `lj-awb model asset-review-models --model-group-code <code>` | 查询支持素材加白的模型组与平台关系 |
|
|
12
13
|
| `lj-awb model input-guide -f text` | 查看统一创建参数、resources 字段和素材绑定规则 |
|
|
13
14
|
| `lj-awb model options --model-group-code <code> -f text` | 查看该模型支持的 CLI 参数、枚举值、默认值、素材约束和条件约束 |
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
```bash
|
|
21
22
|
lj-awb model image-models --model "<keyword>"
|
|
22
23
|
lj-awb model video-models --model "<keyword>"
|
|
24
|
+
lj-awb model audio-models --model "<keyword>"
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
候选展示走 [`driver.md`](driver.md) 的“模型候选展示门”:基本信息 → 并行跑 `model options` 列真实参数取值和资源能力 → 输出用户可读清单 → STOP 等用户选择或明确授权默认。不要把原始 JSON 整段粘给用户,但必须把候选转成用户可读清单;不能只在内部读完 options 后直接代选模型或参数。(**简单文生图默认走「简单生图一次性选择门」,不触发本门**——用户没点名模型、无参考图时,默认GPT Image 2,模型+参数合并成一条让用户一次选好,详见 [`driver.md`](driver.md)。)
|
|
@@ -67,7 +69,7 @@ Agent 默认用 `-f text` 读取;只有需要程序化校验完整嵌套结构
|
|
|
67
69
|
|
|
68
70
|
Agent 读取这些字段:
|
|
69
71
|
|
|
70
|
-
- `taskKind`:`image` 或 `
|
|
72
|
+
- `taskKind`:`image`、`video` 或 `audio`,决定使用对应的 create 命令。
|
|
71
73
|
- `optionsCommand`:查看本模型参数约束的命令。
|
|
72
74
|
- `inputRequirement`:是否必须提供视觉输入,以及不能只传 prompt 的原因。
|
|
73
75
|
- `supportedIntents[]`:用户意图到统一输入方式的权威映射,例如 `prompt_only`、`reference`、`frames`、`storyboard`。
|
|
@@ -83,6 +85,7 @@ Agent 读取这些字段:
|
|
|
83
85
|
| 模型配置 | CLI create 参数 | 说明 |
|
|
84
86
|
|----------|-----------------|------|
|
|
85
87
|
| `generated_time` | `--duration` | 视频时长 |
|
|
88
|
+
| `duration` | `--duration` | 音频生成时长 |
|
|
86
89
|
| `generate_num` | `--generate-num` | 图片张数 |
|
|
87
90
|
| `iref` | `--resource image:reference=...` | 图片参考图 |
|
|
88
91
|
| `frames` | `--resource image:first_frame=...` / `image:last_frame=...`,可传文件/URL/backendPath/`asset:<assetId>` | 视频首尾帧 |
|
|
@@ -101,9 +104,9 @@ Agent 读取这些字段:
|
|
|
101
104
|
|
|
102
105
|
## 下一步
|
|
103
106
|
|
|
104
|
-
- 模型 + 参数定下后 → [`image.md`](image.md) 或 [`video.md`](video.md)
|
|
107
|
+
- 模型 + 参数定下后 → 图片/视频按 [`image.md`](image.md) 或 [`video.md`](video.md),音频按 [`create.md`](create.md),依次跑 `fee` + `create --dry-run` + 确认 + `--yes`。
|
|
105
108
|
- 模型 `taskQueueNum` 很大(>100)→ 向用户提示排队风险,可让用户在候选间换;不要默认换。
|
|
106
|
-
- 不要重复跑 `model image-models / video-models` —— `modelGroupCode` 一旦确定,整个对话内复用。
|
|
109
|
+
- 不要重复跑 `model image-models / video-models / audio-models` —— `modelGroupCode` 一旦确定,整个对话内复用。
|
|
107
110
|
|
|
108
111
|
## 结构化过滤(Agent 翻译用户意图 → flag)
|
|
109
112
|
|