@effect-uai/fal 0.13.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/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/FalImageGenerator.d.mts +152 -0
- package/dist/FalImageGenerator.d.mts.map +1 -0
- package/dist/FalImageGenerator.mjs +273 -0
- package/dist/FalImageGenerator.mjs.map +1 -0
- package/dist/codec.d.mts +17 -0
- package/dist/codec.d.mts.map +1 -0
- package/dist/codec.mjs +73 -0
- package/dist/codec.mjs.map +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +4 -0
- package/dist/models.d.mts +32 -0
- package/dist/models.d.mts.map +1 -0
- package/dist/models.mjs +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +59 -0
- package/src/FalImageGenerator.ts +524 -0
- package/src/codec.ts +130 -0
- package/src/index.ts +3 -0
- package/src/models.ts +49 -0
package/src/models.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fal endpoint identifiers (as of September 2026). Unlike every other
|
|
3
|
+
* provider here, the "model" is a *path*: it selects the endpoint, and
|
|
4
|
+
* text-to-image and edit are separate endpoints of the same model
|
|
5
|
+
* family. Pass a `FalImageModel` to `generate` and a `FalImageEditModel`
|
|
6
|
+
* to `edit`.
|
|
7
|
+
*
|
|
8
|
+
* The `(string & {})` tail keeps autocomplete on the literals while
|
|
9
|
+
* accepting any string, so fal's whole catalogue works without an SDK
|
|
10
|
+
* update: the id is the model page's URL after `fal.ai/models/`.
|
|
11
|
+
*
|
|
12
|
+
* Read that literally. Whether an id carries the `fal-ai/` prefix varies
|
|
13
|
+
* even between generations of one model (`fal-ai/bytedance/seedream/v4.5/edit`
|
|
14
|
+
* has it, `bytedance/seedream/v5/pro/text-to-image` does not), and a
|
|
15
|
+
* wrong guess is fal's "Application not found", not a 404 you can read.
|
|
16
|
+
*
|
|
17
|
+
* Reference: https://fal.ai/models
|
|
18
|
+
*/
|
|
19
|
+
export type FalImageModel =
|
|
20
|
+
| "fal-ai/flux-2-pro"
|
|
21
|
+
| "fal-ai/flux/schnell"
|
|
22
|
+
| "fal-ai/flux/dev"
|
|
23
|
+
| "bytedance/seedream/v5/pro/text-to-image"
|
|
24
|
+
| "alibaba/qwen-image-3/text-to-image"
|
|
25
|
+
| "meta/muse-image/text-to-image"
|
|
26
|
+
| "openai/gpt-image-2"
|
|
27
|
+
| "fal-ai/nano-banana-2"
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
29
|
+
| (string & {})
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Edit endpoints. A generate id sent to `edit` gets fal's 422 for an
|
|
33
|
+
* unknown field.
|
|
34
|
+
*
|
|
35
|
+
* Which wire field the references ride in differs per endpoint and the
|
|
36
|
+
* adapter works that out on its own, so any edit endpoint fal hosts
|
|
37
|
+
* works here, single-image ones included.
|
|
38
|
+
*/
|
|
39
|
+
export type FalImageEditModel =
|
|
40
|
+
| "fal-ai/flux-2-pro/edit"
|
|
41
|
+
| "bytedance/seedream/v5/pro/edit"
|
|
42
|
+
| "fal-ai/bytedance/seedream/v4.5/edit"
|
|
43
|
+
| "alibaba/qwen-image-3/edit"
|
|
44
|
+
| "fal-ai/nano-banana-2/edit"
|
|
45
|
+
| "openai/gpt-image-2/edit"
|
|
46
|
+
| "fal-ai/qwen-image-edit"
|
|
47
|
+
| "fal-ai/flux/dev/image-to-image"
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
49
|
+
| (string & {})
|