@howells/motif-sdk 5.4.0 → 6.0.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 +3 -3
- package/dist/image.js +1 -74
- package/dist/index.cjs +30 -1042
- package/dist/index.d.cts +4 -11
- package/dist/index.d.ts +4 -11
- package/dist/index.js +31 -1042
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,14 +73,14 @@ if (plan.isOk()) {
|
|
|
73
73
|
|
|
74
74
|
## Stream a Task
|
|
75
75
|
|
|
76
|
-
`stream(task, input, options?)` opens a direct inference stream on the resolved route. Streaming is explicitly supported for GPT Image
|
|
76
|
+
`stream(task, input, options?)` opens a direct inference stream on the resolved route. Streaming is explicitly supported for GPT Image 1.5 and FLUX.2 Dev, including their edit routes. Other routes return `STREAMING_UNSUPPORTED` before any provider request; Motif never substitutes another model or retries a stream.
|
|
77
77
|
|
|
78
78
|
```ts
|
|
79
79
|
const controller = new AbortController();
|
|
80
80
|
const opened = await motif.stream(
|
|
81
81
|
"generate",
|
|
82
82
|
{
|
|
83
|
-
model: "
|
|
83
|
+
model: "gpt",
|
|
84
84
|
prompt: "editorial product photo",
|
|
85
85
|
references: ["https://example.com/reference.png"],
|
|
86
86
|
},
|
|
@@ -110,7 +110,7 @@ For a local checkout, `node packages/motif-sdk/examples/stream.mjs --dry-run` pr
|
|
|
110
110
|
- `ASPECT_RATIOS`, `RESOLUTIONS`, `FORMAT_PRESETS` - shared sizing metadata.
|
|
111
111
|
- `LOOKS`, `CREATIVE_TAXONOMY`, `enrichPrompt`, `validateCreativeDirection` - house looks and moods.
|
|
112
112
|
- `formatCost`, `sumCosts` - cost formatting and totals.
|
|
113
|
-
- `getFalKeyFromEnv
|
|
113
|
+
- `getFalKeyFromEnv` - `@howells/envy` backed key parsing.
|
|
114
114
|
- Re-exported `neverthrow` helpers: `ok`, `err`, `Result`, `ResultAsync`.
|
|
115
115
|
|
|
116
116
|
## Common Types
|
package/dist/image.js
CHANGED
|
@@ -193,77 +193,6 @@ const MODELS = {
|
|
|
193
193
|
type: "generation",
|
|
194
194
|
useQueue: true
|
|
195
195
|
},
|
|
196
|
-
gpt2: {
|
|
197
|
-
benchmark: {
|
|
198
|
-
artificialAnalysis: {
|
|
199
|
-
editing: {
|
|
200
|
-
elo: 1125,
|
|
201
|
-
rank: 5
|
|
202
|
-
},
|
|
203
|
-
snapshotDate: AA_IMAGE_LEADERBOARD_SNAPSHOT,
|
|
204
|
-
sourceUrls: AA_IMAGE_SOURCES,
|
|
205
|
-
textToImage: {
|
|
206
|
-
elo: 1172,
|
|
207
|
-
rank: 3
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
speed: {
|
|
211
|
-
medianSeconds: 200.7,
|
|
212
|
-
p95Seconds: 232.6,
|
|
213
|
-
source: "artificial-analysis-models"
|
|
214
|
-
},
|
|
215
|
-
tiers: {
|
|
216
|
-
price: "ultra",
|
|
217
|
-
quality: "frontier",
|
|
218
|
-
speed: "very_slow"
|
|
219
|
-
},
|
|
220
|
-
useCase: "Established frontier generation and transparent PNGs"
|
|
221
|
-
},
|
|
222
|
-
customImageSize: {
|
|
223
|
-
maxEdge: 3840,
|
|
224
|
-
maxPixels: 8294400,
|
|
225
|
-
maxRatio: 3,
|
|
226
|
-
minPixels: 655360,
|
|
227
|
-
multipleOf: 16
|
|
228
|
-
},
|
|
229
|
-
editEndpoint: "openai/gpt-image-2/edit",
|
|
230
|
-
endpoint: "openai/gpt-image-2",
|
|
231
|
-
falPricing: {
|
|
232
|
-
checkedAt: FAL_PRICING_CHECKED_AT,
|
|
233
|
-
currency: "USD",
|
|
234
|
-
endpointId: "openai/gpt-image-2",
|
|
235
|
-
estimatedCostPerImageUsd: .211,
|
|
236
|
-
source: "fal-pricing-api",
|
|
237
|
-
unit: "units",
|
|
238
|
-
unitPrice: 1
|
|
239
|
-
},
|
|
240
|
-
maxReferenceImages: 16,
|
|
241
|
-
name: "GPT Image 2",
|
|
242
|
-
pricePerImageUsd: .211,
|
|
243
|
-
pricing: "$0.211",
|
|
244
|
-
sizeMode: "image_size_enum",
|
|
245
|
-
supportsAspect: true,
|
|
246
|
-
streaming: {
|
|
247
|
-
generation: true,
|
|
248
|
-
edit: true
|
|
249
|
-
},
|
|
250
|
-
supportsEdit: true,
|
|
251
|
-
supportsMaskImage: true,
|
|
252
|
-
maskImageField: "mask_url",
|
|
253
|
-
supportsNumImages: true,
|
|
254
|
-
supportsOutputFormat: true,
|
|
255
|
-
supportsQuality: true,
|
|
256
|
-
supportsResolution: false,
|
|
257
|
-
supportsSyncMode: true,
|
|
258
|
-
transparencyRoute: {
|
|
259
|
-
apiKeyEnv: "OPENAI_API_KEY",
|
|
260
|
-
model: "gpt-image-2",
|
|
261
|
-
provider: "openai",
|
|
262
|
-
supportsEdit: true
|
|
263
|
-
},
|
|
264
|
-
type: "generation",
|
|
265
|
-
useQueue: true
|
|
266
|
-
},
|
|
267
196
|
gpt: {
|
|
268
197
|
benchmark: {
|
|
269
198
|
artificialAnalysis: {
|
|
@@ -1844,7 +1773,6 @@ const MODELS = {
|
|
|
1844
1773
|
[
|
|
1845
1774
|
"sunburst",
|
|
1846
1775
|
"flare",
|
|
1847
|
-
"gpt2",
|
|
1848
1776
|
"gpt",
|
|
1849
1777
|
"banana21",
|
|
1850
1778
|
"banana2",
|
|
@@ -1987,7 +1915,7 @@ Object.keys(OPTION_CAPABILITIES).filter(isModelOption);
|
|
|
1987
1915
|
experimental: true,
|
|
1988
1916
|
id: "illustration",
|
|
1989
1917
|
label: "Editorial illustration",
|
|
1990
|
-
model: "
|
|
1918
|
+
model: "flare"
|
|
1991
1919
|
}
|
|
1992
1920
|
],
|
|
1993
1921
|
mood: [
|
|
@@ -3577,7 +3505,6 @@ const FAL_IMAGE_PRICE_USD = {
|
|
|
3577
3505
|
"fal-ai/flux-2": MODELS["flux2-dev"]?.pricePerImageUsd ?? .012,
|
|
3578
3506
|
"fal-ai/flux-2/turbo": MODELS["flux2-turbo"]?.pricePerImageUsd ?? .008,
|
|
3579
3507
|
[FAL_GPT_IMAGE_MODEL]: MODELS.gpt?.pricePerImageUsd ?? .133,
|
|
3580
|
-
"openai/gpt-image-2": MODELS.gpt2?.pricePerImageUsd ?? .211,
|
|
3581
3508
|
"fal-ai/nano-banana-2": MODELS.banana2?.pricePerImageUsd ?? .08,
|
|
3582
3509
|
"fal-ai/nano-banana-pro": MODELS.banana?.pricePerImageUsd ?? .15,
|
|
3583
3510
|
"fal-ai/gemini-25-flash-image": MODELS.gemini?.pricePerImageUsd ?? .0398,
|