@apicity/fal 0.21.0 → 0.23.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
@@ -1427,6 +1427,68 @@ export const FalMinimaxH3TextToVideoRequestSchema = z.object({
1427
1427
  // Returns the video as base64 instead of a CDN URL.
1428
1428
  sync_mode: z.boolean().optional(),
1429
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
+ });
1430
1492
  // ---------------------------------------------------------------------------
1431
1493
  // MiniMax Hailuo 03 (H3) image-to-video
1432
1494
  // ---------------------------------------------------------------------------
@@ -1468,6 +1530,108 @@ export const FalMinimaxH3ImageToVideoRequestSchema = z.object({
1468
1530
  // Returns the video as base64 instead of a CDN URL.
1469
1531
  sync_mode: z.boolean().optional(),
1470
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
+ });
1471
1635
  // MiniMax Hailuo 03 (H3) reference-to-video
1472
1636
  // ---------------------------------------------------------------------------
1473
1637
  // `prompt` is the only required field, and here it also binds the reference
@@ -1529,6 +1693,398 @@ export const FalMinimaxH3ReferenceToVideoRequestSchema = z
1529
1693
  message: "minimax/h3/reference-to-video accepts at most 12 reference files across reference_image_urls, reference_video_urls, and reference_audio_urls",
1530
1694
  path: ["reference_image_urls"],
1531
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
+ });
1532
2088
  // ---------------------------------------------------------------------------
1533
2089
  // Wan v2.7 text-to-image
1534
2090
  // ---------------------------------------------------------------------------
@@ -2197,6 +2753,49 @@ const Flux3VideoRequestBaseSchema = z.object({
2197
2753
  safety_tolerance: z.number().int().min(0).max(4).optional(),
2198
2754
  });
2199
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
+ });
2200
2799
  export const FalFlux3ImageToVideoRequestSchema = Flux3VideoRequestBaseSchema.extend({
2201
2800
  image_url: z.string(),
2202
2801
  });
@@ -2210,6 +2809,31 @@ export const FalFlux3KeyframeSchema = z.object({
2210
2809
  frame_index: z.number().int().min(0),
2211
2810
  });
2212
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
+ });
2213
2837
  export const FalFlux3KeyframesToVideoRequestSchema = Flux3VideoRequestBaseSchema.extend({
2214
2838
  duration: Flux3NumericDurationSchema.optional(),
2215
2839
  keyframes: Flux3KeyframesSchema,
@@ -3982,6 +4606,98 @@ export const FalMinimaxH3MaxReferenceToVideoRequestSchema = z
3982
4606
  message: "middle_frame_time requires middle_image_url",
3983
4607
  path: ["middle_frame_time"],
3984
4608
  });
