getaiapi 0.3.1 → 0.3.2
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 +31 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
|
|
9
|
-
A unified TypeScript library that wraps 1,
|
|
9
|
+
A unified TypeScript library that wraps 1,930 AI models across 3 providers into a single `generate()` function. One input shape. One output shape. Any model.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -48,6 +48,20 @@ const edited = await generate({
|
|
|
48
48
|
})
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
**Multi-image references** (e.g., character + location consistency)
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
const scene = await generate({
|
|
55
|
+
model: 'google-nano-banana-pro-edit',
|
|
56
|
+
prompt: 'cinematic shot of the character in the location',
|
|
57
|
+
image: 'https://example.com/character.jpg',
|
|
58
|
+
images: [
|
|
59
|
+
'https://example.com/character.jpg',
|
|
60
|
+
'https://example.com/location.jpg',
|
|
61
|
+
],
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
51
65
|
**Text-to-speech**
|
|
52
66
|
|
|
53
67
|
```typescript
|
|
@@ -83,13 +97,13 @@ const cutout = await generate({
|
|
|
83
97
|
Set API keys as environment variables. You only need keys for the providers you plan to call.
|
|
84
98
|
|
|
85
99
|
```bash
|
|
86
|
-
# fal-ai (1,
|
|
100
|
+
# fal-ai (1,201 models)
|
|
87
101
|
export FAL_KEY="your-fal-key"
|
|
88
102
|
|
|
89
103
|
# Replicate (687 models)
|
|
90
104
|
export REPLICATE_API_TOKEN="your-replicate-token"
|
|
91
105
|
|
|
92
|
-
# WaveSpeed (
|
|
106
|
+
# WaveSpeed (66 models)
|
|
93
107
|
export WAVESPEED_API_KEY="your-wavespeed-key"
|
|
94
108
|
```
|
|
95
109
|
|
|
@@ -167,12 +181,12 @@ const model = getModel('flux-schnell')
|
|
|
167
181
|
|
|
168
182
|
| Category | Input | Output | Models |
|
|
169
183
|
|---|---|---|---|
|
|
170
|
-
| `text-to-image` | text | image |
|
|
171
|
-
| `text-to-video` | text | video |
|
|
172
|
-
| `image-edit` | image + text | image |
|
|
173
|
-
| `image-to-video` | image + text | video |
|
|
174
|
-
| `text-to-audio` | text | audio |
|
|
175
|
-
| `upscale-image` | image | image |
|
|
184
|
+
| `text-to-image` | text | image | 820 |
|
|
185
|
+
| `text-to-video` | text | video | 318 |
|
|
186
|
+
| `image-edit` | image + text | image | 210 |
|
|
187
|
+
| `image-to-video` | image + text | video | 155 |
|
|
188
|
+
| `text-to-audio` | text | audio | 82 |
|
|
189
|
+
| `upscale-image` | image | image | 57 |
|
|
176
190
|
| `training` | images | model | 50 |
|
|
177
191
|
| `image-to-image` | image + text | image | 43 |
|
|
178
192
|
| `segmentation` | image/video | segmentation | 34 |
|
|
@@ -180,17 +194,21 @@ const model = getModel('flux-schnell')
|
|
|
180
194
|
| `audio-to-text` | audio | text | 25 |
|
|
181
195
|
| `remove-background` | image/video | image/video | 24 |
|
|
182
196
|
| `text-to-3d` | text | 3d | 19 |
|
|
183
|
-
| `video-to-audio` | video | audio |
|
|
197
|
+
| `video-to-audio` | video | audio | 17 |
|
|
184
198
|
| `upscale-video` | video | video | 15 |
|
|
199
|
+
| `video-to-video` | video | video | 15 |
|
|
185
200
|
| `moderation` | text/image/video | text | 8 |
|
|
201
|
+
| `audio-to-video` | audio | video | 4 |
|
|
202
|
+
| `audio-edit` | audio | audio | 2 |
|
|
203
|
+
| `voice-clone` | audio | text | 1 |
|
|
186
204
|
|
|
187
205
|
## Providers
|
|
188
206
|
|
|
189
207
|
| Provider | Models | Auth Env Var | Protocol |
|
|
190
208
|
|---|---|---|---|
|
|
191
|
-
| fal-ai | 1,
|
|
209
|
+
| fal-ai | 1,201 | `FAL_KEY` | Native fetch |
|
|
192
210
|
| Replicate | 687 | `REPLICATE_API_TOKEN` | Native fetch |
|
|
193
|
-
| WaveSpeed |
|
|
211
|
+
| WaveSpeed | 66 | `WAVESPEED_API_KEY` | Native fetch |
|
|
194
212
|
|
|
195
213
|
Zero external dependencies -- all provider communication uses native `fetch`.
|
|
196
214
|
|
|
@@ -207,6 +225,7 @@ interface GenerateRequest {
|
|
|
207
225
|
model: string // required - model name
|
|
208
226
|
prompt?: string // text prompt
|
|
209
227
|
image?: string | File // input image (URL or File)
|
|
228
|
+
images?: (string | File)[] // multiple reference images
|
|
210
229
|
audio?: string | File // input audio
|
|
211
230
|
video?: string | File // input video
|
|
212
231
|
negative_prompt?: string // what to avoid
|