makefx 1.6.3 → 1.6.5
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 +1 -1
- package/makefx.mjs +665 -225
- package/package.json +1 -1
package/makefx.mjs
CHANGED
|
@@ -616,9 +616,10 @@ function extractProviderErrorMessage(message) {
|
|
|
616
616
|
}
|
|
617
617
|
return "Provider request failed";
|
|
618
618
|
}
|
|
619
|
-
function isProviderAuthMessage(message, providerErrorCode, provider) {
|
|
619
|
+
function isProviderAuthMessage(message, providerErrorCode, provider, status) {
|
|
620
620
|
if (provider === "r2" || provider === "space_do" || provider === "workflow" || provider === "polar") return false;
|
|
621
|
-
|
|
621
|
+
const code = providerErrorCode?.toLowerCase();
|
|
622
|
+
return status === 401 && !(code === "permission_denied" || code === "missing_permissions" || code === "authorization_error") || code === "api_key_invalid" || code === "invalid_api_key" || code === "authentication_error" || message.includes("api_key_invalid") || message.includes("api key not valid") || message.includes("invalid api key") || message.includes("api key is required") || message.includes("not configured") || message.includes("unauthenticated");
|
|
622
623
|
}
|
|
623
624
|
//#endregion
|
|
624
625
|
//#region src/shared/generation-blockers.ts
|
|
@@ -634,6 +635,7 @@ var PROVIDER_LABELS = {
|
|
|
634
635
|
lyria: "Lyria",
|
|
635
636
|
kling: "Kling",
|
|
636
637
|
fal: "fal.ai",
|
|
638
|
+
pika: "Pika",
|
|
637
639
|
replicate: "Replicate"
|
|
638
640
|
};
|
|
639
641
|
function isGenerationBlockerCode(code) {
|
|
@@ -646,11 +648,12 @@ function inferGenerationBlockerProvider(message) {
|
|
|
646
648
|
if (normalized.includes("lyria")) return "lyria";
|
|
647
649
|
if (normalized.includes("kling")) return "kling";
|
|
648
650
|
if (normalized.includes("fal.ai") || normalized.includes("fal provider")) return "fal";
|
|
651
|
+
if (normalized.includes("pika")) return "pika";
|
|
649
652
|
if (normalized.includes("replicate")) return "replicate";
|
|
650
653
|
}
|
|
651
654
|
function generationBlockerProviderFromService(provider) {
|
|
652
655
|
if (provider === "google_ai" || provider === "veo") return "google_ai";
|
|
653
|
-
if (provider === "elevenlabs" || provider === "lyria" || provider === "kling" || provider === "fal" || provider === "replicate") return provider;
|
|
656
|
+
if (provider === "elevenlabs" || provider === "lyria" || provider === "kling" || provider === "fal" || provider === "pika" || provider === "replicate") return provider;
|
|
654
657
|
}
|
|
655
658
|
function getGenerationBlockerPresentation(code, serverMessage, provider) {
|
|
656
659
|
if (!isGenerationBlockerCode(code)) return null;
|
|
@@ -670,11 +673,12 @@ function getGenerationBlockerPresentation(code, serverMessage, provider) {
|
|
|
670
673
|
};
|
|
671
674
|
const resolvedProvider = provider ?? inferGenerationBlockerProvider(serverMessage);
|
|
672
675
|
const providerLabel = resolvedProvider ? PROVIDER_LABELS[resolvedProvider] : "provider";
|
|
676
|
+
const providerArticle = /^[aeiou]/iu.test(providerLabel) ? "An" : "A";
|
|
673
677
|
const actionPath = resolvedProvider ? `/profile#provider-key-${resolvedProvider}` : "/profile#provider-keys";
|
|
674
678
|
const setupUrl = `https://makefx.app${actionPath}`;
|
|
675
679
|
if (code === "PROVIDER_KEY_REQUIRED") return {
|
|
676
680
|
code,
|
|
677
|
-
message:
|
|
681
|
+
message: `${providerArticle} ${providerLabel} account key is required before generation can start.`,
|
|
678
682
|
retryable: false,
|
|
679
683
|
actionLabel: "Configure key",
|
|
680
684
|
actionPath,
|
|
@@ -4438,7 +4442,7 @@ require_websocket_server();
|
|
|
4438
4442
|
var wrapper_default = import_websocket.default;
|
|
4439
4443
|
//#endregion
|
|
4440
4444
|
//#region src/cli/version.ts
|
|
4441
|
-
var CLI_VERSION = "1.6.
|
|
4445
|
+
var CLI_VERSION = "1.6.5+9c81b1e6ede4";
|
|
4442
4446
|
var CLI_VERSION_HEADER = "X-MakeFX-CLI-Version";
|
|
4443
4447
|
function cliVersionHeaders() {
|
|
4444
4448
|
return {
|
|
@@ -4456,6 +4460,7 @@ function cliVersionHeaders() {
|
|
|
4456
4460
|
*/
|
|
4457
4461
|
var GENERATION_REQUEST_TIMEOUT_MS = 3e5;
|
|
4458
4462
|
var VIDEO_GENERATION_REQUEST_TIMEOUT_MS = 72e4;
|
|
4463
|
+
var VARIANT_SYNC_POLL_INTERVAL_MS = 15e3;
|
|
4459
4464
|
function getGenerationRequestTimeoutMs(mediaKind) {
|
|
4460
4465
|
return mediaKind === "video" ? VIDEO_GENERATION_REQUEST_TIMEOUT_MS : GENERATION_REQUEST_TIMEOUT_MS;
|
|
4461
4466
|
}
|
|
@@ -4652,6 +4657,7 @@ var WebSocketClient = class WebSocketClient {
|
|
|
4652
4657
|
reject: handler.reject,
|
|
4653
4658
|
timeout: handler.timeout
|
|
4654
4659
|
});
|
|
4660
|
+
this.startVariantSyncPolling(startedMsg.variantId, startedMsg.requestId);
|
|
4655
4661
|
this.generateHandlers.delete(startedMsg.requestId);
|
|
4656
4662
|
const earlyTerminal = this.earlyTerminalVariants.get(startedMsg.variantId);
|
|
4657
4663
|
if (earlyTerminal) {
|
|
@@ -4684,6 +4690,12 @@ var WebSocketClient = class WebSocketClient {
|
|
|
4684
4690
|
}
|
|
4685
4691
|
case "sync:state": {
|
|
4686
4692
|
const syncMsg = message;
|
|
4693
|
+
for (const variant of syncMsg.variants) {
|
|
4694
|
+
const handler = this.variantCompletionHandlers.get(variant.id);
|
|
4695
|
+
if (!handler) continue;
|
|
4696
|
+
handler.onUpdate?.(variant);
|
|
4697
|
+
if (variant.status === "completed" || variant.status === "failed") this.handleTerminalVariant(variant);
|
|
4698
|
+
}
|
|
4687
4699
|
this.onSyncState?.({
|
|
4688
4700
|
assets: syncMsg.assets,
|
|
4689
4701
|
variants: syncMsg.variants,
|
|
@@ -4796,6 +4808,7 @@ var WebSocketClient = class WebSocketClient {
|
|
|
4796
4808
|
for (const [variantId, handler] of this.variantCompletionHandlers) if (handler.requestId === requestId) {
|
|
4797
4809
|
this.variantCompletionHandlers.delete(variantId);
|
|
4798
4810
|
clearTimeout(handler.timeout);
|
|
4811
|
+
if (handler.syncPoll) clearInterval(handler.syncPoll);
|
|
4799
4812
|
handler.reject(error);
|
|
4800
4813
|
return true;
|
|
4801
4814
|
}
|
|
@@ -4808,6 +4821,7 @@ var WebSocketClient = class WebSocketClient {
|
|
|
4808
4821
|
handled = true;
|
|
4809
4822
|
this.variantCompletionHandlers.delete(variant.id);
|
|
4810
4823
|
clearTimeout(handler.timeout);
|
|
4824
|
+
if (handler.syncPoll) clearInterval(handler.syncPoll);
|
|
4811
4825
|
handler.onResult({
|
|
4812
4826
|
requestId: handler.requestId,
|
|
4813
4827
|
variantId: variant.id,
|
|
@@ -4820,6 +4834,19 @@ var WebSocketClient = class WebSocketClient {
|
|
|
4820
4834
|
}
|
|
4821
4835
|
return handled;
|
|
4822
4836
|
}
|
|
4837
|
+
startVariantSyncPolling(variantId, requestId) {
|
|
4838
|
+
const requestCurrentState = () => {
|
|
4839
|
+
if (this.variantCompletionHandlers.get(variantId)?.requestId !== requestId) return;
|
|
4840
|
+
try {
|
|
4841
|
+
this.requestSync();
|
|
4842
|
+
} catch {}
|
|
4843
|
+
};
|
|
4844
|
+
requestCurrentState();
|
|
4845
|
+
const syncPoll = setInterval(requestCurrentState, VARIANT_SYNC_POLL_INTERVAL_MS);
|
|
4846
|
+
const handler = this.variantCompletionHandlers.get(variantId);
|
|
4847
|
+
if (handler?.requestId === requestId) handler.syncPoll = syncPoll;
|
|
4848
|
+
else clearInterval(syncPoll);
|
|
4849
|
+
}
|
|
4823
4850
|
hasRequestsAwaitingStarted() {
|
|
4824
4851
|
return this.generateHandlers.size > 0 || this.draftRunStartsAwaitingVariant.size > 0;
|
|
4825
4852
|
}
|
|
@@ -5079,6 +5106,7 @@ var WebSocketClient = class WebSocketClient {
|
|
|
5079
5106
|
}
|
|
5080
5107
|
for (const [variantId, handler] of this.variantCompletionHandlers) if (handler.requestId === requestId) {
|
|
5081
5108
|
this.variantCompletionHandlers.delete(variantId);
|
|
5109
|
+
if (handler.syncPoll) clearInterval(handler.syncPoll);
|
|
5082
5110
|
reject(/* @__PURE__ */ new Error("Generate request timed out"));
|
|
5083
5111
|
return;
|
|
5084
5112
|
}
|
|
@@ -5101,6 +5129,8 @@ var WebSocketClient = class WebSocketClient {
|
|
|
5101
5129
|
model: params.model,
|
|
5102
5130
|
aspectRatio: params.aspectRatio,
|
|
5103
5131
|
imageSize: params.imageSize,
|
|
5132
|
+
imageQuality: params.imageQuality,
|
|
5133
|
+
imageSeed: params.imageSeed,
|
|
5104
5134
|
mediaKind: params.mediaKind,
|
|
5105
5135
|
voiceId: params.voiceId,
|
|
5106
5136
|
dialogueVoiceIds: params.dialogueVoiceIds,
|
|
@@ -5111,8 +5141,11 @@ var WebSocketClient = class WebSocketClient {
|
|
|
5111
5141
|
videoTier: params.videoTier,
|
|
5112
5142
|
seedanceDuration: params.seedanceDuration,
|
|
5113
5143
|
seedanceBitrateMode: params.seedanceBitrateMode,
|
|
5144
|
+
provider: params.provider,
|
|
5114
5145
|
avatarResolution: params.avatarResolution,
|
|
5115
|
-
avatarMode: params.avatarMode
|
|
5146
|
+
avatarMode: params.avatarMode,
|
|
5147
|
+
avatarGuidanceScale: params.avatarGuidanceScale,
|
|
5148
|
+
avatarAudioGuidanceScale: params.avatarAudioGuidanceScale
|
|
5116
5149
|
};
|
|
5117
5150
|
try {
|
|
5118
5151
|
this.send(message);
|
|
@@ -5129,8 +5162,10 @@ var WebSocketClient = class WebSocketClient {
|
|
|
5129
5162
|
const timeoutMs = params.timeoutMs ?? 3e5;
|
|
5130
5163
|
return new Promise((resolve, reject) => {
|
|
5131
5164
|
const timeout = setTimeout(() => {
|
|
5132
|
-
|
|
5165
|
+
const handler = this.variantCompletionHandlers.get(params.variantId);
|
|
5166
|
+
if (handler?.requestId === requestId) {
|
|
5133
5167
|
this.variantCompletionHandlers.delete(params.variantId);
|
|
5168
|
+
if (handler.syncPoll) clearInterval(handler.syncPoll);
|
|
5134
5169
|
reject(/* @__PURE__ */ new Error("Follow request timed out"));
|
|
5135
5170
|
}
|
|
5136
5171
|
}, timeoutMs);
|
|
@@ -5143,6 +5178,7 @@ var WebSocketClient = class WebSocketClient {
|
|
|
5143
5178
|
reject,
|
|
5144
5179
|
timeout
|
|
5145
5180
|
});
|
|
5181
|
+
this.startVariantSyncPolling(params.variantId, requestId);
|
|
5146
5182
|
const earlyTerminal = this.earlyTerminalVariants.get(params.variantId);
|
|
5147
5183
|
if (earlyTerminal) {
|
|
5148
5184
|
this.earlyTerminalVariants.delete(params.variantId);
|
|
@@ -5156,6 +5192,7 @@ var WebSocketClient = class WebSocketClient {
|
|
|
5156
5192
|
if (requestId && handler.requestId !== requestId) return;
|
|
5157
5193
|
this.variantCompletionHandlers.delete(variantId);
|
|
5158
5194
|
clearTimeout(handler.timeout);
|
|
5195
|
+
if (handler.syncPoll) clearInterval(handler.syncPoll);
|
|
5159
5196
|
}
|
|
5160
5197
|
/**
|
|
5161
5198
|
* Send a describe image request and wait for response
|
|
@@ -5792,114 +5829,6 @@ function normalizeElevenLabsSpeechModelId(model) {
|
|
|
5792
5829
|
return normalized === "eleven-v3" ? DEFAULT_ELEVENLABS_SPEECH_MODEL_ID : normalized;
|
|
5793
5830
|
}
|
|
5794
5831
|
//#endregion
|
|
5795
|
-
//#region src/backend/utils/audio-metadata.ts
|
|
5796
|
-
function readWavDurationMs(bytes) {
|
|
5797
|
-
if (bytes.byteLength < 12) return void 0;
|
|
5798
|
-
const text = (offset, length) => String.fromCharCode(...bytes.subarray(offset, offset + length));
|
|
5799
|
-
if (text(0, 4) !== "RIFF" || text(8, 4) !== "WAVE") return void 0;
|
|
5800
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
5801
|
-
let byteRate;
|
|
5802
|
-
let dataSize;
|
|
5803
|
-
for (let offset = 12; offset + 8 <= bytes.byteLength;) {
|
|
5804
|
-
const type = text(offset, 4);
|
|
5805
|
-
const size = view.getUint32(offset + 4, true);
|
|
5806
|
-
const payload = offset + 8;
|
|
5807
|
-
if (type === "fmt " && size >= 12 && payload + 12 <= bytes.byteLength) byteRate = view.getUint32(payload + 8, true);
|
|
5808
|
-
if (type === "data") {
|
|
5809
|
-
dataSize = size;
|
|
5810
|
-
break;
|
|
5811
|
-
}
|
|
5812
|
-
if (payload + size > bytes.byteLength) break;
|
|
5813
|
-
offset = payload + size + size % 2;
|
|
5814
|
-
}
|
|
5815
|
-
if (!byteRate || dataSize === void 0) return void 0;
|
|
5816
|
-
return Math.round(dataSize * 1e3 / byteRate);
|
|
5817
|
-
}
|
|
5818
|
-
function id3PayloadSize(bytes) {
|
|
5819
|
-
if (bytes.byteLength < 10 || String.fromCharCode(...bytes.subarray(0, 3)) !== "ID3") return 0;
|
|
5820
|
-
return 10 + ((bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127) + ((bytes[5] & 16) !== 0 ? 10 : 0);
|
|
5821
|
-
}
|
|
5822
|
-
var MPEG1_LAYER3_BITRATES = [
|
|
5823
|
-
0,
|
|
5824
|
-
32,
|
|
5825
|
-
40,
|
|
5826
|
-
48,
|
|
5827
|
-
56,
|
|
5828
|
-
64,
|
|
5829
|
-
80,
|
|
5830
|
-
96,
|
|
5831
|
-
112,
|
|
5832
|
-
128,
|
|
5833
|
-
160,
|
|
5834
|
-
192,
|
|
5835
|
-
224,
|
|
5836
|
-
256,
|
|
5837
|
-
320
|
|
5838
|
-
];
|
|
5839
|
-
var MPEG2_LAYER3_BITRATES = [
|
|
5840
|
-
0,
|
|
5841
|
-
8,
|
|
5842
|
-
16,
|
|
5843
|
-
24,
|
|
5844
|
-
32,
|
|
5845
|
-
40,
|
|
5846
|
-
48,
|
|
5847
|
-
56,
|
|
5848
|
-
64,
|
|
5849
|
-
80,
|
|
5850
|
-
96,
|
|
5851
|
-
112,
|
|
5852
|
-
128,
|
|
5853
|
-
144,
|
|
5854
|
-
160
|
|
5855
|
-
];
|
|
5856
|
-
var MPEG1_SAMPLE_RATES = [
|
|
5857
|
-
44100,
|
|
5858
|
-
48e3,
|
|
5859
|
-
32e3
|
|
5860
|
-
];
|
|
5861
|
-
function mp3Frame(bytes, offset) {
|
|
5862
|
-
if (offset + 4 > bytes.byteLength || bytes[offset] !== 255 || (bytes[offset + 1] & 224) !== 224) return void 0;
|
|
5863
|
-
const versionBits = bytes[offset + 1] >> 3 & 3;
|
|
5864
|
-
const layerBits = bytes[offset + 1] >> 1 & 3;
|
|
5865
|
-
const bitrateIndex = bytes[offset + 2] >> 4 & 15;
|
|
5866
|
-
const sampleRateIndex = bytes[offset + 2] >> 2 & 3;
|
|
5867
|
-
if (versionBits === 1 || layerBits !== 1 || bitrateIndex === 0 || bitrateIndex === 15 || sampleRateIndex === 3) return void 0;
|
|
5868
|
-
const isMpeg1 = versionBits === 3;
|
|
5869
|
-
const bitrateKbps = (isMpeg1 ? MPEG1_LAYER3_BITRATES : MPEG2_LAYER3_BITRATES)[bitrateIndex];
|
|
5870
|
-
const divisor = versionBits === 0 ? 4 : versionBits === 2 ? 2 : 1;
|
|
5871
|
-
const sampleRate = MPEG1_SAMPLE_RATES[sampleRateIndex] / divisor;
|
|
5872
|
-
const padding = bytes[offset + 2] >> 1 & 1;
|
|
5873
|
-
const length = Math.floor((isMpeg1 ? 144e3 : 72e3) * bitrateKbps / sampleRate) + padding;
|
|
5874
|
-
if (length < 4 || offset + length > bytes.byteLength) return void 0;
|
|
5875
|
-
return {
|
|
5876
|
-
length,
|
|
5877
|
-
durationMs: (isMpeg1 ? 1152 : 576) * 1e3 / sampleRate,
|
|
5878
|
-
bitrateKbps
|
|
5879
|
-
};
|
|
5880
|
-
}
|
|
5881
|
-
function readMp3DurationMs(bytes) {
|
|
5882
|
-
let offset = id3PayloadSize(bytes);
|
|
5883
|
-
let durationMs = 0;
|
|
5884
|
-
let frames = 0;
|
|
5885
|
-
while (offset + 4 <= bytes.byteLength) {
|
|
5886
|
-
const frame = mp3Frame(bytes, offset);
|
|
5887
|
-
if (!frame) {
|
|
5888
|
-
offset += 1;
|
|
5889
|
-
continue;
|
|
5890
|
-
}
|
|
5891
|
-
durationMs += frame.durationMs;
|
|
5892
|
-
frames += 1;
|
|
5893
|
-
offset += frame.length;
|
|
5894
|
-
}
|
|
5895
|
-
return frames > 0 ? Math.round(durationMs) : void 0;
|
|
5896
|
-
}
|
|
5897
|
-
/** Read duration for the audio formats accepted by Seedance reference mode. */
|
|
5898
|
-
function readAudioDurationMs(bytes, mimeType) {
|
|
5899
|
-
if (mimeType === "audio/wav" || mimeType === "audio/x-wav") return readWavDurationMs(bytes);
|
|
5900
|
-
if (mimeType === "audio/mpeg") return readMp3DurationMs(bytes);
|
|
5901
|
-
}
|
|
5902
|
-
//#endregion
|
|
5903
5832
|
//#region src/backend/utils/iso-bmff-metadata.ts
|
|
5904
5833
|
function readBox(view, offset, limit) {
|
|
5905
5834
|
if (offset < 0 || offset + 8 > limit) return null;
|
|
@@ -5978,14 +5907,60 @@ function readIsoBmffVideoMetadata(bytes) {
|
|
|
5978
5907
|
}
|
|
5979
5908
|
//#endregion
|
|
5980
5909
|
//#region src/shared/avatarGenerationOptions.ts
|
|
5981
|
-
var AVATAR_MODEL_IDS = ["kling-avatar-v2"];
|
|
5910
|
+
var AVATAR_MODEL_IDS = ["kling-avatar-v2", "creatify-aurora"];
|
|
5911
|
+
var AURORA_AVATAR_RESOLUTIONS = ["480p", "720p"];
|
|
5982
5912
|
var AVATAR_MODES = ["standard", "pro"];
|
|
5913
|
+
var DEFAULT_AURORA_AVATAR_RESOLUTION = "720p";
|
|
5914
|
+
var AURORA_GUIDANCE_SCALE = Object.freeze({
|
|
5915
|
+
min: 0,
|
|
5916
|
+
max: 5,
|
|
5917
|
+
default: 1
|
|
5918
|
+
});
|
|
5919
|
+
var AURORA_AUDIO_GUIDANCE_SCALE = Object.freeze({
|
|
5920
|
+
min: 0,
|
|
5921
|
+
max: 5,
|
|
5922
|
+
default: 2
|
|
5923
|
+
});
|
|
5924
|
+
var AVATAR_MODEL_CAPABILITIES = Object.freeze({
|
|
5925
|
+
"kling-avatar-v2": {
|
|
5926
|
+
model: "kling-avatar-v2",
|
|
5927
|
+
label: "Kling Avatar V2",
|
|
5928
|
+
modes: AVATAR_MODES,
|
|
5929
|
+
defaultMode: "standard"
|
|
5930
|
+
},
|
|
5931
|
+
"creatify-aurora": {
|
|
5932
|
+
model: "creatify-aurora",
|
|
5933
|
+
label: "Creatify Aurora",
|
|
5934
|
+
resolutions: AURORA_AVATAR_RESOLUTIONS,
|
|
5935
|
+
defaultResolution: DEFAULT_AURORA_AVATAR_RESOLUTION,
|
|
5936
|
+
guidanceScale: AURORA_GUIDANCE_SCALE,
|
|
5937
|
+
audioGuidanceScale: AURORA_AUDIO_GUIDANCE_SCALE
|
|
5938
|
+
}
|
|
5939
|
+
});
|
|
5983
5940
|
function isAvatarModelId(value) {
|
|
5984
5941
|
return typeof value === "string" && AVATAR_MODEL_IDS.includes(value);
|
|
5985
5942
|
}
|
|
5943
|
+
function isAuroraAvatarResolution(value) {
|
|
5944
|
+
return typeof value === "string" && AURORA_AVATAR_RESOLUTIONS.includes(value);
|
|
5945
|
+
}
|
|
5986
5946
|
function isAvatarMode(value) {
|
|
5987
5947
|
return typeof value === "string" && AVATAR_MODES.includes(value);
|
|
5988
5948
|
}
|
|
5949
|
+
function getAvatarModelCapabilities(model) {
|
|
5950
|
+
return AVATAR_MODEL_CAPABILITIES[model];
|
|
5951
|
+
}
|
|
5952
|
+
function getAuroraProviderCompatibilityError(provider, prompt, references = []) {
|
|
5953
|
+
if (provider === "elevenlabs" && prompt?.trim()) return "ElevenLabs Creatify Aurora does not accept a prompt; clear the prompt or select fal";
|
|
5954
|
+
const audioMimeType = references.find((reference) => reference.mediaKind === "audio")?.mimeType;
|
|
5955
|
+
if (provider === "elevenlabs" && audioMimeType && ![
|
|
5956
|
+
"audio/mpeg",
|
|
5957
|
+
"audio/wav",
|
|
5958
|
+
"audio/x-wav"
|
|
5959
|
+
].includes(audioMimeType)) return `ElevenLabs Creatify Aurora does not accept ${audioMimeType} audio; use MP3 or WAV, or select fal`;
|
|
5960
|
+
const oversizedReference = references.find((reference) => reference.sizeBytes !== void 0 && reference.sizeBytes > 8 * 1024 * 1024);
|
|
5961
|
+
if (provider === "elevenlabs" && oversizedReference) return `ElevenLabs Creatify Aurora ${oversizedReference.mediaKind} input must not exceed 8 MiB`;
|
|
5962
|
+
return null;
|
|
5963
|
+
}
|
|
5989
5964
|
//#endregion
|
|
5990
5965
|
//#region src/shared/seedance2Capabilities.ts
|
|
5991
5966
|
var SEEDANCE_2_ASPECT_RATIOS = [
|
|
@@ -6012,6 +5987,36 @@ var SEEDANCE_2_DURATIONS = [
|
|
|
6012
5987
|
14,
|
|
6013
5988
|
15
|
|
6014
5989
|
];
|
|
5990
|
+
var SEEDANCE_25_DURATIONS = [
|
|
5991
|
+
"auto",
|
|
5992
|
+
4,
|
|
5993
|
+
5,
|
|
5994
|
+
6,
|
|
5995
|
+
7,
|
|
5996
|
+
8,
|
|
5997
|
+
9,
|
|
5998
|
+
10,
|
|
5999
|
+
11,
|
|
6000
|
+
12,
|
|
6001
|
+
13,
|
|
6002
|
+
14,
|
|
6003
|
+
15,
|
|
6004
|
+
16,
|
|
6005
|
+
17,
|
|
6006
|
+
18,
|
|
6007
|
+
19,
|
|
6008
|
+
20,
|
|
6009
|
+
21,
|
|
6010
|
+
22,
|
|
6011
|
+
23,
|
|
6012
|
+
24,
|
|
6013
|
+
25,
|
|
6014
|
+
26,
|
|
6015
|
+
27,
|
|
6016
|
+
28,
|
|
6017
|
+
29,
|
|
6018
|
+
30
|
|
6019
|
+
];
|
|
6015
6020
|
var SEEDANCE_2_BITRATE_MODES = ["standard", "high"];
|
|
6016
6021
|
var MB = 1024 * 1024;
|
|
6017
6022
|
var IMAGE_REFERENCE_RULE = {
|
|
@@ -6073,6 +6078,8 @@ function profile(mode, tier, endpointId) {
|
|
|
6073
6078
|
selection,
|
|
6074
6079
|
generatorId: `video/${selection}`,
|
|
6075
6080
|
endpointId,
|
|
6081
|
+
family: "seedance-2.0",
|
|
6082
|
+
familyLabel: "Seedance 2",
|
|
6076
6083
|
label: `Seedance 2 ${fast ? "Fast " : ""}${mode === "text" ? "Text" : mode === "frame" ? "Frames" : "References"}`,
|
|
6077
6084
|
mode,
|
|
6078
6085
|
tier,
|
|
@@ -6109,20 +6116,137 @@ function profile(mode, tier, endpointId) {
|
|
|
6109
6116
|
}
|
|
6110
6117
|
};
|
|
6111
6118
|
}
|
|
6119
|
+
var SEEDANCE_25_IMAGE_REFERENCE_RULE = {
|
|
6120
|
+
mediaKind: "image",
|
|
6121
|
+
minCount: 0,
|
|
6122
|
+
maxCount: 30,
|
|
6123
|
+
promptLabel: "@ImageN",
|
|
6124
|
+
acceptedMimeTypes: [
|
|
6125
|
+
"image/jpeg",
|
|
6126
|
+
"image/png",
|
|
6127
|
+
"image/webp",
|
|
6128
|
+
"image/gif"
|
|
6129
|
+
],
|
|
6130
|
+
maxBytesPerFile: 30 * MB
|
|
6131
|
+
};
|
|
6132
|
+
var SEEDANCE_25_FRAME_IMAGE_REFERENCE_RULE = {
|
|
6133
|
+
...SEEDANCE_25_IMAGE_REFERENCE_RULE,
|
|
6134
|
+
minCount: 1,
|
|
6135
|
+
maxCount: 2,
|
|
6136
|
+
acceptedMimeTypes: [
|
|
6137
|
+
"image/jpeg",
|
|
6138
|
+
"image/png",
|
|
6139
|
+
"image/webp"
|
|
6140
|
+
]
|
|
6141
|
+
};
|
|
6142
|
+
var SEEDANCE_25_VIDEO_REFERENCE_RULE = {
|
|
6143
|
+
mediaKind: "video",
|
|
6144
|
+
minCount: 0,
|
|
6145
|
+
maxCount: 10,
|
|
6146
|
+
promptLabel: "@VideoN",
|
|
6147
|
+
acceptedMimeTypes: ["video/mp4", "video/quicktime"],
|
|
6148
|
+
maxBytesPerFile: 50 * MB,
|
|
6149
|
+
combinedDurationSeconds: { max: 30.2 },
|
|
6150
|
+
perFileDurationSeconds: {
|
|
6151
|
+
min: 1.8,
|
|
6152
|
+
max: 30.2
|
|
6153
|
+
},
|
|
6154
|
+
dimensionRange: {
|
|
6155
|
+
min: 300,
|
|
6156
|
+
max: 6e3
|
|
6157
|
+
},
|
|
6158
|
+
aspectRatioRange: {
|
|
6159
|
+
min: .4,
|
|
6160
|
+
max: 2.5
|
|
6161
|
+
}
|
|
6162
|
+
};
|
|
6163
|
+
var SEEDANCE_25_AUDIO_REFERENCE_RULE = {
|
|
6164
|
+
mediaKind: "audio",
|
|
6165
|
+
minCount: 0,
|
|
6166
|
+
maxCount: 10,
|
|
6167
|
+
promptLabel: "@AudioN",
|
|
6168
|
+
acceptedMimeTypes: [
|
|
6169
|
+
"audio/mpeg",
|
|
6170
|
+
"audio/wav",
|
|
6171
|
+
"audio/x-wav"
|
|
6172
|
+
],
|
|
6173
|
+
maxBytesPerFile: 15 * MB,
|
|
6174
|
+
combinedDurationSeconds: { max: 30.2 },
|
|
6175
|
+
perFileDurationSeconds: {
|
|
6176
|
+
min: 1.8,
|
|
6177
|
+
max: 30.2
|
|
6178
|
+
}
|
|
6179
|
+
};
|
|
6180
|
+
function seedance25Profile(mode, endpointId) {
|
|
6181
|
+
const selection = `seedance-2.5-${mode}`;
|
|
6182
|
+
const references = mode === "reference" ? [
|
|
6183
|
+
SEEDANCE_25_IMAGE_REFERENCE_RULE,
|
|
6184
|
+
SEEDANCE_25_VIDEO_REFERENCE_RULE,
|
|
6185
|
+
SEEDANCE_25_AUDIO_REFERENCE_RULE
|
|
6186
|
+
] : mode === "frame" ? [SEEDANCE_25_FRAME_IMAGE_REFERENCE_RULE] : [];
|
|
6187
|
+
return {
|
|
6188
|
+
selection,
|
|
6189
|
+
generatorId: `video/${selection}`,
|
|
6190
|
+
endpointId,
|
|
6191
|
+
family: "seedance-2.5",
|
|
6192
|
+
familyLabel: "Seedance 2.5",
|
|
6193
|
+
label: `Seedance 2.5 ${mode === "text" ? "Text" : mode === "frame" ? "Frames" : "References"}`,
|
|
6194
|
+
mode,
|
|
6195
|
+
tier: "standard",
|
|
6196
|
+
operations: mode === "text" ? ["generate"] : mode === "frame" ? ["generate", "derive"] : [
|
|
6197
|
+
"generate",
|
|
6198
|
+
"derive",
|
|
6199
|
+
"refine"
|
|
6200
|
+
],
|
|
6201
|
+
resolutions: [
|
|
6202
|
+
"480p",
|
|
6203
|
+
"720p",
|
|
6204
|
+
"1080p"
|
|
6205
|
+
],
|
|
6206
|
+
aspectRatios: mode === "frame" ? ["auto"] : SEEDANCE_2_ASPECT_RATIOS,
|
|
6207
|
+
durations: SEEDANCE_25_DURATIONS,
|
|
6208
|
+
defaultResolution: "720p",
|
|
6209
|
+
defaultAspectRatio: "auto",
|
|
6210
|
+
defaultDuration: "auto",
|
|
6211
|
+
generateAudio: {
|
|
6212
|
+
supported: true,
|
|
6213
|
+
default: true
|
|
6214
|
+
},
|
|
6215
|
+
outputSeed: { returned: true },
|
|
6216
|
+
bitrateModes: SEEDANCE_2_BITRATE_MODES,
|
|
6217
|
+
defaultBitrateMode: "standard",
|
|
6218
|
+
references,
|
|
6219
|
+
maxReferenceFiles: mode === "reference" ? 50 : mode === "frame" ? 2 : 0,
|
|
6220
|
+
requiresVisualReferenceWithAudio: mode === "reference",
|
|
6221
|
+
conditioning: {
|
|
6222
|
+
authoritativeStartEndFrames: mode === "frame",
|
|
6223
|
+
extendedMultimodalReferences: mode === "reference",
|
|
6224
|
+
canCombineAuthoritativeFramesWithExtendedReferences: false
|
|
6225
|
+
}
|
|
6226
|
+
};
|
|
6227
|
+
}
|
|
6112
6228
|
var SEEDANCE_2_CAPABILITIES = {
|
|
6113
6229
|
"seedance-2-text": profile("text", "standard", "bytedance/seedance-2.0/text-to-video"),
|
|
6114
6230
|
"seedance-2-frame": profile("frame", "standard", "bytedance/seedance-2.0/image-to-video"),
|
|
6115
6231
|
"seedance-2-reference": profile("reference", "standard", "bytedance/seedance-2.0/reference-to-video"),
|
|
6116
6232
|
"seedance-2-fast-text": profile("text", "fast", "bytedance/seedance-2.0/fast/text-to-video"),
|
|
6117
6233
|
"seedance-2-fast-frame": profile("frame", "fast", "bytedance/seedance-2.0/fast/image-to-video"),
|
|
6118
|
-
"seedance-2-fast-reference": profile("reference", "fast", "bytedance/seedance-2.0/fast/reference-to-video")
|
|
6234
|
+
"seedance-2-fast-reference": profile("reference", "fast", "bytedance/seedance-2.0/fast/reference-to-video"),
|
|
6235
|
+
"seedance-2.5-text": seedance25Profile("text", "bytedance/seedance-2.5/text-to-video"),
|
|
6236
|
+
"seedance-2.5-frame": seedance25Profile("frame", "bytedance/seedance-2.5/image-to-video"),
|
|
6237
|
+
"seedance-2.5-reference": seedance25Profile("reference", "bytedance/seedance-2.5/reference-to-video")
|
|
6119
6238
|
};
|
|
6120
6239
|
var SEEDANCE_2_SELECTIONS = Object.freeze(Object.keys(SEEDANCE_2_CAPABILITIES));
|
|
6121
6240
|
Object.freeze(SEEDANCE_2_SELECTIONS.map((selection) => SEEDANCE_2_CAPABILITIES[selection].generatorId));
|
|
6241
|
+
function getSeedanceProviderCompatibilityError(capability, provider, options) {
|
|
6242
|
+
if (provider !== "elevenlabs") return null;
|
|
6243
|
+
if (options.bitrateMode === "high") return "ElevenLabs Seedance does not support high bitrate mode";
|
|
6244
|
+
if (capability.family === "seedance-2.0" && options.resolution === "4k") return "ElevenLabs Seedance 2 does not support 4k resolution";
|
|
6245
|
+
return null;
|
|
6246
|
+
}
|
|
6122
6247
|
function getSeedance2RegenerationCapability(model, source, referencesWereOverridden) {
|
|
6123
6248
|
const sourceCapability = source.model ? getSeedance2CapabilityByEndpoint(source.model) : void 0;
|
|
6124
|
-
|
|
6125
|
-
return SEEDANCE_2_CAPABILITIES[`${model === "seedance-2-fast" ? "seedance-2-fast" : "seedance-2"}-${mode}`];
|
|
6249
|
+
return SEEDANCE_2_CAPABILITIES[`${model}-${!referencesWereOverridden && sourceCapability ? sourceCapability.mode : !referencesWereOverridden && source.authoritativeFrames ? "frame" : source.references.length > 0 ? "reference" : "text"}`];
|
|
6126
6250
|
}
|
|
6127
6251
|
/**
|
|
6128
6252
|
* Reference inputs exposed by an interface are additional to the video being
|
|
@@ -6143,18 +6267,19 @@ function getSeedance2ReferenceBudget(capability, operation) {
|
|
|
6143
6267
|
}
|
|
6144
6268
|
function validateSeedance2ReferenceCounts(capability, operation, counts) {
|
|
6145
6269
|
const total = counts.image + counts.video + counts.audio;
|
|
6270
|
+
const familyLabel = capability.familyLabel;
|
|
6146
6271
|
if (capability.mode === "text") return total > 0 ? {
|
|
6147
6272
|
code: "references_not_supported",
|
|
6148
|
-
message:
|
|
6273
|
+
message: `${familyLabel} text mode does not accept references.`
|
|
6149
6274
|
} : null;
|
|
6150
6275
|
if (capability.mode === "frame") {
|
|
6151
6276
|
if (counts.image === 0) return {
|
|
6152
6277
|
code: "start_frame_required",
|
|
6153
|
-
message:
|
|
6278
|
+
message: `${familyLabel} frame mode requires a completed image start frame.`
|
|
6154
6279
|
};
|
|
6155
6280
|
if (counts.video > 0 || counts.audio > 0 || counts.image > 2) return {
|
|
6156
6281
|
code: "frame_images_only",
|
|
6157
|
-
message:
|
|
6282
|
+
message: `${familyLabel} frame mode accepts one start image and one optional end image.`
|
|
6158
6283
|
};
|
|
6159
6284
|
return null;
|
|
6160
6285
|
}
|
|
@@ -6162,23 +6287,23 @@ function validateSeedance2ReferenceCounts(capability, operation, counts) {
|
|
|
6162
6287
|
const qualifier = operation === "refine" ? " additional" : "";
|
|
6163
6288
|
if (total > budget.maxAdditionalFiles) return {
|
|
6164
6289
|
code: "too_many_files",
|
|
6165
|
-
message:
|
|
6290
|
+
message: `${familyLabel} reference mode accepts at most ${budget.maxAdditionalFiles}${qualifier} files.`
|
|
6166
6291
|
};
|
|
6167
6292
|
if (counts.image > budget.maxAdditionalByKind.image) return {
|
|
6168
6293
|
code: "too_many_images",
|
|
6169
|
-
message:
|
|
6294
|
+
message: `${familyLabel} accepts at most ${budget.maxAdditionalByKind.image}${qualifier} reference images.`
|
|
6170
6295
|
};
|
|
6171
6296
|
if (counts.video > budget.maxAdditionalByKind.video) return {
|
|
6172
6297
|
code: "too_many_videos",
|
|
6173
|
-
message:
|
|
6298
|
+
message: `${familyLabel} accepts at most ${budget.maxAdditionalByKind.video}${qualifier} reference videos.`
|
|
6174
6299
|
};
|
|
6175
6300
|
if (counts.audio > budget.maxAdditionalByKind.audio) return {
|
|
6176
6301
|
code: "too_many_audio_clips",
|
|
6177
|
-
message:
|
|
6302
|
+
message: `${familyLabel} accepts at most ${budget.maxAdditionalByKind.audio}${qualifier} reference audio clips.`
|
|
6178
6303
|
};
|
|
6179
6304
|
if (counts.audio > 0 && counts.image + counts.video === 0 && !budget.hasImplicitSourceVideo) return {
|
|
6180
6305
|
code: "visual_reference_required",
|
|
6181
|
-
message:
|
|
6306
|
+
message: `${familyLabel} audio guidance references require at least one image or video reference.`
|
|
6182
6307
|
};
|
|
6183
6308
|
return null;
|
|
6184
6309
|
}
|
|
@@ -6269,6 +6394,16 @@ var VIDEO_GENERATION_TIER_MODELS = {
|
|
|
6269
6394
|
fast: "veo-3.1-fast-generate-preview",
|
|
6270
6395
|
lite: "veo-3.1-lite-generate-preview"
|
|
6271
6396
|
};
|
|
6397
|
+
function getVeoProviderCompatibilityError(model, tier, provider, options) {
|
|
6398
|
+
if (provider !== "elevenlabs") return null;
|
|
6399
|
+
const resolved = resolveVideoGenerationModel(model, normalizeVideoGenerationTier(tier) ?? "generate");
|
|
6400
|
+
if (!resolved || !isVeoVideoGenerationModel(resolved)) return null;
|
|
6401
|
+
if (options.resolution === "4k") return "ElevenLabs Veo 3.1 does not support 4k resolution";
|
|
6402
|
+
const referenceCount = Math.max(0, Math.floor(options.referenceCount ?? 0));
|
|
6403
|
+
if (resolved === VIDEO_GENERATION_TIER_MODELS.fast && referenceCount > 2) return "ElevenLabs Veo 3.1 Fast does not support subject image references";
|
|
6404
|
+
if (referenceCount === 3 && options.durationSeconds !== void 0 && options.durationSeconds !== 8) return "ElevenLabs Veo 3.1 subject image references require an 8-second duration";
|
|
6405
|
+
return null;
|
|
6406
|
+
}
|
|
6272
6407
|
function normalizeVideoGenerationResolution(value) {
|
|
6273
6408
|
return ALL_VIDEO_GENERATION_RESOLUTIONS.includes(value) ? value : void 0;
|
|
6274
6409
|
}
|
|
@@ -6276,6 +6411,12 @@ function normalizeVideoGenerationDurationSeconds(value) {
|
|
|
6276
6411
|
const numeric = typeof value === "string" ? Number(value) : value;
|
|
6277
6412
|
return SEEDANCE_2_DURATION_SECONDS.includes(numeric) ? numeric : void 0;
|
|
6278
6413
|
}
|
|
6414
|
+
function normalizeSeedanceDuration(value, model) {
|
|
6415
|
+
const capability = getSeedance2CapabilityByEndpoint(model);
|
|
6416
|
+
if (!capability) return void 0;
|
|
6417
|
+
const normalized = value === "auto" ? value : typeof value === "string" ? Number(value) : value;
|
|
6418
|
+
return capability.durations.includes(normalized) ? normalized : void 0;
|
|
6419
|
+
}
|
|
6279
6420
|
function normalizeVideoGenerationTier(value) {
|
|
6280
6421
|
return VIDEO_GENERATION_TIERS.includes(value) ? value : void 0;
|
|
6281
6422
|
}
|
|
@@ -6291,6 +6432,12 @@ function getVideoGenerationModelForSelection(selection = DEFAULT_VIDEO_MODEL_SEL
|
|
|
6291
6432
|
if (selection === "fal-seedance") return FAL_VIDEO_MODEL;
|
|
6292
6433
|
return getVideoGenerationModelForTier(tier);
|
|
6293
6434
|
}
|
|
6435
|
+
function resolveVideoGenerationModel(model, tier = DEFAULT_VIDEO_GENERATION_TIER) {
|
|
6436
|
+
if (model === void 0 || model === null || model === "") return getVideoGenerationModelForTier(tier);
|
|
6437
|
+
const selection = normalizeVideoModelSelection(model);
|
|
6438
|
+
if (selection) return getVideoGenerationModelForSelection(selection, tier);
|
|
6439
|
+
return isVideoGenerationModel(model) ? model : void 0;
|
|
6440
|
+
}
|
|
6294
6441
|
function getVideoGenerationResolutionsForTier(tier = DEFAULT_VIDEO_GENERATION_TIER) {
|
|
6295
6442
|
return VIDEO_GENERATION_RESOLUTIONS_BY_TIER[tier];
|
|
6296
6443
|
}
|
|
@@ -6334,6 +6481,9 @@ function isFalSeedanceV1VideoGenerationModel(model) {
|
|
|
6334
6481
|
function isFalSeedance2VideoGenerationModel(model) {
|
|
6335
6482
|
return typeof model === "string" && getSeedance2CapabilityByEndpoint(model) !== void 0;
|
|
6336
6483
|
}
|
|
6484
|
+
function isVideoGenerationModel(model) {
|
|
6485
|
+
return isVeoVideoGenerationModel(model) || isGeminiOmniVideoGenerationModel(model) || isKlingVideoGenerationModel(model) || isFalVideoGenerationModel(model);
|
|
6486
|
+
}
|
|
6337
6487
|
function getVideoGenerationMaxReferenceImages(model) {
|
|
6338
6488
|
if (isFalSeedanceV1VideoGenerationModel(model)) return 0;
|
|
6339
6489
|
if (isFalSeedance2VideoGenerationModel(model)) return getSeedance2CapabilityByEndpoint(model)?.references.find((reference) => reference.mediaKind === "image")?.maxCount ?? 0;
|
|
@@ -6350,16 +6500,34 @@ function doesVideoGenerationModelSupportAudioToggle(model) {
|
|
|
6350
6500
|
return isKlingVideoGenerationModel(model) || isVeoVideoGenerationModel(model) && VIDEO_GENERATION_AUDIO_TOGGLE_MODELS.includes(model);
|
|
6351
6501
|
}
|
|
6352
6502
|
//#endregion
|
|
6503
|
+
//#region src/shared/generationRouting.ts
|
|
6504
|
+
/** Provider identifiers that may participate in user-selectable generation routes. */
|
|
6505
|
+
var GENERATION_ROUTING_PROVIDERS = [
|
|
6506
|
+
"google_ai",
|
|
6507
|
+
"fal",
|
|
6508
|
+
"pika",
|
|
6509
|
+
"kling",
|
|
6510
|
+
"replicate",
|
|
6511
|
+
"elevenlabs",
|
|
6512
|
+
"lyria"
|
|
6513
|
+
];
|
|
6514
|
+
//#endregion
|
|
6353
6515
|
//#region src/shared/imageGenerationOptions.ts
|
|
6354
6516
|
var IMAGE_MODEL_SELECTIONS = [
|
|
6355
6517
|
"pro",
|
|
6356
6518
|
"flash",
|
|
6357
|
-
"flux"
|
|
6519
|
+
"flux",
|
|
6520
|
+
"gpt-image-2",
|
|
6521
|
+
"seedream-5-pro",
|
|
6522
|
+
"seedream-5-lite"
|
|
6358
6523
|
];
|
|
6359
6524
|
var IMAGE_MODEL_IDS = {
|
|
6360
6525
|
pro: "gemini-3-pro-image",
|
|
6361
6526
|
flash: "gemini-3.1-flash-image",
|
|
6362
|
-
flux: "fal-ai/flux/dev"
|
|
6527
|
+
flux: "fal-ai/flux/dev",
|
|
6528
|
+
"gpt-image-2": "gpt-image-2",
|
|
6529
|
+
"seedream-5-pro": "bytedance-seedream-5-pro",
|
|
6530
|
+
"seedream-5-lite": "bytedance-seedream-5-lite"
|
|
6363
6531
|
};
|
|
6364
6532
|
IMAGE_MODEL_IDS["pro"];
|
|
6365
6533
|
var IMAGE_ASPECT_RATIOS = [
|
|
@@ -6377,8 +6545,14 @@ var IMAGE_ASPECT_RATIOS = [
|
|
|
6377
6545
|
var IMAGE_SIZES = [
|
|
6378
6546
|
"1K",
|
|
6379
6547
|
"2K",
|
|
6548
|
+
"3K",
|
|
6380
6549
|
"4K"
|
|
6381
6550
|
];
|
|
6551
|
+
var IMAGE_QUALITIES = [
|
|
6552
|
+
"low",
|
|
6553
|
+
"medium",
|
|
6554
|
+
"high"
|
|
6555
|
+
];
|
|
6382
6556
|
var IMAGE_MODEL_CAPABILITIES = {
|
|
6383
6557
|
pro: {
|
|
6384
6558
|
selection: "pro",
|
|
@@ -6390,13 +6564,15 @@ var IMAGE_MODEL_CAPABILITIES = {
|
|
|
6390
6564
|
"derive",
|
|
6391
6565
|
"refine"
|
|
6392
6566
|
],
|
|
6393
|
-
maxReferenceImages:
|
|
6567
|
+
maxReferenceImages: 10,
|
|
6394
6568
|
supportedImageSizes: [
|
|
6395
6569
|
"1K",
|
|
6396
6570
|
"2K",
|
|
6397
6571
|
"4K"
|
|
6398
6572
|
],
|
|
6399
|
-
supportedAspectRatios: IMAGE_ASPECT_RATIOS
|
|
6573
|
+
supportedAspectRatios: IMAGE_ASPECT_RATIOS,
|
|
6574
|
+
supportedQualities: [],
|
|
6575
|
+
supportsSeed: false
|
|
6400
6576
|
},
|
|
6401
6577
|
flash: {
|
|
6402
6578
|
selection: "flash",
|
|
@@ -6414,7 +6590,9 @@ var IMAGE_MODEL_CAPABILITIES = {
|
|
|
6414
6590
|
"2K",
|
|
6415
6591
|
"4K"
|
|
6416
6592
|
],
|
|
6417
|
-
supportedAspectRatios: IMAGE_ASPECT_RATIOS
|
|
6593
|
+
supportedAspectRatios: IMAGE_ASPECT_RATIOS,
|
|
6594
|
+
supportedQualities: [],
|
|
6595
|
+
supportsSeed: false
|
|
6418
6596
|
},
|
|
6419
6597
|
flux: {
|
|
6420
6598
|
selection: "flux",
|
|
@@ -6424,7 +6602,77 @@ var IMAGE_MODEL_CAPABILITIES = {
|
|
|
6424
6602
|
supportedOperations: ["generate"],
|
|
6425
6603
|
maxReferenceImages: 0,
|
|
6426
6604
|
supportedImageSizes: ["1K"],
|
|
6427
|
-
supportedAspectRatios: IMAGE_ASPECT_RATIOS
|
|
6605
|
+
supportedAspectRatios: IMAGE_ASPECT_RATIOS,
|
|
6606
|
+
supportedQualities: [],
|
|
6607
|
+
supportsSeed: false
|
|
6608
|
+
},
|
|
6609
|
+
"gpt-image-2": {
|
|
6610
|
+
selection: "gpt-image-2",
|
|
6611
|
+
modelId: IMAGE_MODEL_IDS["gpt-image-2"],
|
|
6612
|
+
label: "GPT Image 2",
|
|
6613
|
+
provider: "elevenlabs",
|
|
6614
|
+
supportedOperations: [
|
|
6615
|
+
"generate",
|
|
6616
|
+
"derive",
|
|
6617
|
+
"refine"
|
|
6618
|
+
],
|
|
6619
|
+
maxReferenceImages: 10,
|
|
6620
|
+
supportedImageSizes: [
|
|
6621
|
+
"1K",
|
|
6622
|
+
"2K",
|
|
6623
|
+
"4K"
|
|
6624
|
+
],
|
|
6625
|
+
supportedAspectRatios: [
|
|
6626
|
+
"1:1",
|
|
6627
|
+
"2:3",
|
|
6628
|
+
"3:2"
|
|
6629
|
+
],
|
|
6630
|
+
supportedQualities: IMAGE_QUALITIES,
|
|
6631
|
+
supportsSeed: false
|
|
6632
|
+
},
|
|
6633
|
+
"seedream-5-pro": {
|
|
6634
|
+
selection: "seedream-5-pro",
|
|
6635
|
+
modelId: IMAGE_MODEL_IDS["seedream-5-pro"],
|
|
6636
|
+
label: "Seedream 5 Pro",
|
|
6637
|
+
provider: "elevenlabs",
|
|
6638
|
+
supportedOperations: [
|
|
6639
|
+
"generate",
|
|
6640
|
+
"derive",
|
|
6641
|
+
"refine"
|
|
6642
|
+
],
|
|
6643
|
+
maxReferenceImages: 10,
|
|
6644
|
+
supportedImageSizes: ["1K", "2K"],
|
|
6645
|
+
supportedAspectRatios: [
|
|
6646
|
+
"16:9",
|
|
6647
|
+
"4:3",
|
|
6648
|
+
"1:1",
|
|
6649
|
+
"3:4",
|
|
6650
|
+
"9:16"
|
|
6651
|
+
],
|
|
6652
|
+
supportedQualities: [],
|
|
6653
|
+
supportsSeed: true
|
|
6654
|
+
},
|
|
6655
|
+
"seedream-5-lite": {
|
|
6656
|
+
selection: "seedream-5-lite",
|
|
6657
|
+
modelId: IMAGE_MODEL_IDS["seedream-5-lite"],
|
|
6658
|
+
label: "Seedream 5 Lite",
|
|
6659
|
+
provider: "elevenlabs",
|
|
6660
|
+
supportedOperations: [
|
|
6661
|
+
"generate",
|
|
6662
|
+
"derive",
|
|
6663
|
+
"refine"
|
|
6664
|
+
],
|
|
6665
|
+
maxReferenceImages: 10,
|
|
6666
|
+
supportedImageSizes: ["2K", "3K"],
|
|
6667
|
+
supportedAspectRatios: [
|
|
6668
|
+
"16:9",
|
|
6669
|
+
"4:3",
|
|
6670
|
+
"1:1",
|
|
6671
|
+
"3:4",
|
|
6672
|
+
"9:16"
|
|
6673
|
+
],
|
|
6674
|
+
supportedQualities: [],
|
|
6675
|
+
supportsSeed: true
|
|
6428
6676
|
}
|
|
6429
6677
|
};
|
|
6430
6678
|
function isImageModelSelection(value) {
|
|
@@ -6443,11 +6691,16 @@ function normalizeImageSize(value) {
|
|
|
6443
6691
|
const normalized = value.toUpperCase();
|
|
6444
6692
|
return isImageSize(normalized) ? normalized : void 0;
|
|
6445
6693
|
}
|
|
6694
|
+
function isImageQuality(value) {
|
|
6695
|
+
return IMAGE_QUALITIES.includes(value);
|
|
6696
|
+
}
|
|
6697
|
+
function normalizeImageQuality(value) {
|
|
6698
|
+
const normalized = value.trim().toLowerCase();
|
|
6699
|
+
return isImageQuality(normalized) ? normalized : void 0;
|
|
6700
|
+
}
|
|
6446
6701
|
function getImageModelSelection(value) {
|
|
6447
6702
|
if (isImageModelSelection(value)) return value;
|
|
6448
|
-
|
|
6449
|
-
if (value === IMAGE_MODEL_IDS.flux) return "flux";
|
|
6450
|
-
return "pro";
|
|
6703
|
+
return IMAGE_MODEL_SELECTIONS.find((selection) => IMAGE_MODEL_CAPABILITIES[selection].modelId === value) ?? "pro";
|
|
6451
6704
|
}
|
|
6452
6705
|
function getImageModelProvider(model) {
|
|
6453
6706
|
return getImageModelCapabilities(model).provider;
|
|
@@ -6458,6 +6711,12 @@ function getImageModelCapabilities(model) {
|
|
|
6458
6711
|
function isImageSizeSupportedByModel(model, imageSize) {
|
|
6459
6712
|
return getImageModelCapabilities(model).supportedImageSizes.includes(imageSize);
|
|
6460
6713
|
}
|
|
6714
|
+
function isImageQualitySupportedByModel(model, quality) {
|
|
6715
|
+
return getImageModelCapabilities(model).supportedQualities.includes(quality);
|
|
6716
|
+
}
|
|
6717
|
+
function isImageSeedSupportedByModel(model) {
|
|
6718
|
+
return getImageModelCapabilities(model).supportsSeed;
|
|
6719
|
+
}
|
|
6461
6720
|
function isImageAspectRatioSupportedByModel(model, aspectRatio) {
|
|
6462
6721
|
return getImageModelCapabilities(model).supportedAspectRatios.includes(aspectRatio);
|
|
6463
6722
|
}
|
|
@@ -6654,6 +6913,7 @@ var LOCAL_REFERENCE_MIME_TYPES = {
|
|
|
6654
6913
|
".jpeg": "image/jpeg",
|
|
6655
6914
|
".png": "image/png",
|
|
6656
6915
|
".webp": "image/webp",
|
|
6916
|
+
".gif": "image/gif",
|
|
6657
6917
|
".mp4": "video/mp4",
|
|
6658
6918
|
".mov": "video/quicktime",
|
|
6659
6919
|
".mp3": "audio/mpeg",
|
|
@@ -6661,20 +6921,15 @@ var LOCAL_REFERENCE_MIME_TYPES = {
|
|
|
6661
6921
|
};
|
|
6662
6922
|
async function inspectLocalReference(filePath, mediaKind) {
|
|
6663
6923
|
const fileStat = await stat(filePath);
|
|
6664
|
-
const mimeType = LOCAL_REFERENCE_MIME_TYPES[path.extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
6665
6924
|
const inspection = {
|
|
6666
|
-
mimeType,
|
|
6925
|
+
mimeType: LOCAL_REFERENCE_MIME_TYPES[path.extname(filePath).toLowerCase()] ?? "application/octet-stream",
|
|
6667
6926
|
sizeBytes: fileStat.size
|
|
6668
6927
|
};
|
|
6669
|
-
if (mediaKind
|
|
6928
|
+
if (mediaKind !== "video") return inspection;
|
|
6670
6929
|
const bytes = new Uint8Array(await readFile(filePath));
|
|
6671
|
-
if (mediaKind === "video") return {
|
|
6672
|
-
...inspection,
|
|
6673
|
-
...readIsoBmffVideoMetadata(bytes)
|
|
6674
|
-
};
|
|
6675
6930
|
return {
|
|
6676
6931
|
...inspection,
|
|
6677
|
-
|
|
6932
|
+
...readIsoBmffVideoMetadata(bytes)
|
|
6678
6933
|
};
|
|
6679
6934
|
}
|
|
6680
6935
|
async function handleGenerate(parsed) {
|
|
@@ -6702,6 +6957,7 @@ async function executeForgeCommand(command, parsed, deps = defaultDeps$12, optio
|
|
|
6702
6957
|
validateImageCommandReferenceCount(command, parsed, mediaKind, imageOptions.model);
|
|
6703
6958
|
validateVideoAudioOptions(parsed, mediaKind);
|
|
6704
6959
|
const videoOptions = parseVideoGenerationOptions(parsed, mediaKind);
|
|
6960
|
+
parseGenerationProviderOption(parsed, mediaKind, videoOptions.model);
|
|
6705
6961
|
validateVideoModelOperation(command, mediaKind, videoOptions.model);
|
|
6706
6962
|
validateVideoFrameReferenceOptions(command, parsed, mediaKind);
|
|
6707
6963
|
validateSeedanceReferenceOptions(parseSeedanceReferenceOptions(parsed), videoOptions.model ?? getVideoGenerationModelForSelection(), command);
|
|
@@ -6728,9 +6984,12 @@ var CLI_GENERATION_COMMON_OPTIONS = [
|
|
|
6728
6984
|
var CLI_GENERATION_MEDIA_OPTIONS = {
|
|
6729
6985
|
image: [
|
|
6730
6986
|
"model",
|
|
6987
|
+
"provider",
|
|
6731
6988
|
"refs",
|
|
6732
6989
|
"aspect",
|
|
6733
|
-
"size"
|
|
6990
|
+
"size",
|
|
6991
|
+
"quality",
|
|
6992
|
+
"seed"
|
|
6734
6993
|
],
|
|
6735
6994
|
audio: [
|
|
6736
6995
|
"model",
|
|
@@ -6753,7 +7012,10 @@ var CLI_GENERATION_MEDIA_OPTIONS = {
|
|
|
6753
7012
|
"image-refs",
|
|
6754
7013
|
"video-refs",
|
|
6755
7014
|
"audio-refs",
|
|
6756
|
-
"mode"
|
|
7015
|
+
"mode",
|
|
7016
|
+
"guidance-scale",
|
|
7017
|
+
"audio-guidance-scale",
|
|
7018
|
+
"provider"
|
|
6757
7019
|
]
|
|
6758
7020
|
};
|
|
6759
7021
|
function rejectUnknownGenerationOptions(options, mediaKind) {
|
|
@@ -6825,7 +7087,7 @@ async function executeGenerate(parsed, ctx, client, deps, mediaKind, followOptio
|
|
|
6825
7087
|
...deps,
|
|
6826
7088
|
waitForReferenceVariant: (variant) => waitForReferenceVariant(client, variant)
|
|
6827
7089
|
};
|
|
6828
|
-
const resolvedSeedanceRefs = state && seedanceReferenceCount > 0 ? isAvatarModelId(effectiveVideoModel) ? await resolveAvatarReferenceIds(seedanceRefs, ctx, referenceDeps, state) : await resolveSeedanceReferenceIds(seedanceRefs, ctx, referenceDeps, state) : {
|
|
7090
|
+
const resolvedSeedanceRefs = state && seedanceReferenceCount > 0 ? isAvatarModelId(effectiveVideoModel) ? await resolveAvatarReferenceIds(seedanceRefs, ctx, referenceDeps, state) : await resolveSeedanceReferenceIds(seedanceRefs, seedanceCapability, ctx, referenceDeps, state) : {
|
|
6829
7091
|
refs: [],
|
|
6830
7092
|
ids: []
|
|
6831
7093
|
};
|
|
@@ -6835,6 +7097,24 @@ async function executeGenerate(parsed, ctx, client, deps, mediaKind, followOptio
|
|
|
6835
7097
|
const imageOptions = parseImageGenerationOptions(parsed, mediaKind);
|
|
6836
7098
|
const audioModelOptions = parseAudioGenerationOptions(parsed, mediaKind);
|
|
6837
7099
|
const videoAudioOptions = parseVideoAudioOptions(parsed, mediaKind);
|
|
7100
|
+
const provider = parseGenerationProviderOption(parsed, mediaKind, effectiveVideoModel);
|
|
7101
|
+
if (effectiveVideoModel === "creatify-aurora") {
|
|
7102
|
+
const providerError = getAuroraProviderCompatibilityError(provider, prompt);
|
|
7103
|
+
if (providerError) throw new Error(providerError);
|
|
7104
|
+
}
|
|
7105
|
+
if (seedanceCapability) {
|
|
7106
|
+
const providerError = getSeedanceProviderCompatibilityError(seedanceCapability, provider, {
|
|
7107
|
+
resolution: videoOptions.videoResolution,
|
|
7108
|
+
bitrateMode: videoOptions.seedanceBitrateMode
|
|
7109
|
+
});
|
|
7110
|
+
if (providerError) throw new Error(providerError);
|
|
7111
|
+
}
|
|
7112
|
+
const veoProviderError = getVeoProviderCompatibilityError(effectiveVideoModel, videoOptions.videoTier, provider, {
|
|
7113
|
+
resolution: videoOptions.videoResolution,
|
|
7114
|
+
referenceCount: referenceVariantIds.length,
|
|
7115
|
+
durationSeconds: videoOptions.videoDurationSeconds
|
|
7116
|
+
});
|
|
7117
|
+
if (veoProviderError) throw new Error(veoProviderError);
|
|
6838
7118
|
const collectionPlacement = parseCollectionPlacementOptions(parsed);
|
|
6839
7119
|
const followCommandOptions = {
|
|
6840
7120
|
...followOptions,
|
|
@@ -6858,6 +7138,7 @@ async function executeGenerate(parsed, ctx, client, deps, mediaKind, followOptio
|
|
|
6858
7138
|
...musicProvider ? { musicProvider } : {},
|
|
6859
7139
|
...videoAudioOptions,
|
|
6860
7140
|
...videoOptions,
|
|
7141
|
+
...provider ? { provider } : {},
|
|
6861
7142
|
onStarted: (started) => {
|
|
6862
7143
|
startedVariantRef = compactStartedVariantRef(started);
|
|
6863
7144
|
}
|
|
@@ -7010,12 +7291,12 @@ async function resolveAvatarReferenceIds(options, ctx, deps, state) {
|
|
|
7010
7291
|
ids: [...imageIds, ...audioIds]
|
|
7011
7292
|
};
|
|
7012
7293
|
}
|
|
7013
|
-
async function resolveSeedanceReferenceIds(options, ctx, deps, state, implicitVideoReferenceIds = []) {
|
|
7294
|
+
async function resolveSeedanceReferenceIds(options, capability, ctx, deps, state, implicitVideoReferenceIds = []) {
|
|
7014
7295
|
await preflightLocalSeedanceReferences({
|
|
7015
7296
|
...options,
|
|
7016
7297
|
videoRefs: [...implicitVideoReferenceIds, ...options.videoRefs]
|
|
7017
|
-
}, deps, state);
|
|
7018
|
-
const resolve = (refs, kind) => resolveReferenceVariantIds(refs, ctx, deps, state.variants, "video", state.assets, kind);
|
|
7298
|
+
}, deps, state, capability);
|
|
7299
|
+
const resolve = (refs, kind) => resolveReferenceVariantIds(refs, ctx, deps, state.variants, "video", state.assets, kind, capability);
|
|
7019
7300
|
const imageIds = await resolve(options.imageRefs, "image");
|
|
7020
7301
|
const videoIds = await resolve(options.videoRefs, "video");
|
|
7021
7302
|
const audioIds = await resolve(options.audioRefs, "audio");
|
|
@@ -7032,7 +7313,7 @@ async function resolveSeedanceReferenceIds(options, ctx, deps, state, implicitVi
|
|
|
7032
7313
|
]
|
|
7033
7314
|
};
|
|
7034
7315
|
}
|
|
7035
|
-
async function preflightLocalSeedanceReferences(options, deps, state) {
|
|
7316
|
+
async function preflightLocalSeedanceReferences(options, deps, state, capability = SEEDANCE_2_CAPABILITIES["seedance-2-reference"]) {
|
|
7036
7317
|
if (!deps.inspectLocalReference) return;
|
|
7037
7318
|
const inspections = {
|
|
7038
7319
|
image: [],
|
|
@@ -7044,7 +7325,7 @@ async function preflightLocalSeedanceReferences(options, deps, state) {
|
|
|
7044
7325
|
["video", options.videoRefs],
|
|
7045
7326
|
["audio", options.audioRefs]
|
|
7046
7327
|
]) {
|
|
7047
|
-
const rule =
|
|
7328
|
+
const rule = capability.references.find((candidate) => candidate.mediaKind === mediaKind);
|
|
7048
7329
|
for (const ref of refs) {
|
|
7049
7330
|
const isLocal = await deps.fileExists(ref);
|
|
7050
7331
|
let inspection;
|
|
@@ -7054,7 +7335,7 @@ async function preflightLocalSeedanceReferences(options, deps, state) {
|
|
|
7054
7335
|
if (!state) continue;
|
|
7055
7336
|
const variants = state.variants;
|
|
7056
7337
|
const variantId = resolveVariantRef(ref, state.assets, variants);
|
|
7057
|
-
validateReferenceVariant(variantId, variants, "video", mediaKind);
|
|
7338
|
+
validateReferenceVariant(variantId, variants, "video", mediaKind, capability);
|
|
7058
7339
|
const variant = variants.find((candidate) => candidate.id === variantId);
|
|
7059
7340
|
inspection = {
|
|
7060
7341
|
mimeType: variant.media_mime_type ?? void 0,
|
|
@@ -7064,24 +7345,40 @@ async function preflightLocalSeedanceReferences(options, deps, state) {
|
|
|
7064
7345
|
durationMs: variant.media_duration_ms ?? void 0
|
|
7065
7346
|
};
|
|
7066
7347
|
}
|
|
7067
|
-
if (inspection.mimeType && !rule.acceptedMimeTypes.includes(inspection.mimeType)) throw new Error(
|
|
7068
|
-
if (inspection.sizeBytes > rule.maxBytesPerFile) throw new Error(
|
|
7348
|
+
if (inspection.mimeType && !rule.acceptedMimeTypes.includes(inspection.mimeType)) throw new Error(`${capability.familyLabel} does not accept ${inspection.mimeType} ${mediaKind} references`);
|
|
7349
|
+
if (inspection.sizeBytes > rule.maxBytesPerFile) throw new Error(`${capability.familyLabel} ${mediaKind} references must not exceed ${Math.floor(rule.maxBytesPerFile / (1024 * 1024))} MB`);
|
|
7350
|
+
if (mediaKind === "video" && rule.perFileDurationSeconds && inspection.durationMs !== void 0) {
|
|
7351
|
+
const seconds = inspection.durationMs / 1e3;
|
|
7352
|
+
if (seconds < rule.perFileDurationSeconds.min || seconds > rule.perFileDurationSeconds.max) throw new Error(`${capability.familyLabel} ${mediaKind} references must be ${rule.perFileDurationSeconds.min} to ${rule.perFileDurationSeconds.max} seconds each`);
|
|
7353
|
+
}
|
|
7069
7354
|
if (mediaKind === "video") {
|
|
7070
7355
|
if (isLocal && (!inspection.width || !inspection.height || !inspection.durationMs)) throw new Error(`Could not read Seedance video metadata before upload: ${ref}`);
|
|
7071
|
-
|
|
7072
|
-
|
|
7356
|
+
if (inspection.width !== void 0 && inspection.height !== void 0) {
|
|
7357
|
+
if (rule.dimensionRange) {
|
|
7358
|
+
const { min, max } = rule.dimensionRange;
|
|
7359
|
+
if (inspection.width < min || inspection.width > max || inspection.height < min || inspection.height > max) throw new Error(`${capability.familyLabel} reference video sides must be ${min} to ${max} pixels`);
|
|
7360
|
+
} else {
|
|
7361
|
+
const pixels = inspection.width * inspection.height;
|
|
7362
|
+
if (pixels < 640 * 640 || pixels > 834 * 1112) throw new Error(`${capability.familyLabel} video references must be approximately 480p to 720p`);
|
|
7363
|
+
}
|
|
7364
|
+
if (rule.aspectRatioRange) {
|
|
7365
|
+
const aspectRatio = inspection.width / inspection.height;
|
|
7366
|
+
if (aspectRatio < rule.aspectRatioRange.min || aspectRatio > rule.aspectRatioRange.max) throw new Error(`${capability.familyLabel} reference video aspect ratio is outside the supported range`);
|
|
7367
|
+
}
|
|
7368
|
+
}
|
|
7073
7369
|
}
|
|
7074
|
-
if (mediaKind === "audio" && isLocal && !inspection.durationMs) throw new Error(`Could not read Seedance audio duration before upload: ${ref}`);
|
|
7075
7370
|
inspections[mediaKind].push(inspection);
|
|
7076
7371
|
}
|
|
7077
7372
|
}
|
|
7373
|
+
const videoRule = capability.references.find((rule) => rule.mediaKind === "video");
|
|
7078
7374
|
const videoBytes = inspections.video.reduce((total, item) => total + item.sizeBytes, 0);
|
|
7079
7375
|
const videoDurationMs = inspections.video.reduce((total, item) => total + (item.durationMs ?? 0), 0);
|
|
7080
|
-
if (
|
|
7376
|
+
if (videoRule?.combinedMaxBytes !== void 0 && videoBytes >= videoRule.combinedMaxBytes) throw new Error(`${capability.familyLabel} reference videos exceed their combined file-size limit`);
|
|
7081
7377
|
const hasCompleteVideoDurations = inspections.video.every((item) => item.durationMs !== void 0);
|
|
7082
|
-
|
|
7378
|
+
const videoDurationRange = videoRule?.combinedDurationSeconds;
|
|
7379
|
+
if (inspections.video.length > 0 && hasCompleteVideoDurations && videoDurationRange && (videoDurationMs < (videoDurationRange.min ?? 0) * 1e3 || videoDurationMs > videoDurationRange.max * 1e3)) throw new Error(`${capability.familyLabel} reference videos exceed their combined duration limit`);
|
|
7083
7380
|
}
|
|
7084
|
-
async function resolveReferenceVariantIds(refs, ctx, deps, variants = [], mediaKind = CLI_GENERATION_MEDIA_KIND, assets = [], expectedReferenceMediaKind) {
|
|
7381
|
+
async function resolveReferenceVariantIds(refs, ctx, deps, variants = [], mediaKind = CLI_GENERATION_MEDIA_KIND, assets = [], expectedReferenceMediaKind, seedanceCapability = SEEDANCE_2_CAPABILITIES["seedance-2-reference"]) {
|
|
7085
7382
|
const variantIds = [];
|
|
7086
7383
|
const resolvedVariants = [...variants];
|
|
7087
7384
|
for (const ref of refs) {
|
|
@@ -7103,7 +7400,7 @@ async function resolveReferenceVariantIds(refs, ctx, deps, variants = [], mediaK
|
|
|
7103
7400
|
if (!deps.waitForReferenceVariant) throw new Error(`Reference upload is still processing: ${mirroredVariant.id}`);
|
|
7104
7401
|
resolvedVariants[mirroredVariantIndex] = await deps.waitForReferenceVariant(mirroredVariant);
|
|
7105
7402
|
}
|
|
7106
|
-
validateReferenceVariant(mirror.digestEntry.variantId, resolvedVariants, mediaKind, expectedReferenceMediaKind);
|
|
7403
|
+
validateReferenceVariant(mirror.digestEntry.variantId, resolvedVariants, mediaKind, expectedReferenceMediaKind, seedanceCapability);
|
|
7107
7404
|
await recordReusedReferenceMirror({
|
|
7108
7405
|
ref,
|
|
7109
7406
|
ctx,
|
|
@@ -7135,7 +7432,7 @@ async function resolveReferenceVariantIds(refs, ctx, deps, variants = [], mediaK
|
|
|
7135
7432
|
};
|
|
7136
7433
|
}
|
|
7137
7434
|
resolvedVariants.push(uploaded.variant);
|
|
7138
|
-
validateReferenceVariant(uploaded.variant.id, resolvedVariants, mediaKind, expectedReferenceMediaKind);
|
|
7435
|
+
validateReferenceVariant(uploaded.variant.id, resolvedVariants, mediaKind, expectedReferenceMediaKind, seedanceCapability);
|
|
7139
7436
|
if (deps.recordMirrorForFile) await recordUploadedReferenceMirror({
|
|
7140
7437
|
ref,
|
|
7141
7438
|
ctx,
|
|
@@ -7148,7 +7445,7 @@ async function resolveReferenceVariantIds(refs, ctx, deps, variants = [], mediaK
|
|
|
7148
7445
|
}
|
|
7149
7446
|
if (looksLikeFilePath(ref)) throw new Error(`Reference file not found: ${ref}`);
|
|
7150
7447
|
const variantId = resolveVariantRef(ref, assets, resolvedVariants);
|
|
7151
|
-
validateReferenceVariant(variantId, resolvedVariants, mediaKind, expectedReferenceMediaKind);
|
|
7448
|
+
validateReferenceVariant(variantId, resolvedVariants, mediaKind, expectedReferenceMediaKind, seedanceCapability);
|
|
7152
7449
|
variantIds.push(variantId);
|
|
7153
7450
|
}
|
|
7154
7451
|
return variantIds;
|
|
@@ -7215,7 +7512,7 @@ async function recordUploadedReferenceMirror(input) {
|
|
|
7215
7512
|
console.warn(`Warning: reference upload succeeded but mirror registry was not updated: ${error instanceof Error ? error.message : String(error)}`);
|
|
7216
7513
|
}
|
|
7217
7514
|
}
|
|
7218
|
-
function validateReferenceVariant(ref, variants, mediaKind, expectedReferenceMediaKind) {
|
|
7515
|
+
function validateReferenceVariant(ref, variants, mediaKind, expectedReferenceMediaKind, seedanceCapability = SEEDANCE_2_CAPABILITIES["seedance-2-reference"]) {
|
|
7219
7516
|
const variant = variants.find((candidate) => candidate.id === ref);
|
|
7220
7517
|
if (!variant) throw new Error(`Reference variant not found in space sync state: ${ref}`);
|
|
7221
7518
|
if (variant.status !== "completed") throw new Error(`Reference variant is not completed: ${ref}`);
|
|
@@ -7224,10 +7521,10 @@ function validateReferenceVariant(ref, variants, mediaKind, expectedReferenceMed
|
|
|
7224
7521
|
if (expectedReferenceMediaKind) {
|
|
7225
7522
|
if (expectedReferenceMediaKind === "image" && !variant.image_key) throw new Error(`Reference variant has no image: ${ref}`);
|
|
7226
7523
|
if (expectedReferenceMediaKind !== "image" && !variant.media_key) throw new Error(`Reference variant has no ${expectedReferenceMediaKind} media: ${ref}`);
|
|
7227
|
-
const rule =
|
|
7524
|
+
const rule = seedanceCapability.references.find((candidate) => candidate.mediaKind === expectedReferenceMediaKind);
|
|
7228
7525
|
const mimeType = variant.media_mime_type;
|
|
7229
|
-
if (rule && mimeType && !rule.acceptedMimeTypes.includes(mimeType)) throw new Error(
|
|
7230
|
-
if (rule && variant.media_size_bytes && variant.media_size_bytes > rule.maxBytesPerFile) throw new Error(
|
|
7526
|
+
if (rule && mimeType && !rule.acceptedMimeTypes.includes(mimeType)) throw new Error(`${seedanceCapability.familyLabel} does not accept ${mimeType} ${expectedReferenceMediaKind} references`);
|
|
7527
|
+
if (rule && variant.media_size_bytes && variant.media_size_bytes > rule.maxBytesPerFile) throw new Error(`${seedanceCapability.familyLabel} ${expectedReferenceMediaKind} references must not exceed ${Math.floor(rule.maxBytesPerFile / (1024 * 1024))} MB`);
|
|
7231
7528
|
return;
|
|
7232
7529
|
}
|
|
7233
7530
|
if (mediaKind === "image" && !variant.image_key) throw new Error(`Reference variant has no image: ${ref}`);
|
|
@@ -7359,10 +7656,12 @@ function parseVideoGenerationOptions(parsed, mediaKind) {
|
|
|
7359
7656
|
const tierValue = readOptionalOption(parsed, "tier");
|
|
7360
7657
|
const bitrateValue = readOptionalOption(parsed, "bitrate");
|
|
7361
7658
|
const modeValue = readOptionalOption(parsed, "mode");
|
|
7659
|
+
const guidanceScaleValue = readOptionalOption(parsed, "guidance-scale");
|
|
7660
|
+
const audioGuidanceScaleValue = readOptionalOption(parsed, "audio-guidance-scale");
|
|
7362
7661
|
const modelValue = mediaKind === "video" ? readOptionalOption(parsed, "model") : void 0;
|
|
7363
7662
|
const aspectValue = mediaKind === "video" ? readOptionalOption(parsed, "aspect") : void 0;
|
|
7364
|
-
if (mediaKind !== "video" && resolutionValue === void 0 && durationValue === void 0 && tierValue === void 0 && aspectValue === void 0 && bitrateValue === void 0) return {};
|
|
7365
|
-
if (mediaKind !== "video") throw new Error("
|
|
7663
|
+
if (mediaKind !== "video" && resolutionValue === void 0 && durationValue === void 0 && tierValue === void 0 && aspectValue === void 0 && bitrateValue === void 0 && modeValue === void 0 && guidanceScaleValue === void 0 && audioGuidanceScaleValue === void 0) return {};
|
|
7664
|
+
if (mediaKind !== "video") throw new Error("Video model controls are only supported for video generation");
|
|
7366
7665
|
const videoResolution = resolutionValue === void 0 ? void 0 : normalizeVideoGenerationResolution(resolutionValue);
|
|
7367
7666
|
if (resolutionValue !== void 0 && !videoResolution) throw new Error("--resolution must be 480p, 720p, 1080p, or 4k");
|
|
7368
7667
|
const videoTier = tierValue === void 0 ? void 0 : normalizeVideoGenerationTier(tierValue);
|
|
@@ -7371,18 +7670,41 @@ function parseVideoGenerationOptions(parsed, mediaKind) {
|
|
|
7371
7670
|
if (isAvatarModelId(model)) {
|
|
7372
7671
|
if (parsed.options.refs !== void 0 || parsed.options["first-frame"] !== void 0 || parsed.options["last-frame"] !== void 0) throw new Error("Avatar models accept only --image-refs and --audio-refs");
|
|
7373
7672
|
if (aspectValue !== void 0 || durationValue !== void 0 || tierValue !== void 0 || bitrateValue !== void 0 || parsed.options.audio !== void 0 || parsed.options["no-audio"] !== void 0) throw new Error("Avatar models do not accept --aspect, --duration, --tier, --bitrate, --audio, or --no-audio");
|
|
7374
|
-
if (
|
|
7375
|
-
|
|
7673
|
+
if (model === "kling-avatar-v2") {
|
|
7674
|
+
if (parsed.options.provider !== void 0) throw new Error("Kling Avatar V2 does not accept --provider");
|
|
7675
|
+
if (resolutionValue !== void 0 || guidanceScaleValue !== void 0 || audioGuidanceScaleValue !== void 0) throw new Error("Aurora controls are not supported by --model kling-avatar-v2");
|
|
7676
|
+
if (modeValue !== void 0 && !isAvatarMode(modeValue)) throw new Error(`--mode must be ${AVATAR_MODES.join(" or ")}`);
|
|
7677
|
+
return {
|
|
7678
|
+
model,
|
|
7679
|
+
...modeValue ? { avatarMode: modeValue } : {}
|
|
7680
|
+
};
|
|
7681
|
+
}
|
|
7682
|
+
if (modeValue !== void 0) throw new Error("--mode is only supported by --model kling-avatar-v2");
|
|
7683
|
+
if (resolutionValue !== void 0 && !isAuroraAvatarResolution(resolutionValue)) throw new Error("--model creatify-aurora supports --resolution 480p or 720p; 1080p is not supported");
|
|
7684
|
+
const parseGuidance = (value, option) => {
|
|
7685
|
+
if (value === void 0) return void 0;
|
|
7686
|
+
const parsedValue = Number(value);
|
|
7687
|
+
if (!Number.isFinite(parsedValue) || parsedValue < 0 || parsedValue > 5) throw new Error(`${option} must be a number between 0 and 5`);
|
|
7688
|
+
return parsedValue;
|
|
7689
|
+
};
|
|
7690
|
+
const avatarGuidanceScale = parseGuidance(guidanceScaleValue, "--guidance-scale");
|
|
7691
|
+
const avatarAudioGuidanceScale = parseGuidance(audioGuidanceScaleValue, "--audio-guidance-scale");
|
|
7376
7692
|
return {
|
|
7377
7693
|
model,
|
|
7378
|
-
...
|
|
7694
|
+
...resolutionValue ? { avatarResolution: resolutionValue } : {},
|
|
7695
|
+
...avatarGuidanceScale !== void 0 ? { avatarGuidanceScale } : {},
|
|
7696
|
+
...avatarAudioGuidanceScale !== void 0 ? { avatarAudioGuidanceScale } : {}
|
|
7379
7697
|
};
|
|
7380
7698
|
}
|
|
7381
7699
|
if (modeValue !== void 0) throw new Error("--mode is only supported by --model kling-avatar-v2");
|
|
7700
|
+
if (guidanceScaleValue !== void 0 || audioGuidanceScaleValue !== void 0) throw new Error("--guidance-scale and --audio-guidance-scale require --model creatify-aurora");
|
|
7382
7701
|
const seedanceCapability = getSeedance2CapabilityByEndpoint(model);
|
|
7383
|
-
const seedanceDuration = durationValue === void 0 ? void 0 :
|
|
7702
|
+
const seedanceDuration = durationValue === void 0 ? void 0 : seedanceCapability ? normalizeSeedanceDuration(durationValue, model) : void 0;
|
|
7384
7703
|
const videoDurationSeconds = durationValue === void 0 || durationValue === "auto" ? void 0 : normalizeVideoGenerationDurationSeconds(durationValue);
|
|
7385
|
-
if (durationValue !== void 0 && seedanceDuration === void 0)
|
|
7704
|
+
if (seedanceCapability && durationValue !== void 0 && seedanceDuration === void 0) {
|
|
7705
|
+
const numericDurations = seedanceCapability.durations.filter((value) => typeof value === "number");
|
|
7706
|
+
throw new Error(`--duration must be auto or an integer from ${numericDurations[0]} to ${numericDurations.at(-1)}`);
|
|
7707
|
+
}
|
|
7386
7708
|
if (!seedanceCapability && durationValue === "auto") throw new Error("--duration auto is only supported by Seedance 2");
|
|
7387
7709
|
if (isGeminiOmniVideoGenerationModel(model) && (resolutionValue !== void 0 || durationValue !== void 0 || tierValue !== void 0)) throw new Error("--resolution, --duration, and --tier are only supported with --model veo-3.1");
|
|
7388
7710
|
if ((isKlingVideoGenerationModel(model) || isFalVideoGenerationModel(model)) && tierValue !== void 0) throw new Error("--tier is only supported with --model veo-3.1");
|
|
@@ -7393,10 +7715,10 @@ function parseVideoGenerationOptions(parsed, mediaKind) {
|
|
|
7393
7715
|
6,
|
|
7394
7716
|
8
|
|
7395
7717
|
].includes(videoDurationSeconds)) throw new Error("--duration must be 4, 6, or 8 for this model");
|
|
7396
|
-
const aspectRatio = aspectValue === void 0 ? void 0 : seedanceCapability
|
|
7397
|
-
if (aspectValue !== void 0 && !aspectRatio) throw new Error(seedanceCapability ?
|
|
7718
|
+
const aspectRatio = aspectValue === void 0 ? void 0 : seedanceCapability ? seedanceCapability.aspectRatios.includes(aspectValue) ? aspectValue : void 0 : normalizeVideoGenerationAspectRatio(aspectValue);
|
|
7719
|
+
if (aspectValue !== void 0 && !aspectRatio) throw new Error(seedanceCapability ? `--aspect must be one of: ${seedanceCapability.aspectRatios.join(", ")}` : "--aspect must be 16:9 or 9:16");
|
|
7398
7720
|
const seedanceBitrateMode = bitrateValue;
|
|
7399
|
-
if (bitrateValue !== void 0 && (!seedanceCapability || !seedanceCapability.bitrateModes.includes(seedanceBitrateMode))) throw new Error("--bitrate standard|high is only supported by Seedance 2");
|
|
7721
|
+
if (bitrateValue !== void 0 && (!seedanceCapability || !seedanceCapability.bitrateModes.includes(seedanceBitrateMode))) throw new Error(seedanceCapability ? `${seedanceCapability.familyLabel} does not accept --bitrate` : "--bitrate standard|high is only supported by Seedance 2");
|
|
7400
7722
|
return {
|
|
7401
7723
|
model,
|
|
7402
7724
|
...aspectRatio ? { aspectRatio } : {},
|
|
@@ -7407,6 +7729,14 @@ function parseVideoGenerationOptions(parsed, mediaKind) {
|
|
|
7407
7729
|
...seedanceBitrateMode ? { seedanceBitrateMode } : {}
|
|
7408
7730
|
};
|
|
7409
7731
|
}
|
|
7732
|
+
function parseGenerationProviderOption(parsed, mediaKind, videoModel) {
|
|
7733
|
+
const value = readOptionalOption(parsed, "provider");
|
|
7734
|
+
if (value === void 0) return void 0;
|
|
7735
|
+
if (!GENERATION_ROUTING_PROVIDERS.includes(value)) throw new Error(`--provider must be one of: ${GENERATION_ROUTING_PROVIDERS.join(", ")}`);
|
|
7736
|
+
if (mediaKind === "audio") throw new Error("--provider is supported only for routable image and video models");
|
|
7737
|
+
if (videoModel === "kling-avatar-v2") throw new Error("Kling Avatar V2 does not accept --provider");
|
|
7738
|
+
return value;
|
|
7739
|
+
}
|
|
7410
7740
|
function parseVideoFrameReferenceOptions(parsed, command, mediaKind) {
|
|
7411
7741
|
validateVideoFrameReferenceOptions(command, parsed, mediaKind);
|
|
7412
7742
|
const firstFrame = readVideoFrameOption(parsed, "first-frame");
|
|
@@ -7459,6 +7789,8 @@ function parseImageGenerationOptions(parsed, mediaKind) {
|
|
|
7459
7789
|
const model = parseImageModelOption(readOptionalOption(parsed, "model"));
|
|
7460
7790
|
const imageSize = parseImageSizeOption(readOptionalOption(parsed, "size"));
|
|
7461
7791
|
const aspectRatio = parseImageAspectRatioOption(readOptionalOption(parsed, "aspect"));
|
|
7792
|
+
const imageQuality = parseImageQualityOption(readOptionalOption(parsed, "quality"));
|
|
7793
|
+
const imageSeed = parseImageSeedOption(readOptionalOption(parsed, "seed"));
|
|
7462
7794
|
if (imageSize && !isImageSizeSupportedByModel(model, imageSize)) {
|
|
7463
7795
|
const supportedSizes = getImageModelCapabilities(model).supportedImageSizes.join(", ");
|
|
7464
7796
|
throw new Error(`--model ${model ?? "pro"} supports only --size ${supportedSizes}`);
|
|
@@ -7467,9 +7799,16 @@ function parseImageGenerationOptions(parsed, mediaKind) {
|
|
|
7467
7799
|
const supportedAspectRatios = getImageModelCapabilities(model).supportedAspectRatios.join(", ");
|
|
7468
7800
|
throw new Error(`--model ${model ?? "pro"} supports only --aspect ${supportedAspectRatios}`);
|
|
7469
7801
|
}
|
|
7802
|
+
if (imageQuality && !isImageQualitySupportedByModel(model ?? "pro", imageQuality)) {
|
|
7803
|
+
const supported = getImageModelCapabilities(model).supportedQualities.join(", ");
|
|
7804
|
+
throw new Error(`--model ${model ?? "pro"} supports ${supported ? `only --quality ${supported}` : "no --quality option"}`);
|
|
7805
|
+
}
|
|
7806
|
+
if (imageSeed !== void 0 && !isImageSeedSupportedByModel(model ?? "pro")) throw new Error(`--model ${model ?? "pro"} does not support --seed`);
|
|
7470
7807
|
return {
|
|
7471
7808
|
...model ? { model } : {},
|
|
7472
7809
|
...imageSize ? { imageSize } : {},
|
|
7810
|
+
...imageQuality ? { imageQuality } : {},
|
|
7811
|
+
...imageSeed !== void 0 ? { imageSeed } : {},
|
|
7473
7812
|
...aspectRatio ? { aspectRatio } : {}
|
|
7474
7813
|
};
|
|
7475
7814
|
}
|
|
@@ -7478,26 +7817,40 @@ function parseVideoModelOption(value, tier, parsed) {
|
|
|
7478
7817
|
const effectiveTier = tier ?? "generate";
|
|
7479
7818
|
if (!normalized) return getVideoGenerationModelForSelection(DEFAULT_VIDEO_MODEL_SELECTION, effectiveTier);
|
|
7480
7819
|
if (isAvatarModelId(normalized)) return normalized;
|
|
7481
|
-
if (normalized === "seedance-2" || normalized === "seedance-2-fast") {
|
|
7820
|
+
if (normalized === "seedance-2" || normalized === "seedance-2-fast" || normalized === "seedance-2.5") {
|
|
7482
7821
|
const hasFrames = Boolean(parsed?.options["first-frame"] || parsed?.options["last-frame"]);
|
|
7483
7822
|
const hasReferences = Boolean(parsed?.options.refs || parsed?.options["image-refs"] || parsed?.options["video-refs"] || parsed?.options["audio-refs"]);
|
|
7484
|
-
return SEEDANCE_2_CAPABILITIES[`${normalized
|
|
7823
|
+
return SEEDANCE_2_CAPABILITIES[`${normalized}-${hasFrames ? "frame" : hasReferences ? "reference" : "text"}`].endpointId;
|
|
7485
7824
|
}
|
|
7486
7825
|
const selection = normalizeVideoModelSelection(normalized === "seedance-1" ? "fal-seedance" : normalized);
|
|
7487
7826
|
if (selection) return getVideoGenerationModelForSelection(selection, effectiveTier);
|
|
7488
|
-
throw new Error("--model must be veo-3.1, omni-flash, kling, seedance-1, seedance-2, seedance-2-fast,
|
|
7827
|
+
throw new Error("--model must be veo-3.1, omni-flash, kling, seedance-1, seedance-2, seedance-2-fast, seedance-2.5, kling-avatar-v2, or creatify-aurora");
|
|
7489
7828
|
}
|
|
7490
7829
|
function parseImageModelOption(value) {
|
|
7491
7830
|
if (!value) return void 0;
|
|
7492
7831
|
if (isImageModelSelection(value)) return value;
|
|
7493
|
-
throw new Error(
|
|
7832
|
+
throw new Error(`--model must be one of: ${IMAGE_MODEL_SELECTIONS.join(", ")}`);
|
|
7494
7833
|
}
|
|
7495
7834
|
function parseImageSizeOption(value) {
|
|
7496
7835
|
if (!value) return void 0;
|
|
7497
7836
|
const normalized = normalizeImageSize(value);
|
|
7498
|
-
if (!normalized) throw new Error("--size must be 1K, 2K, or 4K");
|
|
7837
|
+
if (!normalized) throw new Error("--size must be 1K, 2K, 3K, or 4K");
|
|
7499
7838
|
return normalized;
|
|
7500
7839
|
}
|
|
7840
|
+
function parseImageQualityOption(value) {
|
|
7841
|
+
const normalized = normalizeCliOption(value);
|
|
7842
|
+
if (!normalized) return void 0;
|
|
7843
|
+
const quality = normalizeImageQuality(normalized);
|
|
7844
|
+
if (!quality) throw new Error("--quality must be low, medium, or high");
|
|
7845
|
+
return quality;
|
|
7846
|
+
}
|
|
7847
|
+
function parseImageSeedOption(value) {
|
|
7848
|
+
const normalized = normalizeCliOption(value);
|
|
7849
|
+
if (!normalized) return void 0;
|
|
7850
|
+
const seed = Number(normalized);
|
|
7851
|
+
if (!Number.isSafeInteger(seed)) throw new Error("--seed must be a safe integer");
|
|
7852
|
+
return seed;
|
|
7853
|
+
}
|
|
7501
7854
|
function parseImageAspectRatioOption(value) {
|
|
7502
7855
|
if (!value) return void 0;
|
|
7503
7856
|
if (!isImageAspectRatio(value)) {
|
|
@@ -7555,7 +7908,7 @@ function cliImageModelValues(command) {
|
|
|
7555
7908
|
function printUsage$6(command) {
|
|
7556
7909
|
console.log(`
|
|
7557
7910
|
Usage:
|
|
7558
|
-
makefx image generate "prompt" --name <name> --type <type> -o <file> [--model ${cliImageModelValues(command)}] [--refs <variant-ref-or-file,...>] [--size ${cliImageSizeValues()}] [--aspect ${cliImageAspectValues()}] [--collection <id>] [--space <id>]
|
|
7911
|
+
makefx image generate "prompt" --name <name> --type <type> -o <file> [--model ${cliImageModelValues(command)}] [--refs <variant-ref-or-file,...>] [--size ${cliImageSizeValues()}] [--quality low|medium|high] [--seed <integer>] [--aspect ${cliImageAspectValues()}] [--collection <id>] [--space <id>]
|
|
7559
7912
|
`);
|
|
7560
7913
|
}
|
|
7561
7914
|
//#endregion
|
|
@@ -7657,6 +8010,9 @@ function buildRegenerationBody(mediaKind, parsed, referenceVariantIds, audioMode
|
|
|
7657
8010
|
const params = {};
|
|
7658
8011
|
let duration;
|
|
7659
8012
|
let modelProvider;
|
|
8013
|
+
const provider = parsed.options.provider;
|
|
8014
|
+
if (provider !== void 0 && !GENERATION_ROUTING_PROVIDERS.includes(provider)) throw new Error(`--provider must be one of: ${GENERATION_ROUTING_PROVIDERS.join(", ")}`);
|
|
8015
|
+
if (provider !== void 0 && mediaKind === "audio") throw new Error("--provider is supported only for routable image and video models");
|
|
7660
8016
|
if (mediaKind === "image") {
|
|
7661
8017
|
if (model) {
|
|
7662
8018
|
if (!isImageModelSelection(model)) throw new Error(`Unsupported image model: ${model}`);
|
|
@@ -7664,6 +8020,8 @@ function buildRegenerationBody(mediaKind, parsed, referenceVariantIds, audioMode
|
|
|
7664
8020
|
}
|
|
7665
8021
|
if (parsed.options.aspect) params.aspectRatio = parsed.options.aspect;
|
|
7666
8022
|
if (parsed.options.size) params.imageSize = parsed.options.size;
|
|
8023
|
+
if (parsed.options.quality) params.imageQuality = parsed.options.quality;
|
|
8024
|
+
if (parsed.options.seed) params.imageSeed = parsed.options.seed === "random" ? null : parseInteger(parsed.options.seed, "--seed");
|
|
7667
8025
|
} else if (mediaKind === "video") {
|
|
7668
8026
|
if (parsed.options.aspect) params.aspectRatio = parsed.options.aspect;
|
|
7669
8027
|
if (parsed.options.resolution) params.videoResolution = parsed.options.resolution;
|
|
@@ -7685,6 +8043,7 @@ function buildRegenerationBody(mediaKind, parsed, referenceVariantIds, audioMode
|
|
|
7685
8043
|
...model && mediaKind === "video" ? { model: resolveVideoRegenerationModel(model, parsed, sourceRecipe) } : {},
|
|
7686
8044
|
...audioModel ? { model: audioModel } : {},
|
|
7687
8045
|
...modelProvider ? { modelProvider } : {},
|
|
8046
|
+
...provider ? { provider } : {},
|
|
7688
8047
|
...referenceVariantIds !== void 0 ? { referenceVariantIds } : {},
|
|
7689
8048
|
...Object.keys(params).length > 0 ? { params } : {},
|
|
7690
8049
|
...duration !== void 0 ? { duration } : {},
|
|
@@ -7693,21 +8052,26 @@ function buildRegenerationBody(mediaKind, parsed, referenceVariantIds, audioMode
|
|
|
7693
8052
|
}
|
|
7694
8053
|
function resolveVideoRegenerationModel(model, parsed, sourceRecipe) {
|
|
7695
8054
|
const tier = parsed.options.tier ?? "generate";
|
|
7696
|
-
if (model === "seedance-2" || model === "seedance-2-fast") {
|
|
8055
|
+
if (model === "seedance-2" || model === "seedance-2-fast" || model === "seedance-2.5") {
|
|
7697
8056
|
const referencesWereOverridden = [
|
|
7698
8057
|
"image-refs",
|
|
7699
8058
|
"video-refs",
|
|
7700
8059
|
"audio-refs"
|
|
7701
8060
|
].some((name) => parsed.options[name] !== void 0);
|
|
7702
8061
|
const storedRecipe = parseStoredRecipe$2(sourceRecipe);
|
|
8062
|
+
const effectiveReferences = referencesWereOverridden ? [
|
|
8063
|
+
...splitList(parsed.options["image-refs"]).map(() => ({ mediaKind: "image" })),
|
|
8064
|
+
...splitList(parsed.options["video-refs"]).map(() => ({ mediaKind: "video" })),
|
|
8065
|
+
...splitList(parsed.options["audio-refs"]).map(() => ({ mediaKind: "audio" }))
|
|
8066
|
+
] : storedRecipe?.references ?? [];
|
|
7703
8067
|
return getSeedance2RegenerationCapability(model, {
|
|
7704
8068
|
model: storedRecipe?.model,
|
|
7705
|
-
references:
|
|
8069
|
+
references: effectiveReferences,
|
|
7706
8070
|
authoritativeFrames: storedRecipe?.veoReferenceMode === "image-to-video" || storedRecipe?.veoReferenceMode === "first-last-frame"
|
|
7707
8071
|
}, referencesWereOverridden).endpointId;
|
|
7708
8072
|
}
|
|
7709
8073
|
const selection = normalizeVideoModelSelection(model === "seedance-1" ? "fal-seedance" : model);
|
|
7710
|
-
if (!selection) throw new Error("Unsupported video model. Expected veo-3.1, omni-flash, kling, seedance-1, seedance-2, or seedance-2
|
|
8074
|
+
if (!selection) throw new Error("Unsupported video model. Expected veo-3.1, omni-flash, kling, seedance-1, seedance-2, seedance-2-fast, or seedance-2.5");
|
|
7711
8075
|
return getVideoGenerationModelForSelection(selection, tier);
|
|
7712
8076
|
}
|
|
7713
8077
|
function parseStoredRecipe$2(recipe) {
|
|
@@ -8639,8 +9003,7 @@ async function executeSpaceLens(parsed, deps = defaultDeps$8) {
|
|
|
8639
9003
|
deps.print(parsed.options.json === "true" ? JSON.stringify(result, null, 2) : `Set the Space canvas lens to ${lens}`);
|
|
8640
9004
|
return result;
|
|
8641
9005
|
}
|
|
8642
|
-
|
|
8643
|
-
//#region src/shared/generatorCapabilities.ts
|
|
9006
|
+
IMAGE_MODEL_SELECTIONS.map((selection) => `image/${selection}`);
|
|
8644
9007
|
function input(name, type, required, description, options = {}) {
|
|
8645
9008
|
return {
|
|
8646
9009
|
name,
|
|
@@ -8673,8 +9036,13 @@ function imageGenerator(capability) {
|
|
|
8673
9036
|
}),
|
|
8674
9037
|
input("image_size", "string", false, "Output image size.", {
|
|
8675
9038
|
allowedValues: capability.supportedImageSizes,
|
|
8676
|
-
defaultValue:
|
|
8677
|
-
})
|
|
9039
|
+
defaultValue: capability.supportedImageSizes[0]
|
|
9040
|
+
}),
|
|
9041
|
+
...capability.supportedQualities.length ? [input("quality", "string", false, "Output rendering quality.", {
|
|
9042
|
+
allowedValues: capability.supportedQualities,
|
|
9043
|
+
defaultValue: "medium"
|
|
9044
|
+
})] : [],
|
|
9045
|
+
...capability.supportsSeed ? [input("seed", "integer", false, "Optional reproducible generation seed.")] : []
|
|
8678
9046
|
];
|
|
8679
9047
|
const operations = [{
|
|
8680
9048
|
operation: "generate",
|
|
@@ -8711,8 +9079,13 @@ function imageGenerator(capability) {
|
|
|
8711
9079
|
}),
|
|
8712
9080
|
input("image_size", "string", false, "Output image size.", {
|
|
8713
9081
|
allowedValues: capability.supportedImageSizes,
|
|
8714
|
-
defaultValue:
|
|
8715
|
-
})
|
|
9082
|
+
defaultValue: capability.supportedImageSizes[0]
|
|
9083
|
+
}),
|
|
9084
|
+
...capability.supportedQualities.length ? [input("quality", "string", false, "Output rendering quality.", {
|
|
9085
|
+
allowedValues: capability.supportedQualities,
|
|
9086
|
+
defaultValue: "medium"
|
|
9087
|
+
})] : [],
|
|
9088
|
+
...capability.supportsSeed ? [input("seed", "integer", false, "Optional reproducible generation seed.")] : []
|
|
8716
9089
|
]
|
|
8717
9090
|
});
|
|
8718
9091
|
return {
|
|
@@ -8810,7 +9183,8 @@ function videoGenerator(selection) {
|
|
|
8810
9183
|
};
|
|
8811
9184
|
}
|
|
8812
9185
|
function seedanceVideoGenerator(capability) {
|
|
8813
|
-
const fixedGenerator = fixedInput("generator_id", capability.generatorId,
|
|
9186
|
+
const fixedGenerator = fixedInput("generator_id", capability.generatorId, `Selects this exact ${capability.familyLabel} mode and tier.`);
|
|
9187
|
+
const numericDurations = capability.durations.filter((value) => typeof value === "number");
|
|
8814
9188
|
const parameters = [
|
|
8815
9189
|
input("aspect_ratio", "string", false, "Output aspect ratio; auto lets Seedance infer it.", {
|
|
8816
9190
|
allowedValues: capability.aspectRatios,
|
|
@@ -8820,19 +9194,19 @@ function seedanceVideoGenerator(capability) {
|
|
|
8820
9194
|
allowedValues: capability.resolutions,
|
|
8821
9195
|
defaultValue: capability.defaultResolution
|
|
8822
9196
|
}),
|
|
8823
|
-
input("duration", "string_or_integer", false,
|
|
9197
|
+
input("duration", "string_or_integer", false, `Output seconds from ${numericDurations[0]} to ${numericDurations.at(-1)}, or auto.`, {
|
|
8824
9198
|
allowedValues: capability.durations,
|
|
8825
9199
|
defaultValue: capability.defaultDuration
|
|
8826
9200
|
}),
|
|
8827
9201
|
input("generate_audio", "boolean", false, "Generate synchronized native audio.", {
|
|
8828
9202
|
allowedValues: [true, false],
|
|
8829
9203
|
defaultValue: capability.generateAudio.default
|
|
8830
|
-
}),
|
|
8831
|
-
input("bitrate_mode", "string", false, "Output bitrate quality.", {
|
|
8832
|
-
allowedValues: capability.bitrateModes,
|
|
8833
|
-
defaultValue: capability.defaultBitrateMode
|
|
8834
9204
|
})
|
|
8835
9205
|
];
|
|
9206
|
+
if (capability.bitrateModes.length > 0) parameters.push(input("bitrate_mode", "string", false, "Output bitrate quality.", {
|
|
9207
|
+
allowedValues: capability.bitrateModes,
|
|
9208
|
+
defaultValue: capability.defaultBitrateMode
|
|
9209
|
+
}));
|
|
8836
9210
|
const common = [
|
|
8837
9211
|
SPACE_INPUT,
|
|
8838
9212
|
fixedGenerator,
|
|
@@ -8842,18 +9216,21 @@ function seedanceVideoGenerator(capability) {
|
|
|
8842
9216
|
...parameters
|
|
8843
9217
|
];
|
|
8844
9218
|
const frameInputs = [input("start_frame_variant_ref", "string", true, "Completed image variant used as the authoritative first frame; cannot be combined with extended references."), input("end_frame_variant_ref", "string", false, "Completed image variant used as the authoritative final frame; cannot be combined with extended references.")];
|
|
9219
|
+
const referenceMax = (mediaKind) => capability.references.find((reference) => reference.mediaKind === mediaKind)?.maxCount ?? 0;
|
|
9220
|
+
const audioRule = capability.references.find((reference) => reference.mediaKind === "audio");
|
|
9221
|
+
const audioDurationContract = audioRule?.perFileDurationSeconds && audioRule.combinedDurationSeconds ? ` Provider contract: each clip ${audioRule.perFileDurationSeconds.min}-${audioRule.perFileDurationSeconds.max}s, ${audioRule.combinedDurationSeconds.max}s combined; MakeFX does not inspect audio duration.` : "";
|
|
8845
9222
|
const referenceInputs = [
|
|
8846
|
-
input("image_reference_variant_refs", "string_array", false,
|
|
9223
|
+
input("image_reference_variant_refs", "string_array", false, `Ordered completed images addressed as @Image1 through @Image${referenceMax("image")} for soft subject, style, or geography guidance; not authoritative boundary frames.`, {
|
|
8847
9224
|
minItems: 1,
|
|
8848
|
-
maxItems:
|
|
9225
|
+
maxItems: referenceMax("image")
|
|
8849
9226
|
}),
|
|
8850
|
-
input("video_reference_variant_refs", "string_array", false,
|
|
9227
|
+
input("video_reference_variant_refs", "string_array", false, `Ordered completed videos addressed as @Video1 through @Video${referenceMax("video")}.`, {
|
|
8851
9228
|
minItems: 1,
|
|
8852
|
-
maxItems:
|
|
9229
|
+
maxItems: referenceMax("video")
|
|
8853
9230
|
}),
|
|
8854
|
-
input("audio_reference_variant_refs", "string_array", false,
|
|
9231
|
+
input("audio_reference_variant_refs", "string_array", false, `Ordered completed audio clips addressed as @Audio1 through @Audio${referenceMax("audio")}.${audioDurationContract}`, {
|
|
8855
9232
|
minItems: 1,
|
|
8856
|
-
maxItems:
|
|
9233
|
+
maxItems: referenceMax("audio")
|
|
8857
9234
|
})
|
|
8858
9235
|
];
|
|
8859
9236
|
const modeInputs = capability.mode === "frame" ? frameInputs : capability.mode === "reference" ? referenceInputs : [];
|
|
@@ -8867,8 +9244,8 @@ function seedanceVideoGenerator(capability) {
|
|
|
8867
9244
|
const budget = getSeedance2ReferenceBudget(capability, "refine");
|
|
8868
9245
|
const editReferenceInputs = referenceInputs.map((referenceInput) => referenceInput.name === "video_reference_variant_refs" ? {
|
|
8869
9246
|
...referenceInput,
|
|
8870
|
-
maxItems:
|
|
8871
|
-
description:
|
|
9247
|
+
maxItems: budget.maxAdditionalByKind.video,
|
|
9248
|
+
description: `Up to ${budget.maxAdditionalByKind.video} additional completed videos addressed from @Video2; the source video is @Video1.`
|
|
8872
9249
|
} : referenceInput);
|
|
8873
9250
|
operations.push({
|
|
8874
9251
|
operation: "refine",
|
|
@@ -8917,19 +9294,35 @@ function seedanceVideoGenerator(capability) {
|
|
|
8917
9294
|
notes: [
|
|
8918
9295
|
"Use compact variant references; binary media input is not accepted.",
|
|
8919
9296
|
capability.mode === "reference" ? "Prompt labels are modality-specific and one-based: @ImageN, @VideoN, and @AudioN. @ImageN guides content, style, or geography but is not an authoritative start/end frame." : capability.mode === "frame" ? "The start and end images are authoritative boundary frames. The provider does not allow extended image, video, or audio references in this mode." : "This mode rejects all reference inputs.",
|
|
8920
|
-
|
|
8921
|
-
capability.resolutions.includes("4k") ? "Standard supports 480p, 720p, 1080p, and 4K output." : "Fast supports 480p and 720p output."
|
|
9297
|
+
`${capability.familyLabel} cannot combine authoritative start/end frames with extended multimodal references in one request.`,
|
|
9298
|
+
capability.family === "seedance-2.5" ? "Seedance 2.5 supports 480p, 720p, and 1080p output; 4K is not exposed by the provider." : capability.resolutions.includes("4k") ? "Standard supports 480p, 720p, 1080p, and 4K output." : "Fast supports 480p and 720p output."
|
|
8922
9299
|
]
|
|
8923
9300
|
};
|
|
8924
9301
|
}
|
|
8925
9302
|
function avatarVideoGenerator(model) {
|
|
8926
|
-
const
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
9303
|
+
const capability = getAvatarModelCapabilities(model);
|
|
9304
|
+
const parameters = capability.model === "kling-avatar-v2" ? [input("mode", "string", false, "Generation quality.", {
|
|
9305
|
+
allowedValues: capability.modes,
|
|
9306
|
+
defaultValue: capability.defaultMode
|
|
9307
|
+
})] : [
|
|
9308
|
+
input("resolution", "string", false, "Output resolution.", {
|
|
9309
|
+
allowedValues: capability.resolutions,
|
|
9310
|
+
defaultValue: capability.defaultResolution
|
|
9311
|
+
}),
|
|
9312
|
+
input("guidance_scale", "number", false, "Strength of visual prompt guidance.", {
|
|
9313
|
+
defaultValue: capability.guidanceScale.default,
|
|
9314
|
+
minimum: capability.guidanceScale.min,
|
|
9315
|
+
maximum: capability.guidanceScale.max
|
|
9316
|
+
}),
|
|
9317
|
+
input("audio_guidance_scale", "number", false, "Strength of audio-driven motion guidance.", {
|
|
9318
|
+
defaultValue: capability.audioGuidanceScale.default,
|
|
9319
|
+
minimum: capability.audioGuidanceScale.min,
|
|
9320
|
+
maximum: capability.audioGuidanceScale.max
|
|
9321
|
+
})
|
|
9322
|
+
];
|
|
8930
9323
|
return {
|
|
8931
9324
|
id: `video/${model}`,
|
|
8932
|
-
label:
|
|
9325
|
+
label: capability.label,
|
|
8933
9326
|
mediaKind: "video",
|
|
8934
9327
|
modelIds: [model],
|
|
8935
9328
|
defaultModelId: model,
|
|
@@ -8985,7 +9378,7 @@ function avatarVideoGenerator(model) {
|
|
|
8985
9378
|
maxBytesPerFile: 5 * 1024 * 1024
|
|
8986
9379
|
}]
|
|
8987
9380
|
},
|
|
8988
|
-
notes: ["Outputs an ordinary video Variant. Provider routing remains internal."]
|
|
9381
|
+
notes: ["Outputs an ordinary video Variant. Provider routing remains internal.", ...capability.model === "creatify-aurora" ? ["Aurora supports 480p and 720p output; 1080p is not supported by the provider."] : []]
|
|
8989
9382
|
};
|
|
8990
9383
|
}
|
|
8991
9384
|
function audioGenerator(input_) {
|
|
@@ -9097,6 +9490,8 @@ var DRAFT_RECIPE_INPUT_KEYS = {
|
|
|
9097
9490
|
prompt: "prompt",
|
|
9098
9491
|
aspect_ratio: "aspectRatio",
|
|
9099
9492
|
image_size: "imageSize",
|
|
9493
|
+
quality: "imageQuality",
|
|
9494
|
+
seed: "imageSeed",
|
|
9100
9495
|
model: "model",
|
|
9101
9496
|
voice_id: "voiceId",
|
|
9102
9497
|
dialogue_voice_ids: "dialogueVoiceIds",
|
|
@@ -9106,11 +9501,14 @@ var DRAFT_RECIPE_INPUT_KEYS = {
|
|
|
9106
9501
|
video_duration_seconds: "videoDurationSeconds",
|
|
9107
9502
|
video_tier: "videoTier",
|
|
9108
9503
|
duration: "seedanceDuration",
|
|
9109
|
-
bitrate_mode: "seedanceBitrateMode"
|
|
9504
|
+
bitrate_mode: "seedanceBitrateMode",
|
|
9505
|
+
provider: "provider"
|
|
9110
9506
|
};
|
|
9111
9507
|
function draftRecipeInputKey(inputName, generatorId) {
|
|
9112
|
-
if (generatorId === "video/p-video-avatar" && inputName === "resolution") return "avatarResolution";
|
|
9508
|
+
if ((generatorId === "video/p-video-avatar" || generatorId === "video/creatify-aurora") && inputName === "resolution") return "avatarResolution";
|
|
9113
9509
|
if (generatorId === "video/kling-avatar-v2" && inputName === "mode") return "avatarMode";
|
|
9510
|
+
if (generatorId === "video/creatify-aurora" && inputName === "guidance_scale") return "avatarGuidanceScale";
|
|
9511
|
+
if (generatorId === "video/creatify-aurora" && inputName === "audio_guidance_scale") return "avatarAudioGuidanceScale";
|
|
9114
9512
|
return DRAFT_RECIPE_INPUT_KEYS[inputName];
|
|
9115
9513
|
}
|
|
9116
9514
|
var DRAFT_REFERENCE_FIELD = /(?:_variant_refs?|VariantRefs?)$/;
|
|
@@ -9161,6 +9559,7 @@ function buildDraftMapping(args) {
|
|
|
9161
9559
|
const value = recipe[key];
|
|
9162
9560
|
if (value !== void 0) recipeTemplate[key] = value;
|
|
9163
9561
|
}
|
|
9562
|
+
if (recipe.provider !== void 0) recipeTemplate.provider = recipe.provider;
|
|
9164
9563
|
const availableSlots = operationDefinition.inputs.filter((input) => DRAFT_REFERENCE_FIELD.test(input.name)).map((input) => input.name);
|
|
9165
9564
|
const bindings = [];
|
|
9166
9565
|
if (destinationKind === "sibling" && sourceVariantId && availableSlots.includes("source_variant_ref")) bindings.push({
|
|
@@ -10359,7 +10758,29 @@ async function executeModels(parsed, deps = defaultDeps$5) {
|
|
|
10359
10758
|
deps.print(parsed.options.json === "true" ? JSON.stringify(model, null, 2) : formatModelDetail(model));
|
|
10360
10759
|
return model;
|
|
10361
10760
|
}
|
|
10362
|
-
|
|
10761
|
+
if (command === "configure") {
|
|
10762
|
+
const id = parsed.positionals[1];
|
|
10763
|
+
if (!id) throw new Error("Model is required: makefx models configure <model>");
|
|
10764
|
+
const provider = parsed.options.provider;
|
|
10765
|
+
const reset = parsed.options["reset-provider"] === "true";
|
|
10766
|
+
if ((!provider || provider === "true") === !reset) throw new Error("Use exactly one of --provider <provider> or --reset-provider");
|
|
10767
|
+
const response = reset ? await deps.fetch(`${baseUrl}/api/user/model-provider-preferences/${encodeURIComponent(id)}`, {
|
|
10768
|
+
method: "DELETE",
|
|
10769
|
+
headers
|
|
10770
|
+
}) : await deps.fetch(`${baseUrl}/api/user/model-provider-preferences/${encodeURIComponent(id)}`, {
|
|
10771
|
+
method: "PUT",
|
|
10772
|
+
headers: {
|
|
10773
|
+
...headers,
|
|
10774
|
+
"Content-Type": "application/json"
|
|
10775
|
+
},
|
|
10776
|
+
body: JSON.stringify({ provider })
|
|
10777
|
+
});
|
|
10778
|
+
if (!response.ok) throw new Error(`Model provider configuration failed (${response.status}): ${await response.text()}`);
|
|
10779
|
+
const { preference } = await response.json();
|
|
10780
|
+
deps.print(parsed.options.json === "true" ? JSON.stringify(preference, null, 2) : formatModelRouting(preference));
|
|
10781
|
+
return preference;
|
|
10782
|
+
}
|
|
10783
|
+
throw new Error("Models command is required: list, show, or configure");
|
|
10363
10784
|
}
|
|
10364
10785
|
function formatModelDetail(model) {
|
|
10365
10786
|
const lines = [
|
|
@@ -10369,6 +10790,7 @@ function formatModelDetail(model) {
|
|
|
10369
10790
|
"Operations:"
|
|
10370
10791
|
];
|
|
10371
10792
|
if (!model.availability.available && model.availability.guidance) lines.splice(3, 0, `Next step: ${model.availability.guidance}`);
|
|
10793
|
+
if (model.routing) lines.splice(3, 0, ...formatModelRoutingLines(model));
|
|
10372
10794
|
for (const operation of model.operations) {
|
|
10373
10795
|
if (typeof operation === "string") {
|
|
10374
10796
|
lines.push(` - ${operation}`);
|
|
@@ -10390,6 +10812,20 @@ function formatModelDetail(model) {
|
|
|
10390
10812
|
}
|
|
10391
10813
|
return lines.join("\n");
|
|
10392
10814
|
}
|
|
10815
|
+
function formatModelRouting(model) {
|
|
10816
|
+
return [`${model.label} (${model.model})`, ...formatModelRoutingLines(model)].join("\n");
|
|
10817
|
+
}
|
|
10818
|
+
function formatModelRoutingLines(model) {
|
|
10819
|
+
if (!model.routing) return [];
|
|
10820
|
+
const lines = [`Default provider: ${model.routing.effective_provider} (${model.routing.source})`, "Provider routes:"];
|
|
10821
|
+
for (const provider of model.routing.providers) {
|
|
10822
|
+
const credential = provider.requires_byok ? "BYOK" : "managed or BYOK";
|
|
10823
|
+
lines.push(` - ${provider.id} (${credential}): ${provider.available ? "ready" : provider.reason ?? "unavailable"}`);
|
|
10824
|
+
if (!provider.available && provider.guidance) lines.push(` Next step: ${provider.guidance}`);
|
|
10825
|
+
if (provider.requires_byok) lines.push(" Provider billing and model access are controlled by that provider account.");
|
|
10826
|
+
}
|
|
10827
|
+
return lines;
|
|
10828
|
+
}
|
|
10393
10829
|
function formatInputs(inputs, indent) {
|
|
10394
10830
|
if (inputs.length === 0) return [];
|
|
10395
10831
|
return inputs.map((input) => {
|
|
@@ -10409,7 +10845,8 @@ function rejectUnknownModelOptions(command, options) {
|
|
|
10409
10845
|
];
|
|
10410
10846
|
const commandOptions = command ? {
|
|
10411
10847
|
list: ["media", "available"],
|
|
10412
|
-
show: []
|
|
10848
|
+
show: [],
|
|
10849
|
+
configure: ["provider", "reset-provider"]
|
|
10413
10850
|
}[command] : void 0;
|
|
10414
10851
|
if (!commandOptions) return;
|
|
10415
10852
|
const allowed = new Set([...common, ...commandOptions]);
|
|
@@ -11471,7 +11908,7 @@ async function handleVideo(parsed) {
|
|
|
11471
11908
|
var TOP_LEVEL_HELP = `Make Effects CLI
|
|
11472
11909
|
|
|
11473
11910
|
Creative:
|
|
11474
|
-
models list | show
|
|
11911
|
+
models list | show | configure
|
|
11475
11912
|
image generate | regenerate
|
|
11476
11913
|
video generate | regenerate
|
|
11477
11914
|
audio speech|dialogue|music|sfx generate|regenerate
|
|
@@ -11498,16 +11935,18 @@ Assets and variants use compact refs:
|
|
|
11498
11935
|
Run makefx help <noun> for details.`;
|
|
11499
11936
|
var HELP = {
|
|
11500
11937
|
image: `Usage:
|
|
11501
|
-
makefx image generate "prompt" --name <name> --type <type> -o <file> [--model pro|flash|flux] [--refs <variant-ref-or-file,...>] [--aspect <ratio>] [--size 1K|2K|4K] [--collection <id>] [--space <id>]
|
|
11502
|
-
makefx image regenerate <variant-ref> ["prompt"] [--model pro|flash|flux] [--aspect <ratio>] [--size <size>] [--refs <refs>] [--no-activate] [--wait]`,
|
|
11938
|
+
makefx image generate "prompt" --name <name> --type <type> -o <file> [--model pro|flash|flux|gpt-image-2|seedream-5-pro|seedream-5-lite] [--provider <provider>] [--refs <variant-ref-or-file,...>] [--aspect <ratio>] [--size 1K|2K|3K|4K] [--quality low|medium|high] [--seed <integer>] [--collection <id>] [--space <id>]
|
|
11939
|
+
makefx image regenerate <variant-ref> ["prompt"] [--model pro|flash|flux|gpt-image-2|seedream-5-pro|seedream-5-lite] [--provider <provider>] [--aspect <ratio>] [--size <size>] [--quality low|medium|high] [--seed <integer|random>] [--refs <refs>] [--no-activate] [--wait]`,
|
|
11503
11940
|
video: `Usage:
|
|
11504
|
-
makefx video generate "prompt" --name <name> --type <type> -o <file> [--model veo-3.1|omni-flash|kling|seedance-1|seedance-2|seedance-2-fast]
|
|
11941
|
+
makefx video generate "prompt" --name <name> --type <type> -o <file> [--model veo-3.1|omni-flash|kling|seedance-1|seedance-2|seedance-2-fast|seedance-2.5|kling-avatar-v2|creatify-aurora] [--provider fal|elevenlabs|pika]
|
|
11505
11942
|
[--refs <variant-ref-or-file,...>] [--first-frame <ref>] [--last-frame <ref>] [--image-refs <refs>] [--video-refs <refs>] [--audio-refs <refs>]
|
|
11506
11943
|
[--aspect <ratio>] [--resolution 480p|720p|1080p|4k] [--duration <seconds|auto>] [--tier generate|fast|lite] [--bitrate standard|high]
|
|
11507
11944
|
[--audio | --no-audio] [--collection <id>] [--space <id>]
|
|
11508
11945
|
makefx video generate ["prompt"] --model kling-avatar-v2 --image-refs <portrait-ref> --audio-refs <audio-ref>
|
|
11509
11946
|
--name <name> --type <type> -o <file> [--mode standard|pro] [--collection <id>] [--space <id>]
|
|
11510
|
-
makefx video
|
|
11947
|
+
makefx video generate ["prompt"] --model creatify-aurora --image-refs <portrait-ref> --audio-refs <audio-ref>
|
|
11948
|
+
--name <name> --type <type> -o <file> [--resolution 480p|720p] [--guidance-scale 0..5] [--audio-guidance-scale 0..5] [--collection <id>] [--space <id>]
|
|
11949
|
+
makefx video regenerate <variant-ref> ["prompt"] [--model <model>] [--provider fal|elevenlabs|pika] [--aspect <ratio>] [--resolution <value>] [--duration <seconds>] [--tier <tier>] [--bitrate standard|high] [--audio | --no-audio] [--image-refs <refs>] [--video-refs <refs>] [--audio-refs <refs>] [--no-activate] [--wait]
|
|
11511
11950
|
|
|
11512
11951
|
Seedance mode is inferred: first/last frame selects frame mode, image/video/audio refs select reference mode, and no references selects text mode.`,
|
|
11513
11952
|
audio: `Usage:
|
|
@@ -11526,7 +11965,8 @@ Seedance mode is inferred: first/last frame selects frame mode, image/video/audi
|
|
|
11526
11965
|
Generate commands also accept [--collection <id>] [--space <id>].`,
|
|
11527
11966
|
models: `Usage:
|
|
11528
11967
|
makefx models list [--media image|video|audio] [--available] [--json]
|
|
11529
|
-
makefx models show <model> [--json]
|
|
11968
|
+
makefx models show <model> [--json]
|
|
11969
|
+
makefx models configure <model> (--provider <provider> | --reset-provider) [--json]`,
|
|
11530
11970
|
assets: `Usage:
|
|
11531
11971
|
makefx assets list [--query <text>] [--media image|audio|video] [--type <type>] [--json]
|
|
11532
11972
|
makefx assets show <asset-ref> [--json]
|