4609
+ // H3 Max Turbo reference-to-video takes H3 Max reference-to-video's fields
4610
+ // without the first, middle and last frames, plus an ordered
4611
+ // `reference_conditions` list (queue OpenAPI read 2026-10-31). Unbilled 422
4612
+ // probes the same day showed the same validator as H3 Max: only `prompt` is
4613
+ // required, a whitespace-only prompt is refused, `prompt_expansion_mode`
4614
+ // takes four modes, and each condition needs an image, video or audio type
4615
+ // and a non-empty URL. A non-null `image_url` is refused, so the frame fields
4616
+ // are left out. The two refinements restate published rules: at most 12
4617
+ // reference files, and the ordered list in place of the per-type lists.
4618
+ // Docs: https://fal.ai/models/minimax/h3-max-turbo/reference-to-video/api
4619
+ const FalMinimaxH3MaxTurboReferenceConditionSchema = z.object({
4620
+ type: z
4621
+ .enum(["image", "video", "audio"])
4622
+ .describe("Reference modality. Cross-modality list order is semantic."),
4623
+ url: z.string().min(1).describe("URL of the reference media."),
4624
+ });
4625
+ export const FalMinimaxH3MaxTurboReferenceToVideoRequestSchema = z
4626
+ .object({
4627
+ prompt: z
4628
+ .string()
4629
+ .min(1)
4630
+ .max(50000)
4631
+ .regex(/\S/, "Prompt cannot be empty or contain only whitespace")
4632
+ .describe("Text prompt for video generation. Refer to reference assets by their modality and order in the reference lists: Image 1, Image 2, Video 1, Audio 1, and so on."),
4633
+ reference_image_urls: z
4634
+ .array(z.string())
4635
+ .max(9)
4636
+ .optional()
4637
+ .describe("URLs of subject/style reference images, referenced in the prompt as Image 1, Image 2, and so on. Reference images, videos, and audio clips must add up to at most 12 files."),
4638
+ reference_video_urls: z
4639
+ .array(z.string())
4640
+ .max(3)
4641
+ .optional()
4642
+ .describe("URLs of motion/reference video clips (2-15 seconds each, combined duration at most 15 seconds), referenced in the prompt as Video 1, Video 2, and so on. Reference images, videos, and audio clips must add up to at most 12 files."),
4643
+ reference_audio_urls: z
4644
+ .array(z.string())
4645
+ .max(3)
4646
+ .optional()
4647
+ .describe("URLs of reference audio clips (2-15 seconds each, combined duration at most 15 seconds), referenced in the prompt as Audio 1, Audio 2, and so on. Images, videos, and audio can be provided individually or together. Reference images, videos, and audio clips must add up to at most 12 files."),
4648
+ duration: z
4649
+ .number()
4650
+ .min(0.92)
4651
+ .max(15)
4652
+ .default(5)
4653
+ .describe("Video length in seconds. The output can run up to about 0.7 s longer than requested."),
4654
+ resolution: z
4655
+ .enum(["480P", "768P", "1080P"])
4656
+ .default("768P")
4657
+ .describe("The native generation resolution, or 1080P latent refinement from a native 768P source."),
4658
+ seed: z
4659
+ .number()
4660
+ .int()
4661
+ .nullable()
4662
+ .optional()
4663
+ .describe("Random seed. A random seed is selected when omitted."),
4664
+ enable_safety_checker: z
4665
+ .boolean()
4666
+ .default(true)
4667
+ .describe("If set to true, the safety checker will be enabled."),
4668
+ sync_mode: z
4669
+ .boolean()
4670
+ .default(false)
4671
+ .describe("Return the generated video as base64 instead of a CDN URL."),
4672
+ prompt_expansion_mode: z
4673
+ .enum(["disabled", "fast", "balanced", "quality"])
4674
+ .default("balanced")
4675
+ .describe("How much effort to spend rewriting the prompt before generation. 'disabled' skips prompt expansion. 'balanced' returns in about a second. 'quality' spends up to ~30s on a richer prompt."),
4676
+ aspect_ratio: z
4677
+ .enum(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
4678
+ .default("adaptive")
4679
+ .describe("The aspect ratio of the generated video."),
4680
+ reference_conditions: z
4681
+ .array(FalMinimaxH3MaxTurboReferenceConditionSchema)
4682
+ .max(12)
4683
+ .optional()
4684
+ .describe("Ordered reference list; cross-modality order is semantic and is preserved end-to-end. Do not combine with reference_*_urls."),
4685
+ })
4686
+ .refine((v) => (v.reference_image_urls?.length ?? 0) +
4687
+ (v.reference_video_urls?.length ?? 0) +
4688
+ (v.reference_audio_urls?.length ?? 0) <=
4689
+ 12, {
4690
+ message: "minimax/h3-max-turbo/reference-to-video accepts at most 12 reference files across reference_image_urls, reference_video_urls, and reference_audio_urls",
4691
+ path: ["reference_image_urls"],
4692
+ })
4693
+ .refine((v) => (v.reference_conditions?.length ?? 0) === 0 ||
4694
+ (v.reference_image_urls?.length ?? 0) +
4695
+ (v.reference_video_urls?.length ?? 0) +
4696
+ (v.reference_audio_urls?.length ?? 0) ===
4697
+ 0, {
4698
+ message: "reference_conditions replaces reference_image_urls, reference_video_urls, and reference_audio_urls; do not combine them",
4699
+ path: ["reference_conditions"],
4700
+ });
3985
4701
  // Upstream refuses every media URL here, `video_url` and each
3986
4702
  // `reference_image_urls` entry, unless it is "an HTTPS URL without
3987
4703
  // credentials or fragments" (unbilled 422 probes, 2026-10-07): an `http:`
@@ -4900,16 +5616,106 @@ export const FalAlibabaQwenAudio3TtsRequestSchema = z.object({
4900
5616
  .describe("Language of the input text. `Auto` lets the model detect it; setting it explicitly improves pronunciation and intonation."),
4901
5617
  });
4902
5618
  // Pinned to the live queue OpenAPI read on 2026-10-08
4903
- // (sha256 10e9ea49b4e3c7d3298ecdd9e8eda5fb332c5122e4f699b51592c839ae2c674e). Field order follows x-fal-order-properties.
4904
- // Docs: https://fal.ai/models/alibaba/happy-horse/v1.1/reference-to-video/api
4905
- export const FalAlibabaHappyHorseV1p1ReferenceToVideoRequestSchema = z.object({
5619
+ // (sha256 10e9ea49b4e3c7d3298ecdd9e8eda5fb332c5122e4f699b51592c839ae2c674e). Field order follows x-fal-order-properties.
5620
+ // Docs: https://fal.ai/models/alibaba/happy-horse/v1.1/reference-to-video/api
5621
+ export const FalAlibabaHappyHorseV1p1ReferenceToVideoRequestSchema = z.object({
5622
+ prompt: z
5623
+ .string()
5624
+ .min(1)
5625
+ .describe("Text prompt describing the desired video. Reference subjects from your images using ``character1``, ``character2``, ... up to ``character9`` (the order matches the order of ``image_urls``). Max 2500 characters."),
5626
+ image_urls: z
5627
+ .array(z.string())
5628
+ .describe("Reference images for subject consistency (1-9 images). Formats: JPEG, JPG, PNG, WEBP. Shortest side must be at least 400 px (720P or higher recommended). Max 20 MB each."),
5629
+ aspect_ratio: z
5630
+ .enum(["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21", "5:4", "4:5"])
5631
+ .default("16:9")
5632
+ .describe("Aspect ratio of the generated video."),
5633
+ resolution: z
5634
+ .enum(["720p", "1080p"])
5635
+ .default("1080p")
5636
+ .describe("Output video resolution tier."),
5637
+ duration: z
5638
+ .union([
5639
+ z.literal(3),
5640
+ z.literal(4),
5641
+ z.literal(5),
5642
+ z.literal(6),
5643
+ z.literal(7),
5644
+ z.literal(8),
5645
+ z.literal(9),
5646
+ z.literal(10),
5647
+ z.literal(11),
5648
+ z.literal(12),
5649
+ z.literal(13),
5650
+ z.literal(14),
5651
+ z.literal(15),
5652
+ ])
5653
+ .default(5)
5654
+ .describe("Output video duration in seconds (3-15)."),
5655
+ seed: z
5656
+ .number()
5657
+ .int()
5658
+ .nullable()
5659
+ .optional()
5660
+ .describe("Random seed for reproducibility (0-2147483647)."),
5661
+ enable_safety_checker: z
5662
+ .boolean()
5663
+ .default(true)
5664
+ .describe("Enable content moderation for input and output. Disabling it requires account authorization; unauthorized requests are always checked."),
5665
+ });
5666
+ // Pinned to the live queue OpenAPI read on 2026-10-08
5667
+ // (sha256 19e08067c44b97e67233cabf1e0ccfc17ef3efb25c01fcf4d0e4f3754501de68). Field order follows x-fal-order-properties.
5668
+ // Docs: https://fal.ai/models/alibaba/happy-horse/v1.1/image-to-video/api
5669
+ export const FalAlibabaHappyHorseV1p1ImageToVideoRequestSchema = z.object({
5670
+ image_url: z
5671
+ .string()
5672
+ .describe("URL of the first frame image. Formats: JPEG, JPG, PNG, BMP, WEBP. Dimensions must be at least 300px. Aspect ratio must be between 1:2.5 and 2.5:1. Max 20 MB."),
5673
+ prompt: z
5674
+ .string()
5675
+ .nullable()
5676
+ .optional()
5677
+ .describe("Optional text prompt guiding the animation. Max 2500 characters."),
5678
+ resolution: z
5679
+ .enum(["720p", "1080p"])
5680
+ .default("1080p")
5681
+ .describe("Output video resolution tier."),
5682
+ duration: z
5683
+ .union([
5684
+ z.literal(3),
5685
+ z.literal(4),
5686
+ z.literal(5),
5687
+ z.literal(6),
5688
+ z.literal(7),
5689
+ z.literal(8),
5690
+ z.literal(9),
5691
+ z.literal(10),
5692
+ z.literal(11),
5693
+ z.literal(12),
5694
+ z.literal(13),
5695
+ z.literal(14),
5696
+ z.literal(15),
5697
+ ])
5698
+ .default(5)
5699
+ .describe("Output video duration in seconds (3-15)."),
5700
+ seed: z
5701
+ .number()
5702
+ .int()
5703
+ .nullable()
5704
+ .optional()
5705
+ .describe("Random seed for reproducibility (0-2147483647)."),
5706
+ enable_safety_checker: z
5707
+ .boolean()
5708
+ .default(true)
5709
+ .describe("Enable content moderation for input and output. Disabling it requires account authorization; unauthorized requests are always checked."),
5710
+ });
5711
+ // Pinned to the live queue OpenAPI read on 2026-10-08
5712
+ // (sha256 6ef799aab74dd454c97802c98b8e8151130e7b09ad878eb7457bc5a091688955). Field order follows x-fal-order-properties.
5713
+ // Docs: https://fal.ai/models/alibaba/happy-horse/v1.1/text-to-video/api
5714
+ export const FalAlibabaHappyHorseV1p1TextToVideoRequestSchema = z.object({
4906
5715
  prompt: z
4907
5716
  .string()
4908
5717
  .min(1)
4909
- .describe("Text prompt describing the desired video. Reference subjects from your images using ``character1``, ``character2``, ... up to ``character9`` (the order matches the order of ``image_urls``). Max 2500 characters."),
4910
- image_urls: z
4911
- .array(z.string())
4912
- .describe("Reference images for subject consistency (1-9 images). Formats: JPEG, JPG, PNG, WEBP. Shortest side must be at least 400 px (720P or higher recommended). Max 20 MB each."),
5718
+ .describe("Text prompt describing the desired video. Max 2500 characters."),
4913
5719
  aspect_ratio: z
4914
5720
  .enum(["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21", "5:4", "4:5"])
4915
5721
  .default("16:9")
@@ -4947,13 +5753,103 @@ export const FalAlibabaHappyHorseV1p1ReferenceToVideoRequestSchema = z.object({
4947
5753
  .default(true)
4948
5754
  .describe("Enable content moderation for input and output. Disabling it requires account authorization; unauthorized requests are always checked."),
4949
5755
  });
4950
- // Pinned to the live queue OpenAPI read on 2026-10-08
4951
- // (sha256 19e08067c44b97e67233cabf1e0ccfc17ef3efb25c01fcf4d0e4f3754501de68). Field order follows x-fal-order-properties.
4952
- // Docs: https://fal.ai/models/alibaba/happy-horse/v1.1/image-to-video/api
4953
- export const FalAlibabaHappyHorseV1p1ImageToVideoRequestSchema = z.object({
4954
- image_url: z
5756
+ // A HappyHorse 1.0 media URL. Unbilled 422 probes on 2026-10-31 refused ""
5757
+ // and ftp:// and an upper-case HTTPS:// scheme, and accepted http://,
5758
+ // https:// and a data URI, with the message restated here.
5759
+ const happyHorseMediaUrl = z
5760
+ .string()
5761
+ .regex(/^(https?:\/\/|data:)/, "Input must be a valid HTTPS URL or a Data URI");
5762
+ // Pinned to the live queue OpenAPI read on 2026-10-31
5763
+ // (sha256 09b7bf1c49675e4031b99e43fd365628d7deab19aa0bc8432e6374b1d5d91b12). Field order follows x-fal-order-properties.
5764
+ // The same day's unbilled 422 probes also showed the URL rule above and a
5765
+ // cap of 5 reference images. A prompt over 2,500 characters and a seed
5766
+ // outside 0-2147483647 drew no field error, so those stay in the
5767
+ // descriptions.
5768
+ // Docs: https://fal.ai/models/alibaba/happy-horse/video-edit/api
5769
+ export const FalAlibabaHappyHorseVideoEditRequestSchema = z.object({
5770
+ video_url: happyHorseMediaUrl.describe("URL of the source video to edit. Formats: MP4, MOV (H.264 recommended). Duration: 3-60 s. Longer side ≤ 2160 px, shorter side ≥ 320 px. Aspect ratio between 1:2.5 and 2.5:1. Frame rate > 8 fps. Max 100 MB. The output video preserves the source aspect ratio. Output duration matches the input video, capped at 15 s (longer inputs are truncated to the first 15 s)."),
5771
+ prompt: z
4955
5772
  .string()
4956
- .describe("URL of the first frame image. Formats: JPEG, JPG, PNG, BMP, WEBP. Dimensions must be at least 300px. Aspect ratio must be between 1:2.5 and 2.5:1. Max 20 MB."),
5773
+ .min(1)
5774
+ .describe("Text prompt describing the desired edit. Reference any supplied reference images using @Image1, @Image2, ... up to @Image5. Max 2500 characters."),
5775
+ reference_image_urls: z
5776
+ .array(happyHorseMediaUrl)
5777
+ .max(5, "Maximum 5 reference images allowed")
5778
+ .nullable()
5779
+ .optional()
5780
+ .describe("Optional reference images used to guide the edit (up to 5). Formats: JPEG, JPG, PNG, WEBP. Dimensions must be at least 300px. Aspect ratio between 1:2.5 and 2.5:1. Max 10 MB each."),
5781
+ resolution: z
5782
+ .enum(["720p", "1080p"])
5783
+ .default("1080p")
5784
+ .describe("Output video resolution tier."),
5785
+ audio_setting: z
5786
+ .enum(["auto", "origin"])
5787
+ .default("auto")
5788
+ .describe("Audio handling. 'auto': model decides whether to regenerate audio. 'origin': preserve the original audio from the input video."),
5789
+ seed: z
5790
+ .number()
5791
+ .int()
5792
+ .nullable()
5793
+ .optional()
5794
+ .describe("Random seed for reproducibility (0-2147483647)."),
5795
+ enable_safety_checker: z
5796
+ .boolean()
5797
+ .default(true)
5798
+ .describe("Enable content moderation for input and output. Disabling it requires account authorization; unauthorized requests are always checked."),
5799
+ });
5800
+ // Pinned to the live queue OpenAPI read on 2026-10-31
5801
+ // (sha256 3434de690251ddc092f4458c56b1f094d166399bdb4d1a75e8a187ecdcbb7f35). Field order follows x-fal-order-properties.
5802
+ // It matches v1.1 text-to-video except for the five aspect ratios.
5803
+ // Docs: https://fal.ai/models/alibaba/happy-horse/text-to-video/api
5804
+ export const FalAlibabaHappyHorseTextToVideoRequestSchema = z.object({
5805
+ prompt: z
5806
+ .string()
5807
+ .min(1)
5808
+ .describe("Text prompt describing the desired video. Max 2500 characters."),
5809
+ aspect_ratio: z
5810
+ .enum(["16:9", "9:16", "1:1", "4:3", "3:4"])
5811
+ .default("16:9")
5812
+ .describe("Aspect ratio of the generated video."),
5813
+ resolution: z
5814
+ .enum(["720p", "1080p"])
5815
+ .default("1080p")
5816
+ .describe("Output video resolution tier."),
5817
+ duration: z
5818
+ .union([
5819
+ z.literal(3),
5820
+ z.literal(4),
5821
+ z.literal(5),
5822
+ z.literal(6),
5823
+ z.literal(7),
5824
+ z.literal(8),
5825
+ z.literal(9),
5826
+ z.literal(10),
5827
+ z.literal(11),
5828
+ z.literal(12),
5829
+ z.literal(13),
5830
+ z.literal(14),
5831
+ z.literal(15),
5832
+ ])
5833
+ .default(5)
5834
+ .describe("Output video duration in seconds (3-15)."),
5835
+ seed: z
5836
+ .number()
5837
+ .int()
5838
+ .nullable()
5839
+ .optional()
5840
+ .describe("Random seed for reproducibility (0-2147483647)."),
5841
+ enable_safety_checker: z
5842
+ .boolean()
5843
+ .default(true)
5844
+ .describe("Enable content moderation for input and output. Disabling it requires account authorization; unauthorized requests are always checked."),
5845
+ });
5846
+ // Pinned to the live queue OpenAPI read on 2026-10-31
5847
+ // (sha256 93960e9d97e21a4681e2671bca46adb9f6c79a1fa10296f0762b44264e2f8d7a). Field order follows x-fal-order-properties.
5848
+ // It matches v1.1 image-to-video except for a 10 MB image cap. Unbilled 422
5849
+ // probes the same day showed the HappyHorse 1.0 URL rule on image_url.
5850
+ // Docs: https://fal.ai/models/alibaba/happy-horse/image-to-video/api
5851
+ export const FalAlibabaHappyHorseImageToVideoRequestSchema = z.object({
5852
+ image_url: happyHorseMediaUrl.describe("URL of the first frame image. Formats: JPEG, JPG, PNG, BMP, WEBP. Dimensions must be at least 300px. Aspect ratio must be between 1:2.5 and 2.5:1. Max 10 MB."),
4957
5853
  prompt: z
4958
5854
  .string()
4959
5855
  .nullable()
@@ -4992,16 +5888,24 @@ export const FalAlibabaHappyHorseV1p1ImageToVideoRequestSchema = z.object({
4992
5888
  .default(true)
4993
5889
  .describe("Enable content moderation for input and output. Disabling it requires account authorization; unauthorized requests are always checked."),
4994
5890
  });
4995
- // Pinned to the live queue OpenAPI read on 2026-10-08
4996
- // (sha256 6ef799aab74dd454c97802c98b8e8151130e7b09ad878eb7457bc5a091688955). Field order follows x-fal-order-properties.
4997
- // Docs: https://fal.ai/models/alibaba/happy-horse/v1.1/text-to-video/api
4998
- export const FalAlibabaHappyHorseV1p1TextToVideoRequestSchema = z.object({
5891
+ // Pinned to the live queue OpenAPI read on 2026-10-31
5892
+ // (sha256 273b084e9ee70e333a94d35a0abf6e212eb2fc7a96ccb9200ff64f5793b3610a). Field order follows x-fal-order-properties.
5893
+ // It matches v1.1 reference-to-video except for the five aspect ratios and a
5894
+ // 10 MB image cap. Unbilled 422 probes the same day showed the HappyHorse
5895
+ // 1.0 URL rule on each image and the 1-9 image count, restated here.
5896
+ // Docs: https://fal.ai/models/alibaba/happy-horse/reference-to-video/api
5897
+ export const FalAlibabaHappyHorseReferenceToVideoRequestSchema = z.object({
4999
5898
  prompt: z
5000
5899
  .string()
5001
5900
  .min(1)
5002
- .describe("Text prompt describing the desired video. Max 2500 characters."),
5901
+ .describe("Text prompt describing the desired video. Reference subjects from your images using ``character1``, ``character2``, ... up to ``character9`` (the order matches the order of ``image_urls``). Max 2500 characters."),
5902
+ image_urls: z
5903
+ .array(happyHorseMediaUrl)
5904
+ .min(1, "At least 1 reference image is required")
5905
+ .max(9, "Maximum 9 reference images allowed")
5906
+ .describe("Reference images for subject consistency (1-9 images). Formats: JPEG, JPG, PNG, WEBP. Shortest side must be at least 400 px (720P or higher recommended). Max 10 MB each."),
5003
5907
  aspect_ratio: z
5004
- .enum(["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21", "5:4", "4:5"])
5908
+ .enum(["16:9", "9:16", "1:1", "4:3", "3:4"])
5005
5909
  .default("16:9")
5006
5910
  .describe("Aspect ratio of the generated video."),
5007
5911
  resolution: z
@@ -5692,6 +6596,267 @@ export const FalMetaMuseImageEditRequestSchema = z.object({
5692
6596
  .default(false)
5693
6597
  .describe("If `True`, the image is returned as a data URI and is not persisted in the request history."),
5694
6598
  });
6599
+ const FalKreaV3EditImageSizeSchema = z.object({
6600
+ width: z
6601
+ .number()
6602
+ .int()
6603
+ .gt(0)
6604
+ .max(14142)
6605
+ .default(512)
6606
+ .describe("The width of the generated image."),
6607
+ height: z
6608
+ .number()
6609
+ .int()
6610
+ .gt(0)
6611
+ .max(14142)
6612
+ .default(512)
6613
+ .describe("The height of the generated image."),
6614
+ });
6615
+ const FalKreaV3EditRegionSchema = z.object({
6616
+ image_idx: z
6617
+ .number()
6618
+ .int()
6619
+ .min(0)
6620
+ .describe("Zero-based index into image_urls."),
6621
+ x: z
6622
+ .number()
6623
+ .min(0)
6624
+ .lt(1)
6625
+ .describe("Left edge as a fraction of image width."),
6626
+ y: z
6627
+ .number()
6628
+ .min(0)
6629
+ .lt(1)
6630
+ .describe("Top edge as a fraction of image height."),
6631
+ width: z
6632
+ .number()
6633
+ .gt(0)
6634
+ .max(1)
6635
+ .describe("Width as a fraction of image width."),
6636
+ height: z
6637
+ .number()
6638
+ .gt(0)
6639
+ .max(1)
6640
+ .describe("Height as a fraction of image height."),
6641
+ label: z
6642
+ .string()
6643
+ .min(1)
6644
+ .max(64)
6645
+ .regex(/^[^\s@]+$/)
6646
+ .nullable()
6647
+ .optional()
6648
+ .describe("Refer to this region as @label. Defaults to its one-based position."),
6649
+ note: z
6650
+ .string()
6651
+ .max(5000)
6652
+ .default("")
6653
+ .describe("Edit instruction for this region; may reference other @labels."),
6654
+ });
6655
+ // Pinned to the live queue OpenAPI read on 2026-10-29
6656
+ // (sha256 5fc40fc471b2be4960ee54eed8fd5993545f9d41096dbe9d83ef61518a74e913). Field order follows x-fal-order-properties.
6657
+ // Docs: https://fal.ai/models/krea/v3/edit/api
6658
+ export const FalKreaV3EditRequestSchema = z.object({
6659
+ prompt: z
6660
+ .string()
6661
+ .max(5000)
6662
+ .default("")
6663
+ .describe("Edit instruction. Refer to images as <image-1>, <image-2>, ... and regions as @label. May be omitted when a region has a note."),
6664
+ image_urls: z
6665
+ .array(z.string())
6666
+ .min(1)
6667
+ .max(8)
6668
+ .describe("Reference images to edit or combine (1-8). Order sets the <image-N> tags."),
6669
+ regions: z
6670
+ .array(FalKreaV3EditRegionSchema)
6671
+ .max(24)
6672
+ .optional()
6673
+ .describe("Bounding boxes on reference images, with optional labels and editing notes. Requires high or ultra reasoning."),
6674
+ regional_edit: z
6675
+ .boolean()
6676
+ .nullable()
6677
+ .optional()
6678
+ .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."),
6679
+ model: z
6680
+ .enum(["berry", "jam"])
6681
+ .default("berry")
6682
+ .describe("Model variant: berry favors quality, jam favors speed."),
6683
+ image_size: z
6684
+ .union([
6685
+ FalKreaV3EditImageSizeSchema,
6686
+ z.enum([
6687
+ "square_hd",
6688
+ "square",
6689
+ "portrait_4_3",
6690
+ "portrait_16_9",
6691
+ "landscape_4_3",
6692
+ "landscape_16_9",
6693
+ "auto",
6694
+ ]),
6695
+ ])
6696
+ .default("auto")
6697
+ .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."),
6698
+ reasoning_level: z
6699
+ .enum(["low", "medium", "high", "ultra"])
6700
+ .default("medium")
6701
+ .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."),
6702
+ negative_prompt: z
6703
+ .string()
6704
+ .max(1024)
6705
+ .default("")
6706
+ .describe("What to keep out of the image. Used by berry only."),
6707
+ seed: z
6708
+ .number()
6709
+ .int()
6710
+ .nullable()
6711
+ .optional()
6712
+ .describe("Latent noise seed. Use a new seed when editing a previous output again."),
6713
+ output_format: z
6714
+ .enum(["png", "jpeg"])
6715
+ .default("png")
6716
+ .describe("Output image format."),
6717
+ sync_mode: z
6718
+ .boolean()
6719
+ .default(false)
6720
+ .describe("Return images as data URIs instead of saving them in request history."),
6721
+ enable_safety_checker: z
6722
+ .boolean()
6723
+ .default(true)
6724
+ .describe("Check output images for unsafe content. Disabling requires account authorization."),
6725
+ });
6726
+ const FalKreaV3TextToImageImageSizeSchema = z.object({
6727
+ width: z
6728
+ .number()
6729
+ .int()
6730
+ .gt(0)
6731
+ .max(14142)
6732
+ .default(512)
6733
+ .describe("The width of the generated image."),
6734
+ height: z
6735
+ .number()
6736
+ .int()
6737
+ .gt(0)
6738
+ .max(14142)
6739
+ .default(512)
6740
+ .describe("The height of the generated image."),
6741
+ });
6742
+ // Pinned to the live queue OpenAPI read on 2026-10-29
6743
+ // (sha256 347a03eddc1f1385a22e32ea9d6f6217e970da6890d8a630978fbb19cc24ff42).
6744
+ // Field order follows x-fal-order-properties. Leaf under krea.v3; the edit
6745
+ // child owns the scaffold.
6746
+ // Docs: https://fal.ai/models/krea/v3/text-to-image/api
6747
+ export const FalKreaV3TextToImageRequestSchema = z.object({
6748
+ prompt: z
6749
+ .string()
6750
+ .min(1)
6751
+ .max(5000)
6752
+ .describe("Description of the image to generate."),
6753
+ model: z
6754
+ .enum(["berry", "jam"])
6755
+ .default("berry")
6756
+ .describe("Model variant: berry favors quality, jam favors speed."),
6757
+ image_size: z
6758
+ .union([
6759
+ FalKreaV3TextToImageImageSizeSchema,
6760
+ z.enum([
6761
+ "square_hd",
6762
+ "square",
6763
+ "portrait_4_3",
6764
+ "portrait_16_9",
6765
+ "landscape_4_3",
6766
+ "landscape_16_9",
6767
+ "auto",
6768
+ ]),
6769
+ ])
6770
+ .default("auto")
6771
+ .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."),
6772
+ reasoning_level: z
6773
+ .enum(["low", "medium"])
6774
+ .default("medium")
6775
+ .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."),
6776
+ negative_prompt: z
6777
+ .string()
6778
+ .max(1024)
6779
+ .default("")
6780
+ .describe("What to keep out of the image. Used by berry only."),
6781
+ seed: z
6782
+ .number()
6783
+ .int()
6784
+ .nullable()
6785
+ .optional()
6786
+ .describe("Latent noise seed. Use a new seed when editing a previous output again."),
6787
+ output_format: z
6788
+ .enum(["png", "jpeg"])
6789
+ .default("png")
6790
+ .describe("Output image format."),
6791
+ sync_mode: z
6792
+ .boolean()
6793
+ .default(false)
6794
+ .describe("Return images as data URIs instead of saving them in request history."),
6795
+ enable_safety_checker: z
6796
+ .boolean()
6797
+ .default(true)
6798
+ .describe("Check output images for unsafe content. Disabling requires account authorization."),
6799
+ });
6800
+ // GPT Image 2 concrete size limits, queue OpenAPI/docs read 2026-10-30.
6801
+ const FalOpenaiGptImage2ImageSizeSchema = z
6802
+ .object({
6803
+ width: z.number().int().positive().multipleOf(16).max(3840).default(512),
6804
+ height: z.number().int().positive().multipleOf(16).max(3840).default(512),
6805
+ })
6806
+ .superRefine(({ width, height }, ctx) => {
6807
+ const pixels = width * height;
6808
+ if (pixels < 655360 || pixels > 8294400)
6809
+ ctx.addIssue({
6810
+ code: "custom",
6811
+ message: "Image area must be between 655360 and 8294400 pixels.",
6812
+ });
6813
+ if (Math.max(width, height) / Math.min(width, height) > 3)
6814
+ ctx.addIssue({
6815
+ code: "custom",
6816
+ message: "Aspect ratio must not exceed 3:1.",
6817
+ });
6818
+ });
6819
+ // Docs: https://fal.ai/models/openai/gpt-image-2/api
6820
+ export const FalOpenaiGptImage2RequestSchema = z.object({
6821
+ prompt: z.string().min(1).max(32000),
6822
+ image_size: z
6823
+ .union([
6824
+ FalOpenaiGptImage2ImageSizeSchema,
6825
+ z.enum([
6826
+ "square_hd",
6827
+ "square",
6828
+ "portrait_4_3",
6829
+ "portrait_16_9",
6830
+ "landscape_4_3",
6831
+ "landscape_16_9",
6832
+ "auto",
6833
+ ]),
6834
+ ])
6835
+ .default("landscape_4_3"),
6836
+ background: z.enum(["auto", "transparent", "opaque"]).default("auto"),
6837
+ quality: z.enum(["auto", "low", "medium", "high"]).default("high"),
6838
+ num_images: z.number().int().min(1).max(10).default(1),
6839
+ output_format: z.enum(["jpeg", "png", "webp"]).default("png"),
6840
+ output_compression: z.number().int().min(0).max(100).nullable().optional(),
6841
+ sync_mode: z.boolean().default(false),
6842
+ enable_safety_checker: z.boolean().default(true),
6843
+ });
6844
+ // GPT Image 2 edit, queue OpenAPI read 2026-10-30.
6845
+ // Docs: https://fal.ai/models/openai/gpt-image-2/edit/api
6846
+ export const FalOpenaiGptImage2EditRequestSchema = FalOpenaiGptImage2RequestSchema.extend({
6847
+ image_urls: z
6848
+ .array(z.string())
6849
+ .max(16)
6850
+ .describe("Reference image URLs or data URIs; at most 16 images."),
6851
+ image_size: FalOpenaiGptImage2RequestSchema.shape.image_size
6852
+ .unwrap()
6853
+ .default("auto"),
6854
+ mask_url: z
6855
+ .string()
6856
+ .nullable()
6857
+ .optional()
6858
+ .describe("Mask URL: white regions are edited and black regions are kept."),
6859
+ });
5695
6860
  const FalOpenaiGptImage2p5SunburstEditImageSizeSchema = z.object({
5696
6861
  width: z
5697
6862
  .number()
@@ -7758,6 +8923,59 @@ const FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema = z.obj
7758
8923
  .default("5")
7759
8924
  .describe("The duration of this shot in seconds"),
7760
8925
  });
8926
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/text-to-video/api
8927
+ export const FalKlingVideoO3ProTextToVideoRequestSchema = z
8928
+ .object({
8929
+ enable_safety_checker: z
8930
+ .boolean()
8931
+ .default(true)
8932
+ .describe("Disabling safety checks requires account authorization; unauthorized requests are always checked."),
8933
+ prompt: z
8934
+ .string()
8935
+ .max(2500)
8936
+ .nullable()
8937
+ .optional()
8938
+ .describe("Text prompt for video generation. Required unless multi_prompt is provided."),
8939
+ duration: z
8940
+ .enum([
8941
+ "3",
8942
+ "4",
8943
+ "5",
8944
+ "6",
8945
+ "7",
8946
+ "8",
8947
+ "9",
8948
+ "10",
8949
+ "11",
8950
+ "12",
8951
+ "13",
8952
+ "14",
8953
+ "15",
8954
+ ])
8955
+ .default("5")
8956
+ .describe("Video duration in seconds (3-15s)."),
8957
+ aspect_ratio: z
8958
+ .enum(["16:9", "9:16", "1:1"])
8959
+ .default("16:9")
8960
+ .describe("Aspect ratio of the generated video."),
8961
+ generate_audio: z
8962
+ .boolean()
8963
+ .default(false)
8964
+ .describe("Whether to generate native audio for the video."),
8965
+ multi_prompt: z
8966
+ .array(FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema)
8967
+ .nullable()
8968
+ .optional()
8969
+ .describe("List of prompts for multi-shot video generation."),
8970
+ shot_type: z
8971
+ .enum(["customize", "intelligent"])
8972
+ .default("customize")
8973
+ .describe("The type of multi-shot video generation. 'intelligent' lets the model automatically determine shot structure."),
8974
+ })
8975
+ .refine((v) => v.prompt != null || v.multi_prompt != null, {
8976
+ message: "fal-ai/kling-video/o3/pro/text-to-video needs prompt or multi_prompt",
8977
+ path: ["prompt"],
8978
+ });
7761
8979
  // Kling O3 Standard image-to-video: live OpenAPI 2026-10-15. Field order
7762
8980
  // follows x-fal-order-properties. The prompt-or-multi_prompt rule comes from
7763
8981
  // the prompt description; a guarded 422 probe cannot reach it.
@@ -7818,6 +9036,249 @@ export const FalKlingVideoO3StandardImageToVideoRequestSchema = z
7818
9036
  message: "fal-ai/kling-video/o3/standard/image-to-video multi_prompt and prompt are mutually exclusive",
7819
9037
  path: ["prompt"],
7820
9038
  });
9039
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/image-to-video/api
9040
+ export const FalKlingVideoO3ProImageToVideoRequestSchema = z
9041
+ .object({
9042
+ enable_safety_checker: z
9043
+ .boolean()
9044
+ .default(true)
9045
+ .describe("Disabling safety checks requires account authorization; unauthorized requests are always checked."),
9046
+ prompt: z
9047
+ .string()
9048
+ .max(2500)
9049
+ .nullable()
9050
+ .optional()
9051
+ .describe("Text prompt for video generation. Either prompt or multi_prompt must be provided, but not both."),
9052
+ 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."),
9053
+ end_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable()
9054
+ .optional()
9055
+ .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."),
9056
+ duration: z
9057
+ .enum([
9058
+ "3",
9059
+ "4",
9060
+ "5",
9061
+ "6",
9062
+ "7",
9063
+ "8",
9064
+ "9",
9065
+ "10",
9066
+ "11",
9067
+ "12",
9068
+ "13",
9069
+ "14",
9070
+ "15",
9071
+ ])
9072
+ .default("5")
9073
+ .describe("Video duration in seconds (3-15s)."),
9074
+ generate_audio: z
9075
+ .boolean()
9076
+ .default(false)
9077
+ .describe("Whether to generate native audio for the video."),
9078
+ multi_prompt: z
9079
+ .array(FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema)
9080
+ .nullable()
9081
+ .optional()
9082
+ .describe("List of prompts for multi-shot video generation."),
9083
+ shot_type: z
9084
+ .enum(["customize", "intelligent"])
9085
+ .default("customize")
9086
+ .describe("The type of multi-shot video generation. 'intelligent' lets the model automatically determine shot structure."),
9087
+ })
9088
+ .refine((v) => v.prompt != null || v.multi_prompt != null, {
9089
+ message: "fal-ai/kling-video/o3/pro/image-to-video needs prompt or multi_prompt",
9090
+ path: ["prompt"],
9091
+ })
9092
+ .refine((v) => !(v.prompt != null && v.multi_prompt != null), {
9093
+ message: "fal-ai/kling-video/o3/pro/image-to-video multi_prompt and prompt are mutually exclusive",
9094
+ path: ["prompt"],
9095
+ });
9096
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/reference-to-video/api
9097
+ export const FalKlingVideoO3ProReferenceToVideoRequestSchema = z
9098
+ .object({
9099
+ enable_safety_checker: z.boolean().default(true),
9100
+ prompt: z
9101
+ .string()
9102
+ .max(2500)
9103
+ .nullable()
9104
+ .optional()
9105
+ .describe("Either prompt or multi_prompt must be provided, but not both."),
9106
+ multi_prompt: z
9107
+ .array(FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema)
9108
+ .nullable()
9109
+ .optional(),
9110
+ start_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable()
9111
+ .optional()
9112
+ .describe("Image to use as the first frame."),
9113
+ end_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable()
9114
+ .optional()
9115
+ .describe("Image to use as the last frame."),
9116
+ image_urls: z
9117
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
9118
+ .nullable()
9119
+ .optional()
9120
+ .describe("Reference images for style/appearance, referenced as @Image1, @Image2. Maximum four combined elements and images when using video."),
9121
+ elements: z
9122
+ .array(z.object({
9123
+ frontal_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable().optional(),
9124
+ reference_image_urls: z
9125
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
9126
+ .min(1)
9127
+ .max(3)
9128
+ .nullable()
9129
+ .optional()
9130
+ .describe("Additional reference images from different angles; one to three images."),
9131
+ video_url: z
9132
+ .string()
9133
+ .nullable()
9134
+ .optional()
9135
+ .describe("Element video; at most one element per request may use video."),
9136
+ voice_id: z.string().nullable().optional(),
9137
+ }))
9138
+ .nullable()
9139
+ .optional()
9140
+ .describe("Characters or objects referenced as @Element1, @Element2."),
9141
+ generate_audio: z.boolean().default(false),
9142
+ duration: z
9143
+ .enum([
9144
+ "3",
9145
+ "4",
9146
+ "5",
9147
+ "6",
9148
+ "7",
9149
+ "8",
9150
+ "9",
9151
+ "10",
9152
+ "11",
9153
+ "12",
9154
+ "13",
9155
+ "14",
9156
+ "15",
9157
+ ])
9158
+ .default("5"),
9159
+ shot_type: z.enum(["customize", "intelligent"]).default("customize"),
9160
+ aspect_ratio: z.enum(["16:9", "9:16", "1:1"]).default("16:9"),
9161
+ })
9162
+ .refine((v) => (v.prompt != null) !== (v.multi_prompt != null), {
9163
+ message: "Provide exactly one of prompt or multi_prompt",
9164
+ path: ["prompt"],
9165
+ })
9166
+ .superRefine((v, ctx) => {
9167
+ const videos = v.elements?.filter((e) => e.video_url != null).length ?? 0;
9168
+ if (videos > 1)
9169
+ ctx.addIssue({
9170
+ code: "custom",
9171
+ message: "At most one element may use video",
9172
+ path: ["elements"],
9173
+ });
9174
+ if (videos > 0 &&
9175
+ (v.elements?.length ?? 0) + (v.image_urls?.length ?? 0) > 4)
9176
+ ctx.addIssue({
9177
+ code: "custom",
9178
+ message: "At most four combined elements and images when using video",
9179
+ path: ["image_urls"],
9180
+ });
9181
+ });
9182
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/video-to-video/edit/api
9183
+ export const FalKlingVideoO3ProVideoToVideoEditRequestSchema = z
9184
+ .object({
9185
+ enable_safety_checker: z.boolean().default(true),
9186
+ prompt: z
9187
+ .string()
9188
+ .max(2500)
9189
+ .describe("Text prompt for video generation. Reference the video as @Video1."),
9190
+ video_url: z
9191
+ .string()
9192
+ .describe("Reference MP4/MOV video: 3-15 seconds, 720-3840px, maximum 200MB."),
9193
+ image_urls: z
9194
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
9195
+ .nullable()
9196
+ .optional()
9197
+ .describe("Reference images as @Image1, @Image2. Maximum four combined images and elements."),
9198
+ keep_audio: z
9199
+ .boolean()
9200
+ .default(true)
9201
+ .describe("Keep the original audio from the reference video."),
9202
+ elements: z
9203
+ .array(z.object({
9204
+ frontal_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable().optional(),
9205
+ reference_image_urls: z
9206
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
9207
+ .min(1)
9208
+ .max(3)
9209
+ .nullable()
9210
+ .optional()
9211
+ .describe("Additional reference images; one to three images."),
9212
+ }))
9213
+ .nullable()
9214
+ .optional()
9215
+ .describe("Characters or objects referenced as @Element1, @Element2."),
9216
+ shot_type: z.literal("customize").default("customize"),
9217
+ })
9218
+ .refine((v) => (v.elements?.length ?? 0) + (v.image_urls?.length ?? 0) <= 4, {
9219
+ message: "At most four combined elements and reference images",
9220
+ path: ["image_urls"],
9221
+ });
9222
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/pro/video-to-video/reference/api
9223
+ export const FalKlingVideoO3ProVideoToVideoReferenceRequestSchema = z
9224
+ .object({
9225
+ enable_safety_checker: z.boolean().default(true),
9226
+ prompt: z
9227
+ .string()
9228
+ .max(2500)
9229
+ .describe("Text prompt for video generation. Reference the video as @Video1."),
9230
+ video_url: z
9231
+ .string()
9232
+ .describe("Reference MP4/MOV video: 3-15 seconds, 720-3840px, maximum 200MB."),
9233
+ image_urls: z
9234
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
9235
+ .nullable()
9236
+ .optional()
9237
+ .describe("Reference images as @Image1, @Image2. Maximum four combined images and elements."),
9238
+ keep_audio: z
9239
+ .boolean()
9240
+ .default(true)
9241
+ .describe("Keep the original audio from the reference video."),
9242
+ elements: z
9243
+ .array(z.object({
9244
+ frontal_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable().optional(),
9245
+ reference_image_urls: z
9246
+ .array(FalKlingVideoO3StandardImageToVideoImageUrlSchema)
9247
+ .min(1)
9248
+ .max(3)
9249
+ .nullable()
9250
+ .optional()
9251
+ .describe("Additional reference images; one to three images."),
9252
+ }))
9253
+ .nullable()
9254
+ .optional()
9255
+ .describe("Characters or objects referenced as @Element1, @Element2."),
9256
+ shot_type: z.literal("customize").default("customize"),
9257
+ aspect_ratio: z.enum(["auto", "16:9", "9:16", "1:1"]).default("auto"),
9258
+ duration: z
9259
+ .enum([
9260
+ "3",
9261
+ "4",
9262
+ "5",
9263
+ "6",
9264
+ "7",
9265
+ "8",
9266
+ "9",
9267
+ "10",
9268
+ "11",
9269
+ "12",
9270
+ "13",
9271
+ "14",
9272
+ "15",
9273
+ ])
9274
+ .nullable()
9275
+ .optional()
9276
+ .describe("Video duration in seconds (3-15s)."),
9277
+ })
9278
+ .refine((v) => (v.elements?.length ?? 0) + (v.image_urls?.length ?? 0) <= 4, {
9279
+ message: "At most four combined elements and reference images",
9280
+ path: ["image_urls"],
9281
+ });
7821
9282
  // VEED Clean Audio
7822
9283
  export const FalVeedCleanAudioRequestSchema = z.object({
7823
9284
  audio_url: z
@@ -8779,6 +10240,10 @@ export const FalBytedanceSeedance2p5UsTextToVideoRequestSchema = z.object({
8779
10240
  .enum(["480p", "720p", "1080p"])
8780
10241
  .default("720p")
8781
10242
  .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality."),
10243
+ draft: z
10244
+ .boolean()
10245
+ .default(false)
10246
+ .describe("Generate a draft preview at 480p, overriding resolution. Returns a draft_id for completing the draft at 1080p within 14 days."),
8782
10247
  duration: z
8783
10248
  .enum([
8784
10249
  "auto",
@@ -8853,6 +10318,10 @@ export const FalBytedanceSeedance2p5UsImageToVideoRequestSchema = z.object({
8853
10318
  .enum(["480p", "720p", "1080p"])
8854
10319
  .default("720p")
8855
10320
  .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality."),
10321
+ draft: z
10322
+ .boolean()
10323
+ .default(false)
10324
+ .describe("Generate a draft preview at 480p, overriding resolution. Returns a draft_id for completing the draft at 1080p within 14 days."),
8856
10325
  duration: z
8857
10326
  .enum([
8858
10327
  "auto",
@@ -8941,6 +10410,10 @@ export const FalBytedanceSeedance2p5UsReferenceToVideoRequestSchema = z.object({
8941
10410
  .enum(["480p", "720p", "1080p"])
8942
10411
  .default("720p")
8943
10412
  .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality."),
10413
+ draft: z
10414
+ .boolean()
10415
+ .default(false)
10416
+ .describe("Generate a draft preview at 480p, overriding resolution. Returns a draft_id for completing the draft at 1080p within 14 days."),
8944
10417
  duration: z
8945
10418
  .enum([
8946
10419
  "auto",
@@ -9018,6 +10491,22 @@ export const FalBytedanceSeedance2p5DraftCompleteRequestSchema = z.object({
9018
10491
  .default("auto")
9019
10492
  .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
9020
10493
  });
10494
+ // Bytedance Seedance 2.5 US draft completion, queue OpenAPI read 2026-10-31.
10495
+ export const FalBytedanceSeedance2p5UsDraftCompleteRequestSchema = z.object({
10496
+ draft_id: z
10497
+ .string()
10498
+ .min(1)
10499
+ .max(8192)
10500
+ .describe("The draft_id returned with draft enabled. Valid for 14 days and only for the original caller."),
10501
+ resolution: z
10502
+ .literal("1080p")
10503
+ .default("1080p")
10504
+ .describe("Completed drafts only support 1080p output."),
10505
+ codec: z
10506
+ .enum(["auto", "H264", "H265"])
10507
+ .default("auto")
10508
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
10509
+ });
9021
10510
  // Meshy 6 Lite retexture
9022
10511
  export const FalMeshyV6LiteRetextureRequestSchema = z
9023
10512
  .object({
@@ -11929,6 +13418,8 @@ export const FalHeygenV3VideoAgentRequestSchema = z.object({
11929
13418
  .describe("Authorized callers may set false to request relaxed screening."),
11930
13419
  });
11931
13420
  export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
13421
+ "openai/gpt-image-2": FalOpenaiGptImage2RequestSchema,
13422
+ "openai/gpt-image-2/edit": FalOpenaiGptImage2EditRequestSchema,
11932
13423
  "fal-ai/heygen/v3/video-agent": FalHeygenV3VideoAgentRequestSchema,
11933
13424
  "fal-ai/heygen/v2/video-agent": FalHeygenV2VideoAgentRequestSchema,
11934
13425
  "kling/v4/video-to-video/edit": FalKlingV4VideoToVideoEditRequestSchema,
@@ -11953,6 +13444,7 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
11953
13444
  "heygen/heygen-voice": FalHeygenHeygenVoiceRequestSchema,
11954
13445
  "meshy/v6-lite/retexture": FalMeshyV6LiteRetextureRequestSchema,
11955
13446
  "bytedance/seedance-2.5/draft/complete": FalBytedanceSeedance2p5DraftCompleteRequestSchema,
13447
+ "bytedance/seedance-2.5/us/draft/complete": FalBytedanceSeedance2p5UsDraftCompleteRequestSchema,
11956
13448
  "bytedance/seedance-2.5/us/reference-to-video": FalBytedanceSeedance2p5UsReferenceToVideoRequestSchema,
11957
13449
  "bytedance/seedance-2.5/us/image-to-video": FalBytedanceSeedance2p5UsImageToVideoRequestSchema,
11958
13450
  "bytedance/seedance-2.5/us/text-to-video": FalBytedanceSeedance2p5UsTextToVideoRequestSchema,
@@ -11971,6 +13463,11 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
11971
13463
  "openrouter/router/decisions": FalOpenrouterRouterDecisionsRequestSchema,
11972
13464
  "creatify/boreal": FalCreatifyBorealRequestSchema,
11973
13465
  "veed/clean-audio": FalVeedCleanAudioRequestSchema,
13466
+ "fal-ai/kling-video/o3/pro/reference-to-video": FalKlingVideoO3ProReferenceToVideoRequestSchema,
13467
+ "fal-ai/kling-video/o3/pro/video-to-video/reference": FalKlingVideoO3ProVideoToVideoReferenceRequestSchema,
13468
+ "fal-ai/kling-video/o3/pro/video-to-video/edit": FalKlingVideoO3ProVideoToVideoEditRequestSchema,
13469
+ "fal-ai/kling-video/o3/pro/image-to-video": FalKlingVideoO3ProImageToVideoRequestSchema,
13470
+ "fal-ai/kling-video/o3/pro/text-to-video": FalKlingVideoO3ProTextToVideoRequestSchema,
11974
13471
  "fal-ai/kling-video/o3/standard/image-to-video": FalKlingVideoO3StandardImageToVideoRequestSchema,
11975
13472
  "fal-ai/flux-2-flex": FalFlux2FlexRequestSchema,
11976
13473
  "fal-ai/kandinsky6-pro/image-to-video": FalKandinsky6ProImageToVideoRequestSchema,
@@ -12008,6 +13505,8 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
12008
13505
  "openai/gpt-image-2.5/sunburst/text-to-image": FalOpenaiGptImage2p5SunburstTextToImageRequestSchema,
12009
13506
  "openai/gpt-image-2.5/sunburst/edit": FalOpenaiGptImage2p5SunburstEditRequestSchema,
12010
13507
  "meta/muse-image/edit": FalMetaMuseImageEditRequestSchema,
13508
+ "krea/v3/edit": FalKreaV3EditRequestSchema,
13509
+ "krea/v3/text-to-image": FalKreaV3TextToImageRequestSchema,
12011
13510
  "meta/muse-image/text-to-image": FalMetaMuseImageTextToImageRequestSchema,
12012
13511
  "elevenlabs/music/v2.5": FalElevenlabsMusicV2p5RequestSchema,
12013
13512
  "bria/fibo-gen-1.5/text-to-image": FalBriaFiboGen1p5TextToImageRequestSchema,
@@ -12018,6 +13517,10 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
12018
13517
  "alibaba/happy-horse/v1.1/text-to-video": FalAlibabaHappyHorseV1p1TextToVideoRequestSchema,
12019
13518
  "alibaba/happy-horse/v1.1/image-to-video": FalAlibabaHappyHorseV1p1ImageToVideoRequestSchema,
12020
13519
  "alibaba/happy-horse/v1.1/reference-to-video": FalAlibabaHappyHorseV1p1ReferenceToVideoRequestSchema,
13520
+ "alibaba/happy-horse/video-edit": FalAlibabaHappyHorseVideoEditRequestSchema,
13521
+ "alibaba/happy-horse/text-to-video": FalAlibabaHappyHorseTextToVideoRequestSchema,
13522
+ "alibaba/happy-horse/image-to-video": FalAlibabaHappyHorseImageToVideoRequestSchema,
13523
+ "alibaba/happy-horse/reference-to-video": FalAlibabaHappyHorseReferenceToVideoRequestSchema,
12021
13524
  "alibaba/qwen-audio-3-tts": FalAlibabaQwenAudio3TtsRequestSchema,
12022
13525
  "fal-ai/kling-video/v3/turbo/pro/image-to-video": FalKlingVideoV3TurboProImageToVideoRequestSchema,
12023
13526
  "fal-ai/kling-video/v3/turbo/pro/text-to-video": FalKlingVideoV3TurboProTextToVideoRequestSchema,
@@ -12035,6 +13538,7 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
12035
13538
  "xai/grok-imagine-video/v1.5/text-to-video": FalXaiGrokImagineVideoV1p5TextToVideoRequestSchema,
12036
13539
  "minimax/h3-max-turbo/text-to-video": FalMinimaxH3MaxTurboTextToVideoRequestSchema,
12037
13540
  "minimax/h3-max-turbo/image-to-video": FalMinimaxH3MaxTurboImageToVideoRequestSchema,
13541
+ "minimax/h3-max-turbo/reference-to-video": FalMinimaxH3MaxTurboReferenceToVideoRequestSchema,
12038
13542
  "minimax/h3-max/lip-sync/image-to-video": FalMinimaxH3MaxLipSyncImageToVideoRequestSchema,
12039
13543
  "minimax/h3-max/3d-to-video": FalMinimaxH3MaxThreeDToVideoRequestSchema,
12040
13544
  "minimax/h3-max/reference-to-video": FalMinimaxH3MaxReferenceToVideoRequestSchema,
@@ -12079,8 +13583,14 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
12079
13583
  "blackforestlabs/flux-3/extend-video": FalFlux3ExtendVideoRequestSchema,
12080
13584
  "blackforestlabs/flux-3/first-last-frame-to-video": FalFlux3FirstLastFrameToVideoRequestSchema,
12081
13585
  "blackforestlabs/flux-3/image-to-video": FalFlux3ImageToVideoRequestSchema,
13586
+ "blackforestlabs/flux-3/image-to-video/draft": FalFlux3ImageToVideoDraftRequestSchema,
13587
+ "blackforestlabs/flux-3/extend-video/draft": FalFlux3ExtendVideoDraftRequestSchema,
13588
+ "blackforestlabs/flux-3/first-last-frame-to-video/draft": FalFlux3FirstLastFrameToVideoDraftRequestSchema,
13589
+ "blackforestlabs/flux-3/keyframes-to-video/draft": FalFlux3KeyframesToVideoDraftRequestSchema,
12082
13590
  "blackforestlabs/flux-3/keyframes-to-video": FalFlux3KeyframesToVideoRequestSchema,
12083
13591
  "blackforestlabs/flux-3/text-to-video": FalFlux3TextToVideoRequestSchema,
13592
+ "blackforestlabs/flux-3/text-to-video/draft": FalFlux3TextToVideoDraftRequestSchema,
13593
+ "blackforestlabs/flux-3/draft-enhance": FalFlux3DraftEnhanceRequestSchema,
12084
13594
  "blackforestlabs/flux-3-max/image-to-video": FalFlux3MaxImageToVideoRequestSchema,
12085
13595
  "blackforestlabs/flux-3-max/keyframes-to-video": FalFlux3MaxKeyframesToVideoRequestSchema,
12086
13596
  "blackforestlabs/flux-3-max/text-to-video": FalFlux3MaxTextToVideoRequestSchema,
@@ -12128,8 +13638,15 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
12128
13638
  "alibaba/wan-3.0-prime/image-to-video": FalWan3p0ImageToVideoRequestSchema,
12129
13639
  "alibaba/wan-3.0-prime/reference-to-video": FalWan3p0ReferenceToVideoRequestSchema,
12130
13640
  "minimax/h3/text-to-video": FalMinimaxH3TextToVideoRequestSchema,
13641
+ "minimax/h3/text-to-video/lora": FalMinimaxH3TextToVideoLoraRequestSchema,
12131
13642
  "minimax/h3/image-to-video": FalMinimaxH3ImageToVideoRequestSchema,
13643
+ "minimax/h3/image-to-video/lora": FalMinimaxH3ImageToVideoLoraRequestSchema,
12132
13644
  "minimax/h3/reference-to-video": FalMinimaxH3ReferenceToVideoRequestSchema,
13645
+ "minimax/h3/reference-to-video/lora": FalMinimaxH3ReferenceToVideoLoraRequestSchema,
13646
+ "minimax/h3/t2v/trainer": FalMinimaxH3T2vTrainerRequestSchema,
13647
+ "minimax/h3/i2v/trainer": FalMinimaxH3I2vTrainerRequestSchema,
13648
+ "minimax/h3/flf2v/trainer": FalMinimaxH3Flf2vTrainerRequestSchema,
13649
+ "minimax/h3/ref2va/trainer": FalMinimaxH3Ref2vaTrainerRequestSchema,
12133
13650
  "fal-ai/wan/v2.7/text-to-image": FalWanV2p7TextToImageRequestSchema,
12134
13651
  "fal-ai/wan/v2.7/edit": FalWanV2p7EditRequestSchema,
12135
13652
  "fal-ai/wan/v2.7/pro/text-to-image": FalWanV2p7TextToImageRequestSchema,