@apicity/fal 0.28.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -1
- package/dist/src/example.d.ts.map +1 -1
- package/dist/src/example.js +61 -0
- package/dist/src/example.js.map +1 -1
- package/dist/src/fal.d.ts.map +1 -1
- package/dist/src/fal.js +55 -1
- package/dist/src/fal.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +104 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/zod.d.ts +373 -0
- package/dist/src/zod.d.ts.map +1 -1
- package/dist/src/zod.js +290 -0
- package/dist/src/zod.js.map +1 -1
- package/package.json +1 -1
package/dist/src/zod.js
CHANGED
|
@@ -1268,6 +1268,77 @@ export const FalSeedreamV5ProEditRequestSchema = z.object({
|
|
|
1268
1268
|
enable_safety_checker: z.boolean().optional(),
|
|
1269
1269
|
});
|
|
1270
1270
|
// ---------------------------------------------------------------------------
|
|
1271
|
+
// Bytedance Seedream 5.5 edit
|
|
1272
|
+
// ---------------------------------------------------------------------------
|
|
1273
|
+
// Queue OpenAPI re-read 2026-11-20
|
|
1274
|
+
// (sha256 717a8bfaa7293167665dcaeb6bc9d35ab4b16793fc45402fa7626c6dfc19e3c6).
|
|
1275
|
+
// The route was not probed: a rejected body can still be billed.
|
|
1276
|
+
// Docs: https://fal.ai/models/bytedance/seedream/v5.5/edit/api
|
|
1277
|
+
const FalSeedreamV55ImageSizeSchema = z.union([
|
|
1278
|
+
z.enum([
|
|
1279
|
+
"square_hd",
|
|
1280
|
+
"square",
|
|
1281
|
+
"portrait_4_3",
|
|
1282
|
+
"portrait_16_9",
|
|
1283
|
+
"landscape_4_3",
|
|
1284
|
+
"landscape_16_9",
|
|
1285
|
+
"auto_1K",
|
|
1286
|
+
"auto_1.5K",
|
|
1287
|
+
"auto_2K",
|
|
1288
|
+
]),
|
|
1289
|
+
z.object({
|
|
1290
|
+
width: z
|
|
1291
|
+
.number()
|
|
1292
|
+
.int()
|
|
1293
|
+
.min(1)
|
|
1294
|
+
.max(14142)
|
|
1295
|
+
.describe("The width of the generated image."),
|
|
1296
|
+
height: z
|
|
1297
|
+
.number()
|
|
1298
|
+
.int()
|
|
1299
|
+
.min(1)
|
|
1300
|
+
.max(14142)
|
|
1301
|
+
.describe("The height of the generated image."),
|
|
1302
|
+
}),
|
|
1303
|
+
]);
|
|
1304
|
+
export const FalSeedreamV55EditRequestSchema = z.object({
|
|
1305
|
+
prompt: z.string().describe("The text prompt used to edit the image."),
|
|
1306
|
+
image_size: FalSeedreamV55ImageSizeSchema.default("auto_2K").describe("The size of the generated image. Total pixels must be between 921600 and 4624220, with aspect ratio between 1/16 and 16."),
|
|
1307
|
+
num_images: z
|
|
1308
|
+
.number()
|
|
1309
|
+
.int()
|
|
1310
|
+
.min(1)
|
|
1311
|
+
.max(6)
|
|
1312
|
+
.default(1)
|
|
1313
|
+
.describe("Number of separate model generations to run with the prompt."),
|
|
1314
|
+
output_format: z
|
|
1315
|
+
.enum(["jpeg", "png"])
|
|
1316
|
+
.default("png")
|
|
1317
|
+
.describe("The file format of the generated image."),
|
|
1318
|
+
watermark: z
|
|
1319
|
+
.boolean()
|
|
1320
|
+
.default(false)
|
|
1321
|
+
.describe("Whether to add the provider's visible watermark."),
|
|
1322
|
+
sync_mode: z
|
|
1323
|
+
.boolean()
|
|
1324
|
+
.default(false)
|
|
1325
|
+
.describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
|
|
1326
|
+
enable_safety_checker: z
|
|
1327
|
+
.boolean()
|
|
1328
|
+
.default(true)
|
|
1329
|
+
.describe("If set to true, the safety checker will be enabled. Disabling it requires account authorization; unauthorized requests are always checked."),
|
|
1330
|
+
background: z
|
|
1331
|
+
.enum(["auto", "opaque", "transparent"])
|
|
1332
|
+
.default("auto")
|
|
1333
|
+
.describe("`auto` lets the model choose from the prompt and output format. `transparent` returns an RGBA image and requires `output_format=png`."),
|
|
1334
|
+
// Upstream keeps at most the last 10 images and does not reject a longer
|
|
1335
|
+
// list, so the cap is not encoded. The list is required and non-empty.
|
|
1336
|
+
image_urls: z
|
|
1337
|
+
.array(z.string())
|
|
1338
|
+
.min(1)
|
|
1339
|
+
.describe("List of URLs of input reference images. Up to 10 images are supported; if more are sent, only the last 10 are used."),
|
|
1340
|
+
});
|
|
1341
|
+
// ---------------------------------------------------------------------------
|
|
1271
1342
|
// Bytedance Seed Speech TTS v2
|
|
1272
1343
|
// ---------------------------------------------------------------------------
|
|
1273
1344
|
const FalSeedSpeechTtsV2VoiceSchema = z.enum([
|
|
@@ -7929,6 +8000,126 @@ export const FalMicrosoftMaiImage2p5ProEditRequestSchema = z.object({
|
|
|
7929
8000
|
.default("")
|
|
7930
8001
|
.describe("The URL of the image to edit. Provide one http(s) or data: URL."),
|
|
7931
8002
|
});
|
|
8003
|
+
// The custom ImageSize component both MAI-Image-2.7 leaves publish.
|
|
8004
|
+
const FalMicrosoftMaiImage2p7ImageSizeSchema = z.object({
|
|
8005
|
+
width: z
|
|
8006
|
+
.number()
|
|
8007
|
+
.int()
|
|
8008
|
+
.gt(0)
|
|
8009
|
+
.max(14142)
|
|
8010
|
+
.default(512)
|
|
8011
|
+
.describe("The width of the generated image."),
|
|
8012
|
+
height: z
|
|
8013
|
+
.number()
|
|
8014
|
+
.int()
|
|
8015
|
+
.gt(0)
|
|
8016
|
+
.max(14142)
|
|
8017
|
+
.default(512)
|
|
8018
|
+
.describe("The height of the generated image."),
|
|
8019
|
+
});
|
|
8020
|
+
// Pinned to the live queue OpenAPI read on 2026-11-20
|
|
8021
|
+
// (sha256 6be8ad1b6176ba07bd96bd0b3ba3b5b2d77b28534fe9014ddf53ed7fcf88c4c9). Field order follows x-fal-order-properties.
|
|
8022
|
+
// Docs: https://fal.ai/models/microsoft/mai-image-2.7/edit/api
|
|
8023
|
+
// The image_size side and pixel limits and the transparent-background format
|
|
8024
|
+
// rule are documented, not probe-confirmed: free 422 pairing probes on
|
|
8025
|
+
// 2026-11-20 drew no field error for 512x1024, 767x1024, 2048x2064 or
|
|
8026
|
+
// transparent jpeg, so fal checks them (if at all) after field validation.
|
|
8027
|
+
export const FalMicrosoftMaiImage2p7EditRequestSchema = z.object({
|
|
8028
|
+
prompt: z
|
|
8029
|
+
.string()
|
|
8030
|
+
.min(1)
|
|
8031
|
+
.max(32000)
|
|
8032
|
+
.describe("The instruction describing how to edit the input images."),
|
|
8033
|
+
image_urls: z
|
|
8034
|
+
.array(z.string())
|
|
8035
|
+
.min(1)
|
|
8036
|
+
.max(5)
|
|
8037
|
+
.describe("The URLs of the images to edit or reference (up to 5)."),
|
|
8038
|
+
image_size: z
|
|
8039
|
+
.union([
|
|
8040
|
+
FalMicrosoftMaiImage2p7ImageSizeSchema,
|
|
8041
|
+
z.enum([
|
|
8042
|
+
"square_hd",
|
|
8043
|
+
"portrait_4_3",
|
|
8044
|
+
"landscape_4_3",
|
|
8045
|
+
"portrait_3_2",
|
|
8046
|
+
"landscape_3_2",
|
|
8047
|
+
"portrait_16_9",
|
|
8048
|
+
"landscape_16_9",
|
|
8049
|
+
]),
|
|
8050
|
+
])
|
|
8051
|
+
.nullable()
|
|
8052
|
+
.optional()
|
|
8053
|
+
.describe("The size of the edited image. If not set, the model picks a size close to the input. Each side must be at least 768 pixels and the total pixel count at most 4,194,304 (2048x2048). Custom sizes are rounded down to a multiple of 16."),
|
|
8054
|
+
resolution: z
|
|
8055
|
+
.enum(["1K", "2K"])
|
|
8056
|
+
.default("1K")
|
|
8057
|
+
.describe('Resolution of preset image sizes: "1K" (about 1 megapixel) or "2K" (each side doubled). Ignored for custom sizes.'),
|
|
8058
|
+
background: z
|
|
8059
|
+
.enum(["opaque", "transparent"])
|
|
8060
|
+
.default("opaque")
|
|
8061
|
+
.describe('Use "transparent" for a transparent background (requires png or webp output).'),
|
|
8062
|
+
output_format: z
|
|
8063
|
+
.enum(["jpeg", "png", "webp"])
|
|
8064
|
+
.default("png")
|
|
8065
|
+
.describe("The format of the edited image."),
|
|
8066
|
+
sync_mode: z
|
|
8067
|
+
.boolean()
|
|
8068
|
+
.default(false)
|
|
8069
|
+
.describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
|
|
8070
|
+
});
|
|
8071
|
+
// Pinned to the live queue OpenAPI read on 2026-11-20
|
|
8072
|
+
// (sha256 48c07fe76b2e06e358aa5ed4796d54b208621c5cf5d5b2d019c50d677112b639).
|
|
8073
|
+
// Docs: https://fal.ai/models/microsoft/mai-image-2.7/flash/edit/api
|
|
8074
|
+
// The Flash edit Input matches the MAI-Image-2.7 edit Input field for field
|
|
8075
|
+
// (names, order, required, bounds, defaults and descriptions), so it reuses
|
|
8076
|
+
// that shape; only the token card differs. The same free 422 probes drew no
|
|
8077
|
+
// field error for the documented size and background rules.
|
|
8078
|
+
export const FalMicrosoftMaiImage2p7FlashEditRequestSchema = FalMicrosoftMaiImage2p7EditRequestSchema.extend({});
|
|
8079
|
+
// Pinned to the live queue OpenAPI read on 2026-11-20
|
|
8080
|
+
// (sha256 bc8c6966d7827b0eef018d29dacb5a883aeffc736f9ae0fd5ca5881201b29b6a). Field order follows x-fal-order-properties.
|
|
8081
|
+
// Docs: https://fal.ai/models/microsoft/mai-image-2.7/text-to-image/api
|
|
8082
|
+
// As on the edit leaf, the image_size side and pixel limits and the
|
|
8083
|
+
// transparent-background format rule are documented, not probe-confirmed:
|
|
8084
|
+
// free 422 pairing probes on 2026-11-20 drew no field error for them.
|
|
8085
|
+
export const FalMicrosoftMaiImage2p7TextToImageRequestSchema = z.object({
|
|
8086
|
+
prompt: z
|
|
8087
|
+
.string()
|
|
8088
|
+
.min(1)
|
|
8089
|
+
.max(32000)
|
|
8090
|
+
.describe("The text prompt to generate an image from."),
|
|
8091
|
+
image_size: z
|
|
8092
|
+
.union([
|
|
8093
|
+
FalMicrosoftMaiImage2p7ImageSizeSchema,
|
|
8094
|
+
z.enum([
|
|
8095
|
+
"square_hd",
|
|
8096
|
+
"portrait_4_3",
|
|
8097
|
+
"landscape_4_3",
|
|
8098
|
+
"portrait_3_2",
|
|
8099
|
+
"landscape_3_2",
|
|
8100
|
+
"portrait_16_9",
|
|
8101
|
+
"landscape_16_9",
|
|
8102
|
+
]),
|
|
8103
|
+
])
|
|
8104
|
+
.default("square_hd")
|
|
8105
|
+
.describe("The size of the generated image. Each side must be at least 768 pixels and the total pixel count at most 4,194,304 (2048x2048). Custom sizes are rounded down to a multiple of 16."),
|
|
8106
|
+
resolution: z
|
|
8107
|
+
.enum(["1K", "2K"])
|
|
8108
|
+
.default("1K")
|
|
8109
|
+
.describe('Resolution of preset image sizes: "1K" (about 1 megapixel) or "2K" (each side doubled). Ignored for custom sizes.'),
|
|
8110
|
+
background: z
|
|
8111
|
+
.enum(["opaque", "transparent"])
|
|
8112
|
+
.default("opaque")
|
|
8113
|
+
.describe('Use "transparent" for a transparent background (requires png or webp output).'),
|
|
8114
|
+
output_format: z
|
|
8115
|
+
.enum(["jpeg", "png", "webp"])
|
|
8116
|
+
.default("png")
|
|
8117
|
+
.describe("The format of the generated image."),
|
|
8118
|
+
sync_mode: z
|
|
8119
|
+
.boolean()
|
|
8120
|
+
.default(false)
|
|
8121
|
+
.describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
|
|
8122
|
+
});
|
|
7932
8123
|
const FalNvidiaCosmos3SuperImageToVideoImageSizeSchema = z.object({
|
|
7933
8124
|
width: z
|
|
7934
8125
|
.number()
|
|
@@ -14042,6 +14233,99 @@ export const FalKlingV4VideoToVideoEditRequestSchema = z.object({
|
|
|
14042
14233
|
.default("1080p")
|
|
14043
14234
|
.describe("Output resolution."),
|
|
14044
14235
|
});
|
|
14236
|
+
// Pinned to the live queue OpenAPI read on 2026-11-20
|
|
14237
|
+
// (sha256 15c4978af1d2649f0bd7a10ea685c2bab1223116df919226194a23eb29708990).
|
|
14238
|
+
// Field order follows x-fal-order-properties. The input is open. The media
|
|
14239
|
+
// URL rule is the one free 422 probes confirmed on the four kling/v4 video
|
|
14240
|
+
// endpoints; this image route was not probed, because a rejected body can
|
|
14241
|
+
// still be billed. Images and elements combined must stay at or under 10;
|
|
14242
|
+
// that limit is documented and not checked here.
|
|
14243
|
+
// Docs: https://fal.ai/models/kling/v4/image-to-image/api
|
|
14244
|
+
export const FalKlingV4ImageToImageRequestSchema = z.object({
|
|
14245
|
+
prompt: z
|
|
14246
|
+
.string()
|
|
14247
|
+
.min(1)
|
|
14248
|
+
.max(50000)
|
|
14249
|
+
.describe("Text prompt. Reference images as @Image1, @Image2, ... and elements as @Element1, @Element2, ..."),
|
|
14250
|
+
image_urls: z
|
|
14251
|
+
.array(KlingV4MediaUrlSchema)
|
|
14252
|
+
.min(1)
|
|
14253
|
+
.max(10)
|
|
14254
|
+
.describe("Reference images (1-10).\n\nMax file size: 30.0MB, Min width: 300px, Min height: 300px, Min aspect ratio: 0.40, Max aspect ratio: 2.50, Timeout: 20.0s"),
|
|
14255
|
+
elements: z
|
|
14256
|
+
.array(KlingV4ImageElementSchema)
|
|
14257
|
+
.max(7)
|
|
14258
|
+
.nullable()
|
|
14259
|
+
.optional()
|
|
14260
|
+
.describe("Elements, referenced as @Element1, @Element2, ... (max 7). Images and elements combined must not exceed 10."),
|
|
14261
|
+
result_type: z
|
|
14262
|
+
.enum(["single", "series"])
|
|
14263
|
+
.default("single")
|
|
14264
|
+
.describe("'single' returns independent images; 'series' returns a coherent set of related images."),
|
|
14265
|
+
num_images: z
|
|
14266
|
+
.number()
|
|
14267
|
+
.int()
|
|
14268
|
+
.min(1)
|
|
14269
|
+
.max(9)
|
|
14270
|
+
.default(1)
|
|
14271
|
+
.describe("Number of independent images to generate (1-9). Only used when result_type is 'single'."),
|
|
14272
|
+
series_amount: z
|
|
14273
|
+
.union([z.number().int().min(2).max(10), z.literal("auto")])
|
|
14274
|
+
.default(4)
|
|
14275
|
+
.describe("Number of images in the series (2-10), or 'auto' to let the model choose. Only used when result_type is 'series'."),
|
|
14276
|
+
resolution: z
|
|
14277
|
+
.enum(["2K", "4K", "8K"])
|
|
14278
|
+
.default("2K")
|
|
14279
|
+
.describe("Output resolution."),
|
|
14280
|
+
aspect_ratio: z
|
|
14281
|
+
.enum(["auto", "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9"])
|
|
14282
|
+
.default("auto")
|
|
14283
|
+
.describe("Aspect ratio of generated images. 'auto' picks one from the input content."),
|
|
14284
|
+
sync_mode: z
|
|
14285
|
+
.boolean()
|
|
14286
|
+
.default(false)
|
|
14287
|
+
.describe("If `True`, the media will be returned as a data URI."),
|
|
14288
|
+
});
|
|
14289
|
+
// Pinned to the live queue OpenAPI read on 2026-11-20
|
|
14290
|
+
// (sha256 a6a499f3f677057d97bc6a9cc076c8b801a2323ce8250f85e3a9cf4fa9ad0c74).
|
|
14291
|
+
// Field order follows x-fal-order-properties. The input is open. llms.txt
|
|
14292
|
+
// still says $0.063 per units, matching the 2026-11-19 survey. This route
|
|
14293
|
+
// was not probed with a rejected body, because a rejection can still be billed.
|
|
14294
|
+
// Docs: https://fal.ai/models/kling/v4/text-to-image/api
|
|
14295
|
+
export const FalKlingV4TextToImageRequestSchema = z.object({
|
|
14296
|
+
prompt: z
|
|
14297
|
+
.string()
|
|
14298
|
+
.min(1)
|
|
14299
|
+
.max(50000)
|
|
14300
|
+
.describe("Text prompt for image generation."),
|
|
14301
|
+
result_type: z
|
|
14302
|
+
.enum(["single", "series"])
|
|
14303
|
+
.default("single")
|
|
14304
|
+
.describe("'single' returns independent images; 'series' returns a coherent set of related images."),
|
|
14305
|
+
num_images: z
|
|
14306
|
+
.number()
|
|
14307
|
+
.int()
|
|
14308
|
+
.min(1)
|
|
14309
|
+
.max(9)
|
|
14310
|
+
.default(1)
|
|
14311
|
+
.describe("Number of independent images to generate (1-9). Only used when result_type is 'single'."),
|
|
14312
|
+
series_amount: z
|
|
14313
|
+
.union([z.number().int().min(2).max(10), z.literal("auto")])
|
|
14314
|
+
.default(4)
|
|
14315
|
+
.describe("Number of images in the series (2-10), or 'auto' to let the model choose. Only used when result_type is 'series'."),
|
|
14316
|
+
resolution: z
|
|
14317
|
+
.enum(["2K", "4K", "8K"])
|
|
14318
|
+
.default("2K")
|
|
14319
|
+
.describe("Output resolution."),
|
|
14320
|
+
aspect_ratio: z
|
|
14321
|
+
.enum(["auto", "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9"])
|
|
14322
|
+
.default("auto")
|
|
14323
|
+
.describe("Aspect ratio of generated images. 'auto' picks one from the input content."),
|
|
14324
|
+
sync_mode: z
|
|
14325
|
+
.boolean()
|
|
14326
|
+
.default(false)
|
|
14327
|
+
.describe("If `True`, the media will be returned as a data URI."),
|
|
14328
|
+
});
|
|
14045
14329
|
// Pinned to the live queue OpenAPI read on 2026-10-23
|
|
14046
14330
|
// (sha256 896571542e77dada6cfd0bcabc34f17f1db6e4b7afdfa75784e8b3a72461bb05).
|
|
14047
14331
|
// Field order follows x-fal-order-properties. The input is open; free 422
|
|
@@ -14128,6 +14412,8 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
|
|
|
14128
14412
|
"fal-ai/heygen/v2/video-agent": FalHeygenV2VideoAgentRequestSchema,
|
|
14129
14413
|
"kling/v4/video-to-video/edit": FalKlingV4VideoToVideoEditRequestSchema,
|
|
14130
14414
|
"kling/v4/reference-to-video": FalKlingV4ReferenceToVideoRequestSchema,
|
|
14415
|
+
"kling/v4/image-to-image": FalKlingV4ImageToImageRequestSchema,
|
|
14416
|
+
"kling/v4/text-to-image": FalKlingV4TextToImageRequestSchema,
|
|
14131
14417
|
"kling/v4/image-to-video": FalKlingV4ImageToVideoRequestSchema,
|
|
14132
14418
|
"kling/v4/text-to-video": FalKlingV4TextToVideoRequestSchema,
|
|
14133
14419
|
"fal-ai/heygen/v3/filler-word-removal": FalHeygenV3FillerWordRemovalRequestSchema,
|
|
@@ -14204,6 +14490,9 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
|
|
|
14204
14490
|
"nvidia/cosmos-3-super/image-to-video": FalNvidiaCosmos3SuperImageToVideoRequestSchema,
|
|
14205
14491
|
"microsoft/mai-image-2.5-pro/edit": FalMicrosoftMaiImage2p5ProEditRequestSchema,
|
|
14206
14492
|
"microsoft/mai-image-2.5-pro": FalMicrosoftMaiImage2p5ProRequestSchema,
|
|
14493
|
+
"microsoft/mai-image-2.7/edit": FalMicrosoftMaiImage2p7EditRequestSchema,
|
|
14494
|
+
"microsoft/mai-image-2.7/flash/edit": FalMicrosoftMaiImage2p7FlashEditRequestSchema,
|
|
14495
|
+
"microsoft/mai-image-2.7/text-to-image": FalMicrosoftMaiImage2p7TextToImageRequestSchema,
|
|
14207
14496
|
"openai/gpt-image-2.5/flare/text-to-image": FalOpenaiGptImage2p5FlareTextToImageRequestSchema,
|
|
14208
14497
|
"openai/gpt-image-2.5/flare/edit": FalOpenaiGptImage2p5FlareEditRequestSchema,
|
|
14209
14498
|
"openai/gpt-image-2.5/sunburst/text-to-image": FalOpenaiGptImage2p5SunburstTextToImageRequestSchema,
|
|
@@ -14344,6 +14633,7 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
|
|
|
14344
14633
|
"bytedance/seedream/v5/pro/layerize": FalSeedreamV5ProLayerizeRequestSchema,
|
|
14345
14634
|
"bytedance/seedream/v5/pro/text-to-image": FalSeedreamV5ProTextToImageRequestSchema,
|
|
14346
14635
|
"bytedance/seedream/v5/pro/edit": FalSeedreamV5ProEditRequestSchema,
|
|
14636
|
+
"bytedance/seedream/v5.5/edit": FalSeedreamV55EditRequestSchema,
|
|
14347
14637
|
"fal-ai/bytedance/seed-speech/tts/v2": FalSeedSpeechTtsV2RequestSchema,
|
|
14348
14638
|
"minimax/music-3": FalMinimaxMusic3RequestSchema,
|
|
14349
14639
|
"fal-ai/elevenlabs/speech-to-text/scribe-v2": FalElevenlabsSpeechToTextScribeV2RequestSchema,
|