@apicity/fal 0.10.3 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/zod.js CHANGED
@@ -329,6 +329,88 @@ export const FalSeedance2p5ReferenceToVideoRequestSchema = FalSeedance2p5TextToV
329
329
  }
330
330
  });
331
331
  // ---------------------------------------------------------------------------
332
+ // Lightricks LTX-2.5 image-to-video (pro tier)
333
+ // ---------------------------------------------------------------------------
334
+ export const FalLtx2p5ImageToVideoProRequestSchema = z.object({
335
+ image_url: z.string(),
336
+ // When set, upstream generates a transition between the start and end
337
+ // frames instead of animating the start frame alone.
338
+ end_image_url: z.string().nullable().optional(),
339
+ prompt: z.string().min(1).max(5000),
340
+ // Output length in seconds, or "auto" to let the model choose. A fixed
341
+ // vocabulary, not a model registry, so it stays a closed union.
342
+ duration: z
343
+ .union([z.literal(6), z.literal(8), z.literal(10), z.literal("auto")])
344
+ .optional(),
345
+ resolution: z.enum(["720p", "1080p"]).optional(),
346
+ // "auto" derives the ratio from the start image.
347
+ aspect_ratio: z.enum(["auto", "16:9", "9:16"]).optional(),
348
+ fps: z.union([z.literal(24), z.literal(25), z.literal(50)]).optional(),
349
+ generate_audio: z.boolean().optional(),
350
+ camera_motion: z
351
+ .enum([
352
+ "dolly_in",
353
+ "dolly_out",
354
+ "dolly_left",
355
+ "dolly_right",
356
+ "jib_up",
357
+ "jib_down",
358
+ "static",
359
+ "focus_shift",
360
+ ])
361
+ .nullable()
362
+ .optional(),
363
+ });
364
+ // ---------------------------------------------------------------------------
365
+ // Lightricks LTX-2.5 image-to-video (fast tier)
366
+ // ---------------------------------------------------------------------------
367
+ export const FalLtx2p5ImageToVideoFastRequestSchema = z.object({
368
+ image_url: z.string(),
369
+ // When set, upstream generates a transition between the start and end
370
+ // frames instead of animating the start frame alone.
371
+ end_image_url: z.string().nullable().optional(),
372
+ prompt: z.string().min(1).max(5000),
373
+ // Output length in seconds, or "auto" to let the model choose. The fast
374
+ // tier reaches 20s, twice the pro tier's ceiling. A fixed vocabulary, not a
375
+ // model registry, so it stays a closed union.
376
+ duration: z
377
+ .union([
378
+ z.literal(6),
379
+ z.literal(8),
380
+ z.literal(10),
381
+ z.literal(12),
382
+ z.literal(14),
383
+ z.literal(16),
384
+ z.literal(18),
385
+ z.literal(20),
386
+ z.literal("auto"),
387
+ ])
388
+ .optional(),
389
+ // Upstream couples length to resolution and frame rate: 24/25 fps reaches
390
+ // 20s at 720p/1080p, 48/50 fps and the 1440p/2160p tiers cap at 10s. That
391
+ // is a cross-field rule upstream enforces, not a shape this schema encodes.
392
+ resolution: z.enum(["720p", "1080p", "1440p", "2160p"]).optional(),
393
+ // "auto" derives the ratio from the start image.
394
+ aspect_ratio: z.enum(["auto", "16:9", "9:16"]).optional(),
395
+ fps: z
396
+ .union([z.literal(24), z.literal(25), z.literal(48), z.literal(50)])
397
+ .optional(),
398
+ generate_audio: z.boolean().optional(),
399
+ camera_motion: z
400
+ .enum([
401
+ "dolly_in",
402
+ "dolly_out",
403
+ "dolly_left",
404
+ "dolly_right",
405
+ "jib_up",
406
+ "jib_down",
407
+ "static",
408
+ "focus_shift",
409
+ ])
410
+ .nullable()
411
+ .optional(),
412
+ });
413
+ // ---------------------------------------------------------------------------
332
414
  // Nano Banana 2 text-to-image
333
415
  // ---------------------------------------------------------------------------
334
416
  export const FalNanoBanana2TextToImageRequestSchema = z.object({
@@ -449,6 +531,193 @@ export const FalNanoBanana2LiteEditRequestSchema = FalNanoBanana2LiteTextToImage
449
531
  image_urls: z.array(z.string()).optional(),
450
532
  });
451
533
  // ---------------------------------------------------------------------------
