@picsart/ai-sdk 5.28.8 → 5.30.0
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/_vendor/workflows-types/index.d.ts +1433 -1338
- package/index.d.ts +17 -13
- package/index.js +121 -126
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -841,19 +841,10 @@ type ModelInputById = {
|
|
|
841
841
|
prompt: string;
|
|
842
842
|
startFrame?: string;
|
|
843
843
|
endFrame?: string;
|
|
844
|
-
resolution?: "480p" | "768p";
|
|
845
|
-
duration?: number;
|
|
846
|
-
aspectRatio?: "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
|
|
847
|
-
promptExpansionMode?: "disabled" | "balanced" | "quality";
|
|
848
|
-
seed?: number;
|
|
849
|
-
enableSafetyChecker?: boolean;
|
|
850
|
-
};
|
|
851
|
-
"minimax-h3-max-r2v": {
|
|
852
|
-
prompt: string;
|
|
853
844
|
imageUrls?: string[];
|
|
854
845
|
videoUrls?: string[];
|
|
855
846
|
audioUrls?: string[];
|
|
856
|
-
resolution?: "480p" | "768p";
|
|
847
|
+
resolution?: "480p" | "768p" | "1080p";
|
|
857
848
|
duration?: number;
|
|
858
849
|
aspectRatio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
|
|
859
850
|
promptExpansionMode?: "balanced" | "quality";
|
|
@@ -864,7 +855,7 @@ type ModelInputById = {
|
|
|
864
855
|
prompt: string;
|
|
865
856
|
startFrame?: string;
|
|
866
857
|
endFrame?: string;
|
|
867
|
-
resolution?: "480p" | "768p";
|
|
858
|
+
resolution?: "480p" | "768p" | "1080p";
|
|
868
859
|
duration?: number;
|
|
869
860
|
aspectRatio?: "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
|
|
870
861
|
promptExpansionMode?: "balanced" | "quality";
|
|
@@ -2530,6 +2521,17 @@ interface GenerateTextResult {
|
|
|
2530
2521
|
/** Credit usage reported by the platform — same structure as the pluggable APIs' GenAITaskResponse. */
|
|
2531
2522
|
usage?: CreditUsage;
|
|
2532
2523
|
}
|
|
2524
|
+
/** Input-transformation settings injected into the workflow payload as
|
|
2525
|
+
* `options.inputs_transformation` (GenAIOptions, alongside `drive`). */
|
|
2526
|
+
interface PayloadInputsTransformationOptions {
|
|
2527
|
+
/**
|
|
2528
|
+
* Downscale input images that exceed the vendor's download size cap
|
|
2529
|
+
* (e.g. ByteDance's 30 MiB) and retry the generation once, instead of
|
|
2530
|
+
* failing with an input-limit error. Defaults to true; workers without
|
|
2531
|
+
* input transformation ignore it.
|
|
2532
|
+
*/
|
|
2533
|
+
downscaleOversizedImages?: boolean;
|
|
2534
|
+
}
|
|
2533
2535
|
/** Options for individual generate() / submit() calls. */
|
|
2534
2536
|
interface GenerateOptions {
|
|
2535
2537
|
signal?: AbortSignal;
|
|
@@ -2548,6 +2550,9 @@ interface GenerateOptions {
|
|
|
2548
2550
|
folder?: DriveFolder;
|
|
2549
2551
|
/** Save result to Picsart Drive via backend. Injected into the workflow payload. */
|
|
2550
2552
|
drive?: PayloadDriveOptions;
|
|
2553
|
+
/** Input-transformation settings. Injected into the workflow payload; when
|
|
2554
|
+
* omitted, oversized-image downscaling defaults to enabled. */
|
|
2555
|
+
inputsTransformation?: PayloadInputsTransformationOptions;
|
|
2551
2556
|
/**
|
|
2552
2557
|
* App identity stamped onto the saved generation (appId/appType).
|
|
2553
2558
|
* TODO(backend-autosave): temporary — remove once the backend stamps these.
|
|
@@ -2737,7 +2742,6 @@ declare const Models: {
|
|
|
2737
2742
|
readonly Minimax02Hd: "minimax-02-hd";
|
|
2738
2743
|
readonly MinimaxH3: "minimax-h3";
|
|
2739
2744
|
readonly MinimaxH3Max: "minimax-h3-max";
|
|
2740
|
-
readonly MinimaxH3MaxR2v: "minimax-h3-max-r2v";
|
|
2741
2745
|
readonly MinimaxH3MaxTurbo: "minimax-h3-max-turbo";
|
|
2742
2746
|
readonly MinimaxMusicV2: "minimax-music-v2";
|
|
2743
2747
|
readonly MinimaxMusicV3: "minimax-music-v3";
|
|
@@ -3053,4 +3057,4 @@ declare const findModel: (ref: string) => ModelDefinition | undefined;
|
|
|
3053
3057
|
*/
|
|
3054
3058
|
declare const KLING_DUAL_IMAGE_EFFECTS: ReadonlySet<string>;
|
|
3055
3059
|
|
|
3056
|
-
export { ALL_MODELS, type AiClient, ApiError, type ApiErrorCode, type ApiErrorInit, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type CatalogDescriptor, type CatalogEntry, type CatalogItem, type CatalogKind, type CatalogPage, type CatalogPageOptions, type CatalogPreview, type CatalogQuery, type CatalogResult, type CatalogSource, type CatalogsClient, type CatalogsOptions, type ClientConfig, type CreditRange, type CreditRangeContext, type CreditTier, type CreditUsage, DEFAULT_VISIBLE_RELEASES, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateTextResult, type GenerationContext, type GenerationFile, type GenerationMode, KLING_DUAL_IMAGE_EFFECTS, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter$1 as ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type ToolUsage, type TypedModelId, type UserReaction, type ValidationResult$1 as ValidationResult, type VoiceOption, type WorkflowJobHandle, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf, toAvatarOption, toVoiceOption };
|
|
3060
|
+
export { ALL_MODELS, type AiClient, ApiError, type ApiErrorCode, type ApiErrorInit, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type CatalogDescriptor, type CatalogEntry, type CatalogItem, type CatalogKind, type CatalogPage, type CatalogPageOptions, type CatalogPreview, type CatalogQuery, type CatalogResult, type CatalogSource, type CatalogsClient, type CatalogsOptions, type ClientConfig, type CreditRange, type CreditRangeContext, type CreditTier, type CreditUsage, DEFAULT_VISIBLE_RELEASES, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateTextResult, type GenerationContext, type GenerationFile, type GenerationMode, KLING_DUAL_IMAGE_EFFECTS, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter$1 as ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PayloadInputsTransformationOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type ToolUsage, type TypedModelId, type UserReaction, type ValidationResult$1 as ValidationResult, type VoiceOption, type WorkflowJobHandle, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf, toAvatarOption, toVoiceOption };
|
package/index.js
CHANGED
|
@@ -6619,7 +6619,44 @@ var buildMinimaxMusicPayload = (ctx) => ({
|
|
|
6619
6619
|
format: ctx.format ?? "mp3"
|
|
6620
6620
|
}
|
|
6621
6621
|
});
|
|
6622
|
-
var
|
|
6622
|
+
var H3_MAX_PROMPT_MAX = 5e4;
|
|
6623
|
+
var FRAME_REF_EXCLUSIVE2 = "References and start/end frames cannot be combined.";
|
|
6624
|
+
var AUDIO_NEEDS_VISUAL2 = "Audio cannot be the only reference \u2014 add an image or video.";
|
|
6625
|
+
var RATIO_FOLLOWS_FRAME = "Aspect ratio follows the frame image.";
|
|
6626
|
+
var ADAPTIVE_NEEDS_REFS = "Adaptive aspect ratio requires reference inputs.";
|
|
6627
|
+
var H3_MAX_RATIOS = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"];
|
|
6628
|
+
var REFERENCE_EXCLUDES_FRAMES = {
|
|
6629
|
+
startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
|
|
6630
|
+
endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 }
|
|
6631
|
+
};
|
|
6632
|
+
var FRAME_EXCLUDES_REFERENCES = {
|
|
6633
|
+
imageUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
|
|
6634
|
+
videoUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
|
|
6635
|
+
audioUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 }
|
|
6636
|
+
};
|
|
6637
|
+
var h3MaxConstraints = [
|
|
6638
|
+
{ when: { startFrame: { exists: true } }, then: FRAME_EXCLUDES_REFERENCES },
|
|
6639
|
+
{ when: { endFrame: { exists: true } }, then: FRAME_EXCLUDES_REFERENCES },
|
|
6640
|
+
{ when: { imageUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
|
|
6641
|
+
{ when: { videoUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
|
|
6642
|
+
{ when: { audioUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
|
|
6643
|
+
// With a frame the output follows that image, so the ratio is not a choice.
|
|
6644
|
+
// An end frame alone is valid — it generates towards that keyframe.
|
|
6645
|
+
{ when: { startFrame: { exists: true } }, then: {
|
|
6646
|
+
aspectRatio: { disabled: true, reason: RATIO_FOLLOWS_FRAME }
|
|
6647
|
+
} },
|
|
6648
|
+
{ when: { endFrame: { exists: true } }, then: {
|
|
6649
|
+
aspectRatio: { disabled: true, reason: RATIO_FOLLOWS_FRAME }
|
|
6650
|
+
} },
|
|
6651
|
+
// 'adaptive' means "follow the references" — no meaning without them.
|
|
6652
|
+
{ when: { imageUrls: { exists: false }, videoUrls: { exists: false }, audioUrls: { exists: false } }, then: {
|
|
6653
|
+
aspectRatio: { allowed: [...H3_MAX_RATIOS], reason: ADAPTIVE_NEEDS_REFS }
|
|
6654
|
+
} },
|
|
6655
|
+
// Audio carries no visual signal, so it cannot be the only reference.
|
|
6656
|
+
{ when: { imageUrls: { exists: false }, videoUrls: { exists: false } }, then: {
|
|
6657
|
+
audioUrls: { disabled: true, reason: AUDIO_NEEDS_VISUAL2 }
|
|
6658
|
+
} }
|
|
6659
|
+
];
|
|
6623
6660
|
var { MODELS: MODELS26 } = defineModels("minimax", [
|
|
6624
6661
|
{
|
|
6625
6662
|
id: "minimax-02-hd",
|
|
@@ -6690,55 +6727,51 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
|
|
|
6690
6727
|
}
|
|
6691
6728
|
},
|
|
6692
6729
|
{
|
|
6693
|
-
//
|
|
6694
|
-
//
|
|
6695
|
-
//
|
|
6730
|
+
// One entry for all three H3 Max modes: the inputs pick it — reference
|
|
6731
|
+
// images, videos or audio generate from references; a start and/or end
|
|
6732
|
+
// frame animates those frames; neither generates from the prompt alone.
|
|
6696
6733
|
id: "minimax-h3-max",
|
|
6697
6734
|
name: "MiniMax H3 Max",
|
|
6698
6735
|
modelId: "fal-ai-h3-max",
|
|
6699
6736
|
addedAt: "2026-08-28",
|
|
6700
|
-
workflow: "minimax/h3-max/
|
|
6701
|
-
editWorkflow: "minimax/h3-max/image-to-video",
|
|
6737
|
+
workflow: "minimax/h3-max/video-generation",
|
|
6702
6738
|
estimatedTime: 5,
|
|
6703
6739
|
mode: "video",
|
|
6704
6740
|
inputType: "t2v",
|
|
6705
|
-
description: "Top-tier MiniMax H3 Max video from text
|
|
6741
|
+
description: "Top-tier MiniMax H3 Max video from text, a start/end frame, or reference images, videos, and audio \u2014 refer to references in the prompt as Image 1, Video 1, Audio 1, in input order. Up to 15s at 1080p.",
|
|
6706
6742
|
features: [
|
|
6707
|
-
feat("Image Input", "input"),
|
|
6708
6743
|
feat("Start/End Frame", "frame"),
|
|
6709
|
-
feat("
|
|
6744
|
+
feat("Multi-Image Input", "input"),
|
|
6745
|
+
feat("Video Input", "input"),
|
|
6746
|
+
feat("Audio Input", "input"),
|
|
6747
|
+
feat("1080p", "resolution"),
|
|
6710
6748
|
feat("5-15 sec", "duration")
|
|
6711
6749
|
],
|
|
6712
6750
|
paramConfig: {
|
|
6713
|
-
...params.prompt({ maxLength:
|
|
6751
|
+
...params.prompt({ maxLength: H3_MAX_PROMPT_MAX }),
|
|
6714
6752
|
...params.startFrame(),
|
|
6715
6753
|
...params.endFrame(),
|
|
6716
|
-
//
|
|
6717
|
-
//
|
|
6718
|
-
|
|
6754
|
+
// Reference slots — reference-to-video route. Clips are 2-15s each
|
|
6755
|
+
// (≤15s combined per modality) and images + videos + audios must add up
|
|
6756
|
+
// to ≤12 files — backend-enforced; only the per-array maxima live here.
|
|
6757
|
+
...params.imageInput(9, "Reference Images"),
|
|
6758
|
+
...params.videoInputs(3, "Reference Videos"),
|
|
6759
|
+
...params.audioInputs(3, "Reference Audios"),
|
|
6760
|
+
// 1080p is a latent refinement of a native 768p generation.
|
|
6761
|
+
...params.resolution(["480p", "768p", "1080p"], "768p"),
|
|
6719
6762
|
...params.durationRange(5, 15, 5),
|
|
6720
|
-
|
|
6721
|
-
...
|
|
6763
|
+
// 'adaptive' means "follow the references" — constrained below.
|
|
6764
|
+
...params.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
|
|
6765
|
+
...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
|
|
6722
6766
|
// -1 (sentinel) means "pick a random seed"; the builder drops it.
|
|
6723
6767
|
...p.range("seed", -1, 2147483647, -1),
|
|
6724
6768
|
...p.boolean("enableSafetyChecker", true, "Safety Checker")
|
|
6725
6769
|
},
|
|
6726
|
-
constraints:
|
|
6727
|
-
// The T2V wire has no end_image_url — an end frame only reaches the
|
|
6728
|
-
// vendor on the I2V route, which needs a start frame to trigger.
|
|
6729
|
-
{ when: { startFrame: { exists: false } }, then: {
|
|
6730
|
-
endFrame: { disabled: true, reason: "An end frame requires a start frame." }
|
|
6731
|
-
} },
|
|
6732
|
-
// I2V derives the ratio from the input image (no aspect_ratio on that wire).
|
|
6733
|
-
{ when: { startFrame: { exists: true } }, then: {
|
|
6734
|
-
aspectRatio: { disabled: true, reason: "Aspect ratio follows the start frame image." }
|
|
6735
|
-
} }
|
|
6736
|
-
]
|
|
6770
|
+
constraints: h3MaxConstraints
|
|
6737
6771
|
},
|
|
6738
6772
|
{
|
|
6739
|
-
// Turbo sibling of minimax-h3-max — same
|
|
6740
|
-
//
|
|
6741
|
-
// difference: prompt expansion has no 'disabled' mode on this endpoint.
|
|
6773
|
+
// Turbo sibling of minimax-h3-max — same model family, tuned for speed
|
|
6774
|
+
// (faster-than-realtime generation), text and frames only.
|
|
6742
6775
|
id: "minimax-h3-max-turbo",
|
|
6743
6776
|
name: "MiniMax H3 Max Turbo",
|
|
6744
6777
|
modelId: "fal-ai-h3-max-turbo",
|
|
@@ -6748,81 +6781,35 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
|
|
|
6748
6781
|
estimatedTime: 5,
|
|
6749
6782
|
mode: "video",
|
|
6750
6783
|
inputType: "t2v",
|
|
6751
|
-
description: "Faster-than-realtime MiniMax H3 Max Turbo video from text or a start/end frame, with prompt expansion. Up to 15s at
|
|
6784
|
+
description: "Faster-than-realtime MiniMax H3 Max Turbo video from text or a start/end frame, with prompt expansion. Up to 15s at 1080p.",
|
|
6752
6785
|
features: [
|
|
6753
6786
|
feat("Fast", "characteristic"),
|
|
6754
6787
|
feat("Image Input", "input"),
|
|
6755
6788
|
feat("Start/End Frame", "frame"),
|
|
6756
|
-
feat("
|
|
6789
|
+
feat("1080p", "resolution"),
|
|
6757
6790
|
feat("5-15 sec", "duration")
|
|
6758
6791
|
],
|
|
6759
6792
|
paramConfig: {
|
|
6760
|
-
...params.prompt({ maxLength:
|
|
6793
|
+
...params.prompt({ maxLength: H3_MAX_PROMPT_MAX }),
|
|
6761
6794
|
...params.startFrame(),
|
|
6762
6795
|
...params.endFrame(),
|
|
6763
|
-
|
|
6764
|
-
// and the pricing qualities are lowercase, so this casing serves both.
|
|
6765
|
-
...params.resolution(["480p", "768p"], "768p"),
|
|
6796
|
+
...params.resolution(["480p", "768p", "1080p"], "768p"),
|
|
6766
6797
|
...params.durationRange(5, 15, 5),
|
|
6767
6798
|
...params.aspectRatio(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
|
|
6768
|
-
// Unlike minimax-h3-max, the turbo wire has no 'disabled' expansion mode.
|
|
6769
6799
|
...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
|
|
6770
6800
|
// -1 (sentinel) means "pick a random seed"; the builder drops it.
|
|
6771
6801
|
...p.range("seed", -1, 2147483647, -1),
|
|
6772
6802
|
...p.boolean("enableSafetyChecker", true, "Safety Checker")
|
|
6773
6803
|
},
|
|
6774
6804
|
constraints: [
|
|
6775
|
-
//
|
|
6776
|
-
//
|
|
6777
|
-
|
|
6778
|
-
endFrame: { disabled: true, reason: "An end frame requires a start frame." }
|
|
6779
|
-
} },
|
|
6780
|
-
// I2V derives the ratio from the input image (no aspect_ratio on that wire).
|
|
6805
|
+
// Either frame routes to image-to-video, which derives the ratio from
|
|
6806
|
+
// the image it was given (no aspect_ratio on that wire). An end frame
|
|
6807
|
+
// alone is valid — fal documents it as end-only keyframe generation.
|
|
6781
6808
|
{ when: { startFrame: { exists: true } }, then: {
|
|
6782
|
-
aspectRatio: { disabled: true, reason: "Aspect ratio follows the
|
|
6783
|
-
} }
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
{
|
|
6787
|
-
// Reference-to-video sibling of minimax-h3-max (same fal.ai worker).
|
|
6788
|
-
// The prompt addresses references by modality and order — Image 1,
|
|
6789
|
-
// Video 1, Audio 1, … Reference clips are 2-15s each (≤15s combined per
|
|
6790
|
-
// modality) and images + videos + audios must add up to ≤12 files —
|
|
6791
|
-
// backend-enforced; paramConfig only carries the per-array maxima.
|
|
6792
|
-
id: "minimax-h3-max-r2v",
|
|
6793
|
-
name: "MiniMax H3 Max Ref-to-Video",
|
|
6794
|
-
modelId: "fal-ai-h3-max",
|
|
6795
|
-
addedAt: "2026-09-01",
|
|
6796
|
-
workflow: "minimax/h3-max/reference-to-video",
|
|
6797
|
-
estimatedTime: 5,
|
|
6798
|
-
mode: "video",
|
|
6799
|
-
inputType: "i2v",
|
|
6800
|
-
description: "MiniMax H3 Max video from reference images, videos, and audio \u2014 refer to them in the prompt as Image 1, Video 1, Audio 1, in input order. Up to 15s at 768p.",
|
|
6801
|
-
features: [
|
|
6802
|
-
feat("Multi-Image Input", "input"),
|
|
6803
|
-
feat("Video Input", "input"),
|
|
6804
|
-
feat("Audio Input", "input"),
|
|
6805
|
-
feat("768p", "resolution"),
|
|
6806
|
-
feat("5-15 sec", "duration")
|
|
6807
|
-
],
|
|
6808
|
-
paramConfig: {
|
|
6809
|
-
...params.prompt({ maxLength: MINIMAX_H3_PROMPT_MAX, placeholder: "Image 1 is the protagonist. Keep her consistent with the reference while she walks through a sunlit garden..." }),
|
|
6810
|
-
...params.imageInput(9, "Reference Images"),
|
|
6811
|
-
...params.videoInputs(3, "Reference Videos"),
|
|
6812
|
-
...params.audioInputs(3, "Reference Audios"),
|
|
6813
|
-
// Lowercase on purpose — same worker normalization as minimax-h3-max.
|
|
6814
|
-
...params.resolution(["480p", "768p"], "768p"),
|
|
6815
|
-
...params.durationRange(5, 15, 5),
|
|
6816
|
-
...params.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "adaptive"),
|
|
6817
|
-
// Unlike the T2V/I2V entry, this wire has no 'disabled' expansion mode.
|
|
6818
|
-
...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
|
|
6819
|
-
// -1 (sentinel) means "pick a random seed"; the builder drops it.
|
|
6820
|
-
...p.range("seed", -1, 2147483647, -1),
|
|
6821
|
-
...p.boolean("enableSafetyChecker", true, "Safety Checker")
|
|
6822
|
-
},
|
|
6823
|
-
constraints: [
|
|
6824
|
-
{ when: { imageUrls: { exists: false }, videoUrls: { exists: false } }, then: {
|
|
6825
|
-
audioUrls: { disabled: true, reason: "Audio cannot be the only reference \u2014 add an image or video." }
|
|
6809
|
+
aspectRatio: { disabled: true, reason: "Aspect ratio follows the frame image." }
|
|
6810
|
+
} },
|
|
6811
|
+
{ when: { endFrame: { exists: true } }, then: {
|
|
6812
|
+
aspectRatio: { disabled: true, reason: "Aspect ratio follows the frame image." }
|
|
6826
6813
|
} }
|
|
6827
6814
|
]
|
|
6828
6815
|
}
|
|
@@ -6843,41 +6830,43 @@ var buildMinimaxMusicV3Payload = (input) => ({
|
|
|
6843
6830
|
format: input.format ?? "mp3"
|
|
6844
6831
|
}
|
|
6845
6832
|
});
|
|
6846
|
-
var buildMinimaxH3MaxPayload = (input) =>
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
}
|
|
6833
|
+
var buildMinimaxH3MaxPayload = (input) => {
|
|
6834
|
+
const hasReferences = !!(input.imageUrls?.length || input.videoUrls?.length || input.audioUrls?.length);
|
|
6835
|
+
const hasFrame = !!(input.startFrame || input.endFrame);
|
|
6836
|
+
return {
|
|
6837
|
+
prompt: input.prompt,
|
|
6838
|
+
prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
|
|
6839
|
+
duration: input.duration ?? 5,
|
|
6840
|
+
// The vendor enum is uppercase; paramConfig keeps the lowercase form.
|
|
6841
|
+
resolution: (input.resolution ?? "768p").toUpperCase(),
|
|
6842
|
+
// Frames and references pick different modes and are mutually exclusive
|
|
6843
|
+
// (the model's constraints keep them so), hence whichever the caller
|
|
6844
|
+
// filled is what goes out.
|
|
6845
|
+
...input.startFrame ? { image_url: input.startFrame } : {},
|
|
6846
|
+
...input.endFrame ? { end_image_url: input.endFrame } : {},
|
|
6847
|
+
...input.imageUrls?.length ? { reference_image_urls: input.imageUrls } : {},
|
|
6848
|
+
...input.videoUrls?.length ? { reference_video_urls: input.videoUrls } : {},
|
|
6849
|
+
...input.audioUrls?.length ? { reference_audio_urls: input.audioUrls } : {},
|
|
6850
|
+
// A frame decides the ratio itself, so the field is dropped there. With
|
|
6851
|
+
// references the default is 'adaptive' (follow them); from the prompt
|
|
6852
|
+
// alone it is 16:9.
|
|
6853
|
+
...hasFrame ? {} : { aspect_ratio: input.aspectRatio ?? (hasReferences ? "adaptive" : "16:9") },
|
|
6854
|
+
// -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
|
|
6855
|
+
...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
|
|
6856
|
+
enable_safety_checker: input.enableSafetyChecker ?? true
|
|
6857
|
+
};
|
|
6858
|
+
};
|
|
6859
6859
|
var buildMinimaxH3MaxTurboPayload = (input) => ({
|
|
6860
6860
|
prompt: input.prompt,
|
|
6861
6861
|
prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
|
|
6862
6862
|
duration: input.duration ?? 5,
|
|
6863
6863
|
resolution: input.resolution ?? "768p",
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
...input.
|
|
6870
|
-
enable_safety_checker: input.enableSafetyChecker ?? true
|
|
6871
|
-
});
|
|
6872
|
-
var buildMinimaxH3MaxR2VPayload = (input) => ({
|
|
6873
|
-
prompt: input.prompt,
|
|
6874
|
-
prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
|
|
6875
|
-
duration: input.duration ?? 5,
|
|
6876
|
-
resolution: input.resolution ?? "768p",
|
|
6877
|
-
aspect_ratio: input.aspectRatio ?? "adaptive",
|
|
6878
|
-
...input.imageUrls?.length ? { reference_image_urls: input.imageUrls } : {},
|
|
6879
|
-
...input.videoUrls?.length ? { reference_video_urls: input.videoUrls } : {},
|
|
6880
|
-
...input.audioUrls?.length ? { reference_audio_urls: input.audioUrls } : {},
|
|
6864
|
+
// Either frame animates frames, and an end frame alone is valid (it
|
|
6865
|
+
// generates towards that keyframe). The ratio follows the frame when one is
|
|
6866
|
+
// supplied, so it goes out only when neither is set.
|
|
6867
|
+
...input.startFrame ? { image_url: input.startFrame } : {},
|
|
6868
|
+
...input.endFrame ? { end_image_url: input.endFrame } : {},
|
|
6869
|
+
...input.startFrame || input.endFrame ? {} : { aspect_ratio: input.aspectRatio ?? "16:9" },
|
|
6881
6870
|
// -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
|
|
6882
6871
|
...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
|
|
6883
6872
|
enable_safety_checker: input.enableSafetyChecker ?? true
|
|
@@ -6885,11 +6874,9 @@ var buildMinimaxH3MaxR2VPayload = (input) => ({
|
|
|
6885
6874
|
registerPayloads(MODELS26, {
|
|
6886
6875
|
"minimax-music-v3": buildMinimaxMusicV3Payload,
|
|
6887
6876
|
"minimax-h3-max": buildMinimaxH3MaxPayload,
|
|
6888
|
-
"minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload
|
|
6889
|
-
"minimax-h3-max-r2v": buildMinimaxH3MaxR2VPayload
|
|
6877
|
+
"minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload
|
|
6890
6878
|
});
|
|
6891
6879
|
registerEditPayloads(MODELS26, {
|
|
6892
|
-
"minimax-h3-max": buildMinimaxH3MaxPayload,
|
|
6893
6880
|
"minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload
|
|
6894
6881
|
});
|
|
6895
6882
|
|
|
@@ -10759,9 +10746,19 @@ function createClient(config) {
|
|
|
10759
10746
|
folder: explicit?.folder ?? (folderPath ? { path: folderPath } : void 0)
|
|
10760
10747
|
};
|
|
10761
10748
|
}
|
|
10762
|
-
function
|
|
10763
|
-
|
|
10764
|
-
|
|
10749
|
+
function injectPayloadOptions(payload, drive, inputsTransformation) {
|
|
10750
|
+
const record = payload;
|
|
10751
|
+
const existing = record.options ?? {};
|
|
10752
|
+
return {
|
|
10753
|
+
...record,
|
|
10754
|
+
options: {
|
|
10755
|
+
...existing,
|
|
10756
|
+
inputs_transformation: {
|
|
10757
|
+
downscale_oversized_images: inputsTransformation?.downscaleOversizedImages ?? true
|
|
10758
|
+
},
|
|
10759
|
+
...drive ? { drive } : {}
|
|
10760
|
+
}
|
|
10761
|
+
};
|
|
10765
10762
|
}
|
|
10766
10763
|
return {
|
|
10767
10764
|
// ── Simple path ──────────────────────────────────────────────────
|
|
@@ -10783,7 +10780,7 @@ function createClient(config) {
|
|
|
10783
10780
|
}
|
|
10784
10781
|
const { workflow, payload, contract } = prepareRequest(resolved, params2);
|
|
10785
10782
|
const drive = buildDrivePayloadOptions(resolved, params2, options);
|
|
10786
|
-
const finalPayload =
|
|
10783
|
+
const finalPayload = injectPayloadOptions(payload, drive, options?.inputsTransformation);
|
|
10787
10784
|
const completed = await executeModel(resolved, workflow, finalPayload, options);
|
|
10788
10785
|
return parseResult(completed, resolved, contract);
|
|
10789
10786
|
},
|
|
@@ -10837,7 +10834,7 @@ function createClient(config) {
|
|
|
10837
10834
|
const resolved = resolveModel(model);
|
|
10838
10835
|
const { workflow, payload } = prepareRequest(resolved, params2);
|
|
10839
10836
|
const drive = buildDrivePayloadOptions(resolved, params2, options);
|
|
10840
|
-
const finalPayload =
|
|
10837
|
+
const finalPayload = injectPayloadOptions(payload, drive, options?.inputsTransformation);
|
|
10841
10838
|
return client.submit({ workflow, payload: finalPayload, signal: options?.signal });
|
|
10842
10839
|
},
|
|
10843
10840
|
/** Check the current status of a submitted job. */
|
|
@@ -11456,7 +11453,6 @@ var Lyria35 = "lyria-3.5";
|
|
|
11456
11453
|
var Minimax02Hd = "minimax-02-hd";
|
|
11457
11454
|
var MinimaxH3 = "minimax-h3";
|
|
11458
11455
|
var MinimaxH3Max = "minimax-h3-max";
|
|
11459
|
-
var MinimaxH3MaxR2v = "minimax-h3-max-r2v";
|
|
11460
11456
|
var MinimaxH3MaxTurbo = "minimax-h3-max-turbo";
|
|
11461
11457
|
var MinimaxMusicV2 = "minimax-music-v2";
|
|
11462
11458
|
var MinimaxMusicV3 = "minimax-music-v3";
|
|
@@ -11680,7 +11676,6 @@ var Models = {
|
|
|
11680
11676
|
Minimax02Hd,
|
|
11681
11677
|
MinimaxH3,
|
|
11682
11678
|
MinimaxH3Max,
|
|
11683
|
-
MinimaxH3MaxR2v,
|
|
11684
11679
|
MinimaxH3MaxTurbo,
|
|
11685
11680
|
MinimaxMusicV2,
|
|
11686
11681
|
MinimaxMusicV3,
|