@@ -215,31 +215,38 @@ const createResponseOutputSchema = s.looseRequiredObject(
215215 } ,
216216) ;
217217
218- const videoModels = [
218+ const textToVideoModels = [ "MiniMax-Hailuo-2.3" , "MiniMax-Hailuo-02" , "T2V-01-Director" , "T2V-01" ] ;
219+
220+ const imageToVideoModels = [
219221 "MiniMax-Hailuo-2.3" ,
220222 "MiniMax-Hailuo-2.3-Fast" ,
221223 "MiniMax-Hailuo-02" ,
222- "T2V-01-Director" ,
223- "T2V-01" ,
224224 "I2V-01-Director" ,
225225 "I2V-01-live" ,
226226 "I2V-01" ,
227227] ;
228228
229- const videoRegionSchema = s . stringEnum ( [ "global" , "china" ] , {
230- description :
231- "MiniMax service region. Use global for the https://api.minimax.io host or china for the https://api.minimaxi.com host. Defaults to global." ,
232- default : "global" ,
229+ const textToVideoModelSchema = s . stringEnum ( textToVideoModels , {
230+ description : "MiniMax text-to-video model to invoke, for example MiniMax-Hailuo-2.3." ,
231+ default : "MiniMax-Hailuo-2.3" ,
233232} ) ;
234233
235- const videoModelSchema = s . stringEnum ( videoModels , {
236- description : "MiniMax video model to invoke, for example MiniMax-Hailuo-2.3." ,
234+ const imageToVideoModelSchema = s . stringEnum ( imageToVideoModels , {
235+ description : "MiniMax image-to- video model to invoke, for example MiniMax-Hailuo-2.3." ,
237236 default : "MiniMax-Hailuo-2.3" ,
238237} ) ;
239238
240- const videoDurationSchema = s . integer ( "Length of the generated video in seconds." , { minimum : 1 } ) ;
241- const videoResolutionSchema = trimmedNonEmptyString (
242- "Resolution of the generated video, for example 512P, 768P, or 1080P." ,
239+ const videoDurationSchema = s . anyOf ( [ s . literal ( 6 ) , s . literal ( 10 ) ] , {
240+ description : "Length of the generated video in seconds. Model and resolution determine whether 6 or 10 is valid." ,
241+ default : 6 ,
242+ } ) ;
243+ const textToVideoResolutionSchema = s . stringEnum (
244+ "Resolution of the generated text-to-video result. Supported values depend on the model and duration." ,
245+ [ "720P" , "768P" , "1080P" ] ,
246+ ) ;
247+ const imageToVideoResolutionSchema = s . stringEnum (
248+ "Resolution of the generated image-to-video result. Supported values depend on the model and duration." ,
249+ [ "512P" , "720P" , "768P" , "1080P" ] ,
243250) ;
244251const videoPromptOptimizerSchema = s . boolean ( "Whether MiniMax may rewrite the prompt to improve the result." ) ;
245252const videoFastPretreatmentSchema = s . boolean ( "Whether MiniMax applies fast pre-processing to speed up generation." ) ;
@@ -248,53 +255,39 @@ const videoCallbackUrlSchema = s.url("URL MiniMax calls with asynchronous task s
248255const textToVideoInputSchema = s . object (
249256 "Request body for creating a MiniMax text-to-video generation task." ,
250257 {
251- model : videoModelSchema ,
258+ model : textToVideoModelSchema ,
252259 prompt : trimmedNonEmptyString ( "Text description of the video to generate." ) ,
253260 prompt_optimizer : videoPromptOptimizerSchema ,
254261 fast_pretreatment : videoFastPretreatmentSchema ,
255262 duration : videoDurationSchema ,
256- resolution : videoResolutionSchema ,
263+ resolution : textToVideoResolutionSchema ,
257264 callback_url : videoCallbackUrlSchema ,
258- region : videoRegionSchema ,
259265 } ,
260- { optional : [ "prompt_optimizer" , "fast_pretreatment" , "duration" , "resolution" , "callback_url" , "region" ] } ,
266+ { optional : [ "prompt_optimizer" , "fast_pretreatment" , "duration" , "resolution" , "callback_url" ] } ,
261267) ;
262268
263269const imageToVideoInputSchema = s . object (
264270 "Request body for creating a MiniMax image-to-video generation task from a first frame image." ,
265271 {
266- model : videoModelSchema ,
272+ model : imageToVideoModelSchema ,
267273 first_frame_image : trimmedNonEmptyString ( "First frame image as a public HTTPS URL or a data URI base64 string." ) ,
268274 prompt : optionalTrimmedString ( "Text description that guides the generated video." ) ,
269275 prompt_optimizer : videoPromptOptimizerSchema ,
270276 fast_pretreatment : videoFastPretreatmentSchema ,
271277 duration : videoDurationSchema ,
272- resolution : videoResolutionSchema ,
278+ resolution : imageToVideoResolutionSchema ,
273279 callback_url : videoCallbackUrlSchema ,
274- region : videoRegionSchema ,
275- } ,
276- {
277- optional : [ "prompt" , "prompt_optimizer" , "fast_pretreatment" , "duration" , "resolution" , "callback_url" , "region" ] ,
278280 } ,
281+ { optional : [ "prompt" , "prompt_optimizer" , "fast_pretreatment" , "duration" , "resolution" , "callback_url" ] } ,
279282) ;
280283
281- const queryVideoGenerationInputSchema = s . object (
282- "Input parameters for querying a MiniMax video generation task." ,
283- {
284- task_id : trimmedNonEmptyString ( "Identifier of the MiniMax video generation task to query." ) ,
285- region : videoRegionSchema ,
286- } ,
287- { optional : [ "region" ] } ,
288- ) ;
284+ const queryVideoGenerationInputSchema = s . object ( "Input parameters for querying a MiniMax video generation task." , {
285+ task_id : trimmedNonEmptyString ( "Identifier of the MiniMax video generation task to query." ) ,
286+ } ) ;
289287
290- const downloadVideoInputSchema = s . object (
291- "Input parameters for retrieving a generated MiniMax video file." ,
292- {
293- file_id : trimmedNonEmptyString ( "Identifier of the generated video file to retrieve." ) ,
294- region : videoRegionSchema ,
295- } ,
296- { optional : [ "region" ] } ,
297- ) ;
288+ const downloadVideoInputSchema = s . object ( "Input parameters for retrieving a generated MiniMax video file." , {
289+ file_id : trimmedNonEmptyString ( "Identifier of the generated video file to retrieve." ) ,
290+ } ) ;
298291
299292const minimaxBaseRespSchema = s . looseRequiredObject (
300293 "MiniMax base response wrapper." ,
@@ -331,7 +324,7 @@ const videoFileOutputSchema = s.looseRequiredObject(
331324 file : s . looseRequiredObject (
332325 "MiniMax file object with download metadata." ,
333326 {
334- file_id : s . integer ( "MiniMax file identifier." ) ,
327+ file_id : s . string ( "MiniMax file identifier." ) ,
335328 bytes : s . integer ( "Size of the file in bytes." ) ,
336329 created_at : s . integer ( "File creation time as Unix seconds." ) ,
337330 filename : s . string ( "File name assigned by MiniMax." ) ,
0 commit comments