534
+ // Google Virtual Try-On
535
+ // ---------------------------------------------------------------------------
536
+ export const FalVirtualTryOnRequestSchema = z.object({
537
+ person_image_url: z.string(),
538
+ product_image_url: z.string(),
539
+ // Upstream documents 1..4 inclusive, defaulting to 1 when omitted.
540
+ num_images: z.number().int().min(1).max(4).optional(),
541
+ });
542
+ // ---------------------------------------------------------------------------
543
+ // Topaz Precision Image Upscale (Gigapixel)
544
+ // ---------------------------------------------------------------------------
545
+ // Topaz versions its Gigapixel precision models on its own cadence — the
546
+ // endpoint's own prose still lists five while the schema enum already carries
547
+ // six ("High Fidelity V3" landed without the prose catching up) — so the enum
548
+ // is unioned with a family alias rather than closed or opened to bare
549
+ // `z.string()`. The alias matches Topaz's actual id grammar: title-cased words
550
+ // with an optional trailing `V<n>` revision, e.g. "High Fidelity V4".
551
+ const FalTopazPrecisionModelAliasSchema = z
552
+ .string()
553
+ .regex(/^[A-Z][A-Za-z]*(?: [A-Z][A-Za-z]*)*(?: V\d+)?$/, 'Expected a listed model or a Topaz precision alias (e.g. "High Fidelity V4")');
554
+ export const FalTopazUpscaleImagePrecisionRequestSchema = z.object({
555
+ image_url: z.string().min(1),
556
+ model: z
557
+ .enum([
558
+ "Standard V2",
559
+ "High Fidelity V3",
560
+ "High Fidelity V2",
561
+ "Low Resolution V2",
562
+ "CGI",
563
+ "Text Refine",
564
+ ])
565
+ .or(FalTopazPrecisionModelAliasSchema)
566
+ .optional(),
567
+ // Upstream documents 1..4 inclusive, defaulting to 2 when omitted.
568
+ upscale_factor: z.number().min(1).max(4).optional(),
569
+ crop_to_fill: z.boolean().optional(),
570
+ output_format: z.enum(["jpeg", "png"]).optional(),
571
+ subject_detection: z.enum(["All", "Foreground", "Background"]).optional(),
572
+ face_enhancement: z.boolean().optional(),
573
+ face_enhancement_creativity: z.number().min(0).max(1).optional(),
574
+ face_enhancement_strength: z.number().min(0).max(1).optional(),
575
+ // Upstream types these four as `number | null` with a model-dependent
576
+ // default, so null is an accepted way to ask for the model's own default.
577
+ sharpen: z.number().min(0).max(1).nullable().optional(),
578
+ denoise: z.number().min(0).max(1).nullable().optional(),
579
+ fix_compression: z.number().min(0).max(1).nullable().optional(),
580
+ // Text Refine only; upstream's floor is 0.01, not 0.
581
+ strength: z.number().min(0.01).max(1).nullable().optional(),
582
+ });
583
+ // Topaz Precision Video Upscale
584
+ // ---------------------------------------------------------------------------
585
+ // Topaz ships new precision engines and new revisions of existing ones on its
586
+ // own cadence — the endpoint's own prose names seven families while the schema
587
+ // enum already carries twenty-one concrete ids, and "Proteus Natural" appears
588
+ // in neither the prose list nor the older Gigapixel image family — so the enum
589
+ // is unioned with a family alias rather than closed or opened to a bare
590
+ // `z.string()`. The alias matches Topaz's actual id grammar: title-cased words,
591
+ // a literal `&`, and an optional trailing revision number ("Gaia 2",
592
+ // "Proteus V3").
593
+ const FalTopazPrecisionVideoModelAliasSchema = z
594
+ .string()
595
+ .regex(/^[A-Z][A-Za-z]*(?: (?:[A-Z][A-Za-z]*|&))*(?: (?:V\d+|\d+))?$/, 'Expected a listed model or a Topaz precision alias (e.g. "Proteus V3")');
596
+ export const FalTopazUpscaleVideoPrecisionRequestSchema = z.object({
597
+ video_url: z.string(),
598
+ model: z
599
+ .enum([
600
+ "Proteus",
601
+ "Proteus Natural",
602
+ "Iris",
603
+ "Iris Low Quality",
604
+ "Dione DV",
605
+ "Dione TV",
606
+ "Dione Robust",
607
+ "Dione Dehalo",
608
+ "Dione Robust Dehalo",
609
+ "Artemis High Quality",
610
+ "Artemis Medium Quality",
611
+ "Artemis Low Quality",
612
+ "Artemis Strong Halo",
613
+ "Artemis Medium Halo",
614
+ "Artemis Aliasing & Moire",
615
+ "Gaia HQ",
616
+ "Gaia CG",
617
+ "Gaia 2",
618
+ "Rhea",
619
+ "Theia Fine Tune Detail",
620
+ "Theia Fine Tune Fidelity",
621
+ ])
622
+ .or(FalTopazPrecisionVideoModelAliasSchema)
623
+ .optional(),
624
+ // Upstream documents 1..4 inclusive, defaulting to 2 when omitted.
625
+ upscale_factor: z.number().min(1).max(4).optional(),
626
+ // Apollo frame interpolation runs only when this differs from the source FPS.
627
+ target_fps: z.number().int().min(16).max(60).nullable().optional(),
628
+ // Upstream types these enhancement levels as `number | null` with a
629
+ // model-dependent default, so null is an accepted way to ask for the model's
630
+ // own default.
631
+ compression: z.number().min(0).max(1).nullable().optional(),
632
+ noise: z.number().min(0).max(1).nullable().optional(),
633
+ halo: z.number().min(0).max(1).nullable().optional(),
634
+ // Film grain is a 0..0.1 band in 0.01 steps, not the 0..1 of the levels above.
635
+ grain: z.number().min(0).max(0.1).multipleOf(0.01).nullable().optional(),
636
+ recover_detail: z.number().min(0).max(1).nullable().optional(),
637
+ // Output codec toggle; upstream defaults to H265. The field name is
638
+ // upstream's own casing.
639
+ H264_output: z.boolean().optional(),
640
+ });
641
+ // Meshy-7 image-to-3D
642
+ // ---------------------------------------------------------------------------
643
+ export const FalMeshyV7ImageTo3dRequestSchema = z.object({
644
+ image_url: z.string(),
645
+ // Mesh generation mode, not a model registry. Upstream's OpenAPI document
646
+ // advertises a third value, "lowpoly", but the endpoint rejects it live:
647
+ // POST /meshy/v7/image-to-3d returns 422 `model_type: lowpoly is not
648
+ // supported for meshy-7` (2026-08-28), so the published enum is wider than
649
+ // the endpoint and only these two are accepted. "smart-topology" routes to
650
+ // Meshy-T2, which caps target_polycount at 15,000 and cannot be combined
651
+ // with ultra_mode.
652
+ model_type: z.enum(["standard", "smart-topology"]).optional(),
653
+ topology: z.enum(["quad", "triangle"]).optional(),
654
+ target_polycount: z.number().int().min(100).max(300000).optional(),
655
+ symmetry_mode: z.enum(["off", "auto", "on"]).optional(),
656
+ should_remesh: z.boolean().optional(),
657
+ should_texture: z.boolean().optional(),
658
+ enable_pbr: z.boolean().optional(),
659
+ // Upstream deprecates is_a_t_pose in favour of pose_mode; the empty string
660
+ // is upstream's own "no specific pose" default.
661
+ is_a_t_pose: z.boolean().optional(),
662
+ pose_mode: z.enum(["a-pose", "t-pose", ""]).optional(),
663
+ texture_prompt: z.string().max(600).optional(),
664
+ texture_image_url: z.string().optional(),
665
+ enable_rigging: z.boolean().optional(),
666
+ rigging_height_meters: z.number().positive().optional(),
667
+ enable_animation: z.boolean().optional(),
668
+ // Meshy animation preset id. Upstream documents 0..696 inclusive (0 is
669
+ // "Idle") and rejects anything outside that window with a 422.
670
+ animation_action_id: z.number().int().min(0).max(696).optional(),
671
+ enable_safety_checker: z.boolean().optional(),
672
+ ultra_mode: z.boolean().optional(),
673
+ });
674
+ // Google Gemini Omni Flash (text-to-video with synchronized audio)
675
+ // ---------------------------------------------------------------------------
676
+ export const FalGeminiOmniFlashRequestSchema = z.object({
677
+ // Upstream caps the prompt at 20,000 characters.
678
+ prompt: z.string().max(20_000),
679
+ // Upstream documents "16:9" and "9:16", defaulting to "16:9" when omitted.
680
+ aspect_ratio: z.enum(["16:9", "9:16"]).optional(),
681
+ // Upstream documents 3..10 inclusive seconds, defaulting to 8 when omitted.
682
+ duration: z.number().int().min(3).max(10).optional(),
683
+ });
684
+ // Google Gemini Omni Flash edit (video-to-video)
685
+ // ---------------------------------------------------------------------------
686
+ export const FalGeminiOmniFlashEditRequestSchema = z.object({
687
+ // Upstream caps the prompt at 20,000 characters. Simple instructions work
688
+ // best; voice editing is not supported.
689
+ prompt: z.string().max(20_000),
690
+ // URL of the source video to edit. Required alongside the prompt.
691
+ video_url: z.string(),
692
+ });
693
+ // Google Gemini Omni Flash image-to-video
694
+ // ---------------------------------------------------------------------------
695
+ export const FalGeminiOmniFlashImageToVideoRequestSchema = z.object({
696
+ // Upstream caps the prompt at 20,000 characters. Describes how the still
697
+ // image should be animated.
698
+ prompt: z.string().max(20_000),
699
+ // URL of the input image to animate. Required alongside the prompt.
700
+ image_url: z.string(),
701
+ // Upstream default "16:9"; the vocabulary is fixed, so this stays closed.
702
+ aspect_ratio: z.enum(["16:9", "9:16"]).optional(),
703
+ // Seconds of generated video. Upstream default 8, bounded 3..10.
704
+ duration: z.number().int().min(3).max(10).optional(),
705
+ });
706
+ // Google Gemini Omni Flash reference-to-video
707
+ // ---------------------------------------------------------------------------
708
+ export const FalGeminiOmniFlashReferenceToVideoRequestSchema = z.object({
709
+ // Upstream caps the prompt at 20,000 characters. Reference images can be
710
+ // bound to roles inline with `<IMAGE_REF_0>`-style tags, 0-based.
711
+ prompt: z.string().max(20_000),
712
+ // Reference images to incorporate into the video. Upstream requires at
713
+ // least one and accepts at most ten.
714
+ image_urls: z.array(z.string()).min(1).max(10),
715
+ // Upstream default "16:9"; the vocabulary is fixed, so this stays closed.
716
+ aspect_ratio: z.enum(["16:9", "9:16"]).optional(),
717
+ // Seconds of generated video. Upstream default 8, bounded 3..10.
718
+ duration: z.number().int().min(3).max(10).optional(),
719
+ });
720
+ // ---------------------------------------------------------------------------
452
721
  // Nano Banana text-to-image
