@seawork/server 1.0.12 → 1.0.13-rc.2
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/dist/server/server/sac/generate.d.ts.map +1 -1
- package/dist/server/server/sac/generate.js.map +1 -1
- package/dist/server/server/sac/providers/alibaba.js +231 -249
- package/dist/server/server/sac/providers/alibaba.js.map +1 -1
- package/dist/server/server/sac/providers/audio.js +16 -19
- package/dist/server/server/sac/providers/audio.js.map +1 -1
- package/dist/server/server/sac/providers/kling.js +157 -184
- package/dist/server/server/sac/providers/kling.js.map +1 -1
- package/dist/server/server/sac/providers/nano.js +7 -9
- package/dist/server/server/sac/providers/nano.js.map +1 -1
- package/dist/server/server/sac/providers/pixverse.js +436 -425
- package/dist/server/server/sac/providers/pixverse.js.map +1 -1
- package/dist/server/server/sac/providers/seaart.d.ts.map +1 -1
- package/dist/server/server/sac/providers/seaart.js +6 -10
- package/dist/server/server/sac/providers/seaart.js.map +1 -1
- package/dist/server/server/sac/providers/store.d.ts +1 -1
- package/dist/server/server/sac/providers/tencent-3d.js +59 -57
- package/dist/server/server/sac/providers/tencent-3d.js.map +1 -1
- package/dist/server/server/sac/providers/tencent-image.js +39 -38
- package/dist/server/server/sac/providers/tencent-image.js.map +1 -1
- package/dist/server/server/sac/providers/tencent-video.js +58 -57
- package/dist/server/server/sac/providers/tencent-video.js.map +1 -1
- package/dist/server/server/sac/providers/tripo3d.js +135 -136
- package/dist/server/server/sac/providers/tripo3d.js.map +1 -1
- package/dist/server/server/sac/providers/vidu.js +470 -467
- package/dist/server/server/sac/providers/vidu.js.map +1 -1
- package/dist/server/server/sac/providers/volces-3d.js +30 -32
- package/dist/server/server/sac/providers/volces-3d.js.map +1 -1
- package/dist/server/server/sac/providers/volces-video.js +87 -83
- package/dist/server/server/sac/providers/volces-video.js.map +1 -1
- package/dist/server/server/sac/providers/volces.d.ts.map +1 -1
- package/dist/server/server/sac/providers/volces.js +44 -42
- package/dist/server/server/sac/providers/volces.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,82 +1,87 @@
|
|
|
1
1
|
import { SACError as CLIError, ExitCode } from "../errors.js";
|
|
2
2
|
import { registerProvider } from "./store.js";
|
|
3
3
|
const TRANSITION_MODELS = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
"pixverse_v35_transition",
|
|
5
|
+
"pixverse_v4_transition",
|
|
6
|
+
"pixverse_v45_transition",
|
|
7
|
+
"pixverse_v5_transition",
|
|
8
|
+
"pixverse_v5_5_transition",
|
|
9
|
+
"pixverse_v5_6_transition",
|
|
10
|
+
"pixverse_v6_transition",
|
|
11
11
|
];
|
|
12
12
|
const I2V_MODELS = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
"pixverse_v3_5_i2v",
|
|
14
|
+
"pixverse_v4_i2v",
|
|
15
|
+
"pixverse_v4_5_i2v",
|
|
16
|
+
"pixverse_v5_i2v",
|
|
17
|
+
"pixverse_v5_5_i2v",
|
|
18
|
+
"pixverse_v5_6_i2v",
|
|
19
|
+
"pixverse_v6_i2v",
|
|
20
20
|
];
|
|
21
21
|
const T2V_MODELS = [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
];
|
|
30
|
-
const FUSION_MODELS = [
|
|
31
|
-
'pixverse_v5_6_fusion',
|
|
22
|
+
"pixverse_v3_5_t2v",
|
|
23
|
+
"pixverse_v4_t2v",
|
|
24
|
+
"pixverse_v4_5_t2v",
|
|
25
|
+
"pixverse_v5_t2v",
|
|
26
|
+
"pixverse_v5_5_t2v",
|
|
27
|
+
"pixverse_v5_6_t2v",
|
|
28
|
+
"pixverse_v6_t2v",
|
|
32
29
|
];
|
|
30
|
+
const FUSION_MODELS = ["pixverse_v5_6_fusion"];
|
|
33
31
|
const OPTIONAL_PROMPT_MODELS = new Set([
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
"pixverse_v35_transition",
|
|
33
|
+
"pixverse_v3_5_t2v",
|
|
34
|
+
"pixverse_v3_5_i2v",
|
|
35
|
+
"pixverse_v4_i2v",
|
|
36
|
+
"pixverse_v4_5_i2v",
|
|
37
|
+
"pixverse_v5_i2v",
|
|
38
|
+
"pixverse_v5_transition",
|
|
39
|
+
"pixverse_v45_transition",
|
|
40
|
+
"pixverse_v5_6_i2v",
|
|
41
|
+
"pixverse_v6_transition",
|
|
44
42
|
]);
|
|
45
43
|
const LEGACY_T2V_MODELS = new Set([
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
"pixverse_v3_5_t2v",
|
|
45
|
+
"pixverse_v4_t2v",
|
|
46
|
+
"pixverse_v4_5_t2v",
|
|
47
|
+
"pixverse_v5_t2v",
|
|
50
48
|
]);
|
|
51
49
|
const LEGACY_I2V_MODELS = new Set([
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
"pixverse_v3_5_i2v",
|
|
51
|
+
"pixverse_v4_i2v",
|
|
52
|
+
"pixverse_v4_5_i2v",
|
|
53
|
+
"pixverse_v5_i2v",
|
|
56
54
|
]);
|
|
57
55
|
const LEGACY_TRANSITION_MODELS = new Set([
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
"pixverse_v35_transition",
|
|
57
|
+
"pixverse_v4_transition",
|
|
58
|
+
"pixverse_v45_transition",
|
|
59
|
+
"pixverse_v5_transition",
|
|
60
|
+
]);
|
|
61
|
+
const V55_T2V_MODELS = new Set(["pixverse_v5_5_t2v"]);
|
|
62
|
+
const V55_I2V_MODELS = new Set(["pixverse_v5_5_i2v"]);
|
|
63
|
+
const V55_TRANSITION_MODELS = new Set(["pixverse_v5_5_transition"]);
|
|
64
|
+
const V56_T2V_MODELS = new Set(["pixverse_v5_6_t2v"]);
|
|
65
|
+
const V56_I2V_MODELS = new Set(["pixverse_v5_6_i2v"]);
|
|
66
|
+
const V56_TRANSITION_MODELS = new Set(["pixverse_v5_6_transition"]);
|
|
67
|
+
const V6_T2V_MODELS = new Set(["pixverse_v6_t2v"]);
|
|
68
|
+
const V6_I2V_MODELS = new Set(["pixverse_v6_i2v"]);
|
|
69
|
+
const V6_TRANSITION_MODELS = new Set(["pixverse_v6_transition"]);
|
|
70
|
+
const QUALITYS = new Set(["360p", "540p", "720p", "1080p"]);
|
|
71
|
+
const LEGACY_RATIOS = new Set(["16:9", "9:16", "1:1", "4:3", "3:4"]);
|
|
72
|
+
const V6_RATIOS = new Set(["16:9", "4:3", "1:1", "3:4", "9:16", "2:3", "3:2", "21:9"]);
|
|
73
|
+
const STYLES = new Set(["anime", "3d_animation", "clay", "comic", "cyberpunk"]);
|
|
74
|
+
const MOTION_MODES = new Set(["normal", "fast"]);
|
|
75
|
+
const CAMERA_MOVEMENTS = new Set([
|
|
76
|
+
"zoom_in",
|
|
77
|
+
"zoom_out",
|
|
78
|
+
"pan_left",
|
|
79
|
+
"pan_right",
|
|
80
|
+
"tilt_up",
|
|
81
|
+
"tilt_down",
|
|
62
82
|
]);
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const V55_TRANSITION_MODELS = new Set(['pixverse_v5_5_transition']);
|
|
66
|
-
const V56_T2V_MODELS = new Set(['pixverse_v5_6_t2v']);
|
|
67
|
-
const V56_I2V_MODELS = new Set(['pixverse_v5_6_i2v']);
|
|
68
|
-
const V56_TRANSITION_MODELS = new Set(['pixverse_v5_6_transition']);
|
|
69
|
-
const V6_T2V_MODELS = new Set(['pixverse_v6_t2v']);
|
|
70
|
-
const V6_I2V_MODELS = new Set(['pixverse_v6_i2v']);
|
|
71
|
-
const V6_TRANSITION_MODELS = new Set(['pixverse_v6_transition']);
|
|
72
|
-
const QUALITYS = new Set(['360p', '540p', '720p', '1080p']);
|
|
73
|
-
const LEGACY_RATIOS = new Set(['16:9', '9:16', '1:1', '4:3', '3:4']);
|
|
74
|
-
const V6_RATIOS = new Set(['16:9', '4:3', '1:1', '3:4', '9:16', '2:3', '3:2', '21:9']);
|
|
75
|
-
const STYLES = new Set(['anime', '3d_animation', 'clay', 'comic', 'cyberpunk']);
|
|
76
|
-
const MOTION_MODES = new Set(['normal', 'fast']);
|
|
77
|
-
const CAMERA_MOVEMENTS = new Set(['zoom_in', 'zoom_out', 'pan_left', 'pan_right', 'tilt_up', 'tilt_down']);
|
|
78
|
-
const THINKING_TYPES = new Set(['enabled', 'disabled', 'auto']);
|
|
79
|
-
const REFERENCE_TYPES = new Set(['subject', 'background']);
|
|
83
|
+
const THINKING_TYPES = new Set(["enabled", "disabled", "auto"]);
|
|
84
|
+
const REFERENCE_TYPES = new Set(["subject", "background"]);
|
|
80
85
|
function buildEnvelope(model, params) {
|
|
81
86
|
return {
|
|
82
87
|
model,
|
|
@@ -87,29 +92,29 @@ function buildEnvelope(model, params) {
|
|
|
87
92
|
};
|
|
88
93
|
}
|
|
89
94
|
function maybeString(value) {
|
|
90
|
-
if (typeof value !==
|
|
95
|
+
if (typeof value !== "string" || value.length === 0)
|
|
91
96
|
return undefined;
|
|
92
97
|
return value;
|
|
93
98
|
}
|
|
94
99
|
function maybeStringArray(value) {
|
|
95
100
|
if (Array.isArray(value)) {
|
|
96
|
-
return value.filter((item) => typeof item ===
|
|
101
|
+
return value.filter((item) => typeof item === "string" && item.length > 0);
|
|
97
102
|
}
|
|
98
|
-
if (typeof value ===
|
|
103
|
+
if (typeof value === "string" && value.length > 0)
|
|
99
104
|
return [value];
|
|
100
105
|
return [];
|
|
101
106
|
}
|
|
102
107
|
function escapeRegex(value) {
|
|
103
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g,
|
|
108
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
104
109
|
}
|
|
105
110
|
function promptContainsReference(prompt, refName) {
|
|
106
|
-
const pattern = new RegExp(`(^|\\s)@${escapeRegex(refName)}(?=$|\\s|[\\p{P}\\p{S}])`,
|
|
111
|
+
const pattern = new RegExp(`(^|\\s)@${escapeRegex(refName)}(?=$|\\s|[\\p{P}\\p{S}])`, "u");
|
|
107
112
|
return pattern.test(prompt);
|
|
108
113
|
}
|
|
109
114
|
function parseInteger(model, value, flagName, options = {}) {
|
|
110
115
|
if (value === undefined)
|
|
111
116
|
return undefined;
|
|
112
|
-
if (typeof value !==
|
|
117
|
+
if (typeof value !== "number" || Number.isNaN(value) || !Number.isInteger(value)) {
|
|
113
118
|
throw new CLIError(`Model "${model}" requires --${flagName} to be an integer.`, ExitCode.USAGE);
|
|
114
119
|
}
|
|
115
120
|
if (options.min !== undefined && value < options.min) {
|
|
@@ -123,15 +128,15 @@ function parseInteger(model, value, flagName, options = {}) {
|
|
|
123
128
|
function parseEnum(model, value, flagName, allowed) {
|
|
124
129
|
if (value === undefined)
|
|
125
130
|
return undefined;
|
|
126
|
-
if (typeof value !==
|
|
127
|
-
throw new CLIError(`Model "${model}" requires --${flagName} to be one of: ${Array.from(allowed).join(
|
|
131
|
+
if (typeof value !== "string" || !allowed.has(value)) {
|
|
132
|
+
throw new CLIError(`Model "${model}" requires --${flagName} to be one of: ${Array.from(allowed).join(", ")}.`, ExitCode.USAGE);
|
|
128
133
|
}
|
|
129
134
|
return value;
|
|
130
135
|
}
|
|
131
136
|
function parseNonEmptyString(model, value, flagName) {
|
|
132
137
|
if (value === undefined)
|
|
133
138
|
return undefined;
|
|
134
|
-
if (typeof value !==
|
|
139
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
135
140
|
throw new CLIError(`Model "${model}" requires --${flagName} to be a non-empty string.`, ExitCode.USAGE);
|
|
136
141
|
}
|
|
137
142
|
return value;
|
|
@@ -143,61 +148,61 @@ function assertUnsupported(model, value, flagName, hint) {
|
|
|
143
148
|
}
|
|
144
149
|
function assertPixVerseCommonUnsupported(model, flags) {
|
|
145
150
|
const entries = [
|
|
146
|
-
[
|
|
147
|
-
[
|
|
148
|
-
[
|
|
149
|
-
[
|
|
150
|
-
[
|
|
151
|
-
[
|
|
152
|
-
[
|
|
153
|
-
[
|
|
154
|
-
[
|
|
155
|
-
[
|
|
156
|
-
[
|
|
157
|
-
[
|
|
158
|
-
[
|
|
159
|
-
[
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
[
|
|
164
|
-
[
|
|
165
|
-
[
|
|
166
|
-
[
|
|
167
|
-
[
|
|
168
|
-
[
|
|
169
|
-
[
|
|
170
|
-
[
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
174
|
-
[
|
|
175
|
-
[
|
|
176
|
-
[
|
|
177
|
-
[
|
|
178
|
-
[
|
|
179
|
-
[
|
|
180
|
-
[
|
|
181
|
-
[
|
|
182
|
-
[
|
|
183
|
-
[
|
|
184
|
-
[
|
|
185
|
-
[
|
|
186
|
-
[
|
|
187
|
-
[
|
|
188
|
-
[
|
|
189
|
-
[
|
|
190
|
-
[
|
|
191
|
-
[
|
|
192
|
-
[
|
|
193
|
-
[
|
|
194
|
-
[
|
|
195
|
-
[
|
|
196
|
-
[
|
|
197
|
-
[
|
|
198
|
-
[
|
|
199
|
-
[
|
|
200
|
-
[
|
|
151
|
+
["short", flags.short],
|
|
152
|
+
["size", flags.size],
|
|
153
|
+
["fps", flags.fps],
|
|
154
|
+
["frames", flags.frames],
|
|
155
|
+
["service-tier", flags.serviceTier],
|
|
156
|
+
["expires-after", flags.expiresAfter],
|
|
157
|
+
["payload", flags.payload],
|
|
158
|
+
["callback-url", flags.callbackUrl],
|
|
159
|
+
["off-peak", flags.offPeak],
|
|
160
|
+
["recommend-prompt", flags.recommendPrompt],
|
|
161
|
+
["enhance-prompt", flags.enhancePrompt],
|
|
162
|
+
["template", flags.template],
|
|
163
|
+
["template-params", flags.templateParams],
|
|
164
|
+
["language", flags.language],
|
|
165
|
+
["creative", flags.creative],
|
|
166
|
+
["add-subtitle", flags.addSubtitle],
|
|
167
|
+
["remove-audio", flags.removeAudio],
|
|
168
|
+
["watermark", flags.watermark],
|
|
169
|
+
["watermark-position", flags.watermarkPosition],
|
|
170
|
+
["watermark-url", flags.watermarkUrl],
|
|
171
|
+
["meta-data", flags.metaData],
|
|
172
|
+
["external-task-id", flags.externalTaskId],
|
|
173
|
+
["element-ids", flags.elementIds],
|
|
174
|
+
["effect-scene", flags.effectScene],
|
|
175
|
+
["character-orientation", flags.characterOrientation],
|
|
176
|
+
["keep-original-sound", flags.keepOriginalSound],
|
|
177
|
+
["video-refer-type", flags.videoReferType],
|
|
178
|
+
["lipsync-mode", flags.lipsyncMode],
|
|
179
|
+
["camera-fixed", flags.cameraFixed],
|
|
180
|
+
["return-last-frame", flags.returnLastFrame],
|
|
181
|
+
["draft", flags.draft],
|
|
182
|
+
["draft-task-id", flags.draftTaskId],
|
|
183
|
+
["reference-urls", flags.referenceUrls],
|
|
184
|
+
["video-url", flags.videoUrl],
|
|
185
|
+
["video-id", flags.videoId],
|
|
186
|
+
["mask-urls", flags.maskUrls],
|
|
187
|
+
["movement-amplitude", flags.movementAmplitude],
|
|
188
|
+
["mode", flags.mode],
|
|
189
|
+
["shot-type", flags.shotType],
|
|
190
|
+
["cfg-scale", flags.cfgScale],
|
|
191
|
+
["video-quality", flags.videoQuality],
|
|
192
|
+
["pe-fast-mode", flags.peFastMode],
|
|
193
|
+
["audio-id", flags.audioId],
|
|
194
|
+
["voice-language", flags.voiceLanguage],
|
|
195
|
+
["voice-speed", flags.voiceSpeed],
|
|
196
|
+
["bgm", flags.bgm],
|
|
197
|
+
["sound", flags.sound],
|
|
198
|
+
["audio-url", flags.audioUrl],
|
|
199
|
+
["sounds", flags.sounds],
|
|
200
|
+
["bitrate", flags.bitrate],
|
|
201
|
+
["extension-type", flags.extensionType],
|
|
202
|
+
["character-reference-url", flags.characterReferenceUrl],
|
|
203
|
+
["style-reference-url", flags.styleReferenceUrl],
|
|
204
|
+
["character-reference-weight", flags.characterReferenceWeight],
|
|
205
|
+
["style-reference-weight", flags.styleReferenceWeight],
|
|
201
206
|
];
|
|
202
207
|
for (const [flagName, value] of entries) {
|
|
203
208
|
assertUnsupported(model, value, flagName);
|
|
@@ -216,7 +221,7 @@ function requireImageInputs(model, flags) {
|
|
|
216
221
|
return images;
|
|
217
222
|
}
|
|
218
223
|
function requireStartEndImages(model, flags) {
|
|
219
|
-
assertUnsupported(model, flags.imageUrls,
|
|
224
|
+
assertUnsupported(model, flags.imageUrls, "image-urls");
|
|
220
225
|
const first = maybeString(flags.imageUrl);
|
|
221
226
|
const last = maybeString(flags.imageTailUrl);
|
|
222
227
|
if (!first || !last) {
|
|
@@ -228,7 +233,7 @@ function assertDurationInSet(model, duration, allowed) {
|
|
|
228
233
|
if (duration === undefined)
|
|
229
234
|
return;
|
|
230
235
|
if (!allowed.includes(duration)) {
|
|
231
|
-
throw new CLIError(`Model "${model}" requires --duration to be one of: ${allowed.join(
|
|
236
|
+
throw new CLIError(`Model "${model}" requires --duration to be one of: ${allowed.join(", ")}.`, ExitCode.USAGE);
|
|
232
237
|
}
|
|
233
238
|
}
|
|
234
239
|
function assertDurationRange(model, duration, min, max) {
|
|
@@ -239,33 +244,33 @@ function assertDurationRange(model, duration, min, max) {
|
|
|
239
244
|
}
|
|
240
245
|
}
|
|
241
246
|
function validate1080pDuration(model, quality, duration) {
|
|
242
|
-
if (quality ===
|
|
247
|
+
if (quality === "1080p" && duration === 10) {
|
|
243
248
|
throw new CLIError(`Model "${model}" does not support --duration 10 with --resolution 1080p.`, ExitCode.USAGE);
|
|
244
249
|
}
|
|
245
250
|
}
|
|
246
251
|
function assertNoFusionFlags(model, flags) {
|
|
247
|
-
assertUnsupported(model, flags.referenceNames,
|
|
248
|
-
assertUnsupported(model, flags.referenceTypes,
|
|
252
|
+
assertUnsupported(model, flags.referenceNames, "reference-names");
|
|
253
|
+
assertUnsupported(model, flags.referenceTypes, "reference-types");
|
|
249
254
|
}
|
|
250
255
|
function validateLegacyControls(model, flags, options = {}) {
|
|
251
256
|
if (options.allowAspectRatio) {
|
|
252
|
-
parseEnum(model, flags.aspectRatio,
|
|
257
|
+
parseEnum(model, flags.aspectRatio, "aspect-ratio", LEGACY_RATIOS);
|
|
253
258
|
}
|
|
254
259
|
else {
|
|
255
|
-
assertUnsupported(model, flags.aspectRatio,
|
|
260
|
+
assertUnsupported(model, flags.aspectRatio, "aspect-ratio");
|
|
256
261
|
}
|
|
257
|
-
parseEnum(model, flags.resolution,
|
|
258
|
-
parseEnum(model, flags.motionMode,
|
|
259
|
-
parseEnum(model, flags.cameraMovement,
|
|
260
|
-
parseInteger(model, flags.seed,
|
|
261
|
-
parseInteger(model, flags.templateId,
|
|
262
|
+
parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
263
|
+
parseEnum(model, flags.motionMode, "motion-mode", MOTION_MODES);
|
|
264
|
+
parseEnum(model, flags.cameraMovement, "camera-movement", CAMERA_MOVEMENTS);
|
|
265
|
+
parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
266
|
+
parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
262
267
|
if (options.allowAudioControls) {
|
|
263
268
|
if (flags.soundEffect !== undefined) {
|
|
264
269
|
if (flags.soundEffect !== true) {
|
|
265
270
|
throw new CLIError(`Model "${model}" only accepts --sound-effect as a boolean flag.`, ExitCode.USAGE);
|
|
266
271
|
}
|
|
267
272
|
}
|
|
268
|
-
parseNonEmptyString(model, flags.soundEffectPrompt,
|
|
273
|
+
parseNonEmptyString(model, flags.soundEffectPrompt, "sound-effect-prompt");
|
|
269
274
|
if (flags.soundEffectPrompt !== undefined && flags.soundEffect !== true) {
|
|
270
275
|
throw new CLIError(`Model "${model}" requires --sound-effect when using --sound-effect-prompt.`, ExitCode.USAGE);
|
|
271
276
|
}
|
|
@@ -274,27 +279,27 @@ function validateLegacyControls(model, flags, options = {}) {
|
|
|
274
279
|
throw new CLIError(`Model "${model}" only accepts --lip-sync as a boolean flag.`, ExitCode.USAGE);
|
|
275
280
|
}
|
|
276
281
|
}
|
|
277
|
-
parseNonEmptyString(model, flags.ttsText,
|
|
278
|
-
parseNonEmptyString(model, flags.voiceId,
|
|
282
|
+
parseNonEmptyString(model, flags.ttsText, "tts-text");
|
|
283
|
+
parseNonEmptyString(model, flags.voiceId, "voice-id");
|
|
279
284
|
if ((flags.ttsText !== undefined || flags.voiceId !== undefined) && flags.lipSync !== true) {
|
|
280
285
|
throw new CLIError(`Model "${model}" requires --lip-sync when using --tts-text or --voice-id.`, ExitCode.USAGE);
|
|
281
286
|
}
|
|
282
287
|
if (flags.lipSync === true && flags.ttsText === undefined) {
|
|
283
288
|
throw new CLIError(`Model "${model}" requires --tts-text when using --lip-sync.`, ExitCode.USAGE);
|
|
284
289
|
}
|
|
285
|
-
assertUnsupported(model, flags.audio,
|
|
290
|
+
assertUnsupported(model, flags.audio, "audio");
|
|
286
291
|
}
|
|
287
292
|
else {
|
|
288
|
-
assertUnsupported(model, flags.soundEffect,
|
|
289
|
-
assertUnsupported(model, flags.soundEffectPrompt,
|
|
290
|
-
assertUnsupported(model, flags.lipSync,
|
|
291
|
-
assertUnsupported(model, flags.ttsText,
|
|
292
|
-
assertUnsupported(model, flags.voiceId,
|
|
293
|
-
assertUnsupported(model, flags.audio,
|
|
293
|
+
assertUnsupported(model, flags.soundEffect, "sound-effect");
|
|
294
|
+
assertUnsupported(model, flags.soundEffectPrompt, "sound-effect-prompt");
|
|
295
|
+
assertUnsupported(model, flags.lipSync, "lip-sync");
|
|
296
|
+
assertUnsupported(model, flags.ttsText, "tts-text");
|
|
297
|
+
assertUnsupported(model, flags.voiceId, "voice-id");
|
|
298
|
+
assertUnsupported(model, flags.audio, "audio");
|
|
294
299
|
}
|
|
295
|
-
assertUnsupported(model, flags.style,
|
|
296
|
-
assertUnsupported(model, flags.multiShot,
|
|
297
|
-
assertUnsupported(model, flags.thinkingType,
|
|
300
|
+
assertUnsupported(model, flags.style, "style");
|
|
301
|
+
assertUnsupported(model, flags.multiShot, "multi-shot");
|
|
302
|
+
assertUnsupported(model, flags.thinkingType, "thinking-type");
|
|
298
303
|
}
|
|
299
304
|
function parsePixVerseAudioFlag(model, value) {
|
|
300
305
|
if (value === undefined)
|
|
@@ -313,20 +318,20 @@ function parsePixVerseMultiShotFlag(model, value) {
|
|
|
313
318
|
return true;
|
|
314
319
|
}
|
|
315
320
|
function applyPromptlessAudioControls(model, params, flags) {
|
|
316
|
-
assertUnsupported(model, flags.soundEffect,
|
|
317
|
-
const soundEffectPrompt = parseNonEmptyString(model, flags.soundEffectPrompt,
|
|
321
|
+
assertUnsupported(model, flags.soundEffect, "sound-effect");
|
|
322
|
+
const soundEffectPrompt = parseNonEmptyString(model, flags.soundEffectPrompt, "sound-effect-prompt");
|
|
318
323
|
if (soundEffectPrompt)
|
|
319
|
-
params[
|
|
320
|
-
assertUnsupported(model, flags.lipSync,
|
|
321
|
-
const ttsText = parseNonEmptyString(model, flags.ttsText,
|
|
324
|
+
params["sound_effect_content"] = soundEffectPrompt;
|
|
325
|
+
assertUnsupported(model, flags.lipSync, "lip-sync");
|
|
326
|
+
const ttsText = parseNonEmptyString(model, flags.ttsText, "tts-text");
|
|
322
327
|
if (ttsText)
|
|
323
|
-
params[
|
|
324
|
-
const voiceId = parseNonEmptyString(model, flags.voiceId,
|
|
328
|
+
params["lip_sync_tts_content"] = ttsText;
|
|
329
|
+
const voiceId = parseNonEmptyString(model, flags.voiceId, "voice-id");
|
|
325
330
|
if (voiceId && !ttsText) {
|
|
326
331
|
throw new CLIError(`Model "${model}" requires --tts-text when using --voice-id.`, ExitCode.USAGE);
|
|
327
332
|
}
|
|
328
333
|
if (voiceId)
|
|
329
|
-
params[
|
|
334
|
+
params["lip_sync_tts_speaker_id"] = voiceId;
|
|
330
335
|
}
|
|
331
336
|
function applyModernAudioControls(model, params, flags, options) {
|
|
332
337
|
if (options.allowSoundSwitch) {
|
|
@@ -334,29 +339,35 @@ function applyModernAudioControls(model, params, flags, options) {
|
|
|
334
339
|
if (flags.soundEffect !== true) {
|
|
335
340
|
throw new CLIError(`Model "${model}" only accepts --sound-effect as a boolean flag.`, ExitCode.USAGE);
|
|
336
341
|
}
|
|
337
|
-
params[
|
|
342
|
+
params["sound_effect_switch"] = true;
|
|
338
343
|
}
|
|
339
|
-
const soundEffectPrompt = parseNonEmptyString(model, flags.soundEffectPrompt,
|
|
344
|
+
const soundEffectPrompt = parseNonEmptyString(model, flags.soundEffectPrompt, "sound-effect-prompt");
|
|
340
345
|
if (soundEffectPrompt) {
|
|
341
346
|
if (flags.soundEffect !== true) {
|
|
342
347
|
throw new CLIError(`Model "${model}" requires --sound-effect when using --sound-effect-prompt.`, ExitCode.USAGE);
|
|
343
348
|
}
|
|
344
|
-
params[
|
|
349
|
+
params["sound_effect_content"] = soundEffectPrompt;
|
|
345
350
|
}
|
|
346
351
|
}
|
|
347
352
|
else {
|
|
348
|
-
assertUnsupported(model, flags.soundEffect,
|
|
349
|
-
applyPromptlessAudioControls(model, params, {
|
|
353
|
+
assertUnsupported(model, flags.soundEffect, "sound-effect");
|
|
354
|
+
applyPromptlessAudioControls(model, params, {
|
|
355
|
+
...flags,
|
|
356
|
+
lipSync: flags.lipSync,
|
|
357
|
+
ttsText: flags.ttsText,
|
|
358
|
+
voiceId: flags.voiceId,
|
|
359
|
+
soundEffectPrompt: flags.soundEffectPrompt,
|
|
360
|
+
});
|
|
350
361
|
}
|
|
351
362
|
if (options.allowLipSyncSwitch) {
|
|
352
363
|
if (flags.lipSync !== undefined) {
|
|
353
364
|
if (flags.lipSync !== true) {
|
|
354
365
|
throw new CLIError(`Model "${model}" only accepts --lip-sync as a boolean flag.`, ExitCode.USAGE);
|
|
355
366
|
}
|
|
356
|
-
params[
|
|
367
|
+
params["lip_sync_switch"] = true;
|
|
357
368
|
}
|
|
358
|
-
const ttsText = parseNonEmptyString(model, flags.ttsText,
|
|
359
|
-
const voiceId = parseNonEmptyString(model, flags.voiceId,
|
|
369
|
+
const ttsText = parseNonEmptyString(model, flags.ttsText, "tts-text");
|
|
370
|
+
const voiceId = parseNonEmptyString(model, flags.voiceId, "voice-id");
|
|
360
371
|
if ((ttsText !== undefined || voiceId !== undefined) && flags.lipSync !== true) {
|
|
361
372
|
throw new CLIError(`Model "${model}" requires --lip-sync when using --tts-text or --voice-id.`, ExitCode.USAGE);
|
|
362
373
|
}
|
|
@@ -364,217 +375,217 @@ function applyModernAudioControls(model, params, flags, options) {
|
|
|
364
375
|
throw new CLIError(`Model "${model}" requires --tts-text when using --lip-sync.`, ExitCode.USAGE);
|
|
365
376
|
}
|
|
366
377
|
if (ttsText)
|
|
367
|
-
params[
|
|
378
|
+
params["lip_sync_tts_content"] = ttsText;
|
|
368
379
|
if (voiceId)
|
|
369
|
-
params[
|
|
380
|
+
params["lip_sync_tts_speaker_id"] = voiceId;
|
|
370
381
|
}
|
|
371
382
|
else {
|
|
372
|
-
assertUnsupported(model, flags.lipSync,
|
|
373
|
-
const ttsText = parseNonEmptyString(model, flags.ttsText,
|
|
374
|
-
const voiceId = parseNonEmptyString(model, flags.voiceId,
|
|
383
|
+
assertUnsupported(model, flags.lipSync, "lip-sync");
|
|
384
|
+
const ttsText = parseNonEmptyString(model, flags.ttsText, "tts-text");
|
|
385
|
+
const voiceId = parseNonEmptyString(model, flags.voiceId, "voice-id");
|
|
375
386
|
if (voiceId && !ttsText) {
|
|
376
387
|
throw new CLIError(`Model "${model}" requires --tts-text when using --voice-id.`, ExitCode.USAGE);
|
|
377
388
|
}
|
|
378
389
|
if (ttsText)
|
|
379
|
-
params[
|
|
390
|
+
params["lip_sync_tts_content"] = ttsText;
|
|
380
391
|
if (voiceId)
|
|
381
|
-
params[
|
|
392
|
+
params["lip_sync_tts_speaker_id"] = voiceId;
|
|
382
393
|
}
|
|
383
394
|
if (options.allowAudio) {
|
|
384
395
|
const audio = parsePixVerseAudioFlag(model, flags.audio);
|
|
385
396
|
if (audio !== undefined)
|
|
386
|
-
params[
|
|
397
|
+
params["generate_audio_switch"] = audio;
|
|
387
398
|
}
|
|
388
399
|
else {
|
|
389
|
-
assertUnsupported(model, flags.audio,
|
|
400
|
+
assertUnsupported(model, flags.audio, "audio");
|
|
390
401
|
}
|
|
391
402
|
if (options.allowMultiShot) {
|
|
392
403
|
const multiShot = parsePixVerseMultiShotFlag(model, flags.multiShot);
|
|
393
404
|
if (multiShot !== undefined)
|
|
394
|
-
params[
|
|
405
|
+
params["generate_multi_clip_switch"] = multiShot;
|
|
395
406
|
}
|
|
396
407
|
else {
|
|
397
|
-
assertUnsupported(model, flags.multiShot,
|
|
408
|
+
assertUnsupported(model, flags.multiShot, "multi-shot");
|
|
398
409
|
}
|
|
399
410
|
if (options.allowThinking) {
|
|
400
|
-
const thinkingType = parseEnum(model, flags.thinkingType,
|
|
411
|
+
const thinkingType = parseEnum(model, flags.thinkingType, "thinking-type", THINKING_TYPES);
|
|
401
412
|
if (thinkingType)
|
|
402
|
-
params[
|
|
413
|
+
params["thinking_type"] = thinkingType;
|
|
403
414
|
}
|
|
404
415
|
else {
|
|
405
|
-
assertUnsupported(model, flags.thinkingType,
|
|
416
|
+
assertUnsupported(model, flags.thinkingType, "thinking-type");
|
|
406
417
|
}
|
|
407
418
|
}
|
|
408
419
|
function buildLegacyTransitionBody(model, prompt, flags) {
|
|
409
420
|
assertPixVerseCommonUnsupported(model, flags);
|
|
410
421
|
assertNoFusionFlags(model, flags);
|
|
411
422
|
const { first, last } = requireStartEndImages(model, flags);
|
|
412
|
-
const duration = parseInteger(model, flags.duration,
|
|
413
|
-
if (model ===
|
|
423
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
424
|
+
if (model === "pixverse_v5_transition") {
|
|
414
425
|
assertDurationInSet(model, duration, [5]);
|
|
415
426
|
}
|
|
416
|
-
else if (model ===
|
|
427
|
+
else if (model === "pixverse_v45_transition") {
|
|
417
428
|
assertDurationInSet(model, duration, [5, 8]);
|
|
418
429
|
}
|
|
419
430
|
else {
|
|
420
431
|
assertDurationInSet(model, duration, [5, 8]);
|
|
421
432
|
}
|
|
422
|
-
assertUnsupported(model, flags.aspectRatio,
|
|
423
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
424
|
-
assertUnsupported(model, flags.negativePrompt,
|
|
425
|
-
assertUnsupported(model, flags.templateId,
|
|
433
|
+
assertUnsupported(model, flags.aspectRatio, "aspect-ratio");
|
|
434
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
435
|
+
assertUnsupported(model, flags.negativePrompt, "negative-prompt");
|
|
436
|
+
assertUnsupported(model, flags.templateId, "template-id");
|
|
426
437
|
validateLegacyControls(model, flags, { allowAudioControls: true });
|
|
427
438
|
const params = {
|
|
428
439
|
first_frame_image: first,
|
|
429
440
|
last_frame_image: last,
|
|
430
441
|
};
|
|
431
442
|
if (prompt)
|
|
432
|
-
params[
|
|
443
|
+
params["prompt"] = prompt;
|
|
433
444
|
if (duration !== undefined)
|
|
434
|
-
params[
|
|
435
|
-
const quality = parseEnum(model, flags.resolution,
|
|
445
|
+
params["duration"] = duration;
|
|
446
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
436
447
|
if (quality)
|
|
437
|
-
params[
|
|
438
|
-
const motionMode = parseEnum(model, flags.motionMode,
|
|
448
|
+
params["quality"] = quality;
|
|
449
|
+
const motionMode = parseEnum(model, flags.motionMode, "motion-mode", MOTION_MODES);
|
|
439
450
|
if (motionMode)
|
|
440
|
-
params[
|
|
441
|
-
const seed = parseInteger(model, flags.seed,
|
|
451
|
+
params["motion_mode"] = motionMode;
|
|
452
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
442
453
|
if (seed !== undefined)
|
|
443
|
-
params[
|
|
454
|
+
params["seed"] = seed;
|
|
444
455
|
if (flags.soundEffect === true)
|
|
445
|
-
params[
|
|
446
|
-
const soundEffectPrompt = parseNonEmptyString(model, flags.soundEffectPrompt,
|
|
456
|
+
params["sound_effect_switch"] = true;
|
|
457
|
+
const soundEffectPrompt = parseNonEmptyString(model, flags.soundEffectPrompt, "sound-effect-prompt");
|
|
447
458
|
if (soundEffectPrompt)
|
|
448
|
-
params[
|
|
459
|
+
params["sound_effect_content"] = soundEffectPrompt;
|
|
449
460
|
if (flags.lipSync === true)
|
|
450
|
-
params[
|
|
451
|
-
const ttsText = parseNonEmptyString(model, flags.ttsText,
|
|
461
|
+
params["lip_sync_tts_switch"] = true;
|
|
462
|
+
const ttsText = parseNonEmptyString(model, flags.ttsText, "tts-text");
|
|
452
463
|
if (ttsText)
|
|
453
|
-
params[
|
|
454
|
-
const voiceId = parseNonEmptyString(model, flags.voiceId,
|
|
464
|
+
params["lip_sync_tts_content"] = ttsText;
|
|
465
|
+
const voiceId = parseNonEmptyString(model, flags.voiceId, "voice-id");
|
|
455
466
|
if (voiceId)
|
|
456
|
-
params[
|
|
467
|
+
params["lip_sync_tts_speaker_id"] = voiceId;
|
|
457
468
|
return buildEnvelope(model, params);
|
|
458
469
|
}
|
|
459
470
|
function buildLegacyI2VBody(model, prompt, flags) {
|
|
460
471
|
assertPixVerseCommonUnsupported(model, flags);
|
|
461
472
|
assertNoFusionFlags(model, flags);
|
|
462
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
473
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
463
474
|
const images = requireImageInputs(model, flags);
|
|
464
|
-
const duration = parseInteger(model, flags.duration,
|
|
475
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
465
476
|
assertDurationInSet(model, duration, [5, 8]);
|
|
466
477
|
validateLegacyControls(model, flags, { allowAudioControls: true });
|
|
467
478
|
const params = {
|
|
468
479
|
img_id: images[0],
|
|
469
480
|
};
|
|
470
481
|
if (images.length > 1)
|
|
471
|
-
params[
|
|
482
|
+
params["img_ids"] = images;
|
|
472
483
|
if (prompt)
|
|
473
|
-
params[
|
|
484
|
+
params["prompt"] = prompt;
|
|
474
485
|
if (duration !== undefined)
|
|
475
|
-
params[
|
|
476
|
-
const quality = parseEnum(model, flags.resolution,
|
|
486
|
+
params["duration"] = duration;
|
|
487
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
477
488
|
if (quality)
|
|
478
|
-
params[
|
|
479
|
-
const motionMode = parseEnum(model, flags.motionMode,
|
|
489
|
+
params["quality"] = quality;
|
|
490
|
+
const motionMode = parseEnum(model, flags.motionMode, "motion-mode", MOTION_MODES);
|
|
480
491
|
if (motionMode)
|
|
481
|
-
params[
|
|
482
|
-
const cameraMovement = parseEnum(model, flags.cameraMovement,
|
|
492
|
+
params["motion_mode"] = motionMode;
|
|
493
|
+
const cameraMovement = parseEnum(model, flags.cameraMovement, "camera-movement", CAMERA_MOVEMENTS);
|
|
483
494
|
if (cameraMovement)
|
|
484
|
-
params[
|
|
495
|
+
params["camera_movement"] = cameraMovement;
|
|
485
496
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
486
497
|
if (negativePrompt)
|
|
487
|
-
params[
|
|
488
|
-
const seed = parseInteger(model, flags.seed,
|
|
498
|
+
params["negative_prompt"] = negativePrompt;
|
|
499
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
489
500
|
if (seed !== undefined)
|
|
490
|
-
params[
|
|
491
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
501
|
+
params["seed"] = seed;
|
|
502
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
492
503
|
if (templateId !== undefined)
|
|
493
|
-
params[
|
|
504
|
+
params["template_id"] = templateId;
|
|
494
505
|
if (flags.soundEffect === true)
|
|
495
|
-
params[
|
|
496
|
-
const soundEffectPrompt = parseNonEmptyString(model, flags.soundEffectPrompt,
|
|
506
|
+
params["sound_effect_switch"] = true;
|
|
507
|
+
const soundEffectPrompt = parseNonEmptyString(model, flags.soundEffectPrompt, "sound-effect-prompt");
|
|
497
508
|
if (soundEffectPrompt)
|
|
498
|
-
params[
|
|
509
|
+
params["sound_effect_content"] = soundEffectPrompt;
|
|
499
510
|
if (flags.lipSync === true)
|
|
500
|
-
params[
|
|
501
|
-
const ttsText = parseNonEmptyString(model, flags.ttsText,
|
|
511
|
+
params["lip_sync_tts_switch"] = true;
|
|
512
|
+
const ttsText = parseNonEmptyString(model, flags.ttsText, "tts-text");
|
|
502
513
|
if (ttsText)
|
|
503
|
-
params[
|
|
504
|
-
const voiceId = parseNonEmptyString(model, flags.voiceId,
|
|
514
|
+
params["lip_sync_tts_content"] = ttsText;
|
|
515
|
+
const voiceId = parseNonEmptyString(model, flags.voiceId, "voice-id");
|
|
505
516
|
if (voiceId)
|
|
506
|
-
params[
|
|
517
|
+
params["lip_sync_tts_speaker_id"] = voiceId;
|
|
507
518
|
return buildEnvelope(model, params);
|
|
508
519
|
}
|
|
509
520
|
function buildLegacyT2VBody(model, prompt, flags) {
|
|
510
521
|
assertPixVerseCommonUnsupported(model, flags);
|
|
511
522
|
assertNoFusionFlags(model, flags);
|
|
512
|
-
assertUnsupported(model, flags.imageUrl,
|
|
513
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
514
|
-
assertUnsupported(model, flags.imageUrls,
|
|
515
|
-
const duration = parseInteger(model, flags.duration,
|
|
523
|
+
assertUnsupported(model, flags.imageUrl, "image-url");
|
|
524
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
525
|
+
assertUnsupported(model, flags.imageUrls, "image-urls");
|
|
526
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
516
527
|
assertDurationInSet(model, duration, [5, 8]);
|
|
517
528
|
validateLegacyControls(model, flags, { allowAspectRatio: true });
|
|
518
529
|
const params = {};
|
|
519
530
|
if (prompt)
|
|
520
|
-
params[
|
|
521
|
-
const aspectRatio = parseEnum(model, flags.aspectRatio,
|
|
531
|
+
params["prompt"] = prompt;
|
|
532
|
+
const aspectRatio = parseEnum(model, flags.aspectRatio, "aspect-ratio", LEGACY_RATIOS);
|
|
522
533
|
if (aspectRatio)
|
|
523
|
-
params[
|
|
534
|
+
params["aspect_ratio"] = aspectRatio;
|
|
524
535
|
if (duration !== undefined)
|
|
525
|
-
params[
|
|
526
|
-
const quality = parseEnum(model, flags.resolution,
|
|
536
|
+
params["duration"] = duration;
|
|
537
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
527
538
|
if (quality)
|
|
528
|
-
params[
|
|
539
|
+
params["quality"] = quality;
|
|
529
540
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
530
541
|
if (negativePrompt)
|
|
531
|
-
params[
|
|
532
|
-
const motionMode = parseEnum(model, flags.motionMode,
|
|
542
|
+
params["negative_prompt"] = negativePrompt;
|
|
543
|
+
const motionMode = parseEnum(model, flags.motionMode, "motion-mode", MOTION_MODES);
|
|
533
544
|
if (motionMode)
|
|
534
|
-
params[
|
|
535
|
-
const cameraMovement = parseEnum(model, flags.cameraMovement,
|
|
545
|
+
params["motion_mode"] = motionMode;
|
|
546
|
+
const cameraMovement = parseEnum(model, flags.cameraMovement, "camera-movement", CAMERA_MOVEMENTS);
|
|
536
547
|
if (cameraMovement)
|
|
537
|
-
params[
|
|
538
|
-
const seed = parseInteger(model, flags.seed,
|
|
548
|
+
params["camera_movement"] = cameraMovement;
|
|
549
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
539
550
|
if (seed !== undefined)
|
|
540
|
-
params[
|
|
541
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
551
|
+
params["seed"] = seed;
|
|
552
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
542
553
|
if (templateId !== undefined)
|
|
543
|
-
params[
|
|
554
|
+
params["template_id"] = templateId;
|
|
544
555
|
return buildEnvelope(model, params);
|
|
545
556
|
}
|
|
546
557
|
function buildV55T2VBody(model, prompt, flags) {
|
|
547
558
|
assertPixVerseCommonUnsupported(model, flags);
|
|
548
559
|
assertNoFusionFlags(model, flags);
|
|
549
|
-
assertUnsupported(model, flags.imageUrl,
|
|
550
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
551
|
-
assertUnsupported(model, flags.imageUrls,
|
|
552
|
-
assertUnsupported(model, flags.motionMode,
|
|
553
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
554
|
-
const duration = parseInteger(model, flags.duration,
|
|
560
|
+
assertUnsupported(model, flags.imageUrl, "image-url");
|
|
561
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
562
|
+
assertUnsupported(model, flags.imageUrls, "image-urls");
|
|
563
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
564
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
565
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
555
566
|
assertDurationInSet(model, duration, [5, 8, 10]);
|
|
556
|
-
const quality = parseEnum(model, flags.resolution,
|
|
567
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
557
568
|
validate1080pDuration(model, quality, duration);
|
|
558
569
|
const params = { prompt };
|
|
559
|
-
const aspectRatio = parseEnum(model, flags.aspectRatio,
|
|
570
|
+
const aspectRatio = parseEnum(model, flags.aspectRatio, "aspect-ratio", LEGACY_RATIOS);
|
|
560
571
|
if (aspectRatio)
|
|
561
|
-
params[
|
|
572
|
+
params["aspect_ratio"] = aspectRatio;
|
|
562
573
|
if (duration !== undefined)
|
|
563
|
-
params[
|
|
574
|
+
params["duration"] = duration;
|
|
564
575
|
if (quality)
|
|
565
|
-
params[
|
|
576
|
+
params["quality"] = quality;
|
|
566
577
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
567
578
|
if (negativePrompt)
|
|
568
|
-
params[
|
|
569
|
-
const seed = parseInteger(model, flags.seed,
|
|
579
|
+
params["negative_prompt"] = negativePrompt;
|
|
580
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
570
581
|
if (seed !== undefined)
|
|
571
|
-
params[
|
|
572
|
-
const style = parseEnum(model, flags.style,
|
|
582
|
+
params["seed"] = seed;
|
|
583
|
+
const style = parseEnum(model, flags.style, "style", STYLES);
|
|
573
584
|
if (style)
|
|
574
|
-
params[
|
|
575
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
585
|
+
params["style"] = style;
|
|
586
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
576
587
|
if (templateId !== undefined)
|
|
577
|
-
params[
|
|
588
|
+
params["template_id"] = templateId;
|
|
578
589
|
applyModernAudioControls(model, params, flags, {
|
|
579
590
|
allowSoundSwitch: false,
|
|
580
591
|
allowLipSyncSwitch: false,
|
|
@@ -587,36 +598,36 @@ function buildV55T2VBody(model, prompt, flags) {
|
|
|
587
598
|
function buildV55I2VBody(model, prompt, flags) {
|
|
588
599
|
assertPixVerseCommonUnsupported(model, flags);
|
|
589
600
|
assertNoFusionFlags(model, flags);
|
|
590
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
591
|
-
assertUnsupported(model, flags.motionMode,
|
|
592
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
601
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
602
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
603
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
593
604
|
const images = requireImageInputs(model, flags);
|
|
594
|
-
const duration = parseInteger(model, flags.duration,
|
|
605
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
595
606
|
assertDurationInSet(model, duration, [5, 8, 10]);
|
|
596
|
-
const quality = parseEnum(model, flags.resolution,
|
|
607
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
597
608
|
validate1080pDuration(model, quality, duration);
|
|
598
609
|
const params = {
|
|
599
610
|
img_id: images[0],
|
|
600
611
|
};
|
|
601
612
|
if (images.length > 1)
|
|
602
|
-
params[
|
|
603
|
-
params[
|
|
613
|
+
params["img_ids"] = images;
|
|
614
|
+
params["prompt"] = prompt;
|
|
604
615
|
if (duration !== undefined)
|
|
605
|
-
params[
|
|
616
|
+
params["duration"] = duration;
|
|
606
617
|
if (quality)
|
|
607
|
-
params[
|
|
618
|
+
params["quality"] = quality;
|
|
608
619
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
609
620
|
if (negativePrompt)
|
|
610
|
-
params[
|
|
611
|
-
const seed = parseInteger(model, flags.seed,
|
|
621
|
+
params["negative_prompt"] = negativePrompt;
|
|
622
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
612
623
|
if (seed !== undefined)
|
|
613
|
-
params[
|
|
614
|
-
const style = parseEnum(model, flags.style,
|
|
624
|
+
params["seed"] = seed;
|
|
625
|
+
const style = parseEnum(model, flags.style, "style", STYLES);
|
|
615
626
|
if (style)
|
|
616
|
-
params[
|
|
617
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
627
|
+
params["style"] = style;
|
|
628
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
618
629
|
if (templateId !== undefined)
|
|
619
|
-
params[
|
|
630
|
+
params["template_id"] = templateId;
|
|
620
631
|
applyModernAudioControls(model, params, flags, {
|
|
621
632
|
allowSoundSwitch: false,
|
|
622
633
|
allowLipSyncSwitch: false,
|
|
@@ -629,18 +640,18 @@ function buildV55I2VBody(model, prompt, flags) {
|
|
|
629
640
|
function buildV55TransitionBody(model, prompt, flags) {
|
|
630
641
|
assertPixVerseCommonUnsupported(model, flags);
|
|
631
642
|
assertNoFusionFlags(model, flags);
|
|
632
|
-
assertUnsupported(model, flags.motionMode,
|
|
633
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
634
|
-
assertUnsupported(model, flags.aspectRatio,
|
|
635
|
-
assertUnsupported(model, flags.negativePrompt,
|
|
636
|
-
assertUnsupported(model, flags.style,
|
|
637
|
-
assertUnsupported(model, flags.templateId,
|
|
638
|
-
assertUnsupported(model, flags.multiShot,
|
|
639
|
-
assertUnsupported(model, flags.thinkingType,
|
|
643
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
644
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
645
|
+
assertUnsupported(model, flags.aspectRatio, "aspect-ratio");
|
|
646
|
+
assertUnsupported(model, flags.negativePrompt, "negative-prompt");
|
|
647
|
+
assertUnsupported(model, flags.style, "style");
|
|
648
|
+
assertUnsupported(model, flags.templateId, "template-id");
|
|
649
|
+
assertUnsupported(model, flags.multiShot, "multi-shot");
|
|
650
|
+
assertUnsupported(model, flags.thinkingType, "thinking-type");
|
|
640
651
|
const { first, last } = requireStartEndImages(model, flags);
|
|
641
|
-
const duration = parseInteger(model, flags.duration,
|
|
652
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
642
653
|
assertDurationInSet(model, duration, [5, 8, 10]);
|
|
643
|
-
const quality = parseEnum(model, flags.resolution,
|
|
654
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
644
655
|
validate1080pDuration(model, quality, duration);
|
|
645
656
|
const params = {
|
|
646
657
|
prompt,
|
|
@@ -648,12 +659,12 @@ function buildV55TransitionBody(model, prompt, flags) {
|
|
|
648
659
|
last_frame_image: last,
|
|
649
660
|
};
|
|
650
661
|
if (duration !== undefined)
|
|
651
|
-
params[
|
|
662
|
+
params["duration"] = duration;
|
|
652
663
|
if (quality)
|
|
653
|
-
params[
|
|
654
|
-
const seed = parseInteger(model, flags.seed,
|
|
664
|
+
params["quality"] = quality;
|
|
665
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
655
666
|
if (seed !== undefined)
|
|
656
|
-
params[
|
|
667
|
+
params["seed"] = seed;
|
|
657
668
|
applyModernAudioControls(model, params, flags, {
|
|
658
669
|
allowSoundSwitch: false,
|
|
659
670
|
allowLipSyncSwitch: false,
|
|
@@ -666,35 +677,35 @@ function buildV55TransitionBody(model, prompt, flags) {
|
|
|
666
677
|
function buildV56T2VBody(model, prompt, flags) {
|
|
667
678
|
assertPixVerseCommonUnsupported(model, flags);
|
|
668
679
|
assertNoFusionFlags(model, flags);
|
|
669
|
-
assertUnsupported(model, flags.imageUrl,
|
|
670
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
671
|
-
assertUnsupported(model, flags.imageUrls,
|
|
672
|
-
assertUnsupported(model, flags.motionMode,
|
|
673
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
674
|
-
const duration = parseInteger(model, flags.duration,
|
|
680
|
+
assertUnsupported(model, flags.imageUrl, "image-url");
|
|
681
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
682
|
+
assertUnsupported(model, flags.imageUrls, "image-urls");
|
|
683
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
684
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
685
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
675
686
|
assertDurationInSet(model, duration, [5, 8, 10]);
|
|
676
|
-
const quality = parseEnum(model, flags.resolution,
|
|
687
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
677
688
|
validate1080pDuration(model, quality, duration);
|
|
678
689
|
const params = { prompt };
|
|
679
|
-
const aspectRatio = parseEnum(model, flags.aspectRatio,
|
|
690
|
+
const aspectRatio = parseEnum(model, flags.aspectRatio, "aspect-ratio", LEGACY_RATIOS);
|
|
680
691
|
if (aspectRatio)
|
|
681
|
-
params[
|
|
692
|
+
params["aspect_ratio"] = aspectRatio;
|
|
682
693
|
if (duration !== undefined)
|
|
683
|
-
params[
|
|
694
|
+
params["duration"] = duration;
|
|
684
695
|
if (quality)
|
|
685
|
-
params[
|
|
696
|
+
params["quality"] = quality;
|
|
686
697
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
687
698
|
if (negativePrompt)
|
|
688
|
-
params[
|
|
689
|
-
const seed = parseInteger(model, flags.seed,
|
|
699
|
+
params["negative_prompt"] = negativePrompt;
|
|
700
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
690
701
|
if (seed !== undefined)
|
|
691
|
-
params[
|
|
692
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
702
|
+
params["seed"] = seed;
|
|
703
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
693
704
|
if (templateId !== undefined)
|
|
694
|
-
params[
|
|
695
|
-
const style = parseEnum(model, flags.style,
|
|
705
|
+
params["template_id"] = templateId;
|
|
706
|
+
const style = parseEnum(model, flags.style, "style", STYLES);
|
|
696
707
|
if (style)
|
|
697
|
-
params[
|
|
708
|
+
params["style"] = style;
|
|
698
709
|
applyModernAudioControls(model, params, flags, {
|
|
699
710
|
allowSoundSwitch: true,
|
|
700
711
|
allowLipSyncSwitch: true,
|
|
@@ -707,38 +718,38 @@ function buildV56T2VBody(model, prompt, flags) {
|
|
|
707
718
|
function buildV56I2VBody(model, prompt, flags) {
|
|
708
719
|
assertPixVerseCommonUnsupported(model, flags);
|
|
709
720
|
assertNoFusionFlags(model, flags);
|
|
710
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
711
|
-
assertUnsupported(model, flags.motionMode,
|
|
712
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
713
|
-
assertUnsupported(model, flags.multiShot,
|
|
721
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
722
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
723
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
724
|
+
assertUnsupported(model, flags.multiShot, "multi-shot");
|
|
714
725
|
const images = requireImageInputs(model, flags);
|
|
715
|
-
const duration = parseInteger(model, flags.duration,
|
|
726
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
716
727
|
assertDurationInSet(model, duration, [5, 8, 10]);
|
|
717
|
-
const quality = parseEnum(model, flags.resolution,
|
|
728
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
718
729
|
validate1080pDuration(model, quality, duration);
|
|
719
730
|
const params = {
|
|
720
731
|
img_id: images[0],
|
|
721
732
|
};
|
|
722
733
|
if (images.length > 1)
|
|
723
|
-
params[
|
|
734
|
+
params["img_ids"] = images;
|
|
724
735
|
if (prompt)
|
|
725
|
-
params[
|
|
736
|
+
params["prompt"] = prompt;
|
|
726
737
|
if (duration !== undefined)
|
|
727
|
-
params[
|
|
738
|
+
params["duration"] = duration;
|
|
728
739
|
if (quality)
|
|
729
|
-
params[
|
|
740
|
+
params["quality"] = quality;
|
|
730
741
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
731
742
|
if (negativePrompt)
|
|
732
|
-
params[
|
|
733
|
-
const seed = parseInteger(model, flags.seed,
|
|
743
|
+
params["negative_prompt"] = negativePrompt;
|
|
744
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
734
745
|
if (seed !== undefined)
|
|
735
|
-
params[
|
|
736
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
746
|
+
params["seed"] = seed;
|
|
747
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
737
748
|
if (templateId !== undefined)
|
|
738
|
-
params[
|
|
739
|
-
const style = parseEnum(model, flags.style,
|
|
749
|
+
params["template_id"] = templateId;
|
|
750
|
+
const style = parseEnum(model, flags.style, "style", STYLES);
|
|
740
751
|
if (style)
|
|
741
|
-
params[
|
|
752
|
+
params["style"] = style;
|
|
742
753
|
applyModernAudioControls(model, params, flags, {
|
|
743
754
|
allowSoundSwitch: true,
|
|
744
755
|
allowLipSyncSwitch: true,
|
|
@@ -751,18 +762,18 @@ function buildV56I2VBody(model, prompt, flags) {
|
|
|
751
762
|
function buildV56TransitionBody(model, prompt, flags) {
|
|
752
763
|
assertPixVerseCommonUnsupported(model, flags);
|
|
753
764
|
assertNoFusionFlags(model, flags);
|
|
754
|
-
assertUnsupported(model, flags.imageUrls,
|
|
755
|
-
assertUnsupported(model, flags.aspectRatio,
|
|
756
|
-
assertUnsupported(model, flags.negativePrompt,
|
|
757
|
-
assertUnsupported(model, flags.templateId,
|
|
758
|
-
assertUnsupported(model, flags.style,
|
|
759
|
-
assertUnsupported(model, flags.motionMode,
|
|
760
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
761
|
-
assertUnsupported(model, flags.multiShot,
|
|
765
|
+
assertUnsupported(model, flags.imageUrls, "image-urls");
|
|
766
|
+
assertUnsupported(model, flags.aspectRatio, "aspect-ratio");
|
|
767
|
+
assertUnsupported(model, flags.negativePrompt, "negative-prompt");
|
|
768
|
+
assertUnsupported(model, flags.templateId, "template-id");
|
|
769
|
+
assertUnsupported(model, flags.style, "style");
|
|
770
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
771
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
772
|
+
assertUnsupported(model, flags.multiShot, "multi-shot");
|
|
762
773
|
const { first, last } = requireStartEndImages(model, flags);
|
|
763
|
-
const duration = parseInteger(model, flags.duration,
|
|
774
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
764
775
|
assertDurationInSet(model, duration, [5, 8, 10]);
|
|
765
|
-
const quality = parseEnum(model, flags.resolution,
|
|
776
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
766
777
|
validate1080pDuration(model, quality, duration);
|
|
767
778
|
const params = {
|
|
768
779
|
prompt,
|
|
@@ -770,12 +781,12 @@ function buildV56TransitionBody(model, prompt, flags) {
|
|
|
770
781
|
last_frame_img: last,
|
|
771
782
|
};
|
|
772
783
|
if (duration !== undefined)
|
|
773
|
-
params[
|
|
784
|
+
params["duration"] = duration;
|
|
774
785
|
if (quality)
|
|
775
|
-
params[
|
|
776
|
-
const seed = parseInteger(model, flags.seed,
|
|
786
|
+
params["quality"] = quality;
|
|
787
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
777
788
|
if (seed !== undefined)
|
|
778
|
-
params[
|
|
789
|
+
params["seed"] = seed;
|
|
779
790
|
applyModernAudioControls(model, params, flags, {
|
|
780
791
|
allowSoundSwitch: true,
|
|
781
792
|
allowLipSyncSwitch: true,
|
|
@@ -788,35 +799,35 @@ function buildV56TransitionBody(model, prompt, flags) {
|
|
|
788
799
|
function buildV6T2VBody(model, prompt, flags) {
|
|
789
800
|
assertPixVerseCommonUnsupported(model, flags);
|
|
790
801
|
assertNoFusionFlags(model, flags);
|
|
791
|
-
assertUnsupported(model, flags.imageUrl,
|
|
792
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
793
|
-
assertUnsupported(model, flags.imageUrls,
|
|
794
|
-
assertUnsupported(model, flags.motionMode,
|
|
795
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
796
|
-
assertUnsupported(model, flags.thinkingType,
|
|
797
|
-
const duration = parseInteger(model, flags.duration,
|
|
802
|
+
assertUnsupported(model, flags.imageUrl, "image-url");
|
|
803
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
804
|
+
assertUnsupported(model, flags.imageUrls, "image-urls");
|
|
805
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
806
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
807
|
+
assertUnsupported(model, flags.thinkingType, "thinking-type");
|
|
808
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
798
809
|
assertDurationRange(model, duration, 1, 15);
|
|
799
|
-
const quality = parseEnum(model, flags.resolution,
|
|
810
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
800
811
|
const params = { prompt };
|
|
801
|
-
const aspectRatio = parseEnum(model, flags.aspectRatio,
|
|
812
|
+
const aspectRatio = parseEnum(model, flags.aspectRatio, "aspect-ratio", V6_RATIOS);
|
|
802
813
|
if (aspectRatio)
|
|
803
|
-
params[
|
|
814
|
+
params["aspect_ratio"] = aspectRatio;
|
|
804
815
|
if (duration !== undefined)
|
|
805
|
-
params[
|
|
816
|
+
params["duration"] = duration;
|
|
806
817
|
if (quality)
|
|
807
|
-
params[
|
|
818
|
+
params["quality"] = quality;
|
|
808
819
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
809
820
|
if (negativePrompt)
|
|
810
|
-
params[
|
|
811
|
-
const seed = parseInteger(model, flags.seed,
|
|
821
|
+
params["negative_prompt"] = negativePrompt;
|
|
822
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
812
823
|
if (seed !== undefined)
|
|
813
|
-
params[
|
|
814
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
824
|
+
params["seed"] = seed;
|
|
825
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
815
826
|
if (templateId !== undefined)
|
|
816
|
-
params[
|
|
817
|
-
const style = parseNonEmptyString(model, flags.style,
|
|
827
|
+
params["template_id"] = templateId;
|
|
828
|
+
const style = parseNonEmptyString(model, flags.style, "style");
|
|
818
829
|
if (style)
|
|
819
|
-
params[
|
|
830
|
+
params["style"] = style;
|
|
820
831
|
applyModernAudioControls(model, params, flags, {
|
|
821
832
|
allowSoundSwitch: true,
|
|
822
833
|
allowLipSyncSwitch: true,
|
|
@@ -829,37 +840,37 @@ function buildV6T2VBody(model, prompt, flags) {
|
|
|
829
840
|
function buildV6I2VBody(model, prompt, flags) {
|
|
830
841
|
assertPixVerseCommonUnsupported(model, flags);
|
|
831
842
|
assertNoFusionFlags(model, flags);
|
|
832
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
833
|
-
assertUnsupported(model, flags.aspectRatio,
|
|
834
|
-
assertUnsupported(model, flags.motionMode,
|
|
835
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
836
|
-
assertUnsupported(model, flags.thinkingType,
|
|
843
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
844
|
+
assertUnsupported(model, flags.aspectRatio, "aspect-ratio", `Model "${model}" does not support --aspect-ratio; output ratio follows the input image.`);
|
|
845
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
846
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
847
|
+
assertUnsupported(model, flags.thinkingType, "thinking-type");
|
|
837
848
|
const images = requireImageInputs(model, flags);
|
|
838
|
-
const duration = parseInteger(model, flags.duration,
|
|
849
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
839
850
|
assertDurationRange(model, duration, 1, 15);
|
|
840
|
-
const quality = parseEnum(model, flags.resolution,
|
|
851
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
841
852
|
const params = {
|
|
842
853
|
img_id: images[0],
|
|
843
854
|
};
|
|
844
855
|
if (images.length > 1)
|
|
845
|
-
params[
|
|
846
|
-
params[
|
|
856
|
+
params["img_ids"] = images;
|
|
857
|
+
params["prompt"] = prompt;
|
|
847
858
|
if (duration !== undefined)
|
|
848
|
-
params[
|
|
859
|
+
params["duration"] = duration;
|
|
849
860
|
if (quality)
|
|
850
|
-
params[
|
|
861
|
+
params["quality"] = quality;
|
|
851
862
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
852
863
|
if (negativePrompt)
|
|
853
|
-
params[
|
|
854
|
-
const seed = parseInteger(model, flags.seed,
|
|
864
|
+
params["negative_prompt"] = negativePrompt;
|
|
865
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
855
866
|
if (seed !== undefined)
|
|
856
|
-
params[
|
|
857
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
867
|
+
params["seed"] = seed;
|
|
868
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
858
869
|
if (templateId !== undefined)
|
|
859
|
-
params[
|
|
860
|
-
const style = parseNonEmptyString(model, flags.style,
|
|
870
|
+
params["template_id"] = templateId;
|
|
871
|
+
const style = parseNonEmptyString(model, flags.style, "style");
|
|
861
872
|
if (style)
|
|
862
|
-
params[
|
|
873
|
+
params["style"] = style;
|
|
863
874
|
applyModernAudioControls(model, params, flags, {
|
|
864
875
|
allowSoundSwitch: false,
|
|
865
876
|
allowLipSyncSwitch: false,
|
|
@@ -872,37 +883,37 @@ function buildV6I2VBody(model, prompt, flags) {
|
|
|
872
883
|
function buildV6TransitionBody(model, prompt, flags) {
|
|
873
884
|
assertPixVerseCommonUnsupported(model, flags);
|
|
874
885
|
assertNoFusionFlags(model, flags);
|
|
875
|
-
assertUnsupported(model, flags.imageUrls,
|
|
876
|
-
assertUnsupported(model, flags.motionMode,
|
|
877
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
878
|
-
assertUnsupported(model, flags.multiShot,
|
|
879
|
-
assertUnsupported(model, flags.thinkingType,
|
|
886
|
+
assertUnsupported(model, flags.imageUrls, "image-urls");
|
|
887
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
888
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
889
|
+
assertUnsupported(model, flags.multiShot, "multi-shot");
|
|
890
|
+
assertUnsupported(model, flags.thinkingType, "thinking-type");
|
|
880
891
|
const { first, last } = requireStartEndImages(model, flags);
|
|
881
|
-
const duration = parseInteger(model, flags.duration,
|
|
892
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
882
893
|
assertDurationRange(model, duration, 1, 15);
|
|
883
|
-
const quality = parseEnum(model, flags.resolution,
|
|
894
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
884
895
|
const params = {
|
|
885
896
|
first_frame_img: first,
|
|
886
897
|
last_frame_img: last,
|
|
887
898
|
};
|
|
888
899
|
if (prompt)
|
|
889
|
-
params[
|
|
900
|
+
params["prompt"] = prompt;
|
|
890
901
|
if (duration !== undefined)
|
|
891
|
-
params[
|
|
902
|
+
params["duration"] = duration;
|
|
892
903
|
if (quality)
|
|
893
|
-
params[
|
|
904
|
+
params["quality"] = quality;
|
|
894
905
|
const negativePrompt = maybeString(flags.negativePrompt);
|
|
895
906
|
if (negativePrompt)
|
|
896
|
-
params[
|
|
897
|
-
const seed = parseInteger(model, flags.seed,
|
|
907
|
+
params["negative_prompt"] = negativePrompt;
|
|
908
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
898
909
|
if (seed !== undefined)
|
|
899
|
-
params[
|
|
900
|
-
const templateId = parseInteger(model, flags.templateId,
|
|
910
|
+
params["seed"] = seed;
|
|
911
|
+
const templateId = parseInteger(model, flags.templateId, "template-id", { min: 0 });
|
|
901
912
|
if (templateId !== undefined)
|
|
902
|
-
params[
|
|
903
|
-
const style = parseNonEmptyString(model, flags.style,
|
|
913
|
+
params["template_id"] = templateId;
|
|
914
|
+
const style = parseNonEmptyString(model, flags.style, "style");
|
|
904
915
|
if (style)
|
|
905
|
-
params[
|
|
916
|
+
params["style"] = style;
|
|
906
917
|
applyModernAudioControls(model, params, flags, {
|
|
907
918
|
allowSoundSwitch: true,
|
|
908
919
|
allowLipSyncSwitch: true,
|
|
@@ -914,19 +925,19 @@ function buildV6TransitionBody(model, prompt, flags) {
|
|
|
914
925
|
}
|
|
915
926
|
function buildFusionBody(model, prompt, flags) {
|
|
916
927
|
assertPixVerseCommonUnsupported(model, flags);
|
|
917
|
-
assertUnsupported(model, flags.imageTailUrl,
|
|
918
|
-
assertUnsupported(model, flags.negativePrompt,
|
|
919
|
-
assertUnsupported(model, flags.style,
|
|
920
|
-
assertUnsupported(model, flags.templateId,
|
|
921
|
-
assertUnsupported(model, flags.motionMode,
|
|
922
|
-
assertUnsupported(model, flags.cameraMovement,
|
|
923
|
-
assertUnsupported(model, flags.soundEffect,
|
|
924
|
-
assertUnsupported(model, flags.soundEffectPrompt,
|
|
925
|
-
assertUnsupported(model, flags.lipSync,
|
|
926
|
-
assertUnsupported(model, flags.ttsText,
|
|
927
|
-
assertUnsupported(model, flags.voiceId,
|
|
928
|
-
assertUnsupported(model, flags.multiShot,
|
|
929
|
-
assertUnsupported(model, flags.thinkingType,
|
|
928
|
+
assertUnsupported(model, flags.imageTailUrl, "image-tail-url");
|
|
929
|
+
assertUnsupported(model, flags.negativePrompt, "negative-prompt");
|
|
930
|
+
assertUnsupported(model, flags.style, "style");
|
|
931
|
+
assertUnsupported(model, flags.templateId, "template-id");
|
|
932
|
+
assertUnsupported(model, flags.motionMode, "motion-mode");
|
|
933
|
+
assertUnsupported(model, flags.cameraMovement, "camera-movement");
|
|
934
|
+
assertUnsupported(model, flags.soundEffect, "sound-effect");
|
|
935
|
+
assertUnsupported(model, flags.soundEffectPrompt, "sound-effect-prompt");
|
|
936
|
+
assertUnsupported(model, flags.lipSync, "lip-sync");
|
|
937
|
+
assertUnsupported(model, flags.ttsText, "tts-text");
|
|
938
|
+
assertUnsupported(model, flags.voiceId, "voice-id");
|
|
939
|
+
assertUnsupported(model, flags.multiShot, "multi-shot");
|
|
940
|
+
assertUnsupported(model, flags.thinkingType, "thinking-type");
|
|
930
941
|
const images = requireImageInputs(model, flags);
|
|
931
942
|
if (images.length < 1 || images.length > 3) {
|
|
932
943
|
throw new CLIError(`Model "${model}" requires 1-3 images via --image-url/--image-urls.`, ExitCode.USAGE);
|
|
@@ -939,17 +950,17 @@ function buildFusionBody(model, prompt, flags) {
|
|
|
939
950
|
if (types.length !== images.length) {
|
|
940
951
|
throw new CLIError(`Model "${model}" requires --reference-types to match the number of input images.`, ExitCode.USAGE);
|
|
941
952
|
}
|
|
942
|
-
const duration = parseInteger(model, flags.duration,
|
|
953
|
+
const duration = parseInteger(model, flags.duration, "duration");
|
|
943
954
|
assertDurationInSet(model, duration, [5, 8, 10]);
|
|
944
|
-
const quality = parseEnum(model, flags.resolution,
|
|
955
|
+
const quality = parseEnum(model, flags.resolution, "resolution", QUALITYS);
|
|
945
956
|
validate1080pDuration(model, quality, duration);
|
|
946
|
-
const aspectRatio = parseEnum(model, flags.aspectRatio,
|
|
957
|
+
const aspectRatio = parseEnum(model, flags.aspectRatio, "aspect-ratio", LEGACY_RATIOS);
|
|
947
958
|
if (!aspectRatio) {
|
|
948
959
|
throw new CLIError(`Model "${model}" requires --aspect-ratio.`, ExitCode.USAGE);
|
|
949
960
|
}
|
|
950
961
|
const imageReferences = images.map((imageUrl, index) => {
|
|
951
|
-
const type = parseEnum(model, types[index],
|
|
952
|
-
const refName = parseNonEmptyString(model, names[index],
|
|
962
|
+
const type = parseEnum(model, types[index], "reference-types", REFERENCE_TYPES);
|
|
963
|
+
const refName = parseNonEmptyString(model, names[index], "reference-names");
|
|
953
964
|
if (!promptContainsReference(prompt, refName)) {
|
|
954
965
|
throw new CLIError(`Model "${model}" requires prompt references like @${refName} for every --reference-names value.`, ExitCode.USAGE);
|
|
955
966
|
}
|
|
@@ -962,24 +973,24 @@ function buildFusionBody(model, prompt, flags) {
|
|
|
962
973
|
const params = {
|
|
963
974
|
image_references: imageReferences,
|
|
964
975
|
prompt,
|
|
965
|
-
model:
|
|
976
|
+
model: "v5.6",
|
|
966
977
|
aspect_ratio: aspectRatio,
|
|
967
978
|
};
|
|
968
979
|
if (duration !== undefined)
|
|
969
|
-
params[
|
|
980
|
+
params["duration"] = duration;
|
|
970
981
|
if (quality)
|
|
971
|
-
params[
|
|
972
|
-
const seed = parseInteger(model, flags.seed,
|
|
982
|
+
params["quality"] = quality;
|
|
983
|
+
const seed = parseInteger(model, flags.seed, "seed", { min: 0, max: 2147483647 });
|
|
973
984
|
if (seed !== undefined)
|
|
974
|
-
params[
|
|
985
|
+
params["seed"] = seed;
|
|
975
986
|
const audio = parsePixVerseAudioFlag(model, flags.audio);
|
|
976
987
|
if (audio !== undefined)
|
|
977
|
-
params[
|
|
988
|
+
params["generate_audio_switch"] = audio;
|
|
978
989
|
return buildEnvelope(model, params);
|
|
979
990
|
}
|
|
980
991
|
registerProvider({
|
|
981
|
-
provider:
|
|
982
|
-
category:
|
|
992
|
+
provider: "pixverse",
|
|
993
|
+
category: "video",
|
|
983
994
|
models: [...TRANSITION_MODELS, ...I2V_MODELS, ...T2V_MODELS, ...FUSION_MODELS],
|
|
984
995
|
requiresPrompt(model) {
|
|
985
996
|
return !OPTIONAL_PROMPT_MODELS.has(model);
|