@apicity/fal 0.20.0 → 0.22.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/dist/src/zod.js CHANGED
@@ -1303,10 +1303,11 @@ export const FalAlibabaQwenImage3EditRequestSchema = z.object({
1303
1303
  // Alibaba Wan 3.0 shared vocabularies
1304
1304
  // ---------------------------------------------------------------------------
1305
1305
  // The base `alibaba/wan-3.0/*` and premium `alibaba/wan-3.0-prime/*` families
1306
- // publish byte-identical request schemas per operation — only their billing
1307
- // differs (compute-second metering vs a flat $0.05 per output second). Each
1308
- // operation therefore defines one schema that both endpoint ids reuse, the
1309
- // same way `fal-ai/wan/v2.7/pro/*` reuses its non-pro schemas.
1306
+ // publish byte-identical request schemas per operation. Their cards differ:
1307
+ // base is $0.05/$0.10/$0.20 and prime is $0.068/$0.14/$0.28 per output
1308
+ // second at 480p/720p/1080p (read 2026-10-29). Each operation therefore
1309
+ // defines one schema that both endpoint ids reuse, the same way
1310
+ // `fal-ai/wan/v2.7/pro/*` reuses its non-pro schemas.
1310
1311
  // Docs: https://fal.ai/models/alibaba/wan-3.0/text-to-video/api
1311
1312
  const FalWan3p0ResolutionSchema = z.enum(["480p", "720p", "1080p"]);
1312
1313
  const FalWan3p0AspectRatioSchema = z.enum([
@@ -1426,6 +1427,68 @@ export const FalMinimaxH3TextToVideoRequestSchema = z.object({
1426
1427
  // Returns the video as base64 instead of a CDN URL.
1427
1428
  sync_mode: z.boolean().optional(),
1428
1429
  });
1430
+ // MiniMax H3 text-to-video LoRA. Queue OpenAPI and llms.txt read 2026-10-29.
1431
+ // `prompt` and `loras` are required. Price is per second by resolution:
1432
+ // $0.0625 at 480P, $0.075 at 768P, $0.1625 at 2K (the default), $0.20 at
1433
+ // 4K. Duration is 5–15 seconds and defaults to 5. This leaf promotes the
1434
+ // existing textToVideo callable. No field names a model. Resolution,
1435
+ // aspect ratio, and prompt expansion are fixed vocabularies.
1436
+ // Docs: https://fal.ai/models/minimax/h3/text-to-video/lora/api
1437
+ const FalMinimaxH3LoraWeightSchema = z.object({
1438
+ path: z
1439
+ .string()
1440
+ .min(1)
1441
+ .describe("URL or HuggingFace repo id (owner/repo) of the LoRA weights."),
1442
+ weight_name: z
1443
+ .string()
1444
+ .nullable()
1445
+ .optional()
1446
+ .describe("LoRA filename inside a HuggingFace repo that holds more than one."),
1447
+ scale: z
1448
+ .number()
1449
+ .min(0)
1450
+ .max(4)
1451
+ .default(1)
1452
+ .describe("Strength of the LoRA, from 0 to 4."),
1453
+ });
1454
+ export const FalMinimaxH3TextToVideoLoraRequestSchema = z.object({
1455
+ prompt: z.string().min(1).max(50000),
1456
+ duration: z
1457
+ .number()
1458
+ .int()
1459
+ .min(5)
1460
+ .max(15)
1461
+ .default(5)
1462
+ .describe("Output length in seconds. Billed per second by resolution."),
1463
+ resolution: z
1464
+ .enum(["480P", "768P", "2K", "4K"])
1465
+ .default("2K")
1466
+ .describe("480P and 768P are native. 2K and 4K upscale a 768P base."),
1467
+ seed: z.number().int().nullable().optional(),
1468
+ enable_safety_checker: z.boolean().default(true),
1469
+ sync_mode: z
1470
+ .boolean()
1471
+ .default(false)
1472
+ .describe("Return the video as base64 instead of a CDN URL."),
1473
+ prompt_expansion_mode: z
1474
+ .enum(["disabled", "fast", "balanced", "quality"])
1475
+ .nullable()
1476
+ .default("balanced"),
1477
+ target_audio_url: z
1478
+ .string()
1479
+ .min(1)
1480
+ .nullable()
1481
+ .optional()
1482
+ .describe("Optional audio clip, at least 2 seconds, that replaces the soundtrack."),
1483
+ aspect_ratio: z
1484
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
1485
+ .default("16:9"),
1486
+ loras: z
1487
+ .array(FalMinimaxH3LoraWeightSchema)
1488
+ .min(1)
1489
+ .max(3)
1490
+ .describe("LoRA adapters applied to the transformer."),
1491
+ });
1429
1492
  // ---------------------------------------------------------------------------
1430
1493
  // MiniMax Hailuo 03 (H3) image-to-video
1431
1494
  // ---------------------------------------------------------------------------
@@ -1467,6 +1530,108 @@ export const FalMinimaxH3ImageToVideoRequestSchema = z.object({
1467
1530
  // Returns the video as base64 instead of a CDN URL.
1468
1531
  sync_mode: z.boolean().optional(),
1469
1532
  });
1533
+ // MiniMax H3 image-to-video LoRA. Queue OpenAPI and llms.txt read 2026-10-29.
1534
+ // `prompt` and `loras` are required. `image_url` is optional: omitting both
1535
+ // frames makes the request behave as text-to-video at 16:9. Price matches
1536
+ // the text-to-video LoRA card: $0.0625/s at 480P, $0.075/s at 768P,
1537
+ // $0.1625/s at 2K (the default), $0.20/s at 4K. Duration defaults to 5.
1538
+ // This leaf promotes the existing imageToVideo callable. No field names a
1539
+ // model. Resolution and prompt expansion are fixed vocabularies.
1540
+ // Docs: https://fal.ai/models/minimax/h3/image-to-video/lora/api
1541
+ export const FalMinimaxH3ImageToVideoLoraRequestSchema = z.object({
1542
+ prompt: z.string().min(1).max(50000),
1543
+ duration: z
1544
+ .number()
1545
+ .int()
1546
+ .min(5)
1547
+ .max(15)
1548
+ .default(5)
1549
+ .describe("Output length in seconds. Billed per second by resolution."),
1550
+ resolution: z
1551
+ .enum(["480P", "768P", "2K", "4K"])
1552
+ .default("2K")
1553
+ .describe("480P and 768P are native. 2K and 4K upscale a 768P base."),
1554
+ seed: z.number().int().nullable().optional(),
1555
+ enable_safety_checker: z.boolean().default(true),
1556
+ sync_mode: z
1557
+ .boolean()
1558
+ .default(false)
1559
+ .describe("Return the video as base64 instead of a CDN URL."),
1560
+ prompt_expansion_mode: z
1561
+ .enum(["disabled", "fast", "balanced", "quality"])
1562
+ .nullable()
1563
+ .default("balanced"),
1564
+ target_audio_url: z
1565
+ .string()
1566
+ .min(1)
1567
+ .nullable()
1568
+ .optional()
1569
+ .describe("Optional audio clip, at least 2 seconds, that replaces the soundtrack."),
1570
+ image_url: z
1571
+ .string()
1572
+ .min(1)
1573
+ .nullable()
1574
+ .optional()
1575
+ .describe("First frame. An HTTP(S) URL or a data URI. The output canvas follows it."),
1576
+ end_image_url: z
1577
+ .string()
1578
+ .min(1)
1579
+ .nullable()
1580
+ .optional()
1581
+ .describe("Optional last frame. It may be provided alone."),
1582
+ loras: z
1583
+ .array(FalMinimaxH3LoraWeightSchema)
1584
+ .min(1)
1585
+ .max(3)
1586
+ .describe("LoRA adapters applied to the transformer."),
1587
+ });
1588
+ // MiniMax H3 reference-to-video LoRA. Queue OpenAPI read 2026-10-30.
1589
+ // References may be supplied individually or together, with a combined cap
1590
+ // of 12 files. The LoRA leaf permits audio-only references. No model fields.
1591
+ // Docs: https://fal.ai/models/minimax/h3/reference-to-video/lora/api
1592
+ export const FalMinimaxH3ReferenceToVideoLoraRequestSchema = z
1593
+ .object({
1594
+ prompt: z.string().min(1).max(50000),
1595
+ duration: z
1596
+ .number()
1597
+ .int()
1598
+ .min(5)
1599
+ .max(15)
1600
+ .default(5)
1601
+ .describe("Output length in seconds. Billed per second by resolution."),
1602
+ resolution: z
1603
+ .enum(["480P", "768P", "2K", "4K"])
1604
+ .default("2K")
1605
+ .describe("480P and 768P are native. 2K and 4K upscale a 768P base."),
1606
+ seed: z.number().int().nullable().optional(),
1607
+ enable_safety_checker: z.boolean().default(true),
1608
+ sync_mode: z
1609
+ .boolean()
1610
+ .default(false)
1611
+ .describe("Return the video as base64 instead of a CDN URL."),
1612
+ prompt_expansion_mode: z
1613
+ .enum(["disabled", "fast", "balanced", "quality"])
1614
+ .nullable()
1615
+ .default("balanced"),
1616
+ aspect_ratio: z
1617
+ .enum(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
1618
+ .default("adaptive"),
1619
+ reference_image_urls: z.array(z.string().min(1)).max(9).optional(),
1620
+ reference_video_urls: z.array(z.string().min(1)).max(3).optional(),
1621
+ reference_audio_urls: z.array(z.string().min(1)).max(3).optional(),
1622
+ loras: z
1623
+ .array(FalMinimaxH3LoraWeightSchema)
1624
+ .min(1)
1625
+ .max(3)
1626
+ .describe("LoRA adapters applied to the transformer."),
1627
+ })
1628
+ .refine((v) => (v.reference_image_urls?.length ?? 0) +
1629
+ (v.reference_video_urls?.length ?? 0) +
1630
+ (v.reference_audio_urls?.length ?? 0) <=
1631
+ 12, {
1632
+ message: "MiniMax H3 accepts at most 12 reference files in total",
1633
+ path: ["reference_image_urls"],
1634
+ });
1470
1635
  // MiniMax Hailuo 03 (H3) reference-to-video
1471
1636
  // ---------------------------------------------------------------------------
1472
1637
  // `prompt` is the only required field, and here it also binds the reference
@@ -1528,6 +1693,398 @@ export const FalMinimaxH3ReferenceToVideoRequestSchema = z
1528
1693
  message: "minimax/h3/reference-to-video accepts at most 12 reference files across reference_image_urls, reference_video_urls, and reference_audio_urls",
1529
1694
  path: ["reference_image_urls"],
1530
1695
  });
1696
+ // MiniMax H3 text-to-video LoRA trainer. Queue OpenAPI read 2026-10-29.
1697
+ // `training_data_url` is the only required field. Price is $0.005 per
1698
+ // `number_of_steps` (range 1–15000, default 2000). No field names a model.
1699
+ // Rank, frame count, resolution, and aspect ratio are fixed vocabularies.
1700
+ // Docs: https://fal.ai/models/minimax/h3/t2v/trainer/api
1701
+ export const FalMinimaxH3T2vTrainerRequestSchema = z.object({
1702
+ training_data_url: z
1703
+ .string()
1704
+ .min(1)
1705
+ .describe("URL or data URI of a zip containing only video clips (.mp4, .mov, .avi, .mkv), plus optional same-basename caption text files. Image datasets are rejected."),
1706
+ rank: z
1707
+ .union([
1708
+ z.literal(8),
1709
+ z.literal(16),
1710
+ z.literal(32),
1711
+ z.literal(64),
1712
+ z.literal(128),
1713
+ ])
1714
+ .default(32)
1715
+ .describe("LoRA rank. Higher values increase capacity and use more memory."),
1716
+ number_of_steps: z
1717
+ .number()
1718
+ .int()
1719
+ .min(1)
1720
+ .max(15000)
1721
+ .default(2000)
1722
+ .describe("Training steps. Billed at $0.005 per step."),
1723
+ learning_rate: z
1724
+ .number()
1725
+ .min(0.000001)
1726
+ .max(1)
1727
+ .default(0.0002)
1728
+ .describe("Learning rate. Higher values train faster and can overfit."),
1729
+ number_of_frames: z
1730
+ .union([
1731
+ z.literal(22),
1732
+ z.literal(39),
1733
+ z.literal(56),
1734
+ z.literal(73),
1735
+ z.literal(90),
1736
+ z.literal(107),
1737
+ z.literal(124),
1738
+ ])
1739
+ .default(73)
1740
+ .describe("Frames per training sample. Each value satisfies frames % 17 == 5."),
1741
+ frame_rate: z
1742
+ .number()
1743
+ .int()
1744
+ .min(8)
1745
+ .max(60)
1746
+ .default(24)
1747
+ .describe("Target frames per second."),
1748
+ resolution: z
1749
+ .enum(["low", "medium", "high"])
1750
+ .default("medium")
1751
+ .describe("Training resolution. Higher values use more memory. Not a pixel tier."),
1752
+ aspect_ratio: z
1753
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
1754
+ .default("16:9")
1755
+ .describe("Training aspect ratio."),
1756
+ trigger_phrase: z
1757
+ .string()
1758
+ .default("")
1759
+ .describe("Phrase prepended to captions during training."),
1760
+ first_frame_conditioning_p: z
1761
+ .number()
1762
+ .min(0)
1763
+ .max(0)
1764
+ .default(0)
1765
+ .describe("Fixed at 0. This endpoint trains text-to-video-audio with no keyframe conditioning."),
1766
+ auto_scale_input: z
1767
+ .boolean()
1768
+ .default(false)
1769
+ .describe("Scale videos to the target frame count and fps."),
1770
+ split_input_into_scenes: z
1771
+ .boolean()
1772
+ .default(true)
1773
+ .describe("Split videos longer than the duration threshold into scenes."),
1774
+ split_input_duration_threshold: z
1775
+ .number()
1776
+ .min(1)
1777
+ .max(60)
1778
+ .default(30)
1779
+ .describe("Duration threshold in seconds above which a video is split into scenes."),
1780
+ debug_dataset: z
1781
+ .boolean()
1782
+ .default(false)
1783
+ .describe("Return a downloadable archive of the preprocessed training data."),
1784
+ strict_dataset: z
1785
+ .boolean()
1786
+ .default(false)
1787
+ .describe("Reject blank captions, missing sidecar keyframes, and videos without a readable audio track."),
1788
+ });
1789
+ // MiniMax H3 image-to-video LoRA trainer. Queue OpenAPI read 2026-10-29.
1790
+ // `training_data_url` is the only required field. Price is $0.01 per
1791
+ // `number_of_steps` (range 1–15000, default 2000). No field names a model.
1792
+ // Rank, frame count, resolution, and aspect ratio are fixed vocabularies.
1793
+ // Docs: https://fal.ai/models/minimax/h3/i2v/trainer/api
1794
+ export const FalMinimaxH3I2vTrainerRequestSchema = z.object({
1795
+ training_data_url: z
1796
+ .string()
1797
+ .min(1)
1798
+ .describe("URL or data URI of a zip containing only video clips (.mp4, .mov, .avi, .mkv), plus optional same-basename caption text files. Image datasets are rejected."),
1799
+ rank: z
1800
+ .union([
1801
+ z.literal(8),
1802
+ z.literal(16),
1803
+ z.literal(32),
1804
+ z.literal(64),
1805
+ z.literal(128),
1806
+ ])
1807
+ .default(32)
1808
+ .describe("LoRA rank. Higher values increase capacity and use more memory."),
1809
+ number_of_steps: z
1810
+ .number()
1811
+ .int()
1812
+ .min(1)
1813
+ .max(15000)
1814
+ .default(2000)
1815
+ .describe("Training steps. Billed at $0.01 per step."),
1816
+ learning_rate: z
1817
+ .number()
1818
+ .min(0.000001)
1819
+ .max(1)
1820
+ .default(0.0002)
1821
+ .describe("Learning rate. Higher values train faster and can overfit."),
1822
+ number_of_frames: z
1823
+ .union([
1824
+ z.literal(22),
1825
+ z.literal(39),
1826
+ z.literal(56),
1827
+ z.literal(73),
1828
+ z.literal(90),
1829
+ z.literal(107),
1830
+ z.literal(124),
1831
+ ])
1832
+ .default(73)
1833
+ .describe("Frames per training sample. Each value satisfies frames % 17 == 5."),
1834
+ frame_rate: z
1835
+ .number()
1836
+ .int()
1837
+ .min(8)
1838
+ .max(60)
1839
+ .default(24)
1840
+ .describe("Target frames per second."),
1841
+ resolution: z
1842
+ .enum(["low", "medium", "high"])
1843
+ .default("medium")
1844
+ .describe("Training resolution. Higher values use more memory. Not a pixel tier."),
1845
+ aspect_ratio: z
1846
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
1847
+ .default("16:9")
1848
+ .describe("Training aspect ratio."),
1849
+ trigger_phrase: z
1850
+ .string()
1851
+ .default("")
1852
+ .describe("Phrase prepended to captions during training."),
1853
+ first_frame_conditioning_p: z
1854
+ .number()
1855
+ .min(0)
1856
+ .max(1)
1857
+ .default(0.5)
1858
+ .describe("Probability of conditioning on the first frame. Higher values favor image-to-video."),
1859
+ auto_scale_input: z
1860
+ .boolean()
1861
+ .default(false)
1862
+ .describe("Scale videos to the target frame count and fps."),
1863
+ split_input_into_scenes: z
1864
+ .boolean()
1865
+ .default(true)
1866
+ .describe("Split videos longer than the duration threshold into scenes."),
1867
+ split_input_duration_threshold: z
1868
+ .number()
1869
+ .min(1)
1870
+ .max(60)
1871
+ .default(30)
1872
+ .describe("Duration threshold in seconds above which a video is split into scenes."),
1873
+ debug_dataset: z
1874
+ .boolean()
1875
+ .default(false)
1876
+ .describe("Return a downloadable archive of the preprocessed training data."),
1877
+ strict_dataset: z
1878
+ .boolean()
1879
+ .default(false)
1880
+ .describe("Reject blank captions, missing sidecar keyframes, and videos without a readable audio track."),
1881
+ });
1882
+ // MiniMax H3 first-last-frame LoRA trainer. Queue OpenAPI read 2026-10-29.
1883
+ // `training_data_url` is the only required field. Price is $0.01 per
1884
+ // `number_of_steps` (range 1–15000, default 2000). Sidecar keyframes are
1885
+ // optional. No field names a model. Rank, frame count, resolution, and
1886
+ // aspect ratio are fixed vocabularies.
1887
+ // Docs: https://fal.ai/models/minimax/h3/flf2v/trainer/api
1888
+ export const FalMinimaxH3Flf2vTrainerRequestSchema = z.object({
1889
+ training_data_url: z
1890
+ .string()
1891
+ .min(1)
1892
+ .describe("URL or data URI of a zip containing only video clips (.mp4, .mov, .avi, .mkv), plus optional same-basename caption text files. Image datasets are rejected. Optional sidecar <stem>.first_frame.png and <stem>.last_frame.png images are used as keyframes when present."),
1893
+ rank: z
1894
+ .union([
1895
+ z.literal(8),
1896
+ z.literal(16),
1897
+ z.literal(32),
1898
+ z.literal(64),
1899
+ z.literal(128),
1900
+ ])
1901
+ .default(32)
1902
+ .describe("LoRA rank. Higher values increase capacity and use more memory."),
1903
+ number_of_steps: z
1904
+ .number()
1905
+ .int()
1906
+ .min(1)
1907
+ .max(15000)
1908
+ .default(2000)
1909
+ .describe("Training steps. Billed at $0.01 per step."),
1910
+ learning_rate: z
1911
+ .number()
1912
+ .min(0.000001)
1913
+ .max(1)
1914
+ .default(0.0002)
1915
+ .describe("Learning rate. Higher values train faster and can overfit."),
1916
+ number_of_frames: z
1917
+ .union([
1918
+ z.literal(22),
1919
+ z.literal(39),
1920
+ z.literal(56),
1921
+ z.literal(73),
1922
+ z.literal(90),
1923
+ z.literal(107),
1924
+ z.literal(124),
1925
+ ])
1926
+ .default(73)
1927
+ .describe("Frames per training sample. Each value satisfies frames % 17 == 5."),
1928
+ frame_rate: z
1929
+ .number()
1930
+ .int()
1931
+ .min(8)
1932
+ .max(60)
1933
+ .default(24)
1934
+ .describe("Target frames per second."),
1935
+ resolution: z
1936
+ .enum(["low", "medium", "high"])
1937
+ .default("medium")
1938
+ .describe("Training resolution. Higher values use more memory. Not a pixel tier."),
1939
+ aspect_ratio: z
1940
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
1941
+ .default("16:9")
1942
+ .describe("Training aspect ratio."),
1943
+ trigger_phrase: z
1944
+ .string()
1945
+ .default("")
1946
+ .describe("Phrase prepended to captions during training."),
1947
+ first_frame_conditioning_p: z
1948
+ .number()
1949
+ .min(0)
1950
+ .max(1)
1951
+ .default(0.2)
1952
+ .describe("Probability of conditioning on the first frame only."),
1953
+ auto_scale_input: z
1954
+ .boolean()
1955
+ .default(false)
1956
+ .describe("Scale videos to the target frame count and fps."),
1957
+ split_input_into_scenes: z
1958
+ .boolean()
1959
+ .default(true)
1960
+ .describe("Split videos longer than the duration threshold into scenes."),
1961
+ split_input_duration_threshold: z
1962
+ .number()
1963
+ .min(1)
1964
+ .max(60)
1965
+ .default(30)
1966
+ .describe("Duration threshold in seconds above which a video is split into scenes."),
1967
+ debug_dataset: z
1968
+ .boolean()
1969
+ .default(false)
1970
+ .describe("Return a downloadable archive of the preprocessed training data."),
1971
+ strict_dataset: z
1972
+ .boolean()
1973
+ .default(false)
1974
+ .describe("Reject blank captions, missing sidecar keyframes, and videos without a readable audio track."),
1975
+ last_frame_conditioning_p: z
1976
+ .number()
1977
+ .min(0)
1978
+ .max(1)
1979
+ .default(0.2)
1980
+ .describe("Probability of conditioning on the last frame only."),
1981
+ first_last_frame_conditioning_p: z
1982
+ .number()
1983
+ .min(0)
1984
+ .max(1)
1985
+ .default(0.4)
1986
+ .describe("Probability of conditioning on both the first and last frames. The rest trains unconditioned text-to-video-audio."),
1987
+ });
1988
+ // MiniMax H3 reference-to-video-audio LoRA trainer. Queue OpenAPI
1989
+ // read 2026-10-29. `training_data_url` is the only required field.
1990
+ // Price is $0.015 per `number_of_steps` (range 1–15000, default 2000).
1991
+ // Reference sidecars are optional. No field names a model. Rank, frame
1992
+ // count, resolution, and aspect ratio are fixed vocabularies.
1993
+ // Docs: https://fal.ai/models/minimax/h3/ref2va/trainer/api
1994
+ export const FalMinimaxH3Ref2vaTrainerRequestSchema = z.object({
1995
+ training_data_url: z
1996
+ .string()
1997
+ .min(1)
1998
+ .describe("URL or data URI of a zip containing only video clips (.mp4, .mov, .avi, .mkv), plus optional same-basename caption text files and ordered reference sidecars. Image datasets are rejected."),
1999
+ rank: z
2000
+ .union([
2001
+ z.literal(8),
2002
+ z.literal(16),
2003
+ z.literal(32),
2004
+ z.literal(64),
2005
+ z.literal(128),
2006
+ ])
2007
+ .default(32)
2008
+ .describe("LoRA rank. Higher values increase capacity and use more memory."),
2009
+ number_of_steps: z
2010
+ .number()
2011
+ .int()
2012
+ .min(1)
2013
+ .max(15000)
2014
+ .default(2000)
2015
+ .describe("Training steps. Billed at $0.015 per step."),
2016
+ learning_rate: z
2017
+ .number()
2018
+ .min(0.000001)
2019
+ .max(1)
2020
+ .default(0.0002)
2021
+ .describe("Learning rate. Higher values train faster and can overfit."),
2022
+ number_of_frames: z
2023
+ .union([
2024
+ z.literal(22),
2025
+ z.literal(39),
2026
+ z.literal(56),
2027
+ z.literal(73),
2028
+ z.literal(90),
2029
+ z.literal(107),
2030
+ z.literal(124),
2031
+ ])
2032
+ .default(73)
2033
+ .describe("Frames per training sample. Each value satisfies frames % 17 == 5."),
2034
+ frame_rate: z
2035
+ .number()
2036
+ .int()
2037
+ .min(8)
2038
+ .max(60)
2039
+ .default(24)
2040
+ .describe("Target frames per second."),
2041
+ resolution: z
2042
+ .enum(["low", "medium", "high"])
2043
+ .default("medium")
2044
+ .describe("Training resolution. Higher values use more memory. Not a pixel tier."),
2045
+ aspect_ratio: z
2046
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
2047
+ .default("16:9")
2048
+ .describe("Training aspect ratio."),
2049
+ trigger_phrase: z
2050
+ .string()
2051
+ .default("")
2052
+ .describe("Phrase prepended to captions during training."),
2053
+ reference_conditioning_p: z
2054
+ .number()
2055
+ .min(0)
2056
+ .max(1)
2057
+ .default(0.9)
2058
+ .describe("Probability of conditioning on the reference images. The rest trains unconditioned text-to-video-audio."),
2059
+ resume_from_lora_url: z
2060
+ .string()
2061
+ .min(1)
2062
+ .nullable()
2063
+ .optional()
2064
+ .describe("URL of a LoRA from this trainer to warm-start. Training continues for number_of_steps more steps."),
2065
+ auto_scale_input: z
2066
+ .boolean()
2067
+ .default(false)
2068
+ .describe("Scale videos to the target frame count and fps."),
2069
+ split_input_into_scenes: z
2070
+ .boolean()
2071
+ .default(true)
2072
+ .describe("Split videos longer than the duration threshold into scenes. Reference sidecars are dropped for split clips."),
2073
+ split_input_duration_threshold: z
2074
+ .number()
2075
+ .min(1)
2076
+ .max(60)
2077
+ .default(30)
2078
+ .describe("Duration threshold in seconds above which a video is split into scenes."),
2079
+ debug_dataset: z
2080
+ .boolean()
2081
+ .default(false)
2082
+ .describe("Return a downloadable archive of the preprocessed training data."),
2083
+ strict_dataset: z
2084
+ .boolean()
2085
+ .default(false)
2086
+ .describe("Reject blank captions, missing reference sidecars, and videos without a readable audio track."),
2087
+ });
1531
2088
  // ---------------------------------------------------------------------------
1532
2089
  // Wan v2.7 text-to-image
1533
2090
  // ---------------------------------------------------------------------------
@@ -2178,7 +2735,10 @@ const Flux3AspectRatioSchema = z.enum([
2178
2735
  "3:4",
2179
2736
  "9:16",
2180
2737
  ]);
2181
- const Flux3ResolutionSchema = z.enum(["720p", "1080p"]);
2738
+ // 1440p is the card's 2K tier and 2160p its 4K tier. Text-to-video and
2739
+ // image-to-video publish prices for both; the other video operations accept
2740
+ // the same enum and price only 720p and 1080p.
2741
+ const Flux3ResolutionSchema = z.enum(["720p", "1080p", "1440p", "2160p"]);
2182
2742
  const Flux3DurationSchema = z.union([
2183
2743
  z.literal("auto"),
2184
2744
  z.number().int().min(5).max(20),
@@ -2193,6 +2753,49 @@ const Flux3VideoRequestBaseSchema = z.object({
2193
2753
  safety_tolerance: z.number().int().min(0).max(4).optional(),
2194
2754
  });
2195
2755
  export const FalFlux3TextToVideoRequestSchema = Flux3VideoRequestBaseSchema;
2756
+ // FLUX 3 draft enhancement. Queue OpenAPI read 2026-10-30.
2757
+ // Docs: https://fal.ai/models/blackforestlabs/flux-3/draft-enhance/api
2758
+ export const FalFlux3DraftEnhanceRequestSchema = z.object({
2759
+ draft_cache_url: z
2760
+ .string()
2761
+ .describe("URL or data URI of the encrypted draft cache bundle to enhance."),
2762
+ safety_tolerance: z.number().int().min(0).max(4).default(2),
2763
+ });
2764
+ // FLUX 3 draft text-to-video. Queue OpenAPI read 2026-10-30.
2765
+ // Drafts are 720p; duration defaults to auto, so paid calls should pin it.
2766
+ // Docs: https://fal.ai/models/blackforestlabs/flux-3/text-to-video/draft/api
2767
+ export const FalFlux3TextToVideoDraftRequestSchema = z.object({
2768
+ prompt: z.string(),
2769
+ aspect_ratio: Flux3AspectRatioSchema.default("auto"),
2770
+ duration: Flux3DurationSchema.default("auto"),
2771
+ generate_audio: z.boolean().default(true),
2772
+ safety_tolerance: z.number().int().min(0).max(4).default(2),
2773
+ });
2774
+ // FLUX 3 draft image-to-video. Queue OpenAPI read 2026-10-30.
2775
+ // Docs: https://fal.ai/models/blackforestlabs/flux-3/image-to-video/draft/api
2776
+ export const FalFlux3ImageToVideoDraftRequestSchema = FalFlux3TextToVideoDraftRequestSchema.extend({
2777
+ image_url: z
2778
+ .string()
2779
+ .describe("URL or data URI of the opening keyframe image."),
2780
+ });
2781
+ // FLUX 3 draft extend-video. Queue OpenAPI read 2026-10-30.
2782
+ // Docs: https://fal.ai/models/blackforestlabs/flux-3/extend-video/draft/api
2783
+ export const FalFlux3ExtendVideoDraftRequestSchema = FalFlux3TextToVideoDraftRequestSchema.extend({
2784
+ video_url: z
2785
+ .string()
2786
+ .describe("URL or data URI of the source MP4, at most 50 MiB."),
2787
+ });
2788
+ // FLUX 3 draft first-last-frame-to-video. Queue OpenAPI read 2026-10-30.
2789
+ // Docs: https://fal.ai/models/blackforestlabs/flux-3/first-last-frame-to-video/draft/api
2790
+ export const FalFlux3FirstLastFrameToVideoDraftRequestSchema = FalFlux3TextToVideoDraftRequestSchema.extend({
2791
+ duration: Flux3NumericDurationSchema.default(5),
2792
+ end_image_url: z
2793
+ .string()
2794
+ .describe("URL or data URI of the final keyframe image."),
2795
+ start_image_url: z
2796
+ .string()
2797
+ .describe("URL or data URI of the opening keyframe image."),
2798
+ });
2196
2799
  export const FalFlux3ImageToVideoRequestSchema = Flux3VideoRequestBaseSchema.extend({
2197
2800
  image_url: z.string(),
2198
2801
  });
@@ -2206,6 +2809,31 @@ export const FalFlux3KeyframeSchema = z.object({
2206
2809
  frame_index: z.number().int().min(0),
2207
2810
  });
2208
2811
  const Flux3KeyframesSchema = z.array(FalFlux3KeyframeSchema).min(1).max(10);
2812
+ // FLUX 3 draft keyframes-to-video. Queue OpenAPI read 2026-10-30.
2813
+ // Docs: https://fal.ai/models/blackforestlabs/flux-3/keyframes-to-video/draft/api
2814
+ export const FalFlux3KeyframesToVideoDraftRequestSchema = FalFlux3TextToVideoDraftRequestSchema.extend({
2815
+ duration: Flux3NumericDurationSchema.default(5),
2816
+ keyframes: Flux3KeyframesSchema,
2817
+ }).superRefine((request, ctx) => {
2818
+ const seen = new Set();
2819
+ request.keyframes.forEach((keyframe, index) => {
2820
+ if (seen.has(keyframe.frame_index)) {
2821
+ ctx.addIssue({
2822
+ code: "custom",
2823
+ path: ["keyframes", index, "frame_index"],
2824
+ message: "Keyframe positions must be unique.",
2825
+ });
2826
+ }
2827
+ seen.add(keyframe.frame_index);
2828
+ if (keyframe.frame_index > request.duration * 24) {
2829
+ ctx.addIssue({
2830
+ code: "custom",
2831
+ path: ["keyframes", index, "frame_index"],
2832
+ message: "Keyframe position must not exceed duration * 24.",
2833
+ });
2834
+ }
2835
+ });
2836
+ });
2209
2837
  export const FalFlux3KeyframesToVideoRequestSchema = Flux3VideoRequestBaseSchema.extend({
2210
2838
  duration: Flux3NumericDurationSchema.optional(),
2211
2839
  keyframes: Flux3KeyframesSchema,
@@ -5653,40 +6281,301 @@ export const FalMetaMuseImageTextToImageRequestSchema = z.object({
5653
6281
  .default(false)
5654
6282
  .describe("If `True`, the image is returned as a data URI and is not persisted in the request history."),
5655
6283
  });
5656
- // Pinned to the live queue OpenAPI read on 2026-10-08
5657
- // (sha256 17c4f7963251d25af485098d771d5a8c9f3f6942db30fd42d05dfeddb3412422). Field order follows x-fal-order-properties.
5658
- // Docs: https://fal.ai/models/meta/muse-image/edit/api
5659
- export const FalMetaMuseImageEditRequestSchema = z.object({
5660
- prompt: z
5661
- .string()
5662
- .min(1)
5663
- .describe("The text prompt used to generate or edit the image."),
6284
+ // Pinned to the live queue OpenAPI read on 2026-10-08
6285
+ // (sha256 17c4f7963251d25af485098d771d5a8c9f3f6942db30fd42d05dfeddb3412422). Field order follows x-fal-order-properties.
6286
+ // Docs: https://fal.ai/models/meta/muse-image/edit/api
6287
+ export const FalMetaMuseImageEditRequestSchema = z.object({
6288
+ prompt: z
6289
+ .string()
6290
+ .min(1)
6291
+ .describe("The text prompt used to generate or edit the image."),
6292
+ image_urls: z
6293
+ .array(z.string())
6294
+ .min(1)
6295
+ .max(10)
6296
+ .describe("Reference images used for the edit. Provide between 1 and 10 HTTP(S) or data URLs."),
6297
+ aspect_ratio: z
6298
+ .string()
6299
+ .regex(/^[1-9][0-9]{0,4}:[1-9][0-9]{0,4}$/)
6300
+ .nullable()
6301
+ .optional()
6302
+ .describe('Any custom output aspect ratio as "width:height", for example "16:9", "5:4", or "1920:1200". Common presets are "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21". The ratio must be between 1:16 and 16:1, the range Muse supports. Only the ratio is used: Muse renders it at its own fixed resolution of roughly 2.5 megapixels, so "1920:1200" and "960:600" both return the same 1920x1200 image. If omitted, Muse chooses the output dimensions automatically.'),
6303
+ num_images: z
6304
+ .number()
6305
+ .int()
6306
+ .min(1)
6307
+ .max(10)
6308
+ .default(1)
6309
+ .describe("The number of edited images to generate."),
6310
+ output_format: z
6311
+ .enum(["jpeg", "png", "webp"])
6312
+ .default("webp")
6313
+ .describe("The format of the generated image."),
6314
+ sync_mode: z
6315
+ .boolean()
6316
+ .default(false)
6317
+ .describe("If `True`, the image is returned as a data URI and is not persisted in the request history."),
6318
+ });
6319
+ const FalKreaV3EditImageSizeSchema = z.object({
6320
+ width: z
6321
+ .number()
6322
+ .int()
6323
+ .gt(0)
6324
+ .max(14142)
6325
+ .default(512)
6326
+ .describe("The width of the generated image."),
6327
+ height: z
6328
+ .number()
6329
+ .int()
6330
+ .gt(0)
6331
+ .max(14142)
6332
+ .default(512)
6333
+ .describe("The height of the generated image."),
6334
+ });
6335
+ const FalKreaV3EditRegionSchema = z.object({
6336
+ image_idx: z
6337
+ .number()
6338
+ .int()
6339
+ .min(0)
6340
+ .describe("Zero-based index into image_urls."),
6341
+ x: z
6342
+ .number()
6343
+ .min(0)
6344
+ .lt(1)
6345
+ .describe("Left edge as a fraction of image width."),
6346
+ y: z
6347
+ .number()
6348
+ .min(0)
6349
+ .lt(1)
6350
+ .describe("Top edge as a fraction of image height."),
6351
+ width: z
6352
+ .number()
6353
+ .gt(0)
6354
+ .max(1)
6355
+ .describe("Width as a fraction of image width."),
6356
+ height: z
6357
+ .number()
6358
+ .gt(0)
6359
+ .max(1)
6360
+ .describe("Height as a fraction of image height."),
6361
+ label: z
6362
+ .string()
6363
+ .min(1)
6364
+ .max(64)
6365
+ .regex(/^[^\s@]+$/)
6366
+ .nullable()
6367
+ .optional()
6368
+ .describe("Refer to this region as @label. Defaults to its one-based position."),
6369
+ note: z
6370
+ .string()
6371
+ .max(5000)
6372
+ .default("")
6373
+ .describe("Edit instruction for this region; may reference other @labels."),
6374
+ });
6375
+ // Pinned to the live queue OpenAPI read on 2026-10-29
6376
+ // (sha256 5fc40fc471b2be4960ee54eed8fd5993545f9d41096dbe9d83ef61518a74e913). Field order follows x-fal-order-properties.
6377
+ // Docs: https://fal.ai/models/krea/v3/edit/api
6378
+ export const FalKreaV3EditRequestSchema = z.object({
6379
+ prompt: z
6380
+ .string()
6381
+ .max(5000)
6382
+ .default("")
6383
+ .describe("Edit instruction. Refer to images as <image-1>, <image-2>, ... and regions as @label. May be omitted when a region has a note."),
6384
+ image_urls: z
6385
+ .array(z.string())
6386
+ .min(1)
6387
+ .max(8)
6388
+ .describe("Reference images to edit or combine (1-8). Order sets the <image-N> tags."),
6389
+ regions: z
6390
+ .array(FalKreaV3EditRegionSchema)
6391
+ .max(24)
6392
+ .optional()
6393
+ .describe("Bounding boxes on reference images, with optional labels and editing notes. Requires high or ultra reasoning."),
6394
+ regional_edit: z
6395
+ .boolean()
6396
+ .nullable()
6397
+ .optional()
6398
+ .describe("With high or ultra reasoning, true preserves pixels outside the edit regions on the chosen canvas; false disables automatic region cropping and preservation. Omit to retain automatic preservation. With image_size=auto, keeps the canvas dimensions; an explicit image_size preserves the resized input. Billing uses the generated render dimensions. Use PNG for lossless output."),
6399
+ model: z
6400
+ .enum(["berry", "jam"])
6401
+ .default("berry")
6402
+ .describe("Model variant: berry favors quality, jam favors speed."),
6403
+ image_size: z
6404
+ .union([
6405
+ FalKreaV3EditImageSizeSchema,
6406
+ z.enum([
6407
+ "square_hd",
6408
+ "square",
6409
+ "portrait_4_3",
6410
+ "portrait_16_9",
6411
+ "landscape_4_3",
6412
+ "landscape_16_9",
6413
+ "auto",
6414
+ ]),
6415
+ ])
6416
+ .default("auto")
6417
+ .describe("Output size, rounded up to multiples of 16, at most 4,220,160 total pixels (1680×2512). auto lets the prompt expander pick the aspect ratio at about 2048×2048."),
6418
+ reasoning_level: z
6419
+ .enum(["low", "medium", "high", "ultra"])
6420
+ .default("medium")
6421
+ .describe("How much effort the harness spends reasoning about the given editing task. Higher reasoning effort means slower generation time. high plans the edit with segmentation, web search and reference photos, keeps unedited areas of a single input image, corrects required text, and bills a flat $0.125 (5 megapixels) more per request. low and medium bill $0.025 per megapixel of the output plus each reference (references larger than the output count as the output size). ultra generates at 2K with Krea's ultra thinking mode, ignores image_size and negative_prompt, and bills a flat price by reference count: $0.27 for 1, $0.30 for 2, $0.32 for 3, $0.35 for 4, plus $0.0275 per reference past 4."),
6422
+ negative_prompt: z
6423
+ .string()
6424
+ .max(1024)
6425
+ .default("")
6426
+ .describe("What to keep out of the image. Used by berry only."),
6427
+ seed: z
6428
+ .number()
6429
+ .int()
6430
+ .nullable()
6431
+ .optional()
6432
+ .describe("Latent noise seed. Use a new seed when editing a previous output again."),
6433
+ output_format: z
6434
+ .enum(["png", "jpeg"])
6435
+ .default("png")
6436
+ .describe("Output image format."),
6437
+ sync_mode: z
6438
+ .boolean()
6439
+ .default(false)
6440
+ .describe("Return images as data URIs instead of saving them in request history."),
6441
+ enable_safety_checker: z
6442
+ .boolean()
6443
+ .default(true)
6444
+ .describe("Check output images for unsafe content. Disabling requires account authorization."),
6445
+ });
6446
+ const FalKreaV3TextToImageImageSizeSchema = z.object({
6447
+ width: z
6448
+ .number()
6449
+ .int()
6450
+ .gt(0)
6451
+ .max(14142)
6452
+ .default(512)
6453
+ .describe("The width of the generated image."),
6454
+ height: z
6455
+ .number()
6456
+ .int()
6457
+ .gt(0)
6458
+ .max(14142)
6459
+ .default(512)
6460
+ .describe("The height of the generated image."),
6461
+ });
6462
+ // Pinned to the live queue OpenAPI read on 2026-10-29
6463
+ // (sha256 347a03eddc1f1385a22e32ea9d6f6217e970da6890d8a630978fbb19cc24ff42).
6464
+ // Field order follows x-fal-order-properties. Leaf under krea.v3; the edit
6465
+ // child owns the scaffold.
6466
+ // Docs: https://fal.ai/models/krea/v3/text-to-image/api
6467
+ export const FalKreaV3TextToImageRequestSchema = z.object({
6468
+ prompt: z
6469
+ .string()
6470
+ .min(1)
6471
+ .max(5000)
6472
+ .describe("Description of the image to generate."),
6473
+ model: z
6474
+ .enum(["berry", "jam"])
6475
+ .default("berry")
6476
+ .describe("Model variant: berry favors quality, jam favors speed."),
6477
+ image_size: z
6478
+ .union([
6479
+ FalKreaV3TextToImageImageSizeSchema,
6480
+ z.enum([
6481
+ "square_hd",
6482
+ "square",
6483
+ "portrait_4_3",
6484
+ "portrait_16_9",
6485
+ "landscape_4_3",
6486
+ "landscape_16_9",
6487
+ "auto",
6488
+ ]),
6489
+ ])
6490
+ .default("auto")
6491
+ .describe("Output size, rounded up to multiples of 16, at most 4,220,160 total pixels (1680×2512). auto lets the prompt expander pick the aspect ratio at about 2048×2048."),
6492
+ reasoning_level: z
6493
+ .enum(["low", "medium"])
6494
+ .default("medium")
6495
+ .describe("How much effort the harness spends reasoning about the given prompt. Higher reasoning effort means slower generation time. Both levels bill $0.025 per output megapixel."),
6496
+ negative_prompt: z
6497
+ .string()
6498
+ .max(1024)
6499
+ .default("")
6500
+ .describe("What to keep out of the image. Used by berry only."),
6501
+ seed: z
6502
+ .number()
6503
+ .int()
6504
+ .nullable()
6505
+ .optional()
6506
+ .describe("Latent noise seed. Use a new seed when editing a previous output again."),
6507
+ output_format: z
6508
+ .enum(["png", "jpeg"])
6509
+ .default("png")
6510
+ .describe("Output image format."),
6511
+ sync_mode: z
6512
+ .boolean()
6513
+ .default(false)
6514
+ .describe("Return images as data URIs instead of saving them in request history."),
6515
+ enable_safety_checker: z
6516
+ .boolean()
6517
+ .default(true)
6518
+ .describe("Check output images for unsafe content. Disabling requires account authorization."),
6519
+ });
6520
+ // GPT Image 2 concrete size limits, queue OpenAPI/docs read 2026-10-30.
6521
+ const FalOpenaiGptImage2ImageSizeSchema = z
6522
+ .object({
6523
+ width: z.number().int().positive().multipleOf(16).max(3840).default(512),
6524
+ height: z.number().int().positive().multipleOf(16).max(3840).default(512),
6525
+ })
6526
+ .superRefine(({ width, height }, ctx) => {
6527
+ const pixels = width * height;
6528
+ if (pixels < 655360 || pixels > 8294400)
6529
+ ctx.addIssue({
6530
+ code: "custom",
6531
+ message: "Image area must be between 655360 and 8294400 pixels.",
6532
+ });
6533
+ if (Math.max(width, height) / Math.min(width, height) > 3)
6534
+ ctx.addIssue({
6535
+ code: "custom",
6536
+ message: "Aspect ratio must not exceed 3:1.",
6537
+ });
6538
+ });
6539
+ // Docs: https://fal.ai/models/openai/gpt-image-2/api
6540
+ export const FalOpenaiGptImage2RequestSchema = z.object({
6541
+ prompt: z.string().min(1).max(32000),
6542
+ image_size: z
6543
+ .union([
6544
+ FalOpenaiGptImage2ImageSizeSchema,
6545
+ z.enum([
6546
+ "square_hd",
6547
+ "square",
6548
+ "portrait_4_3",
6549
+ "portrait_16_9",
6550
+ "landscape_4_3",
6551
+ "landscape_16_9",
6552
+ "auto",
6553
+ ]),
6554
+ ])
6555
+ .default("landscape_4_3"),
6556
+ background: z.enum(["auto", "transparent", "opaque"]).default("auto"),
6557
+ quality: z.enum(["auto", "low", "medium", "high"]).default("high"),
6558
+ num_images: z.number().int().min(1).max(10).default(1),
6559
+ output_format: z.enum(["jpeg", "png", "webp"]).default("png"),
6560
+ output_compression: z.number().int().min(0).max(100).nullable().optional(),
6561
+ sync_mode: z.boolean().default(false),
6562
+ enable_safety_checker: z.boolean().default(true),
6563
+ });
6564
+ // GPT Image 2 edit, queue OpenAPI read 2026-10-30.
6565
+ // Docs: https://fal.ai/models/openai/gpt-image-2/edit/api
6566
+ export const FalOpenaiGptImage2EditRequestSchema = FalOpenaiGptImage2RequestSchema.extend({
5664
6567
  image_urls: z
5665
6568
  .array(z.string())
5666
- .min(1)
5667
- .max(10)
5668
- .describe("Reference images used for the edit. Provide between 1 and 10 HTTP(S) or data URLs."),
5669
- aspect_ratio: z
6569
+ .max(16)
6570
+ .describe("Reference image URLs or data URIs; at most 16 images."),
6571
+ image_size: FalOpenaiGptImage2RequestSchema.shape.image_size
6572
+ .unwrap()
6573
+ .default("auto"),
6574
+ mask_url: z
5670
6575
  .string()
5671
- .regex(/^[1-9][0-9]{0,4}:[1-9][0-9]{0,4}$/)
5672
6576
  .nullable()
5673
6577
  .optional()
5674
- .describe('Any custom output aspect ratio as "width:height", for example "16:9", "5:4", or "1920:1200". Common presets are "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21". The ratio must be between 1:16 and 16:1, the range Muse supports. Only the ratio is used: Muse renders it at its own fixed resolution of roughly 2.5 megapixels, so "1920:1200" and "960:600" both return the same 1920x1200 image. If omitted, Muse chooses the output dimensions automatically.'),
5675
- num_images: z
5676
- .number()
5677
- .int()
5678
- .min(1)
5679
- .max(10)
5680
- .default(1)
5681
- .describe("The number of edited images to generate."),
5682
- output_format: z
5683
- .enum(["jpeg", "png", "webp"])
5684
- .default("webp")
5685
- .describe("The format of the generated image."),
5686
- sync_mode: z
5687
- .boolean()
5688
- .default(false)
5689
- .describe("If `True`, the image is returned as a data URI and is not persisted in the request history."),
6578
+ .describe("Mask URL: white regions are edited and black regions are kept."),
5690
6579
  });
5691
6580
  const FalOpenaiGptImage2p5SunburstEditImageSizeSchema = z.object({
5692
6581
  width: z
@@ -7754,6 +8643,59 @@ const FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema = z.obj
7754
8643
  .default("5")
7755
8644
  .describe("The duration of this shot in seconds"),
7756
8645
  });
8646
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/text-to-video/api
8647
+ export const FalKlingVideoO3ProTextToVideoRequestSchema = z
8648
+ .object({
8649
+ enable_safety_checker: z
8650
+ .boolean()
8651
+ .default(true)
8652
+ .describe("Disabling safety checks requires account authorization; unauthorized requests are always checked."),
8653
+ prompt: z
8654
+ .string()
8655
+ .max(2500)
8656
+ .nullable()
8657
+ .optional()
8658
+ .describe("Text prompt for video generation. Required unless multi_prompt is provided."),
8659
+ duration: z
8660
+ .enum([
8661
+ "3",
8662
+ "4",
8663
+ "5",
8664
+ "6",
8665
+ "7",
8666
+ "8",
8667
+ "9",
8668
+ "10",
8669
+ "11",
8670
+ "12",
8671
+ "13",
8672
+ "14",
8673
+ "15",
8674
+ ])
8675
+ .default("5")
8676
+ .describe("Video duration in seconds (3-15s)."),
8677
+ aspect_ratio: z
8678
+ .enum(["16:9", "9:16", "1:1"])
8679
+ .default("16:9")
8680
+ .describe("Aspect ratio of the generated video."),
8681
+ generate_audio: z
8682
+ .boolean()
8683
+ .default(false)
8684
+ .describe("Whether to generate native audio for the video."),
8685
+ multi_prompt: z
8686
+ .array(FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema)
8687
+ .nullable()
8688
+ .optional()
8689
+ .describe("List of prompts for multi-shot video generation."),
8690
+ shot_type: z
8691
+ .enum(["customize", "intelligent"])
8692
+ .default("customize")
8693
+ .describe("The type of multi-shot video generation. 'intelligent' lets the model automatically determine shot structure."),
8694
+ })
8695
+ .refine((v) => v.prompt != null || v.multi_prompt != null, {
8696
+ message: "fal-ai/kling-video/o3/pro/text-to-video needs prompt or multi_prompt",
8697
+ path: ["prompt"],
8698
+ });
7757
8699
  // Kling O3 Standard image-to-video: live OpenAPI 2026-10-15. Field order
7758
8700
  // follows x-fal-order-properties. The prompt-or-multi_prompt rule comes from
7759
8701
  // the prompt description; a guarded 422 probe cannot reach it.
@@ -7814,6 +8756,249 @@ export const FalKlingVideoO3StandardImageToVideoRequestSchema = z
7814
8756
  message: "fal-ai/kling-video/o3/standard/image-to-video multi_prompt and prompt are mutually exclusive",
7815
8757
  path: ["prompt"],
7816
8758
  });
8759
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/image-to-video/api
8760
+ export const FalKlingVideoO3ProImageToVideoRequestSchema = z
8761
+ .object({
8762
+ enable_safety_checker: z
8763
+ .boolean()
8764
+ .default(true)
8765
+ .describe("Disabling safety checks requires account authorization; unauthorized requests are always checked."),
8766
+ prompt: z
8767
+ .string()
8768
+ .max(2500)
8769
+ .nullable()
8770
+ .optional()
8771
+ .describe("Text prompt for video generation. Either prompt or multi_prompt must be provided, but not both."),
8772
+ image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.describe("URL of the start frame image. At most 50 MB, at least 300 px per side, with an aspect ratio from 0.4 to 2.5."),
8773
+ end_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable()
8774
+ .optional()
8775
+ .describe("URL of the end frame image (optional). At most 50 MB, at least 300 px per side, with an aspect ratio from 0.4 to 2.5."),
8776
+ duration: z
8777
+ .enum([
8778
+ "3",
8779
+ "4",
8780
+ "5",
8781
+ "6",
8782
+ "7",
8783
+ "8",
8784
+ "9",
8785
+ "10",
8786
+ "11",
8787
+ "12",
8788
+ "13",
8789
+ "14",
8790
+ "15",
8791
+ ])
8792
+ .default("5")
8793
+ .describe("Video duration in seconds (3-15s)."),
8794
+ generate_audio: z
8795
+ .boolean()
8796
+ .default(false)
8797
+ .describe("Whether to generate native audio for the video."),
8798
+ multi_prompt: z
8799
+ .array(FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema)
8800
+ .nullable()
8801
+ .optional()
8802
+ .describe("List of prompts for multi-shot video generation."),
8803
+ shot_type: z
8804
+ .enum(["customize", "intelligent"])
8805
+ .default("customize")
8806
+ .describe("The type of multi-shot video generation. 'intelligent' lets the model automatically determine shot structure."),
8807
+ })
8808
+ .refine((v) => v.prompt != null || v.multi_prompt != null, {
8809
+ message: "fal-ai/kling-video/o3/pro/image-to-video needs prompt or multi_prompt",
8810
+ path: ["prompt"],
8811
+ })
8812
+ .refine((v) => !(v.prompt != null && v.multi_prompt != null), {
8813
+ message: "fal-ai/kling-video/o3/pro/image-to-video multi_prompt and prompt are mutually exclusive",
8814
+ path: ["prompt"],
8815
+ });
8816
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/reference-to-video/api
8817
+ export const FalKlingVideoO3ProReferenceToVideoRequestSchema = z
8818
+ .object({
8819
+ enable_safety_checker: z.boolean().default(true),
8820
+ prompt: z
8821
+ .string()
8822
+ .max(2500)
8823
+ .nullable()
8824
+ .optional()
8825
+ .describe("Either prompt or multi_prompt must be provided, but not both."),
8826
+ multi_prompt: z
8827
+ .array(FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema)
8828
+ .nullable()
8829
+ .optional(),
8830
+ start_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable()
8831
+ .optional()
8832
+ .describe("Image to use as the first frame."),
8833
+ end_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable()
8834
+ .optional()
8835
+ .describe("Image to use as the last frame."),
8836
+ image_urls: z
8837
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
8838
+ .nullable()
8839
+ .optional()
8840
+ .describe("Reference images for style/appearance, referenced as @Image1, @Image2. Maximum four combined elements and images when using video."),
8841
+ elements: z
8842
+ .array(z.object({
8843
+ frontal_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable().optional(),
8844
+ reference_image_urls: z
8845
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
8846
+ .min(1)
8847
+ .max(3)
8848
+ .nullable()
8849
+ .optional()
8850
+ .describe("Additional reference images from different angles; one to three images."),
8851
+ video_url: z
8852
+ .string()
8853
+ .nullable()
8854
+ .optional()
8855
+ .describe("Element video; at most one element per request may use video."),
8856
+ voice_id: z.string().nullable().optional(),
8857
+ }))
8858
+ .nullable()
8859
+ .optional()
8860
+ .describe("Characters or objects referenced as @Element1, @Element2."),
8861
+ generate_audio: z.boolean().default(false),
8862
+ duration: z
8863
+ .enum([
8864
+ "3",
8865
+ "4",
8866
+ "5",
8867
+ "6",
8868
+ "7",
8869
+ "8",
8870
+ "9",
8871
+ "10",
8872
+ "11",
8873
+ "12",
8874
+ "13",
8875
+ "14",
8876
+ "15",
8877
+ ])
8878
+ .default("5"),
8879
+ shot_type: z.enum(["customize", "intelligent"]).default("customize"),
8880
+ aspect_ratio: z.enum(["16:9", "9:16", "1:1"]).default("16:9"),
8881
+ })
8882
+ .refine((v) => (v.prompt != null) !== (v.multi_prompt != null), {
8883
+ message: "Provide exactly one of prompt or multi_prompt",
8884
+ path: ["prompt"],
8885
+ })
8886
+ .superRefine((v, ctx) => {
8887
+ const videos = v.elements?.filter((e) => e.video_url != null).length ?? 0;
8888
+ if (videos > 1)
8889
+ ctx.addIssue({
8890
+ code: "custom",
8891
+ message: "At most one element may use video",
8892
+ path: ["elements"],
8893
+ });
8894
+ if (videos > 0 &&
8895
+ (v.elements?.length ?? 0) + (v.image_urls?.length ?? 0) > 4)
8896
+ ctx.addIssue({
8897
+ code: "custom",
8898
+ message: "At most four combined elements and images when using video",
8899
+ path: ["image_urls"],
8900
+ });
8901
+ });
8902
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/video-to-video/edit/api
8903
+ export const FalKlingVideoO3ProVideoToVideoEditRequestSchema = z
8904
+ .object({
8905
+ enable_safety_checker: z.boolean().default(true),
8906
+ prompt: z
8907
+ .string()
8908
+ .max(2500)
8909
+ .describe("Text prompt for video generation. Reference the video as @Video1."),
8910
+ video_url: z
8911
+ .string()
8912
+ .describe("Reference MP4/MOV video: 3-15 seconds, 720-3840px, maximum 200MB."),
8913
+ image_urls: z
8914
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
8915
+ .nullable()
8916
+ .optional()
8917
+ .describe("Reference images as @Image1, @Image2. Maximum four combined images and elements."),
8918
+ keep_audio: z
8919
+ .boolean()
8920
+ .default(true)
8921
+ .describe("Keep the original audio from the reference video."),
8922
+ elements: z
8923
+ .array(z.object({
8924
+ frontal_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable().optional(),
8925
+ reference_image_urls: z
8926
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
8927
+ .min(1)
8928
+ .max(3)
8929
+ .nullable()
8930
+ .optional()
8931
+ .describe("Additional reference images; one to three images."),
8932
+ }))
8933
+ .nullable()
8934
+ .optional()
8935
+ .describe("Characters or objects referenced as @Element1, @Element2."),
8936
+ shot_type: z.literal("customize").default("customize"),
8937
+ })
8938
+ .refine((v) => (v.elements?.length ?? 0) + (v.image_urls?.length ?? 0) <= 4, {
8939
+ message: "At most four combined elements and reference images",
8940
+ path: ["image_urls"],
8941
+ });
8942
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/video-to-video/reference/api
8943
+ export const FalKlingVideoO3ProVideoToVideoReferenceRequestSchema = z
8944
+ .object({
8945
+ enable_safety_checker: z.boolean().default(true),
8946
+ prompt: z
8947
+ .string()
8948
+ .max(2500)
8949
+ .describe("Text prompt for video generation. Reference the video as @Video1."),
8950
+ video_url: z
8951
+ .string()
8952
+ .describe("Reference MP4/MOV video: 3-15 seconds, 720-3840px, maximum 200MB."),
8953
+ image_urls: z
8954
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
8955
+ .nullable()
8956
+ .optional()
8957
+ .describe("Reference images as @Image1, @Image2. Maximum four combined images and elements."),
8958
+ keep_audio: z
8959
+ .boolean()
8960
+ .default(true)
8961
+ .describe("Keep the original audio from the reference video."),
8962
+ elements: z
8963
+ .array(z.object({
8964
+ frontal_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable().optional(),
8965
+ reference_image_urls: z
8966
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
8967
+ .min(1)
8968
+ .max(3)
8969
+ .nullable()
8970
+ .optional()
8971
+ .describe("Additional reference images; one to three images."),
8972
+ }))
8973
+ .nullable()
8974
+ .optional()
8975
+ .describe("Characters or objects referenced as @Element1, @Element2."),
8976
+ shot_type: z.literal("customize").default("customize"),
8977
+ aspect_ratio: z.enum(["auto", "16:9", "9:16", "1:1"]).default("auto"),
8978
+ duration: z
8979
+ .enum([
8980
+ "3",
8981
+ "4",
8982
+ "5",
8983
+ "6",
8984
+ "7",
8985
+ "8",
8986
+ "9",
8987
+ "10",
8988
+ "11",
8989
+ "12",
8990
+ "13",
8991
+ "14",
8992
+ "15",
8993
+ ])
8994
+ .nullable()
8995
+ .optional()
8996
+ .describe("Video duration in seconds (3-15s)."),
8997
+ })
8998
+ .refine((v) => (v.elements?.length ?? 0) + (v.image_urls?.length ?? 0) <= 4, {
8999
+ message: "At most four combined elements and reference images",
9000
+ path: ["image_urls"],
9001
+ });
7817
9002
  // VEED Clean Audio
7818
9003
  export const FalVeedCleanAudioRequestSchema = z.object({
7819
9004
  audio_url: z
@@ -11925,6 +13110,8 @@ export const FalHeygenV3VideoAgentRequestSchema = z.object({
11925
13110
  .describe("Authorized callers may set false to request relaxed screening."),
11926
13111
  });
11927
13112
  export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
13113
+ "openai/gpt-image-2": FalOpenaiGptImage2RequestSchema,
13114
+ "openai/gpt-image-2/edit": FalOpenaiGptImage2EditRequestSchema,
11928
13115
  "fal-ai/heygen/v3/video-agent": FalHeygenV3VideoAgentRequestSchema,
11929
13116
  "fal-ai/heygen/v2/video-agent": FalHeygenV2VideoAgentRequestSchema,
11930
13117
  "kling/v4/video-to-video/edit": FalKlingV4VideoToVideoEditRequestSchema,
@@ -11967,6 +13154,11 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
11967
13154
  "openrouter/router/decisions": FalOpenrouterRouterDecisionsRequestSchema,
11968
13155
  "creatify/boreal": FalCreatifyBorealRequestSchema,
11969
13156
  "veed/clean-audio": FalVeedCleanAudioRequestSchema,
13157
+ "fal-ai/kling-video/o3/pro/reference-to-video": FalKlingVideoO3ProReferenceToVideoRequestSchema,
13158
+ "fal-ai/kling-video/o3/pro/video-to-video/reference": FalKlingVideoO3ProVideoToVideoReferenceRequestSchema,
13159
+ "fal-ai/kling-video/o3/pro/video-to-video/edit": FalKlingVideoO3ProVideoToVideoEditRequestSchema,
13160
+ "fal-ai/kling-video/o3/pro/image-to-video": FalKlingVideoO3ProImageToVideoRequestSchema,
13161
+ "fal-ai/kling-video/o3/pro/text-to-video": FalKlingVideoO3ProTextToVideoRequestSchema,
11970
13162
  "fal-ai/kling-video/o3/standard/image-to-video": FalKlingVideoO3StandardImageToVideoRequestSchema,
11971
13163
  "fal-ai/flux-2-flex": FalFlux2FlexRequestSchema,
11972
13164
  "fal-ai/kandinsky6-pro/image-to-video": FalKandinsky6ProImageToVideoRequestSchema,
@@ -12004,6 +13196,8 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
12004
13196
  "openai/gpt-image-2.5/sunburst/text-to-image": FalOpenaiGptImage2p5SunburstTextToImageRequestSchema,
12005
13197
  "openai/gpt-image-2.5/sunburst/edit": FalOpenaiGptImage2p5SunburstEditRequestSchema,
12006
13198
  "meta/muse-image/edit": FalMetaMuseImageEditRequestSchema,
13199
+ "krea/v3/edit": FalKreaV3EditRequestSchema,
13200
+ "krea/v3/text-to-image": FalKreaV3TextToImageRequestSchema,
12007
13201
  "meta/muse-image/text-to-image": FalMetaMuseImageTextToImageRequestSchema,
12008
13202
  "elevenlabs/music/v2.5": FalElevenlabsMusicV2p5RequestSchema,
12009
13203
  "bria/fibo-gen-1.5/text-to-image": FalBriaFiboGen1p5TextToImageRequestSchema,
@@ -12075,8 +13269,14 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
12075
13269
  "blackforestlabs/flux-3/extend-video": FalFlux3ExtendVideoRequestSchema,
12076
13270
  "blackforestlabs/flux-3/first-last-frame-to-video": FalFlux3FirstLastFrameToVideoRequestSchema,
12077
13271
  "blackforestlabs/flux-3/image-to-video": FalFlux3ImageToVideoRequestSchema,
13272
+ "blackforestlabs/flux-3/image-to-video/draft": FalFlux3ImageToVideoDraftRequestSchema,
13273
+ "blackforestlabs/flux-3/extend-video/draft": FalFlux3ExtendVideoDraftRequestSchema,
13274
+ "blackforestlabs/flux-3/first-last-frame-to-video/draft": FalFlux3FirstLastFrameToVideoDraftRequestSchema,
13275
+ "blackforestlabs/flux-3/keyframes-to-video/draft": FalFlux3KeyframesToVideoDraftRequestSchema,
12078
13276
  "blackforestlabs/flux-3/keyframes-to-video": FalFlux3KeyframesToVideoRequestSchema,
12079
13277
  "blackforestlabs/flux-3/text-to-video": FalFlux3TextToVideoRequestSchema,
13278
+ "blackforestlabs/flux-3/text-to-video/draft": FalFlux3TextToVideoDraftRequestSchema,
13279
+ "blackforestlabs/flux-3/draft-enhance": FalFlux3DraftEnhanceRequestSchema,
12080
13280
  "blackforestlabs/flux-3-max/image-to-video": FalFlux3MaxImageToVideoRequestSchema,
12081
13281
  "blackforestlabs/flux-3-max/keyframes-to-video": FalFlux3MaxKeyframesToVideoRequestSchema,
12082
13282
  "blackforestlabs/flux-3-max/text-to-video": FalFlux3MaxTextToVideoRequestSchema,
@@ -12124,8 +13324,15 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
12124
13324
  "alibaba/wan-3.0-prime/image-to-video": FalWan3p0ImageToVideoRequestSchema,
12125
13325
  "alibaba/wan-3.0-prime/reference-to-video": FalWan3p0ReferenceToVideoRequestSchema,
12126
13326
  "minimax/h3/text-to-video": FalMinimaxH3TextToVideoRequestSchema,
13327
+ "minimax/h3/text-to-video/lora": FalMinimaxH3TextToVideoLoraRequestSchema,
12127
13328
  "minimax/h3/image-to-video": FalMinimaxH3ImageToVideoRequestSchema,
13329
+ "minimax/h3/image-to-video/lora": FalMinimaxH3ImageToVideoLoraRequestSchema,
12128
13330
  "minimax/h3/reference-to-video": FalMinimaxH3ReferenceToVideoRequestSchema,
13331
+ "minimax/h3/reference-to-video/lora": FalMinimaxH3ReferenceToVideoLoraRequestSchema,
13332
+ "minimax/h3/t2v/trainer": FalMinimaxH3T2vTrainerRequestSchema,
13333
+ "minimax/h3/i2v/trainer": FalMinimaxH3I2vTrainerRequestSchema,
13334
+ "minimax/h3/flf2v/trainer": FalMinimaxH3Flf2vTrainerRequestSchema,
13335
+ "minimax/h3/ref2va/trainer": FalMinimaxH3Ref2vaTrainerRequestSchema,
12129
13336
  "fal-ai/wan/v2.7/text-to-image": FalWanV2p7TextToImageRequestSchema,
12130
13337
  "fal-ai/wan/v2.7/edit": FalWanV2p7EditRequestSchema,
12131
13338
  "fal-ai/wan/v2.7/pro/text-to-image": FalWanV2p7TextToImageRequestSchema,