@fungi.computer/darkroom 0.5.12 → 0.6.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/gateway-models.js +11 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/media-binding.d.ts +3 -0
- package/dist/model-catalog.d.ts +3 -1
- package/dist/model-catalog.js +104 -26
- package/docs/api/index.md +13 -11
- package/docs/api/server.md +20 -17
- package/package.json +2 -2
package/dist/gateway-models.js
CHANGED
|
@@ -23,12 +23,22 @@ export function mediaUnits(settings) {
|
|
|
23
23
|
* GPT Image 2 output tokens per image at `medium` quality. OpenAI publishes
|
|
24
24
|
* this table for its gpt-image models; PRICE DECISION PENDING (Levi): confirm
|
|
25
25
|
* against the first live gateway logs, which carry the real token counts.
|
|
26
|
+
* Any other size is billed in proportion to its pixels at the 1024x1024 rate
|
|
27
|
+
* (1,056 tokens per 1,048,576 pixels, which reproduces the table's 1024x1536
|
|
28
|
+
* row exactly and bounds its 1536x1024 row), rounded up; OpenAI publishes no
|
|
29
|
+
* table for the larger sizes.
|
|
26
30
|
*/
|
|
27
31
|
const gptImageOutputTokens = new Map([
|
|
28
32
|
["1024x1024", 1_056],
|
|
29
33
|
["1024x1536", 1_584],
|
|
30
34
|
["1536x1024", 1_568],
|
|
31
35
|
]);
|
|
36
|
+
const gptImageTokensPerMegapixel = 1_056 / 1_048_576;
|
|
37
|
+
function gptImageOutputTokenCount(settings) {
|
|
38
|
+
const known = gptImageOutputTokens.get(sizeOf(settings));
|
|
39
|
+
return (known ??
|
|
40
|
+
Math.ceil(settings.width * settings.height * gptImageTokensPerMegapixel));
|
|
41
|
+
}
|
|
32
42
|
/**
|
|
33
43
|
* USD per million tokens: text input, image input and image output, as
|
|
34
44
|
* Cloudflare publishes them for this exact model.
|
|
@@ -60,9 +70,7 @@ const sizeOf = (settings) => `${String(settings.width)}x${String(settings.height
|
|
|
60
70
|
/** Milliunits (1 cent = 1,000) of provider cost, rounded up. */
|
|
61
71
|
export function estimateGatewayMilliunits(settings, references) {
|
|
62
72
|
if (settings.model === "openai/gpt-image-2") {
|
|
63
|
-
const output =
|
|
64
|
-
if (output === undefined)
|
|
65
|
-
throw new MediaSettingsError("unsupported GPT Image 2 size");
|
|
73
|
+
const output = gptImageOutputTokenCount(settings);
|
|
66
74
|
if (references.length !== (settings.references?.length ?? 0))
|
|
67
75
|
throw new MediaSettingsError("resolved references must match every admitted reference");
|
|
68
76
|
// A bound on prompt tokens: at most one token per character, plus one
|
package/dist/index.d.ts
CHANGED
|
@@ -193,6 +193,7 @@ export type MediaVideoReference = z.output<typeof mediaVideoReferenceSchema>;
|
|
|
193
193
|
/** Neutral video selection; model-specific combinations are checked by validateMediaVideoSelection. */
|
|
194
194
|
export declare const mediaVideoSelectionSchema: z.ZodLazy<z.ZodObject<{
|
|
195
195
|
model: z.ZodEnum<{
|
|
196
|
+
readonly seedance25: "bytedance/seedance-2.5";
|
|
196
197
|
readonly seedance: "bytedance/seedance-2.0";
|
|
197
198
|
readonly seedanceFast: "bytedance/seedance-2.0-fast";
|
|
198
199
|
readonly seedanceMini: "bytedance/seedance-2.0-mini";
|
package/dist/index.js
CHANGED
|
@@ -247,8 +247,8 @@ export const mediaVideoSelectionSchema = z.lazy(() => z.strictObject({
|
|
|
247
247
|
resolution: mediaVideoResolutionSchema.optional(),
|
|
248
248
|
/** Model-specific aspect, default 16:9. */
|
|
249
249
|
aspectRatio: mediaVideoAspectRatioSchema.optional(),
|
|
250
|
-
/** Whole seconds; Seedance 4–12, Veo exactly 4/6/8, MiniMax H3 Max 5–15. */
|
|
251
|
-
durationSeconds: z.number().int().min(4).max(
|
|
250
|
+
/** Whole seconds; Seedance 2.0 4–12, Seedance 2.5 4–30, Veo exactly 4/6/8, MiniMax H3 Max 5–15. */
|
|
251
|
+
durationSeconds: z.number().int().min(4).max(30).optional(),
|
|
252
252
|
/** Veo defaults true; Seedance omits the provider option when unset;
|
|
253
253
|
* MiniMax H3 Max has no audio field and refuses an explicit choice. */
|
|
254
254
|
generateAudio: z.boolean().optional(),
|
package/dist/media-binding.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export declare const mediaVideoBindingInputSchema: z.ZodObject<{
|
|
|
52
52
|
libraryPath: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
53
53
|
settings: z.ZodLazy<z.ZodObject<{
|
|
54
54
|
model: z.ZodEnum<{
|
|
55
|
+
readonly seedance25: "bytedance/seedance-2.5";
|
|
55
56
|
readonly seedance: "bytedance/seedance-2.0";
|
|
56
57
|
readonly seedanceFast: "bytedance/seedance-2.0-fast";
|
|
57
58
|
readonly seedanceMini: "bytedance/seedance-2.0-mini";
|
|
@@ -137,6 +138,7 @@ export declare const mediaBindingGenerationSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
137
138
|
libraryPath: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
138
139
|
settings: z.ZodLazy<z.ZodObject<{
|
|
139
140
|
model: z.ZodEnum<{
|
|
141
|
+
readonly seedance25: "bytedance/seedance-2.5";
|
|
140
142
|
readonly seedance: "bytedance/seedance-2.0";
|
|
141
143
|
readonly seedanceFast: "bytedance/seedance-2.0-fast";
|
|
142
144
|
readonly seedanceMini: "bytedance/seedance-2.0-mini";
|
|
@@ -229,6 +231,7 @@ export declare const mediaBindingCallSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
229
231
|
libraryPath: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
230
232
|
settings: z.ZodLazy<z.ZodObject<{
|
|
231
233
|
model: z.ZodEnum<{
|
|
234
|
+
readonly seedance25: "bytedance/seedance-2.5";
|
|
232
235
|
readonly seedance: "bytedance/seedance-2.0";
|
|
233
236
|
readonly seedanceFast: "bytedance/seedance-2.0-fast";
|
|
234
237
|
readonly seedanceMini: "bytedance/seedance-2.0-mini";
|
package/dist/model-catalog.d.ts
CHANGED
|
@@ -67,9 +67,11 @@ export declare const mediaModelInputSchema: z.ZodLazy<z.ZodReadonly<z.ZodObject<
|
|
|
67
67
|
* Schema ceiling for reference lists: the largest per-model limit. Each model's
|
|
68
68
|
* own `maxReferences` / `maxReferenceImages` is enforced after parsing.
|
|
69
69
|
*/
|
|
70
|
-
export declare const MAX_REFERENCE_COUNT =
|
|
70
|
+
export declare const MAX_REFERENCE_COUNT = 30;
|
|
71
71
|
/** Verified Unified AI video identifiers; no inferred family aliases. */
|
|
72
72
|
export declare const mediaVideoModelIdSchema: z.ZodEnum<{
|
|
73
|
+
/** Seedance 2.5. */
|
|
74
|
+
readonly seedance25: "bytedance/seedance-2.5";
|
|
73
75
|
/** Seedance 2.0. */
|
|
74
76
|
readonly seedance: "bytedance/seedance-2.0";
|
|
75
77
|
/** Seedance 2.0 Fast. */
|
package/dist/model-catalog.js
CHANGED
|
@@ -84,9 +84,11 @@ export const mediaModelInputSchema = z.lazy(() => z
|
|
|
84
84
|
* Schema ceiling for reference lists: the largest per-model limit. Each model's
|
|
85
85
|
* own `maxReferences` / `maxReferenceImages` is enforced after parsing.
|
|
86
86
|
*/
|
|
87
|
-
export const MAX_REFERENCE_COUNT =
|
|
87
|
+
export const MAX_REFERENCE_COUNT = 30;
|
|
88
88
|
/** Verified Unified AI video identifiers; no inferred family aliases. */
|
|
89
89
|
export const mediaVideoModelIdSchema = z.enum({
|
|
90
|
+
/** Seedance 2.5. */
|
|
91
|
+
seedance25: "bytedance/seedance-2.5",
|
|
90
92
|
/** Seedance 2.0. */
|
|
91
93
|
seedance: "bytedance/seedance-2.0",
|
|
92
94
|
/** Seedance 2.0 Fast. */
|
|
@@ -255,6 +257,55 @@ const freezeModel = (model) => Object.freeze({
|
|
|
255
257
|
...model,
|
|
256
258
|
input: Object.freeze(model.input),
|
|
257
259
|
});
|
|
260
|
+
/**
|
|
261
|
+
* GPT Image 2's `size` is `auto` or any WIDTHxHEIGHT with each edge at most
|
|
262
|
+
* 3840, both edges multiples of 16, an aspect ratio between 1:3 and 3:1 and a
|
|
263
|
+
* total of 655,360 to 8,294,400 pixels (no enum).
|
|
264
|
+
* https://developers.cloudflare.com/ai/models/openai/gpt-image-2/
|
|
265
|
+
* https://developers.cloudflare.com/ai/models/openai/gpt-image-2/schema-input.json
|
|
266
|
+
* The catalog lists each common ratio at a standard size (about one megapixel;
|
|
267
|
+
* the three sizes Prints always offered stay as they were) and at the largest
|
|
268
|
+
* size the limits allow, so every entry is exact in ratio and in bounds.
|
|
269
|
+
*/
|
|
270
|
+
const GPT_IMAGE_MAX_EDGE = 3_840;
|
|
271
|
+
/** Largest pixel count the documented size grammar admits. */
|
|
272
|
+
const GPT_IMAGE_MAX_PIXELS = 8_294_400;
|
|
273
|
+
const GPT_IMAGE_RATIOS = [
|
|
274
|
+
[1, 1],
|
|
275
|
+
[4, 3],
|
|
276
|
+
[3, 4],
|
|
277
|
+
[3, 2],
|
|
278
|
+
[2, 3],
|
|
279
|
+
[16, 9],
|
|
280
|
+
[9, 16],
|
|
281
|
+
[21, 9],
|
|
282
|
+
];
|
|
283
|
+
const gptImageSizes = (() => {
|
|
284
|
+
const keep = new Set(["1024x1024", "1024x1536", "1536x1024"]);
|
|
285
|
+
const standard = [];
|
|
286
|
+
const largest = [];
|
|
287
|
+
for (const [across, down] of GPT_IMAGE_RATIOS) {
|
|
288
|
+
const divisor = ((a, b) => {
|
|
289
|
+
let x = a;
|
|
290
|
+
let y = b;
|
|
291
|
+
while (y !== 0)
|
|
292
|
+
[x, y] = [y, x % y];
|
|
293
|
+
return x;
|
|
294
|
+
})(across, down);
|
|
295
|
+
const unitW = (16 * across) / divisor;
|
|
296
|
+
const unitH = (16 * down) / divisor;
|
|
297
|
+
const unitArea = unitW * unitH;
|
|
298
|
+
const at = (k) => `${String(unitW * k)}x${String(unitH * k)}`;
|
|
299
|
+
const fit = Math.round(Math.sqrt(1_048_576 / unitArea));
|
|
300
|
+
const known = [...keep].find((size) => {
|
|
301
|
+
const [w, h] = size.split("x").map(Number);
|
|
302
|
+
return (w ?? 0) * down === (h ?? 0) * across;
|
|
303
|
+
});
|
|
304
|
+
standard.push(known ?? at(fit));
|
|
305
|
+
largest.push(at(Math.floor(Math.min(GPT_IMAGE_MAX_EDGE / Math.max(unitW, unitH), Math.sqrt(GPT_IMAGE_MAX_PIXELS / unitArea)))));
|
|
306
|
+
}
|
|
307
|
+
return Object.freeze([...standard, ...largest]);
|
|
308
|
+
})();
|
|
258
309
|
const videoShortEdges = {
|
|
259
310
|
"480p": 480,
|
|
260
311
|
"720p": 720,
|
|
@@ -271,18 +322,38 @@ const videoAspects = {
|
|
|
271
322
|
"21:9": [21, 9],
|
|
272
323
|
"9:21": [9, 21],
|
|
273
324
|
};
|
|
274
|
-
|
|
325
|
+
/**
|
|
326
|
+
* Seedance 2.5's own bounds, from its Cloudflare input schema (duration 4-30,
|
|
327
|
+
* 480p/720p, `reference_images` up to 30, a 25,000-character prompt, no 9:21).
|
|
328
|
+
* https://developers.cloudflare.com/ai/models/bytedance/seedance-2.5/
|
|
329
|
+
* Prices are Cloudflare dashboard prices, supplied by the owner 2026-11-13;
|
|
330
|
+
* the public model page lists none. Only the non-video-input rates apply, as
|
|
331
|
+
* video-input references are unsupported.
|
|
332
|
+
*/
|
|
333
|
+
const seedance25 = {
|
|
334
|
+
maxSeconds: 30,
|
|
335
|
+
maxReferenceImages: 30,
|
|
336
|
+
maxPromptLength: 25_000,
|
|
337
|
+
resolutions: ["480p", "720p"],
|
|
338
|
+
aspects: mediaVideoAspectRatioSchema.options.filter((aspectRatio) => aspectRatio !== mediaVideoAspectRatioSchema.enum.ultratall),
|
|
339
|
+
};
|
|
340
|
+
function videoModel(id, label, tier, provider, rates, bounds) {
|
|
275
341
|
const seedance = provider === "seedance";
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
342
|
+
const resolutions = bounds?.resolutions ?? rates.map(([resolution]) => resolution);
|
|
343
|
+
const maxSeconds = bounds?.maxSeconds ?? (seedance ? 12 : 8);
|
|
344
|
+
const maxReferenceImages = bounds?.maxReferenceImages ?? (seedance ? 4 : 0);
|
|
345
|
+
const aspects = bounds
|
|
346
|
+
? bounds.aspects
|
|
347
|
+
: seedance
|
|
348
|
+
? mediaVideoAspectRatioSchema.options
|
|
349
|
+
: [
|
|
350
|
+
mediaVideoAspectRatioSchema.enum.wide,
|
|
351
|
+
mediaVideoAspectRatioSchema.enum.tall,
|
|
352
|
+
mediaVideoAspectRatioSchema.enum.square,
|
|
353
|
+
];
|
|
283
354
|
// Nominal dimensions select resolution/aspect; upstream does not accept pixels.
|
|
284
355
|
// Round the long edge to even pixels, retaining the existing 854x480 selector.
|
|
285
|
-
const formats = Object.freeze(
|
|
356
|
+
const formats = Object.freeze(resolutions.flatMap((resolution) => aspects.map((aspectRatio) => {
|
|
286
357
|
const [w, h] = videoAspects[aspectRatio];
|
|
287
358
|
const edge = videoShortEdges[resolution];
|
|
288
359
|
const shorter = Math.min(w, h);
|
|
@@ -293,30 +364,31 @@ function videoModel(id, label, tier, provider, rates) {
|
|
|
293
364
|
height: Math.ceil((edge * h) / shorter / 2) * 2,
|
|
294
365
|
});
|
|
295
366
|
})));
|
|
296
|
-
const durations = Object.freeze(seedance
|
|
367
|
+
const durations = Object.freeze(seedance
|
|
368
|
+
? Array.from({ length: maxSeconds - 3 }, (_, index) => index + 4)
|
|
369
|
+
: [4, 6, 8]);
|
|
297
370
|
const video = Object.freeze({
|
|
298
371
|
minSeconds: 4,
|
|
299
|
-
maxSeconds
|
|
372
|
+
maxSeconds,
|
|
300
373
|
defaultSeconds: seedance ? 5 : 6,
|
|
301
374
|
durations,
|
|
302
375
|
provider,
|
|
303
376
|
formats,
|
|
304
377
|
defaultResolution: "720p",
|
|
305
378
|
defaultAspectRatio: "16:9",
|
|
306
|
-
//
|
|
307
|
-
//
|
|
379
|
+
// Veo documents `generate_audio` with default true. Seedance documents no
|
|
380
|
+
// default; Botanical chooses On (priced the same as silent) so a prompt's
|
|
381
|
+
// AUDIO and dialogue lines take effect without touching the control.
|
|
308
382
|
// https://developers.cloudflare.com/ai/models/bytedance/seedance-2.0/
|
|
309
383
|
// https://developers.cloudflare.com/ai/models/google/veo-3.1/
|
|
310
384
|
supportsAudio: true,
|
|
311
|
-
defaultGenerateAudio:
|
|
385
|
+
defaultGenerateAudio: true,
|
|
312
386
|
referenceRoles: Object.freeze(seedance
|
|
313
387
|
? mediaVideoReferenceRoleSchema.options
|
|
314
388
|
: [mediaVideoReferenceRoleSchema.enum.first]),
|
|
315
|
-
maxReferenceImages
|
|
389
|
+
maxReferenceImages,
|
|
316
390
|
referenceResolutions: Object.freeze(seedance
|
|
317
|
-
?
|
|
318
|
-
.map(([resolution]) => resolution)
|
|
319
|
-
.filter((resolution) => resolution !== "1080p")
|
|
391
|
+
? resolutions.filter((resolution) => resolution !== "1080p")
|
|
320
392
|
: []),
|
|
321
393
|
prices: Object.freeze(rates.map(([resolution, silentMilliunitsPerSecond, audioMilliunitsPerSecond]) => Object.freeze({
|
|
322
394
|
resolution,
|
|
@@ -328,10 +400,12 @@ function videoModel(id, label, tier, provider, rates) {
|
|
|
328
400
|
id,
|
|
329
401
|
label,
|
|
330
402
|
tier,
|
|
331
|
-
// Seedance
|
|
332
|
-
// earlier
|
|
403
|
+
// Seedance 2.0, Fast and Mini: 10,000 characters, from each Cloudflare
|
|
404
|
+
// input schema (the earlier 2,000 rejected real ~2,500-character
|
|
405
|
+
// production prompts). https://developers.cloudflare.com/ai/models/bytedance/seedance-2.0/
|
|
333
406
|
// Veo documents no character limit; keep the retained 2,048 host cap.
|
|
334
|
-
maxPromptLength:
|
|
407
|
+
maxPromptLength: bounds?.maxPromptLength ??
|
|
408
|
+
(seedance ? 10_000 : UNDOCUMENTED_PROMPT_LENGTH),
|
|
335
409
|
kind: "video",
|
|
336
410
|
video,
|
|
337
411
|
sizes: Object.freeze(formats.map(({ width, height }) => `${String(width)}x${String(height)}`)),
|
|
@@ -346,7 +420,7 @@ function videoModel(id, label, tier, provider, rates) {
|
|
|
346
420
|
maxSteps: null,
|
|
347
421
|
defaultSteps: null,
|
|
348
422
|
referenceField: seedance ? "image" : "image_input",
|
|
349
|
-
maxReferences: seedance ?
|
|
423
|
+
maxReferences: seedance ? maxReferenceImages : 1,
|
|
350
424
|
referenceDimension: null,
|
|
351
425
|
referenceFormat: "png",
|
|
352
426
|
},
|
|
@@ -605,12 +679,12 @@ const models = Object.freeze([
|
|
|
605
679
|
outputFormats: Object.freeze(["png", "jpeg", "webp"]),
|
|
606
680
|
tier: "premium",
|
|
607
681
|
label: "GPT Image 2 — strong text and layout, premium",
|
|
608
|
-
sizes:
|
|
682
|
+
sizes: gptImageSizes,
|
|
609
683
|
input: {
|
|
610
684
|
transport: "json",
|
|
611
685
|
dimensions: "own",
|
|
612
|
-
maxDimension:
|
|
613
|
-
maxDimensionDocumented:
|
|
686
|
+
maxDimension: GPT_IMAGE_MAX_EDGE,
|
|
687
|
+
maxDimensionDocumented: true,
|
|
614
688
|
defaultWidth: 1024,
|
|
615
689
|
defaultHeight: 1024,
|
|
616
690
|
steps: "fixed",
|
|
@@ -633,6 +707,10 @@ const models = Object.freeze([
|
|
|
633
707
|
referenceFormat: "webp",
|
|
634
708
|
},
|
|
635
709
|
}),
|
|
710
|
+
videoModel(mediaVideoModelIdSchema.enum.seedance25, "Seedance 2.5", "balanced", "seedance", [
|
|
711
|
+
["480p", 10_280, 10_280],
|
|
712
|
+
["720p", 23_120, 23_120],
|
|
713
|
+
], seedance25),
|
|
636
714
|
videoModel(mediaVideoModelIdSchema.enum.seedance, "Seedance 2.0", "balanced", "seedance", [
|
|
637
715
|
["480p", 7_000, 7_000],
|
|
638
716
|
["720p", 15_000, 15_000],
|
package/docs/api/index.md
CHANGED
|
@@ -817,6 +817,7 @@ const mediaVideoSelectionSchema: ZodLazy<
|
|
|
817
817
|
ZodObject<
|
|
818
818
|
{
|
|
819
819
|
model: ZodEnum<{
|
|
820
|
+
seedance25: "bytedance/seedance-2.5";
|
|
820
821
|
seedance: "bytedance/seedance-2.0";
|
|
821
822
|
seedanceFast: "bytedance/seedance-2.0-fast";
|
|
822
823
|
seedanceMini: "bytedance/seedance-2.0-mini";
|
|
@@ -969,7 +970,7 @@ Media's provider catalog: Workers AI images plus gateway image and video models.
|
|
|
969
970
|
### MAX\_REFERENCE\_COUNT
|
|
970
971
|
|
|
971
972
|
```ts
|
|
972
|
-
const MAX_REFERENCE_COUNT:
|
|
973
|
+
const MAX_REFERENCE_COUNT: 30 = 30;
|
|
973
974
|
```
|
|
974
975
|
|
|
975
976
|
Schema ceiling for reference lists: the largest per-model limit. Each model's
|
|
@@ -981,6 +982,7 @@ own `maxReferences` / `maxReferenceImages` is enforced after parsing.
|
|
|
981
982
|
|
|
982
983
|
```ts
|
|
983
984
|
const mediaVideoModelIdSchema: ZodEnum<{
|
|
985
|
+
seedance25: "bytedance/seedance-2.5";
|
|
984
986
|
seedance: "bytedance/seedance-2.0";
|
|
985
987
|
seedanceFast: "bytedance/seedance-2.0-fast";
|
|
986
988
|
seedanceMini: "bytedance/seedance-2.0-mini";
|
|
@@ -1385,16 +1387,16 @@ or billing admission.
|
|
|
1385
1387
|
|
|
1386
1388
|
#### Parameters
|
|
1387
1389
|
|
|
1388
|
-
| Parameter | Type
|
|
1389
|
-
| ---------------------- |
|
|
1390
|
-
| `raw` | \{ `model`: \| `"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \| `"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"` \| `"minimax/h3-max"`; `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`: `number`; `generateAudio?`: `boolean`; `references?`: `object`[]; \} | - |
|
|
1391
|
-
| `raw.model` | \| `"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \| `"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"` \| `"minimax/h3-max"` | Verified catalog model identifier. |
|
|
1392
|
-
| `raw.prompt` | `string`
|
|
1393
|
-
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`
|
|
1394
|
-
| `raw.aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`
|
|
1395
|
-
| `raw.durationSeconds?` | `number`
|
|
1396
|
-
| `raw.generateAudio?` | `boolean`
|
|
1397
|
-
| `raw.references?` | `object`[]
|
|
1390
|
+
| Parameter | Type | Description |
|
|
1391
|
+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
1392
|
+
| `raw` | \{ `model`: \| `"bytedance/seedance-2.5"` \| `"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \| `"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"` \| `"minimax/h3-max"`; `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`: `number`; `generateAudio?`: `boolean`; `references?`: `object`[]; \} | - |
|
|
1393
|
+
| `raw.model` | \| `"bytedance/seedance-2.5"` \| `"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \| `"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"` \| `"minimax/h3-max"` | Verified catalog model identifier. |
|
|
1394
|
+
| `raw.prompt` | `string` | Trimmed prompt; the selected model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
1395
|
+
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | Model-specific resolution, default 720p. |
|
|
1396
|
+
| `raw.aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"` | Model-specific aspect, default 16:9. |
|
|
1397
|
+
| `raw.durationSeconds?` | `number` | Whole seconds; Seedance 2.0 4–12, Seedance 2.5 4–30, Veo exactly 4/6/8, MiniMax H3 Max 5–15. |
|
|
1398
|
+
| `raw.generateAudio?` | `boolean` | Veo defaults true; Seedance omits the provider option when unset; MiniMax H3 Max has no audio field and refuses an explicit choice. |
|
|
1399
|
+
| `raw.references?` | `object`[] | Up to four references, with provider-specific roles and mode limits. |
|
|
1398
1400
|
|
|
1399
1401
|
#### Returns
|
|
1400
1402
|
|
package/docs/api/server.md
CHANGED
|
@@ -1630,6 +1630,7 @@ const mediaVideoBindingInputSchema: ZodObject<{
|
|
|
1630
1630
|
libraryPath: ZodString & ZodType<string, string, $ZodTypeInternals<string, string>>;
|
|
1631
1631
|
settings: ZodLazy<ZodObject<{
|
|
1632
1632
|
model: ZodEnum<{
|
|
1633
|
+
seedance25: "bytedance/seedance-2.5";
|
|
1633
1634
|
seedance: "bytedance/seedance-2.0";
|
|
1634
1635
|
seedanceFast: "bytedance/seedance-2.0-fast";
|
|
1635
1636
|
seedanceMini: "bytedance/seedance-2.0-mini";
|
|
@@ -1715,6 +1716,7 @@ const mediaBindingGenerationSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
1715
1716
|
libraryPath: ZodString & ZodType<string, string, $ZodTypeInternals<string, string>>;
|
|
1716
1717
|
settings: ZodLazy<ZodObject<{
|
|
1717
1718
|
model: ZodEnum<{
|
|
1719
|
+
seedance25: "bytedance/seedance-2.5";
|
|
1718
1720
|
seedance: "bytedance/seedance-2.0";
|
|
1719
1721
|
seedanceFast: "bytedance/seedance-2.0-fast";
|
|
1720
1722
|
seedanceMini: "bytedance/seedance-2.0-mini";
|
|
@@ -2077,6 +2079,7 @@ function parseMediaBindingCall(raw):
|
|
|
2077
2079
|
libraryPath: string;
|
|
2078
2080
|
settings: {
|
|
2079
2081
|
model:
|
|
2082
|
+
| "bytedance/seedance-2.5"
|
|
2080
2083
|
| "bytedance/seedance-2.0"
|
|
2081
2084
|
| "bytedance/seedance-2.0-fast"
|
|
2082
2085
|
| "bytedance/seedance-2.0-mini"
|
|
@@ -2119,14 +2122,14 @@ Parsing and model refusal stay shared; authorization remains host-owned.
|
|
|
2119
2122
|
\| `"9:16"` \| `"21:9"` \| `"9:21"`; `generateAudio?`: `boolean`; `references?`:
|
|
2120
2123
|
`object`[]; `steps?`: `number`; \}; `outputFormat?`: `"png"` \| `"jpeg"` \|
|
|
2121
2124
|
`"webp"`; \} \| \{ `kind`: `"video"`; `requestId`: `string`; `libraryPath`:
|
|
2122
|
-
`string`; `settings`: \{ `model`: \| `"bytedance/seedance-2.
|
|
2123
|
-
`"bytedance/seedance-2.0
|
|
2124
|
-
`"
|
|
2125
|
-
`string`; `resolution?`: `"480p"` \| `"720p"`
|
|
2126
|
-
|
|
2127
|
-
`"21:9"` \| `"9:21"`; `durationSeconds?`:
|
|
2128
|
-
`references?`: `object`[]; \}; \}; \};
|
|
2129
|
-
`"refused"`; `result`: `JSONType`; \}\>
|
|
2125
|
+
`string`; `settings`: \{ `model`: \| `"bytedance/seedance-2.5"` \|
|
|
2126
|
+
`"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \|
|
|
2127
|
+
`"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"`
|
|
2128
|
+
\| `"minimax/h3-max"`; `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"`
|
|
2129
|
+
\| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \|
|
|
2130
|
+
`"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`:
|
|
2131
|
+
`number`; `generateAudio?`: `boolean`; `references?`: `object`[]; \}; \}; \};
|
|
2132
|
+
\}\> \| `Readonly`\<\{ `kind`: `"refused"`; `result`: `JSONType`; \}\>
|
|
2130
2133
|
|
|
2131
2134
|
---
|
|
2132
2135
|
|
|
@@ -2140,10 +2143,10 @@ Choose the same fixed filename on both hosts without a recursive App lookup.
|
|
|
2140
2143
|
|
|
2141
2144
|
#### Parameters
|
|
2142
2145
|
|
|
2143
|
-
| Parameter | Type
|
|
2144
|
-
| ------------ |
|
|
2145
|
-
| `input` | \| \{ `kind`: `"image"`; `requestId`: `string`; `libraryPath`: `string`; `settings`: \{ `model`: `string`; `prompt`: `string`; `width`: `number`; `height`: `number`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `generateAudio?`: `boolean`; `references?`: `object`[]; `steps?`: `number`; \}; `outputFormat?`: `"png"` \| `"jpeg"` \| `"webp"`; \} \| \{ `kind`: `"video"`; `requestId`: `string`; `libraryPath`: `string`; `settings`: \{ `model`: \| `"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \| `"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"` \| `"minimax/h3-max"`; `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`: `number`; `generateAudio?`: `boolean`; `references?`: `object`[]; \}; \} |
|
|
2146
|
-
| `computerId` | `string`
|
|
2146
|
+
| Parameter | Type |
|
|
2147
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
2148
|
+
| `input` | \| \{ `kind`: `"image"`; `requestId`: `string`; `libraryPath`: `string`; `settings`: \{ `model`: `string`; `prompt`: `string`; `width`: `number`; `height`: `number`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `generateAudio?`: `boolean`; `references?`: `object`[]; `steps?`: `number`; \}; `outputFormat?`: `"png"` \| `"jpeg"` \| `"webp"`; \} \| \{ `kind`: `"video"`; `requestId`: `string`; `libraryPath`: `string`; `settings`: \{ `model`: \| `"bytedance/seedance-2.5"` \| `"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \| `"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"` \| `"minimax/h3-max"`; `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`: `number`; `generateAudio?`: `boolean`; `references?`: `object`[]; \}; \} |
|
|
2149
|
+
| `computerId` | `string` |
|
|
2147
2150
|
|
|
2148
2151
|
#### Returns
|
|
2149
2152
|
|
|
@@ -2161,11 +2164,11 @@ Decode bounded service replies once for both MEDIA host bindings.
|
|
|
2161
2164
|
|
|
2162
2165
|
#### Parameters
|
|
2163
2166
|
|
|
2164
|
-
| Parameter | Type
|
|
2165
|
-
| ------------ |
|
|
2166
|
-
| `input` | \| \{ `operation`: `"models"`; `input`: `Record`\<`string`, `never`\>; \} \| \{ `operation`: `"generate"`; `input`: \| \{ `kind`: `"image"`; `requestId`: `string`; `libraryPath`: `string`; `settings`: \{ `model`: `string`; `prompt`: `string`; `width`: `number`; `height`: `number`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `generateAudio?`: `boolean`; `references?`: `object`[]; `steps?`: `number`; \}; `outputFormat?`: `"png"` \| `"jpeg"` \| `"webp"`; \} \| \{ `kind`: `"video"`; `requestId`: `string`; `libraryPath`: `string`; `settings`: \{ `model`: \| `"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \| `"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"` \| `"minimax/h3-max"`; `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`: `number`; `generateAudio?`: `boolean`; `references?`: `object`[]; \}; \}; \} |
|
|
2167
|
-
| `computerId` | `string`
|
|
2168
|
-
| `response` | `Response`
|
|
2167
|
+
| Parameter | Type |
|
|
2168
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
2169
|
+
| `input` | \| \{ `operation`: `"models"`; `input`: `Record`\<`string`, `never`\>; \} \| \{ `operation`: `"generate"`; `input`: \| \{ `kind`: `"image"`; `requestId`: `string`; `libraryPath`: `string`; `settings`: \{ `model`: `string`; `prompt`: `string`; `width`: `number`; `height`: `number`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `generateAudio?`: `boolean`; `references?`: `object`[]; `steps?`: `number`; \}; `outputFormat?`: `"png"` \| `"jpeg"` \| `"webp"`; \} \| \{ `kind`: `"video"`; `requestId`: `string`; `libraryPath`: `string`; `settings`: \{ `model`: \| `"bytedance/seedance-2.5"` \| `"bytedance/seedance-2.0"` \| `"bytedance/seedance-2.0-fast"` \| `"bytedance/seedance-2.0-mini"` \| `"google/veo-3.1"` \| `"google/veo-3.1-fast"` \| `"minimax/h3-max"`; `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`: `number`; `generateAudio?`: `boolean`; `references?`: `object`[]; \}; \}; \} |
|
|
2170
|
+
| `computerId` | `string` |
|
|
2171
|
+
| `response` | `Response` |
|
|
2169
2172
|
|
|
2170
2173
|
#### Returns
|
|
2171
2174
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/darkroom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Media generation, durable output retention and provenance with host-owned authority and billing",
|
|
6
6
|
"type": "module",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"exifreader": "4.46.0",
|
|
60
60
|
"@fungi.computer/ts-webp": "0.1.6",
|
|
61
61
|
"@xmldom/xmldom": "0.9.12",
|
|
62
|
-
"@fungi.computer/agar": "0.12.
|
|
62
|
+
"@fungi.computer/agar": "0.12.1",
|
|
63
63
|
"@fungi.computer/capnweb": "0.12.0-fungi.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|