@lingjingai/lj-awb-cli 0.5.20 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/packages/awb-cli/package.json +2 -2
- package/packages/awb-core/package.json +1 -1
- package/packages/awb-core/src/commands.js +4 -4
- package/packages/awb-core/src/services.js +103 -10
- package/skills/lj-awb/SKILL.md +2 -2
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/create.md +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/lj-awb-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.22",
|
|
4
4
|
"description": "Lingjing AWB CLI monorepo with shared core, standalone CLI, and agent skills",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"build:pre-publish": "node build/pre-publish.mjs",
|
|
26
26
|
"build:prod": "node build/prod.mjs",
|
|
27
27
|
"check": "npm run check:local && npm run check:real",
|
|
28
|
-
"check:local": "node --check install.mjs && node --check packages/awb-core/src/common.js && node --check packages/awb-core/src/api.js && node --check packages/awb-core/src/auth.js && node --check packages/awb-core/src/output.js && node --check packages/awb-core/src/update.js && node --check packages/awb-core/src/services.js && node --check packages/awb-core/src/commands.js && node --check packages/awb-core/src/standalone.js && sh -n packages/awb-cli/bin/lj-awb && bash -n skills/lj-awb/scripts/resolve-lj-awb-cmd.sh && node --check packages/awb-cli/bin/lj-awb.js && node --check build/build.mjs && node --check build/_shared.mjs && node --check build/pre.mjs && node --check build/volta-pre.mjs && node --check build/pre-publish.mjs && node --check build/prod.mjs && node --check scripts/run-openapi-cli-examples-real.mjs && node --check scripts/validate-cli-schema.mjs && node --check scripts/validate-cli-output-contract.mjs && node --check scripts/validate-cli-command-coverage.mjs && node --check tests/test-api.mjs && node --check tests/test-model-filters.mjs && node --check tests/test-credits-records.mjs && node --check tests/test-task-status.mjs && node --check tests/test-project-members.mjs && node scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs && node --test tests/test-api.mjs tests/test-model-filters.mjs tests/test-credits-records.mjs tests/test-task-status.mjs tests/test-project-members.mjs",
|
|
28
|
+
"check:local": "node --check install.mjs && node --check packages/awb-core/src/common.js && node --check packages/awb-core/src/api.js && node --check packages/awb-core/src/auth.js && node --check packages/awb-core/src/output.js && node --check packages/awb-core/src/update.js && node --check packages/awb-core/src/services.js && node --check packages/awb-core/src/commands.js && node --check packages/awb-core/src/standalone.js && sh -n packages/awb-cli/bin/lj-awb && bash -n skills/lj-awb/scripts/resolve-lj-awb-cmd.sh && node --check packages/awb-cli/bin/lj-awb.js && node --check build/build.mjs && node --check build/_shared.mjs && node --check build/pre.mjs && node --check build/volta-pre.mjs && node --check build/pre-publish.mjs && node --check build/prod.mjs && node --check scripts/run-openapi-cli-examples-real.mjs && node --check scripts/validate-cli-schema.mjs && node --check scripts/validate-cli-output-contract.mjs && node --check scripts/validate-cli-command-coverage.mjs && node --check tests/test-api.mjs && node --check tests/test-model-filters.mjs && node --check tests/test-credits-records.mjs && node --check tests/test-task-status.mjs && node --check tests/test-project-members.mjs && node --check tests/test-video-auto-convert.mjs && node scripts/validate-skill-meta.mjs && node scripts/validate-cli-schema.mjs && node scripts/validate-cli-command-coverage.mjs && node --test tests/test-api.mjs tests/test-model-filters.mjs tests/test-credits-records.mjs tests/test-task-status.mjs tests/test-project-members.mjs tests/test-video-auto-convert.mjs",
|
|
29
29
|
"check:real": "node scripts/validate-cli-output-contract.mjs && node scripts/validate-openapi-cli-examples.mjs",
|
|
30
30
|
"test:openapi-real": "node scripts/run-openapi-cli-examples-real.mjs",
|
|
31
31
|
"smoke": "packages/awb-cli/bin/lj-awb --help && packages/awb-cli/bin/lj-awb auth status -f json && packages/awb-cli/bin/lj-awb system && packages/awb-cli/bin/lj-awb auth && packages/awb-cli/bin/lj-awb account && packages/awb-cli/bin/lj-awb project && packages/awb-cli/bin/lj-awb credits && packages/awb-cli/bin/lj-awb upload && packages/awb-cli/bin/lj-awb model && packages/awb-cli/bin/lj-awb create && packages/awb-cli/bin/lj-awb task && packages/awb-cli/bin/lj-awb schema -f json >/dev/null",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-cli-bin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.22",
|
|
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.22"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -112,11 +112,11 @@ const MODEL_PARAMS_JSON_ARG = { name: 'model-params-json', valueName: 'json|path
|
|
|
112
112
|
const MODEL_PARAM_ARGS = [MODEL_PARAM_ARG, MODEL_PARAMS_JSON_ARG];
|
|
113
113
|
const CREATE_WAIT_ARGS = [
|
|
114
114
|
{ name: 'wait-seconds', valueName: 'seconds', description: '提交后顺带等待结果的秒数;默认 0 不等待' },
|
|
115
|
-
{ name: 'poll-interval-ms', valueName: 'ms', description: '任务轮询间隔毫秒数,默认
|
|
115
|
+
{ name: 'poll-interval-ms', valueName: 'ms', description: '任务轮询间隔毫秒数,默认 30000' },
|
|
116
116
|
];
|
|
117
117
|
const TASK_WAIT_ARGS = [
|
|
118
118
|
{ name: 'wait-seconds', valueName: 'seconds', description: '最长等待秒数;默认 300,传 0 只查询一次' },
|
|
119
|
-
{ name: 'poll-interval-ms', valueName: 'ms', description: '任务轮询间隔毫秒数,默认
|
|
119
|
+
{ name: 'poll-interval-ms', valueName: 'ms', description: '任务轮询间隔毫秒数,默认 30000' },
|
|
120
120
|
];
|
|
121
121
|
const RECORD_POLL_ARGS = [
|
|
122
122
|
{ name: 'wait-seconds', valueName: 'seconds', description: '最长轮询秒数;默认 0 只轮询一次本地台账' },
|
|
@@ -688,7 +688,7 @@ export function registerAwbCommands(cli) {
|
|
|
688
688
|
'lj-awb create video --model-group-code <code> --prompt "首尾帧过渡" --duration 5 --resources-json \'[{"type":"image","usage":"first_frame","source":{"kind":"url","value":"./first.png"}},{"type":"image","usage":"last_frame","source":{"kind":"url","value":"./last.png"}}]\' --dry-run',
|
|
689
689
|
'lj-awb create video --model-group-code <code> --prompt "让 <<<hero>>> 跟随音乐节奏转身" --resource image:reference:hero=./actor.png --resource audio:reference=./music.mp3 --duration 5 --dry-run',
|
|
690
690
|
],
|
|
691
|
-
hint: '--prompt / --resource / --resources-json
|
|
691
|
+
hint: '--prompt / --resource / --resources-json 至少传一个;自动加白 Seedance 的参考图在正式提交前自动检查尺寸,超限时转码上传;fee / --dry-run 之前先确认 quality、duration、ratio 等关键参数。',
|
|
692
692
|
}),
|
|
693
693
|
args: [
|
|
694
694
|
MODEL_GROUP_ARG,
|
|
@@ -717,7 +717,7 @@ export function registerAwbCommands(cli) {
|
|
|
717
717
|
'lj-awb create video-batch --input-file ./prompts.txt --model-group-code <code> --dry-run',
|
|
718
718
|
'lj-awb create video-batch --input-file ./video-input.jsonl --model-group-code <code> --concurrency 2 --yes',
|
|
719
719
|
],
|
|
720
|
-
hint: 'JSON/JSONL 每项只写任务差异字段:prompt、ratio、quality、duration、need_audio、resources、resource、model_params
|
|
720
|
+
hint: 'JSON/JSONL 每项只写任务差异字段:prompt、ratio、quality、duration、need_audio、resources、resource、model_params;自动加白 Seedance 的参考图逐项检查并在超限时转码;提交后用 results[].taskId / statusCommand 查询,需要中断恢复可传 --task-record-file。',
|
|
721
721
|
}),
|
|
722
722
|
args: [
|
|
723
723
|
{ name: 'input-file', valueName: 'path', description: '批量输入文件' },
|
|
@@ -56,12 +56,15 @@ const REMOTE_IMAGE_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
|
|
|
56
56
|
const REMOTE_IMAGE_MIME_TYPES = new Set([
|
|
57
57
|
'image/bmp',
|
|
58
58
|
'image/gif',
|
|
59
|
+
'image/heic',
|
|
60
|
+
'image/heif',
|
|
59
61
|
'image/jpeg',
|
|
60
62
|
'image/jpg',
|
|
61
63
|
'image/png',
|
|
64
|
+
'image/tiff',
|
|
62
65
|
'image/webp',
|
|
63
66
|
]);
|
|
64
|
-
const REMOTE_IMAGE_EXTENSIONS = new Set(['.bmp', '.gif', '.jfif', '.jpg', '.jpeg', '.png', '.webp']);
|
|
67
|
+
const REMOTE_IMAGE_EXTENSIONS = new Set(['.bmp', '.gif', '.heic', '.heif', '.jfif', '.jpg', '.jpeg', '.png', '.tif', '.tiff', '.webp']);
|
|
65
68
|
const REMOTE_VOICE_DOWNLOAD_TIMEOUT_MS = 30_000;
|
|
66
69
|
const REMOTE_VOICE_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
|
|
67
70
|
const REMOTE_VOICE_MIME_TYPES = new Set([
|
|
@@ -1133,7 +1136,7 @@ export async function creditsUsageSummary(kwargs = {}) {
|
|
|
1133
1136
|
};
|
|
1134
1137
|
}
|
|
1135
1138
|
|
|
1136
|
-
function modelListMetadata(kind, paramKeys = [], rulesByKey = new Map()) {
|
|
1139
|
+
function modelListMetadata(kind, paramKeys = [], rulesByKey = new Map(), modelGroupCode = null) {
|
|
1137
1140
|
const keys = new Set(paramKeys);
|
|
1138
1141
|
if (kind === 'audio') {
|
|
1139
1142
|
return {
|
|
@@ -1145,7 +1148,7 @@ function modelListMetadata(kind, paramKeys = [], rulesByKey = new Map()) {
|
|
|
1145
1148
|
}
|
|
1146
1149
|
const imageReferenceParams = ['cref', 'sref', 'iref', 'resources'].filter((key) => keys.has(key));
|
|
1147
1150
|
const videoResourceParams = ['frames', 'multi_param', 'multi_prompt'].filter((key) => keys.has(key));
|
|
1148
|
-
const inputModes = createSpecSupportedIntents(createSpecInputModes(kind, keys, rulesByKey), kind)
|
|
1151
|
+
const inputModes = createSpecSupportedIntents(restrictAutoAssetInputModes(modelGroupCode, createSpecInputModes(kind, keys, rulesByKey)), kind)
|
|
1149
1152
|
.map((item) => item.mode);
|
|
1150
1153
|
const controls = [];
|
|
1151
1154
|
if (keys.has('ratio')) controls.push('ratio');
|
|
@@ -1205,7 +1208,7 @@ function normalizeModelRows(payload, kind, options = {}) {
|
|
|
1205
1208
|
...rawText.matchAll(/"paramKey"\s*:\s*"([^"]+)"/g),
|
|
1206
1209
|
].map((match) => match[1]));
|
|
1207
1210
|
const rulesByKey = new Map(rawOptions.map((option) => [option.paramKey, option.rules]).filter(([key, rules]) => key && rules));
|
|
1208
|
-
const metadata = modelListMetadata(kind, paramKeys, rulesByKey);
|
|
1211
|
+
const metadata = modelListMetadata(kind, paramKeys, rulesByKey, modelGroupCode);
|
|
1209
1212
|
const row = compactRecord({
|
|
1210
1213
|
modelGroupCode,
|
|
1211
1214
|
displayName: item?.modelName ?? item?.name ?? item?.label ?? null,
|
|
@@ -2120,7 +2123,7 @@ async function loadModelOptionContext(modelGroupCode, options = {}) {
|
|
|
2120
2123
|
const optionKeys = new Set(mergedOptions.map((item) => item.paramKey).filter(Boolean));
|
|
2121
2124
|
const taskKind = inferTaskKind(rawModel, optionKeys);
|
|
2122
2125
|
const rulesByKey = new Map(mergedOptions.map((item) => [item.paramKey, item.rules]).filter(([key, rules]) => key && rules));
|
|
2123
|
-
const inputModes = createSpecInputModes(taskKind, optionKeys, rulesByKey);
|
|
2126
|
+
const inputModes = restrictAutoAssetInputModes(modelGroupCode, createSpecInputModes(taskKind, optionKeys, rulesByKey));
|
|
2124
2127
|
const createParams = mergedOptions.map((option) => createParamForModelOption(option, taskKind));
|
|
2125
2128
|
const constraintSchema = options.includeConstraintSchema
|
|
2126
2129
|
? await fetchModelConstraintSchema(rawModel, modelGroupCode)
|
|
@@ -2143,6 +2146,20 @@ async function loadModelOptionContext(modelGroupCode, options = {}) {
|
|
|
2143
2146
|
};
|
|
2144
2147
|
}
|
|
2145
2148
|
|
|
2149
|
+
function restrictAutoAssetInputModes(modelGroupCode, inputModes) {
|
|
2150
|
+
if (isAutoAssetSeedanceModel(modelGroupCode)) {
|
|
2151
|
+
for (const mode of inputModes) {
|
|
2152
|
+
if (mode.sourceKinds) mode.sourceKinds = mode.sourceKinds.filter((kind) => kind !== 'asset_id');
|
|
2153
|
+
if (mode.resourceSyntax) mode.resourceSyntax = mode.resourceSyntax.filter((example) => !example.includes('asset:'));
|
|
2154
|
+
if (mode.mode === 'subject_reference') {
|
|
2155
|
+
mode.supported = false;
|
|
2156
|
+
mode.unsupportedReason = '自动加白模型只接受原素材,不接受主体或素材 ID。';
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
return inputModes;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2146
2163
|
function optionAllowedValues(option = {}) {
|
|
2147
2164
|
if (!Array.isArray(option.optionList)) return [];
|
|
2148
2165
|
return option.optionList
|
|
@@ -4000,8 +4017,11 @@ async function confirmAssetConversion(validation) {
|
|
|
4000
4017
|
}
|
|
4001
4018
|
}
|
|
4002
4019
|
|
|
4003
|
-
async function convertAssetLocalFile(validation) {
|
|
4004
|
-
const plan = validation.conversionPlan
|
|
4020
|
+
async function convertAssetLocalFile(validation, options = {}) {
|
|
4021
|
+
const plan = validation.conversionPlan && {
|
|
4022
|
+
...validation.conversionPlan,
|
|
4023
|
+
toFormat: options.toFormat ?? validation.conversionPlan.toFormat,
|
|
4024
|
+
};
|
|
4005
4025
|
if (!plan) throw assetConversionUnavailableError(validation);
|
|
4006
4026
|
let converted;
|
|
4007
4027
|
if (validation.assetType === ASSET_TYPE_CODES.Image) {
|
|
@@ -4211,8 +4231,11 @@ function extensionFromContentType(contentType = '') {
|
|
|
4211
4231
|
const normalized = String(contentType || '').split(';')[0].trim().toLowerCase();
|
|
4212
4232
|
if (normalized === 'image/bmp') return '.bmp';
|
|
4213
4233
|
if (normalized === 'image/gif') return '.gif';
|
|
4234
|
+
if (normalized === 'image/heic') return '.heic';
|
|
4235
|
+
if (normalized === 'image/heif') return '.heif';
|
|
4214
4236
|
if (normalized === 'image/jpeg' || normalized === 'image/jpg') return '.jpg';
|
|
4215
4237
|
if (normalized === 'image/png') return '.png';
|
|
4238
|
+
if (normalized === 'image/tiff') return '.tiff';
|
|
4216
4239
|
if (normalized === 'image/webp') return '.webp';
|
|
4217
4240
|
if (normalized === 'audio/mpeg') return '.mp3';
|
|
4218
4241
|
if (normalized === 'audio/wav' || normalized === 'audio/x-wav') return '.wav';
|
|
@@ -4783,6 +4806,59 @@ function conversionOutputExtension(format) {
|
|
|
4783
4806
|
return normalized || 'jpg';
|
|
4784
4807
|
}
|
|
4785
4808
|
|
|
4809
|
+
async function resolveAutoAssetVideoImage(resource, base, options) {
|
|
4810
|
+
if (!options.autoConvertAssetImages || resource.type !== 'image') return null;
|
|
4811
|
+
const value = resource._source.value;
|
|
4812
|
+
const remote = isRemoteOrBackendPath(value);
|
|
4813
|
+
// Dry-run does not download remote material; the formal submission checks it before creating a task.
|
|
4814
|
+
if (remote && options.dryRun) return null;
|
|
4815
|
+
const downloaded = remote
|
|
4816
|
+
? await downloadRemoteImageFileToTemp(value, {
|
|
4817
|
+
fallbackName: resourceText(base).replace(/[^0-9A-Za-z._-]+/g, '-'),
|
|
4818
|
+
})
|
|
4819
|
+
: null;
|
|
4820
|
+
try {
|
|
4821
|
+
const original = await inspectAssetLocalFile(downloaded?.filePath ?? value);
|
|
4822
|
+
if (original.legal) return null;
|
|
4823
|
+
if (!original.conversionPlan) throw assetConversionUnavailableError(original);
|
|
4824
|
+
const source = { kind: 'url', value };
|
|
4825
|
+
const rule = options.resourceRules?.find((item) => resourceRuleMatches(item, { ...base, source }));
|
|
4826
|
+
const toFormat = rule && !fileTypeAllowedByRule(rule, 'jpg')
|
|
4827
|
+
? preferredImageConversionTarget(rule.fileTypes)
|
|
4828
|
+
: 'jpg';
|
|
4829
|
+
const plan = { ...original.conversionPlan, toFormat };
|
|
4830
|
+
const conversion = compactRecord({
|
|
4831
|
+
resource: resourceText(base),
|
|
4832
|
+
...plan,
|
|
4833
|
+
...(remote ? { sourceValue: displayResourceSourceValue(value) } : { sourceFile: original.localFile.filePath }),
|
|
4834
|
+
dryRun: options.dryRun || undefined,
|
|
4835
|
+
});
|
|
4836
|
+
const convertedName = forceFileExtension(remoteImageFileNameFromValue(value), extensionForImageFormat(toFormat));
|
|
4837
|
+
if (options.dryRun) {
|
|
4838
|
+
return {
|
|
4839
|
+
resource: { ...base, source: { kind: 'url', value: dryRunBackendPath(convertedName, options.sceneType) } },
|
|
4840
|
+
upload: null,
|
|
4841
|
+
localFile: original.localFile,
|
|
4842
|
+
conversion,
|
|
4843
|
+
};
|
|
4844
|
+
}
|
|
4845
|
+
const converted = await convertAssetLocalFile(original, { toFormat });
|
|
4846
|
+
try {
|
|
4847
|
+
const upload = await uploadLocalFile(converted.localFile.filePath, { sceneType: options.sceneType });
|
|
4848
|
+
return {
|
|
4849
|
+
resource: { ...base, source: { kind: 'url', value: upload.backendPath } },
|
|
4850
|
+
upload,
|
|
4851
|
+
localFile: remote ? null : original.localFile,
|
|
4852
|
+
conversion: { ...conversion, convertedSize: converted.localFile.size },
|
|
4853
|
+
};
|
|
4854
|
+
} finally {
|
|
4855
|
+
await fs.rm(converted.localFile.filePath, { force: true }).catch(() => {});
|
|
4856
|
+
}
|
|
4857
|
+
} finally {
|
|
4858
|
+
if (downloaded) await fs.rm(downloaded.dir, { recursive: true, force: true }).catch(() => {});
|
|
4859
|
+
}
|
|
4860
|
+
}
|
|
4861
|
+
|
|
4786
4862
|
async function resolveResourceFileValue(resource, options = {}) {
|
|
4787
4863
|
if (resource.type === 'subject') {
|
|
4788
4864
|
if (resource._source.kind !== 'asset_id') throw argumentError('subject resource 必须使用 asset_id,例如 subject:reference:hero=asset:element_123');
|
|
@@ -4808,6 +4884,8 @@ async function resolveResourceFileValue(resource, options = {}) {
|
|
|
4808
4884
|
if (resource._source.kind === 'asset_id') {
|
|
4809
4885
|
return { resource: { ...base, source: resource._source }, upload: null, localFile: null };
|
|
4810
4886
|
}
|
|
4887
|
+
const preparedImage = await resolveAutoAssetVideoImage(resource, base, options);
|
|
4888
|
+
if (preparedImage) return preparedImage;
|
|
4811
4889
|
const value = resource._source.value;
|
|
4812
4890
|
if (isRemoteOrBackendPath(value)) {
|
|
4813
4891
|
const source = { kind: 'url', value };
|
|
@@ -5158,6 +5236,15 @@ export async function imageCreate(kwargs = {}) {
|
|
|
5158
5236
|
};
|
|
5159
5237
|
}
|
|
5160
5238
|
|
|
5239
|
+
function isAutoAssetSeedanceModel(code) {
|
|
5240
|
+
return /^Auto_(JiMeng|BytePlus)_Seedance_(2|2_Fast|2_Mini|2_5)_VideoCreate_Group$/.test(code || '');
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5243
|
+
function needsAutoAssetVideoImageConversion(code) {
|
|
5244
|
+
return isAutoAssetSeedanceModel(code)
|
|
5245
|
+
|| LEGACY_ASSET_REVIEW_MODELS.some((model) => model.modelGroupCode === code);
|
|
5246
|
+
}
|
|
5247
|
+
|
|
5161
5248
|
async function buildVideoRequest(kwargs = {}, options = {}) {
|
|
5162
5249
|
const dryRun = Boolean(options.dryRun);
|
|
5163
5250
|
const model = resolveTaskModel('video', kwargs);
|
|
@@ -5166,6 +5253,10 @@ async function buildVideoRequest(kwargs = {}, options = {}) {
|
|
|
5166
5253
|
kind: 'video',
|
|
5167
5254
|
sceneType: TASK_UPLOAD_SCENE.VIDEO_CREATE,
|
|
5168
5255
|
});
|
|
5256
|
+
if (isAutoAssetSeedanceModel(model.modelGroupCode)
|
|
5257
|
+
&& validationResources.resources.some((resource) => resource.source?.kind === 'asset_id')) {
|
|
5258
|
+
throw argumentError('自动加白模型不接受素材 ID', '请传本地文件、HTTP(S) 地址或平台文件路径,由服务端自动加白。');
|
|
5259
|
+
}
|
|
5169
5260
|
const prompt = trimToNull(kwargs.prompt) ?? '';
|
|
5170
5261
|
if (!prompt && !validationResources.resources.length) {
|
|
5171
5262
|
throw argumentError('缺少视频生成输入', '至少传 --prompt 或 --resource。');
|
|
@@ -5195,6 +5286,8 @@ async function buildVideoRequest(kwargs = {}, options = {}) {
|
|
|
5195
5286
|
kind: 'video',
|
|
5196
5287
|
sceneType: TASK_UPLOAD_SCENE.VIDEO_CREATE,
|
|
5197
5288
|
resourceRules: validation.resourceRules,
|
|
5289
|
+
autoConvertAssetImages: options.autoConvertAssetImages === true
|
|
5290
|
+
&& needsAutoAssetVideoImageConversion(model.modelGroupCode),
|
|
5198
5291
|
});
|
|
5199
5292
|
const requestPromptParams = normalizeUnifiedPromptParams({ ...defaultParams, resources: resolvedResources.resources });
|
|
5200
5293
|
const projectGroupNo = await resolveProjectGroupNo(kwargs.projectGroupNo, { allowNull: dryRun, noNetwork: dryRun, noSave: dryRun });
|
|
@@ -5233,7 +5326,7 @@ export async function videoFee(kwargs = {}) {
|
|
|
5233
5326
|
|
|
5234
5327
|
export async function videoCreate(kwargs = {}) {
|
|
5235
5328
|
if (toBool(kwargs.dryRun)) {
|
|
5236
|
-
const built = await buildVideoRequest(kwargs, { dryRun: true });
|
|
5329
|
+
const built = await buildVideoRequest(kwargs, { dryRun: true, autoConvertAssetImages: true });
|
|
5237
5330
|
return compactRecord({
|
|
5238
5331
|
dryRun: true,
|
|
5239
5332
|
action: 'create video',
|
|
@@ -5243,7 +5336,7 @@ export async function videoCreate(kwargs = {}) {
|
|
|
5243
5336
|
});
|
|
5244
5337
|
}
|
|
5245
5338
|
ensureConfirmed(kwargs, '正式生视频会消耗积分,需要确认', { action: 'create video' });
|
|
5246
|
-
const built = await buildVideoRequest(kwargs);
|
|
5339
|
+
const built = await buildVideoRequest(kwargs, { autoConvertAssetImages: true });
|
|
5247
5340
|
const feePayload = await awbApi.fetchVideoFee(built.request).catch(() => null);
|
|
5248
5341
|
const estimate = await pointEstimate(feePayload, built.projectGroupNo).catch(() => ({}));
|
|
5249
5342
|
const payload = await awbApi.createVideoTask(built.request);
|
|
@@ -5763,7 +5856,7 @@ export async function taskList(kwargs = {}) {
|
|
|
5763
5856
|
export async function waitTask(kwargs = {}) {
|
|
5764
5857
|
const taskId = requireValue(kwargs, 'taskId', 'task-id');
|
|
5765
5858
|
const waitSeconds = Math.max(0, toInt(kwargs.waitSeconds, 300));
|
|
5766
|
-
const pollIntervalMs = Math.max(500, toInt(kwargs.pollIntervalMs,
|
|
5859
|
+
const pollIntervalMs = Math.max(500, toInt(kwargs.pollIntervalMs, 30_000));
|
|
5767
5860
|
const deadline = Date.now() + waitSeconds * 1000;
|
|
5768
5861
|
let last = null;
|
|
5769
5862
|
while (true) {
|
package/skills/lj-awb/SKILL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lj-awb
|
|
3
|
-
version: 0.5.
|
|
3
|
+
version: 0.5.22
|
|
4
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.22"
|
|
9
9
|
bin: "lj-awb"
|
|
10
10
|
cliHelp: "lj-awb --help"
|
|
11
11
|
---
|
package/skills/lj-awb/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.22
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
- 音频创建必须传 `prompt` 和 `duration`;默认 `audio-format=mp3`,最多 3 个参考音频或 1 张参考图,两类不能混用。
|
|
39
39
|
- 状态和等待仍在查询域:`task status` / `task wait` 按 `taskId` 查询统一任务状态;主体 / 音色使用 `create subject-wait` / `create subject-voice-wait`。
|
|
40
40
|
- 所有 `create` 写入或扣费命令正式执行前必须先 `--dry-run`,用户确认后再 `--yes`。
|
|
41
|
+
- `create video` 和 `create video-batch` 使用自动加白 Seedance 模型时,正式提交前会检查本地文件和远程 URL / 平台路径中的图片;超出加白规格会在 CLI 本机转码并上传处理后的图片。`--dry-run` 会展示本地图片的转换计划,不下载远程图片;远程图片在正式提交时检查。
|
|
41
42
|
- 查询型 create 子命令(`subject-list`、`subject-voice-list`、`asset-groups`、`asset-group-get`、`asset-match-actor`)是为了避免重复创建;创建前优先查重。
|
|
42
43
|
- `asset-groups` / `asset-group-get` / `asset-group` / `asset-group-update` / `asset` 都必须显式传 `--platform`;平台先由 `model asset-review-models` 或用户选择确定。
|
|
43
44
|
|