453
722
  // ---------------------------------------------------------------------------
454
723
  export const FalNanoBananaTextToImageRequestSchema = z.object({
@@ -710,6 +979,100 @@ export const FalSeedreamV5LiteTextToImageRequestSchema = z.object({
710
979
  enable_safety_checker: z.boolean().optional(),
711
980
  });
712
981
  // ---------------------------------------------------------------------------
982
+ // Bytedance Seedream v5 Pro layerize
983
+ // ---------------------------------------------------------------------------
984
+ // Decomposes one image into a base image plus independently editable layers.
985
+ // `image_url` is the only required field; everything else is optional with an
986
+ // upstream default. Docs:
987
+ // https://fal.ai/models/bytedance/seedream/v5/pro/layerize/api
988
+ export const FalSeedreamV5ProLayerizeRequestSchema = z.object({
989
+ // Upstream constrains the source image to 512x512..6000x6000 total pixels,
990
+ // an aspect ratio within [1/16, 16], and 30 MB. Those are upstream capacity
991
+ // rules over the fetched bytes, not request shape, so they are not encoded.
992
+ image_url: z.string(),
993
+ // Optional instructions naming which elements to separate; the default empty
994
+ // string lets the model pick the major elements. Normalized
995
+ // `<bbox>left top right bottom</bbox>` tags target precise coordinates.
996
+ prompt: z.string().optional(),
997
+ // Resolution tier for the base image and every layer. A fixed vocabulary
998
+ // rather than a model registry, so it stays a closed enum.
999
+ image_size: z.enum(["auto", "auto_1K", "auto_1.5K", "auto_2K"]).optional(),
1000
+ // Prompt optimization mode: `standard` favours image quality, `fast` cuts
1001
+ // generation time. Also a closed vocabulary.
1002
+ enhance_prompt_mode: z.enum(["standard", "fast"]).optional(),
1003
+ sync_mode: z.boolean().optional(),
1004
+ // Upstream notes that disabling the safety checker requires account
1005
+ // authorization; unauthorized requests are checked regardless.
1006
+ enable_safety_checker: z.boolean().optional(),
1007
+ });
1008
+ // Bytedance Seedream v5 Pro text-to-image
1009
+ // Bytedance Seedream v5 Pro (shared image_size)
1010
+ // ---------------------------------------------------------------------------
1011
+ // The Pro surface offers `auto_1K`/`auto_2K` where the Lite surface offers
1012
+ // `auto_2K`/`auto_3K`/`auto_4K`, so it carries its own union rather than
1013
+ // reusing FalSeedreamV5LiteImageSizeSchema.
1014
+ // Docs: https://fal.ai/models/bytedance/seedream/v5/pro/text-to-image/api
1015
+ // Docs: https://fal.ai/models/bytedance/seedream/v5/pro/edit/api
1016
+ const FalSeedreamV5ProImageSizeSchema = z.union([
1017
+ z.enum([
1018
+ "square_hd",
1019
+ "square",
1020
+ "portrait_4_3",
1021
+ "portrait_16_9",
1022
+ "landscape_4_3",
1023
+ "landscape_16_9",
1024
+ "auto_1K",
1025
+ "auto_2K",
1026
+ ]),
1027
+ z.object({ width: z.number(), height: z.number() }),
1028
+ ]);
1029
+ export const FalSeedreamV5ProTextToImageRequestSchema = z.object({
1030
+ prompt: z.string(),
1031
+ // Upstream constrains the generated image to a total area between
1032
+ // 1024x1024 and 2048x2048 pixels and an aspect ratio within [1/16, 16].
1033
+ // Those are upstream capacity rules over the produced image, not request
1034
+ // shape, so they are not encoded here. Defaults to `auto_2K`.
1035
+ image_size: FalSeedreamV5ProImageSizeSchema.optional(),
1036
+ // Fal documents `num_images` as an integer in [1, 6] — separate model
1037
+ // generations run with the prompt. Unlike the Lite surface, Pro has no
1038
+ // `max_images` companion field.
1039
+ num_images: z.number().int().min(1).max(6).optional(),
1040
+ // File format of the generated image. A fixed vocabulary rather than a
1041
+ // model registry, so it stays a closed enum.
1042
+ output_format: z.enum(["jpeg", "png"]).optional(),
1043
+ sync_mode: z.boolean().optional(),
1044
+ // Upstream notes that disabling the safety checker requires account
1045
+ // authorization; unauthorized requests are checked regardless.
1046
+ enable_safety_checker: z.boolean().optional(),
1047
+ });
1048
+ // ---------------------------------------------------------------------------
1049
+ // Bytedance Seedream v5 Pro edit
1050
+ // ---------------------------------------------------------------------------
1051
+ export const FalSeedreamV5ProEditRequestSchema = z.object({
1052
+ prompt: z.string(),
1053
+ // Fal documents the reference-image list as "up to 10 images ... if more are
1054
+ // sent, only the last 10 are used". Upstream truncates rather than rejecting,
1055
+ // so the cap is not encoded; the list is required and must be non-empty.
1056
+ // Docs: https://fal.ai/models/bytedance/seedream/v5/pro/edit/api
1057
+ image_urls: z.array(z.string()).min(1),
1058
+ // Upstream constrains the generated image to a total area between
1059
+ // 1024x1024 and 2048x2048 pixels and an aspect ratio within [1/16, 16].
1060
+ // Those are upstream capacity rules over the produced image, not request
1061
+ // shape, so they are not encoded here. Defaults to `auto_2K`.
1062
+ image_size: FalSeedreamV5ProImageSizeSchema.optional(),
1063
+ // Fal documents `num_images` as an integer in [1, 6] — separate model
1064
+ // generations run with the prompt. Unlike the Lite surface, Pro has no
1065
+ // `max_images` companion field.
1066
+ num_images: z.number().int().min(1).max(6).optional(),
1067
+ // File format of the generated image. A fixed vocabulary rather than a
1068
+ // model registry, so it stays a closed enum.
1069
+ output_format: z.enum(["jpeg", "png"]).optional(),
1070
+ sync_mode: z.boolean().optional(),
1071
+ // Upstream notes that disabling the safety checker requires account
1072
+ // authorization; unauthorized requests are checked regardless.
1073
+ enable_safety_checker: z.boolean().optional(),
1074
+ });
1075
+ // ---------------------------------------------------------------------------
713
1076
  // Bytedance Seed Speech TTS v2
714
1077
  // ---------------------------------------------------------------------------
715
1078
  const FalSeedSpeechTtsV2VoiceSchema = z.enum([
@@ -789,6 +1152,24 @@ export const FalSeedSpeechTtsV2RequestSchema = z.object({
789
1152
  voice_instruction: z.string().nullable().optional(),
790
1153
  });
791
1154
  // ---------------------------------------------------------------------------
1155
+ // MiniMax Music 3
1156
+ // ---------------------------------------------------------------------------
1157
+ // Bounds are upstream's own, read on 2026-08-28 from
1158
+ // https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=minimax/music-3.
1159
+ // `prompt` and `lyrics` are the only required fields; the rest are closed
1160
+ // numeric ranges. No field names a model, so the open-enum rule does not apply.
1161
+ export const FalMinimaxMusic3RequestSchema = z.object({
1162
+ prompt: z.string(),
1163
+ lyrics: z.string(),
1164
+ // Upper bound on the generated audio length in seconds. The model may stop
1165
+ // earlier and reports the length it actually produced in the response.
1166
+ duration: z.number().min(1).max(300).optional(),
1167
+ seed: z.number().int().nullable().optional(),
1168
+ // Flow-matching Euler steps per 8-second denoising chunk.
1169
+ num_inference_steps: z.number().int().min(1).max(100).optional(),
1170
+ guidance_scale: z.number().min(0).max(20).optional(),
1171
+ });
1172
+ // ---------------------------------------------------------------------------
792
1173
  // Alibaba Qwen Image 3 text-to-image
793
1174
  // ---------------------------------------------------------------------------
794
1175
  // Fal publishes a total-pixel range of 512x512 through 2048x2048 and a
@@ -836,6 +1217,55 @@ export const FalAlibabaQwenImage3TextToImageRequestSchema = z.object({
836
1217
  output_format: z.enum(["jpeg", "png", "webp"]).optional(),
837
1218
  });
838
1219
  // ---------------------------------------------------------------------------
1220
+ // Alibaba Qwen Image 3 edit
1221
+ // ---------------------------------------------------------------------------
1222
+ // Same image_size vocabulary and total-pixel rule as text-to-image; only the
1223
+ // error message names this endpoint.
1224
+ // Docs: https://fal.ai/models/alibaba/qwen-image-3/edit/api
1225
+ const FalAlibabaQwenImage3EditImageSizeSchema = z.union([
1226
+ z.enum([
1227
+ "square_hd",
1228
+ "square",
1229
+ "portrait_4_3",
1230
+ "portrait_16_9",
1231
+ "landscape_4_3",
1232
+ "landscape_16_9",
1233
+ ]),
1234
+ z
1235
+ .object({
1236
+ width: z.number().int().positive().max(14142),
1237
+ height: z.number().int().positive().max(14142),
1238
+ })
1239
+ .refine((value) => value.width * value.height >= 512 * 512 &&
1240
+ value.width * value.height <= 2048 * 2048, {
1241
+ message: "alibaba/qwen-image-3/edit image_size total pixels must be between 512x512 and 2048x2048",
1242
+ path: ["width"],
1243
+ }),
1244
+ ]);
1245
+ export const FalAlibabaQwenImage3EditRequestSchema = z.object({
1246
+ // Supports Chinese and English; max 5000 characters. Reference the inputs
1247
+ // positionally as "image 1", "image 2", "image 3".
1248
+ prompt: z.string().min(1).max(5000),
1249
+ // 1-3 reference images, 384-2048px per dimension, 10MB each, JPEG/PNG
1250
+ // (no alpha)/WEBP. Order is meaningful.
1251
+ image_urls: z.array(z.string()).min(1).max(3),
1252
+ // Upstream default "".
1253
+ negative_prompt: z.string().max(500).nullable().optional(),
1254
+ // Upstream default square_hd.
1255
+ image_size: FalAlibabaQwenImage3EditImageSizeSchema.nullable().optional(),
1256
+ // Upstream default true.
1257
+ enable_prompt_expansion: z.boolean().optional(),
1258
+ seed: z.number().int().nullable().optional(),
1259
+ // Upstream default true. Disabling requires account authorization;
1260
+ // unauthorized requests are checked anyway.
1261
+ enable_safety_checker: z.boolean().optional(),
1262
+ sync_mode: z.boolean().optional(),
1263
+ // Upstream default 1; published range 1-6.
1264
+ num_images: z.number().int().min(1).max(6).optional(),
1265
+ // Upstream default "png".
1266
+ output_format: z.enum(["jpeg", "png", "webp"]).optional(),
1267
+ });
1268
+ // ---------------------------------------------------------------------------
839
1269
  // Alibaba Wan 3.0 shared vocabularies
840
1270
  // ---------------------------------------------------------------------------
841
1271
  // The base `alibaba/wan-3.0/*` and premium `alibaba/wan-3.0-prime/*` families
@@ -931,6 +1361,140 @@ export const FalWan3p0ReferenceToVideoRequestSchema = z
931
1361
  path: ["reference_image_urls"],
932
1362
  });
933
1363
  // ---------------------------------------------------------------------------
1364
+ // MiniMax Hailuo 03 (H3) text-to-video
1365
+ // ---------------------------------------------------------------------------
1366
+ // `prompt` is the only required field; every other field carries an upstream
1367
+ // default (duration 5, resolution 2K, aspect_ratio 16:9,
1368
+ // prompt_expansion_mode balanced, enable_safety_checker true, sync_mode
1369
+ // false). No field names a model, so there is no open model-alias union here:
1370
+ // the three vocabularies below are fixed upstream enums and stay closed.
1371
+ // Docs: https://fal.ai/models/minimax/h3/text-to-video/api
1372
+ export const FalMinimaxH3TextToVideoRequestSchema = z.object({
1373
+ prompt: z.string().min(1).max(50000),
1374
+ // Output length in seconds; upstream publishes the range 5-15.
1375
+ duration: z.number().int().min(5).max(15).optional(),
1376
+ // 480P and 768P are native generation modes; 2K and 4K upscale a 768P base
1377
+ // result. A fixed tier vocabulary, not a model registry.
1378
+ resolution: z.enum(["480P", "768P", "2K", "4K"]).optional(),
1379
+ aspect_ratio: z
1380
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
1381
+ .optional(),
1382
+ // How much effort to spend rewriting the prompt before generation:
1383
+ // `disabled` skips expansion, `fast` returns in about a second, `quality`
1384
+ // spends up to ~30s, `balanced` picks per request. Upstream types it as
1385
+ // nullable, so an explicit null is accepted alongside omission.
1386
+ prompt_expansion_mode: z
1387
+ .enum(["disabled", "fast", "balanced", "quality"])
1388
+ .nullable()
1389
+ .optional(),
1390
+ seed: z.number().int().nullable().optional(),
1391
+ enable_safety_checker: z.boolean().optional(),
1392
+ // Returns the video as base64 instead of a CDN URL.
1393
+ sync_mode: z.boolean().optional(),
1394
+ });
1395
+ // ---------------------------------------------------------------------------
1396
+ // MiniMax Hailuo 03 (H3) image-to-video
1397
+ // ---------------------------------------------------------------------------
1398
+ // `prompt` is the only required field; every other field carries an upstream
1399
+ // default (duration 5, resolution 2K, prompt_expansion_mode balanced,
1400
+ // enable_safety_checker true, sync_mode false). Unlike the text-to-video
1401
+ // sibling there is no `aspect_ratio` — upstream derives the output ratio from
1402
+ // `image_url` instead. No field names a model, so there is no open
1403
+ // model-alias union here: the two vocabularies below are fixed upstream enums
1404
+ // and stay closed.
1405
+ //
1406
+ // `image_url` is genuinely OPTIONAL upstream, not merely nullable: the
1407
+ // published contract states that omitting it makes the request behave as
1408
+ // text-to-video at 16:9. That is documented upstream behaviour rather than a
1409
+ // nonsense request, so it is mirrored faithfully instead of being refined
1410
+ // away.
1411
+ // Docs: https://fal.ai/models/minimax/h3/image-to-video/api
1412
+ export const FalMinimaxH3ImageToVideoRequestSchema = z.object({
1413
+ prompt: z.string().min(1).max(50000),
1414
+ // First frame of the generated video; the output aspect ratio follows it.
1415
+ image_url: z.string().url().nullable().optional(),
1416
+ // Last frame, for first-to-last keyframe generation.
1417
+ end_image_url: z.string().url().nullable().optional(),
1418
+ // Output length in seconds; upstream publishes the range 5-15.
1419
+ duration: z.number().int().min(5).max(15).optional(),
1420
+ // 480P and 768P are native generation modes; 2K and 4K upscale a 768P base
1421
+ // result. A fixed tier vocabulary, not a model registry.
1422
+ resolution: z.enum(["480P", "768P", "2K", "4K"]).optional(),
1423
+ // How much effort to spend rewriting the prompt before generation:
1424
+ // `disabled` skips expansion, `fast` returns in about a second, `quality`
1425
+ // spends up to ~30s, `balanced` picks per request. Upstream types it as
1426
+ // nullable, so an explicit null is accepted alongside omission.
1427
+ prompt_expansion_mode: z
1428
+ .enum(["disabled", "fast", "balanced", "quality"])
1429
+ .nullable()
1430
+ .optional(),
1431
+ seed: z.number().int().nullable().optional(),
1432
+ enable_safety_checker: z.boolean().optional(),
1433
+ // Returns the video as base64 instead of a CDN URL.
1434
+ sync_mode: z.boolean().optional(),
1435
+ });
1436
+ // MiniMax Hailuo 03 (H3) reference-to-video
1437
+ // ---------------------------------------------------------------------------
1438
+ // `prompt` is the only required field, and here it also binds the reference
1439
+ // assets together: upstream documents citing them positionally from the
1440
+ // prompt text as "Image 1", "Video 1", "Audio 1", and so on. Every other
1441
+ // field carries an upstream default (duration 5, aspect_ratio adaptive,
1442
+ // resolution 2K, prompt_expansion_mode balanced, enable_safety_checker true,
1443
+ // sync_mode false). No field names a model, so no open model-alias union
1444
+ // applies - the three vocabularies below are fixed upstream enums and stay
1445
+ // closed.
1446
+ //
1447
+ // Upstream marks the reference lists optional, so a prompt-only request is
1448
+ // valid and is mirrored rather than refined away. Two published rules are
1449
+ // encoded below: audio may not be the only reference modality, and the three
1450
+ // lists together may not exceed 12 files. The per-list caps (9/3/3) sum to
1451
+ // 15, so that combined cap is a real constraint rather than a restatement.
1452
+ // Docs: https://fal.ai/models/minimax/h3/reference-to-video/api
1453
+ export const FalMinimaxH3ReferenceToVideoRequestSchema = z
1454
+ .object({
1455
+ prompt: z.string().min(1).max(50000),
1456
+ // Subject/style references, cited in the prompt as "Image 1", "Image 2".
1457
+ reference_image_urls: z.array(z.string().url()).max(9).optional(),
1458
+ // Motion references: 2-15s each, at most 15s combined.
1459
+ reference_video_urls: z.array(z.string().url()).max(3).optional(),
1460
+ // Audio references: 2-15s each, at most 15s combined.
1461
+ reference_audio_urls: z.array(z.string().url()).max(3).optional(),
1462
+ // Output length in seconds; upstream publishes the range 5-15.
1463
+ duration: z.number().int().min(5).max(15).optional(),
1464
+ // `adaptive` derives the output ratio from the reference assets.
1465
+ aspect_ratio: z
1466
+ .enum(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
1467
+ .optional(),
1468
+ // 480P and 768P are native generation modes; 2K and 4K upscale a 768P
1469
+ // base result. A fixed tier vocabulary, not a model registry.
1470
+ resolution: z.enum(["480P", "768P", "2K", "4K"]).optional(),
1471
+ // How much effort to spend rewriting the prompt before generation:
1472
+ // `disabled` skips expansion, `fast` returns in about a second, `quality`
1473
+ // spends up to ~30s, `balanced` picks per request. Upstream types it as
1474
+ // nullable, so an explicit null is accepted alongside omission.
1475
+ prompt_expansion_mode: z
1476
+ .enum(["disabled", "fast", "balanced", "quality"])
1477
+ .nullable()
1478
+ .optional(),
1479
+ seed: z.number().int().nullable().optional(),
1480
+ enable_safety_checker: z.boolean().optional(),
1481
+ // Returns the video as base64 instead of a CDN URL.
1482
+ sync_mode: z.boolean().optional(),
1483
+ })
1484
+ .refine((v) => !v.reference_audio_urls?.length ||
1485
+ Boolean(v.reference_image_urls?.length) ||
1486
+ Boolean(v.reference_video_urls?.length), {
1487
+ message: "minimax/h3/reference-to-video cannot take reference_audio_urls as its only reference modality; pass at least one reference image or video with it",
1488
+ path: ["reference_audio_urls"],
1489
+ })
1490
+ .refine((v) => (v.reference_image_urls?.length ?? 0) +
1491
+ (v.reference_video_urls?.length ?? 0) +
1492
+ (v.reference_audio_urls?.length ?? 0) <=
1493
+ 12, {
1494
+ message: "minimax/h3/reference-to-video accepts at most 12 reference files across reference_image_urls, reference_video_urls, and reference_audio_urls",
1495
+ path: ["reference_image_urls"],
1496
+ });
1497
+ // ---------------------------------------------------------------------------
934
1498
  // Wan v2.7 text-to-image
935
1499
  // ---------------------------------------------------------------------------
936
1500
  const FalWanV2p7ImageSizeSchema = z.union([
@@ -1383,6 +1947,31 @@ export const FalXaiGrokImagineVideoReferenceToVideoRequestSchema = z.object({
1383
1947
  resolution: z.enum(["480p", "720p"]).optional(),
1384
1948
  });
1385
1949
  // ---------------------------------------------------------------------------
1950
+ // xAI Grok Imagine Video 1.5 reference-to-video
1951
+ // ---------------------------------------------------------------------------
1952
+ // A distinct endpoint from the unversioned sibling above, not a re-skin. The
1953
+ // v1.5 contract read 2026-08-28 raises the `duration` ceiling to 15s (the
1954
+ // unversioned path stops at 10), requires at least one reference image, bounds
1955
+ // `prompt` at 4096 characters, and tags references as `<IMAGE_0>`/`<IMAGE_1>`
1956
+ // where the unversioned sibling's examples use `@Image1`. Field order mirrors
1957
+ // upstream `x-fal-order-properties`.
1958
+ export const FalXaiGrokImagineVideoV1p5ReferenceToVideoRequestSchema = z.object({
1959
+ prompt: z
1960
+ .string()
1961
+ .max(4096)
1962
+ .describe("Text prompt describing the video. Tag references as <IMAGE_0>, <IMAGE_1>, etc."),
1963
+ reference_image_urls: z
1964
+ .array(z.string())
1965
+ .min(1)
1966
+ .max(7)
1967
+ .describe("One to seven reference image URLs guiding the video as style and content references."),
1968
+ duration: z.number().int().min(1).max(15).optional(),
1969
+ resolution: z.enum(["480p", "720p"]).optional(),
1970
+ aspect_ratio: z
1971
+ .enum(["16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16"])
1972
+ .optional(),
1973
+ });
1974
+ // ---------------------------------------------------------------------------
1386
1975
  // xAI Grok Imagine Video extend-video
1387
1976
  // ---------------------------------------------------------------------------
1388
1977
  // Upstream server-side invariant: source video length + `duration` must be
@@ -1618,6 +2207,8 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
1618
2207
  "bytedance/seedance-2.5/text-to-video": FalSeedance2p5TextToVideoRequestSchema,
1619
2208
  "bytedance/seedance-2.5/image-to-video": FalSeedance2p5ImageToVideoRequestSchema,
1620
2209
  "bytedance/seedance-2.5/reference-to-video": FalSeedance2p5ReferenceToVideoRequestSchema,
2210
+ "lightricks/ltx-2.5/image-to-video/pro": FalLtx2p5ImageToVideoProRequestSchema,
2211
+ "lightricks/ltx-2.5/image-to-video/fast": FalLtx2p5ImageToVideoFastRequestSchema,
1621
2212
  "fal-ai/nano-banana-pro/edit": FalNanoBananaProEditRequestSchema,
1622
2213
  "fal-ai/nano-banana-pro": FalNanoBananaProTextToImageRequestSchema,
1623
2214
  "fal-ai/nano-banana": FalNanoBananaTextToImageRequestSchema,
@@ -1626,16 +2217,32 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
1626
2217
  "fal-ai/nano-banana-2/edit": FalNanoBanana2EditRequestSchema,
1627
2218
  "google/nano-banana-2-lite": FalNanoBanana2LiteTextToImageRequestSchema,
1628
2219
  "google/nano-banana-lite/edit": FalNanoBanana2LiteEditRequestSchema,
2220
+ "google/virtual-try-on": FalVirtualTryOnRequestSchema,
2221
+ "topaz/upscale/image/precision": FalTopazUpscaleImagePrecisionRequestSchema,
2222
+ "topaz/upscale/video/precision": FalTopazUpscaleVideoPrecisionRequestSchema,
2223
+ "meshy/v7/image-to-3d": FalMeshyV7ImageTo3dRequestSchema,
2224
+ "google/gemini-omni-flash": FalGeminiOmniFlashRequestSchema,
2225
+ "google/gemini-omni-flash/edit": FalGeminiOmniFlashEditRequestSchema,
2226
+ "google/gemini-omni-flash/image-to-video": FalGeminiOmniFlashImageToVideoRequestSchema,
2227
+ "google/gemini-omni-flash/reference-to-video": FalGeminiOmniFlashReferenceToVideoRequestSchema,
1629
2228
  "fal-ai/bytedance/seedream/v5/lite/edit": FalSeedreamV5LiteEditRequestSchema,
1630
2229
  "fal-ai/bytedance/seedream/v5/lite/text-to-image": FalSeedreamV5LiteTextToImageRequestSchema,
2230
+ "bytedance/seedream/v5/pro/layerize": FalSeedreamV5ProLayerizeRequestSchema,
2231
+ "bytedance/seedream/v5/pro/text-to-image": FalSeedreamV5ProTextToImageRequestSchema,
2232
+ "bytedance/seedream/v5/pro/edit": FalSeedreamV5ProEditRequestSchema,
1631
2233
  "fal-ai/bytedance/seed-speech/tts/v2": FalSeedSpeechTtsV2RequestSchema,
2234
+ "minimax/music-3": FalMinimaxMusic3RequestSchema,
1632
2235
  "fal-ai/elevenlabs/speech-to-text/scribe-v2": FalElevenlabsSpeechToTextScribeV2RequestSchema,
2236
+ "alibaba/qwen-image-3/edit": FalAlibabaQwenImage3EditRequestSchema,
1633
2237
  "alibaba/wan-3.0/text-to-video": FalWan3p0TextToVideoRequestSchema,
1634
2238
  "alibaba/wan-3.0/image-to-video": FalWan3p0ImageToVideoRequestSchema,
1635
2239
  "alibaba/wan-3.0/reference-to-video": FalWan3p0ReferenceToVideoRequestSchema,
1636
2240
  "alibaba/wan-3.0-prime/text-to-video": FalWan3p0TextToVideoRequestSchema,
1637
2241
  "alibaba/wan-3.0-prime/image-to-video": FalWan3p0ImageToVideoRequestSchema,
1638
2242
  "alibaba/wan-3.0-prime/reference-to-video": FalWan3p0ReferenceToVideoRequestSchema,
2243
+ "minimax/h3/text-to-video": FalMinimaxH3TextToVideoRequestSchema,
2244
+ "minimax/h3/image-to-video": FalMinimaxH3ImageToVideoRequestSchema,
2245
+ "minimax/h3/reference-to-video": FalMinimaxH3ReferenceToVideoRequestSchema,
1639
2246
  "fal-ai/wan/v2.7/text-to-image": FalWanV2p7TextToImageRequestSchema,
1640
2247
  "fal-ai/wan/v2.7/edit": FalWanV2p7EditRequestSchema,
1641
2248
  "fal-ai/wan/v2.7/pro/text-to-image": FalWanV2p7TextToImageRequestSchema,
@@ -1659,6 +2266,7 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
1659
2266
  "fal-ai/veo3.1/image-to-video": FalVeo3p1ImageToVideoRequestSchema,
1660
2267
  "xai/grok-imagine-video/image-to-video": FalXaiGrokImagineVideoImageToVideoRequestSchema,
1661
2268
  "xai/grok-imagine-video/reference-to-video": FalXaiGrokImagineVideoReferenceToVideoRequestSchema,
2269
+ "xai/grok-imagine-video/v1.5/reference-to-video": FalXaiGrokImagineVideoV1p5ReferenceToVideoRequestSchema,
1662
2270
  "xai/grok-imagine-video/extend-video": FalXaiGrokImagineVideoExtendVideoRequestSchema,
1663
2271
  "xai/grok-imagine-video/edit-video": FalXaiGrokImagineVideoEditVideoRequestSchema,
1664
2272
  "xai/grok-imagine-image": FalXaiGrokImagineImageRequestSchema,