@omnichar/contracts 0.0.0-6cf9984 → 0.0.0-7968a74
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/errors.d.ts +3 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +3 -0
- package/dist/errors.js.map +1 -1
- package/dist/v1/characters.d.ts +90 -8
- package/dist/v1/characters.d.ts.map +1 -1
- package/dist/v1/characters.js +57 -7
- package/dist/v1/characters.js.map +1 -1
- package/dist/v1/credits.d.ts +13 -1
- package/dist/v1/credits.d.ts.map +1 -1
- package/dist/v1/credits.js +6 -0
- package/dist/v1/credits.js.map +1 -1
- package/dist/v1/guest.d.ts +211 -0
- package/dist/v1/guest.d.ts.map +1 -0
- package/dist/v1/guest.js +109 -0
- package/dist/v1/guest.js.map +1 -0
- package/dist/v1/index.d.ts +4 -0
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +4 -0
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/me.d.ts +1 -1
- package/dist/v1/planPresets.d.ts +93 -0
- package/dist/v1/planPresets.d.ts.map +1 -0
- package/dist/v1/planPresets.js +80 -0
- package/dist/v1/planPresets.js.map +1 -0
- package/dist/v1/runs.d.ts +349 -0
- package/dist/v1/runs.d.ts.map +1 -1
- package/dist/v1/runs.js +70 -0
- package/dist/v1/runs.js.map +1 -1
- package/dist/v1/sessions.d.ts +160 -3
- package/dist/v1/sessions.d.ts.map +1 -1
- package/dist/v1/sessions.js +19 -2
- package/dist/v1/sessions.js.map +1 -1
- package/dist/v1/studio.d.ts +209 -6
- package/dist/v1/studio.d.ts.map +1 -1
- package/dist/v1/studio.js +370 -13
- package/dist/v1/studio.js.map +1 -1
- package/dist/v1/teamKeys.d.ts +144 -0
- package/dist/v1/teamKeys.d.ts.map +1 -0
- package/dist/v1/teamKeys.js +57 -0
- package/dist/v1/teamKeys.js.map +1 -0
- package/dist/v1/teams.d.ts +264 -0
- package/dist/v1/teams.d.ts.map +1 -0
- package/dist/v1/teams.js +108 -0
- package/dist/v1/teams.js.map +1 -0
- package/dist/v1/uploads.d.ts +5 -1
- package/dist/v1/uploads.d.ts.map +1 -1
- package/dist/v1/uploads.js +20 -1
- package/dist/v1/uploads.js.map +1 -1
- package/dist/v1/videoPricing.d.ts +9 -2
- package/dist/v1/videoPricing.d.ts.map +1 -1
- package/dist/v1/videoPricing.js +18 -8
- package/dist/v1/videoPricing.js.map +1 -1
- package/dist/v1/workflows.d.ts +4 -1
- package/dist/v1/workflows.d.ts.map +1 -1
- package/dist/v1/workflows.js +1 -0
- package/dist/v1/workflows.js.map +1 -1
- package/package.json +1 -1
package/dist/v1/studio.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MICRO_PER_CREDIT } from './credits.js';
|
|
3
|
-
import { MAX_VIDEO_SECONDS, MIN_VIDEO_SECONDS, billedVideoReferences, videoRunMicro, } from './videoPricing.js';
|
|
2
|
+
import { MICRO_PER_CREDIT, USD_PER_CREDIT } from './credits.js';
|
|
3
|
+
import { FREE_REFERENCE_RULE, H3_REFERENCE_RULE, MAX_VIDEO_SECONDS, MIN_VIDEO_SECONDS, VIDEO_MICRO_PER_SECOND, billedVideoReferences, videoRunMicro, } from './videoPricing.js';
|
|
4
4
|
// The studio's one-box generate: a prompt, a mode and three presets. The server maps each preset
|
|
5
5
|
// onto a workflow's own fields, so the browser never learns a node id or a width.
|
|
6
6
|
export const STUDIO_MODES = ['video', 'image'];
|
|
@@ -8,11 +8,192 @@ export const STUDIO_RESOLUTIONS = ['0.5k', '1k', '2k', '4k'];
|
|
|
8
8
|
export const STUDIO_RATIOS = ['1:1', '3:4', '4:5', '9:16', '16:9'];
|
|
9
9
|
// MiniMax H3 offers no 4:5, so video leaves it out rather than rounding it to a shape nobody chose.
|
|
10
10
|
export const VIDEO_STUDIO_RATIOS = ['1:1', '3:4', '9:16', '16:9'];
|
|
11
|
-
export const ratiosFor = (mode) => mode === 'video' ? VIDEO_STUDIO_RATIOS : STUDIO_RATIOS;
|
|
12
11
|
// An image under a megapixel is billed as a whole one, so 0.5K would cost what 1K costs for less
|
|
13
12
|
// picture. Video keeps it, where 480p really is cheaper.
|
|
14
13
|
export const IMAGE_STUDIO_RESOLUTIONS = ['1k', '2k', '4k'];
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The renderers a caller may pick, by the name they are offered under.
|
|
16
|
+
*
|
|
17
|
+
* Two of these ids spell the same string as a character arch because they name the same renderer.
|
|
18
|
+
* They are not the same thing: an arch is a payload compiled inside a `.char` at build time, and a
|
|
19
|
+
* model id is a choice made per run. Nothing reads one as the other.
|
|
20
|
+
*/
|
|
21
|
+
export const STUDIO_MODELS = [
|
|
22
|
+
'minimax-h3-image',
|
|
23
|
+
'seedream55',
|
|
24
|
+
'seedream50-lite',
|
|
25
|
+
'flux3',
|
|
26
|
+
'krea3',
|
|
27
|
+
'minimax-h3',
|
|
28
|
+
'wan30',
|
|
29
|
+
'seedance25',
|
|
30
|
+
'seedance25-flash',
|
|
31
|
+
'seedance20',
|
|
32
|
+
'happyhorse11',
|
|
33
|
+
'flux2-klein',
|
|
34
|
+
];
|
|
35
|
+
// No longer offered, but kept in the enum: a stored run that chose one must still parse.
|
|
36
|
+
export const RETIRED_MODELS = new Set(['flux2-klein']);
|
|
37
|
+
// Each sells every size and shape the renderer it replaces did, so an old request still fits.
|
|
38
|
+
export const RETIRED_SUCCESSOR = {
|
|
39
|
+
'flux2-klein': 'minimax-h3-image',
|
|
40
|
+
};
|
|
41
|
+
// Image from the identity benchmark of 2026-11-18; video stays on MiniMax H3, quick and prompt-friendly.
|
|
42
|
+
export const DEFAULT_MODEL_FOR = {
|
|
43
|
+
image: 'seedream55',
|
|
44
|
+
video: 'minimax-h3',
|
|
45
|
+
};
|
|
46
|
+
// What a prompt with nothing to reference runs on when the picked renderer needs a character.
|
|
47
|
+
export const PROMPT_ONLY_MODEL_FOR = {
|
|
48
|
+
image: 'seedream55',
|
|
49
|
+
video: 'minimax-h3',
|
|
50
|
+
};
|
|
51
|
+
const H3_TIERS = { '0.5k': '480p', '1k': '768p', '2k': '2K', '4k': '4K' };
|
|
52
|
+
const P_TIERS = { '0.5k': '480p', '1k': '720p', '2k': '1080p', '4k': '4K' };
|
|
53
|
+
// Every renderer's floor unless its own is higher; mirrors MIN_REFERENCE_PX in the control plane.
|
|
54
|
+
const MIN_REFERENCE_PX = 256;
|
|
55
|
+
// Seedream names no 4:5, so its image ratios are the four every renderer agrees on.
|
|
56
|
+
const COMMON_RATIOS = ['1:1', '3:4', '9:16', '16:9'];
|
|
57
|
+
/**
|
|
58
|
+
* What each renderer will actually serve.
|
|
59
|
+
*
|
|
60
|
+
* Measured against each supplier's own schema rather than assumed, because a tier offered here and
|
|
61
|
+
* refused there is a run held for credits and then rejected. Krea stops at 2K because its schema
|
|
62
|
+
* caps a request at 4,220,160 pixels of area; Seedance stops at 2K because 1080p is its top tier;
|
|
63
|
+
* Flux 3 sells every tier our card does, priced per megapixel from the rate its pricing API reports
|
|
64
|
+
* rather than the single 1K figure its model page shows.
|
|
65
|
+
*/
|
|
66
|
+
export const STUDIO_MODEL_SPECS = {
|
|
67
|
+
'minimax-h3-image': {
|
|
68
|
+
mode: 'image',
|
|
69
|
+
label: 'MiniMax H3-Image',
|
|
70
|
+
// Every ratio here: its endpoint takes custom sizes as well as its fifteen named shapes.
|
|
71
|
+
ratios: STUDIO_RATIOS,
|
|
72
|
+
resolutions: IMAGE_STUDIO_RESOLUTIONS,
|
|
73
|
+
needsCharacter: false,
|
|
74
|
+
minReferencePx: MIN_REFERENCE_PX,
|
|
75
|
+
},
|
|
76
|
+
seedream55: {
|
|
77
|
+
mode: 'image',
|
|
78
|
+
label: 'Seedream 5.5',
|
|
79
|
+
ratios: COMMON_RATIOS,
|
|
80
|
+
// Its 1.5k tier is not on our card, and it sells nothing above 2k.
|
|
81
|
+
resolutions: ['1k', '2k'],
|
|
82
|
+
needsCharacter: false,
|
|
83
|
+
minReferencePx: MIN_REFERENCE_PX,
|
|
84
|
+
},
|
|
85
|
+
'seedream50-lite': {
|
|
86
|
+
mode: 'image',
|
|
87
|
+
label: 'Seedream 5.0 Lite',
|
|
88
|
+
ratios: COMMON_RATIOS,
|
|
89
|
+
// Sold only as 2K-class presets, so it offers the one tier it really renders.
|
|
90
|
+
resolutions: ['2k'],
|
|
91
|
+
needsCharacter: false,
|
|
92
|
+
minReferencePx: MIN_REFERENCE_PX,
|
|
93
|
+
},
|
|
94
|
+
flux3: {
|
|
95
|
+
mode: 'image',
|
|
96
|
+
label: 'FLUX.3',
|
|
97
|
+
ratios: STUDIO_RATIOS,
|
|
98
|
+
resolutions: IMAGE_STUDIO_RESOLUTIONS,
|
|
99
|
+
needsCharacter: false,
|
|
100
|
+
minReferencePx: MIN_REFERENCE_PX,
|
|
101
|
+
},
|
|
102
|
+
krea3: {
|
|
103
|
+
mode: 'image',
|
|
104
|
+
label: 'Krea 3',
|
|
105
|
+
ratios: STUDIO_RATIOS,
|
|
106
|
+
resolutions: ['1k', '2k'],
|
|
107
|
+
// `image_urls` is minItems 1 on this endpoint, so there is nothing to send without a character.
|
|
108
|
+
needsCharacter: true,
|
|
109
|
+
minReferencePx: MIN_REFERENCE_PX,
|
|
110
|
+
},
|
|
111
|
+
'minimax-h3': {
|
|
112
|
+
mode: 'video',
|
|
113
|
+
tierNames: H3_TIERS,
|
|
114
|
+
label: 'MiniMax H3',
|
|
115
|
+
ratios: VIDEO_STUDIO_RATIOS,
|
|
116
|
+
resolutions: STUDIO_RESOLUTIONS,
|
|
117
|
+
needsCharacter: false,
|
|
118
|
+
minReferencePx: MIN_REFERENCE_PX,
|
|
119
|
+
},
|
|
120
|
+
// The four below are reference-to-video only: a prompt alone has no request to make there.
|
|
121
|
+
wan30: {
|
|
122
|
+
mode: 'video',
|
|
123
|
+
tierNames: P_TIERS,
|
|
124
|
+
label: 'Wan 3.0',
|
|
125
|
+
ratios: VIDEO_STUDIO_RATIOS,
|
|
126
|
+
resolutions: ['0.5k', '1k', '2k'],
|
|
127
|
+
needsCharacter: true,
|
|
128
|
+
minReferencePx: MIN_REFERENCE_PX,
|
|
129
|
+
},
|
|
130
|
+
'seedance25-flash': {
|
|
131
|
+
mode: 'video',
|
|
132
|
+
tierNames: P_TIERS,
|
|
133
|
+
label: 'Seedance 2.5 Flash',
|
|
134
|
+
ratios: VIDEO_STUDIO_RATIOS,
|
|
135
|
+
resolutions: ['0.5k', '1k'],
|
|
136
|
+
needsCharacter: true,
|
|
137
|
+
// Undocumented; the live endpoint refuses a reference under 300 px wide, measured 2026-11-18.
|
|
138
|
+
minReferencePx: 300,
|
|
139
|
+
},
|
|
140
|
+
seedance20: {
|
|
141
|
+
mode: 'video',
|
|
142
|
+
tierNames: P_TIERS,
|
|
143
|
+
label: 'Seedance 2.0',
|
|
144
|
+
ratios: VIDEO_STUDIO_RATIOS,
|
|
145
|
+
resolutions: STUDIO_RESOLUTIONS,
|
|
146
|
+
needsCharacter: true,
|
|
147
|
+
minReferencePx: 300,
|
|
148
|
+
},
|
|
149
|
+
happyhorse11: {
|
|
150
|
+
mode: 'video',
|
|
151
|
+
tierNames: P_TIERS,
|
|
152
|
+
label: 'HappyHorse 1.1',
|
|
153
|
+
ratios: VIDEO_STUDIO_RATIOS,
|
|
154
|
+
resolutions: ['1k', '2k'],
|
|
155
|
+
needsCharacter: true,
|
|
156
|
+
// Its docs say 400; the live endpoint refuses under 300x300, measured 2026-11-18.
|
|
157
|
+
minReferencePx: 300,
|
|
158
|
+
},
|
|
159
|
+
'flux2-klein': {
|
|
160
|
+
mode: 'image',
|
|
161
|
+
label: 'FLUX.2 Klein',
|
|
162
|
+
ratios: STUDIO_RATIOS,
|
|
163
|
+
resolutions: IMAGE_STUDIO_RESOLUTIONS,
|
|
164
|
+
needsCharacter: false,
|
|
165
|
+
minReferencePx: MIN_REFERENCE_PX,
|
|
166
|
+
},
|
|
167
|
+
// Served by sapi's reference-to-video endpoint since 2026-11-18; fal's dearer one is gone.
|
|
168
|
+
seedance25: {
|
|
169
|
+
mode: 'video',
|
|
170
|
+
tierNames: P_TIERS,
|
|
171
|
+
label: 'Seedance 2.5',
|
|
172
|
+
ratios: VIDEO_STUDIO_RATIOS,
|
|
173
|
+
resolutions: ['0.5k', '1k', '2k'],
|
|
174
|
+
needsCharacter: true,
|
|
175
|
+
minReferencePx: 300,
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* The renderer a run can actually use: one that needs a character, with nothing to reference, gives
|
|
180
|
+
* way to the prompt-only default, so the default never leaves a plain prompt with nothing to run.
|
|
181
|
+
*/
|
|
182
|
+
export function servableModel(mode, model, hasReference) {
|
|
183
|
+
return STUDIO_MODEL_SPECS[model].needsCharacter && !hasReference
|
|
184
|
+
? PROMPT_ONLY_MODEL_FOR[mode]
|
|
185
|
+
: model;
|
|
186
|
+
}
|
|
187
|
+
/** The models offered for a mode, in the order they are listed. Retired ones are not offered. */
|
|
188
|
+
export const modelsFor = (mode) => STUDIO_MODELS.filter((model) => STUDIO_MODEL_SPECS[model].mode === mode && !RETIRED_MODELS.has(model));
|
|
189
|
+
// A model from the other mode cannot describe this one, so the default answers for it rather than
|
|
190
|
+
// returning a shape the mode does not offer.
|
|
191
|
+
const specFor = (mode, model) => {
|
|
192
|
+
const spec = model ? STUDIO_MODEL_SPECS[model] : undefined;
|
|
193
|
+
return spec && spec.mode === mode ? spec : STUDIO_MODEL_SPECS[DEFAULT_MODEL_FOR[mode]];
|
|
194
|
+
};
|
|
195
|
+
export const ratiosFor = (mode, model) => specFor(mode, model).ratios;
|
|
196
|
+
export const resolutionsFor = (mode, model) => specFor(mode, model).resolutions;
|
|
16
197
|
// What an image costs a caller: twice the renderer's own rate, the same margin video carries. A
|
|
17
198
|
// cast character is sent as up to four reference images, each billed as a megapixel of input, so it
|
|
18
199
|
// is priced as its own column rather than a flat add-on. The server recomputes both columns from the
|
|
@@ -29,9 +210,79 @@ export const CAST_IMAGE_MICRO_BY_RESOLUTION = {
|
|
|
29
210
|
'2k': 18_000_000,
|
|
30
211
|
'4k': 44_000_000,
|
|
31
212
|
};
|
|
213
|
+
/**
|
|
214
|
+
* The card, per renderer.
|
|
215
|
+
*
|
|
216
|
+
* Per model rather than per mode because the suppliers do not price alike: Krea bills the output
|
|
217
|
+
* and every reference by the megapixel, so one tier step more than triples it, while Flux 3 bills
|
|
218
|
+
* one flat figure however many references it is sent. A single column would either lose money on
|
|
219
|
+
* one of them or overcharge for the other. `pricing/imageCost.ts` recomputes every cell from the
|
|
220
|
+
* supplier rates in a test, so the card and the cost cannot drift.
|
|
221
|
+
*/
|
|
222
|
+
export const IMAGE_CARD = {
|
|
223
|
+
// Twice cost, rounded up to whole credits. A cast is priced at five references, each billed by
|
|
224
|
+
// the supplier on top of the image; Seedream 5.0 Lite charges nothing for them.
|
|
225
|
+
'minimax-h3-image': {
|
|
226
|
+
plain: { '1k': 8_000_000, '2k': 8_000_000, '4k': 22_000_000 },
|
|
227
|
+
cast: { '1k': 17_000_000, '2k': 17_000_000, '4k': 32_000_000 },
|
|
228
|
+
},
|
|
229
|
+
seedream55: {
|
|
230
|
+
plain: { '1k': 4_000_000, '2k': 7_000_000 },
|
|
231
|
+
cast: { '1k': 12_000_000, '2k': 15_000_000 },
|
|
232
|
+
},
|
|
233
|
+
'seedream50-lite': { plain: { '2k': 7_000_000 }, cast: { '2k': 7_000_000 } },
|
|
234
|
+
'flux2-klein': { plain: IMAGE_MICRO_BY_RESOLUTION, cast: CAST_IMAGE_MICRO_BY_RESOLUTION },
|
|
235
|
+
// Cast only, so `plain` stays empty rather than carrying a price nothing can be charged at.
|
|
236
|
+
krea3: { plain: {}, cast: { '1k': 10_000_000, '2k': 40_000_000 } },
|
|
237
|
+
// Per megapixel, so its tiers climb steeply: cheapest of the three for a cast at 1K, dearest of
|
|
238
|
+
// them at 4K, where sixteen megapixels are billed at the rate Klein charges for one.
|
|
239
|
+
flux3: {
|
|
240
|
+
plain: { '1k': 9_600_000, '2k': 38_400_000, '4k': 153_600_000 },
|
|
241
|
+
cast: { '1k': 9_600_000, '2k': 38_400_000, '4k': 153_600_000 },
|
|
242
|
+
},
|
|
243
|
+
'minimax-h3': { plain: {}, cast: {} },
|
|
244
|
+
wan30: { plain: {}, cast: {} },
|
|
245
|
+
'seedance25-flash': { plain: {}, cast: {} },
|
|
246
|
+
seedance20: { plain: {}, cast: {} },
|
|
247
|
+
happyhorse11: { plain: {}, cast: {} },
|
|
248
|
+
seedance25: { plain: {}, cast: {} },
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Micro-credits per second of output, per renderer, keyed by our tier rather than its own word.
|
|
252
|
+
*
|
|
253
|
+
* The keys are the four tiers `VIDEO_RESOLUTION_FOR` maps the dock's sizes onto; a renderer that
|
|
254
|
+
* sells 720p and 1080p serves them as its 1K and 2K tiers. Twice the supplier's per-second rate,
|
|
255
|
+
* which `pricing/videoCost.ts` recomputes in a test so the card and the cost cannot drift.
|
|
256
|
+
*/
|
|
257
|
+
export const VIDEO_CARD = {
|
|
258
|
+
'minimax-h3-image': {},
|
|
259
|
+
seedream55: {},
|
|
260
|
+
'seedream50-lite': {},
|
|
261
|
+
flux3: {},
|
|
262
|
+
krea3: {},
|
|
263
|
+
'minimax-h3': VIDEO_MICRO_PER_SECOND,
|
|
264
|
+
wan30: { '480p': 9_000_000, '768p': 18_000_000, '2K': 36_000_000 },
|
|
265
|
+
'seedance25-flash': { '480p': 23_000_000, '768p': 47_840_000 },
|
|
266
|
+
seedance20: { '480p': 14_000_000, '768p': 30_400_000, '2K': 74_800_000, '4K': 155_600_000 },
|
|
267
|
+
happyhorse11: { '768p': 28_000_000, '2K': 36_000_000 },
|
|
268
|
+
'flux2-klein': {},
|
|
269
|
+
seedance25: { '480p': 24_680_000, '768p': 55_460_000, '2K': 136_460_000 },
|
|
270
|
+
};
|
|
271
|
+
/** How each video renderer bills reference images. Only MiniMax H3 charges for them separately. */
|
|
272
|
+
export const VIDEO_REFERENCE_RULE = {
|
|
273
|
+
'minimax-h3': H3_REFERENCE_RULE,
|
|
274
|
+
};
|
|
275
|
+
export const referenceRuleFor = (model) => VIDEO_REFERENCE_RULE[model] ?? FREE_REFERENCE_RULE;
|
|
32
276
|
/** The flat price of one image, in micro-credits. */
|
|
33
|
-
export function imageRunMicro(resolution, hasCharacter) {
|
|
34
|
-
|
|
277
|
+
export function imageRunMicro(model, resolution, hasCharacter) {
|
|
278
|
+
const column = hasCharacter ? IMAGE_CARD[model].cast : IMAGE_CARD[model].plain;
|
|
279
|
+
const micro = column[resolution];
|
|
280
|
+
// An unpriced cell is a shape this renderer was never meant to be offered at, so it is refused
|
|
281
|
+
// here rather than charged at a neighbouring tier's rate.
|
|
282
|
+
if (micro === undefined) {
|
|
283
|
+
throw new Error(`No price for ${model} at ${resolution}${hasCharacter ? ' with a character' : ''}.`);
|
|
284
|
+
}
|
|
285
|
+
return micro;
|
|
35
286
|
}
|
|
36
287
|
// Pixels on the long edge. The short edge follows from the ratio.
|
|
37
288
|
export const IMAGE_LONG_EDGE = {
|
|
@@ -58,20 +309,49 @@ export function imageDimensions(resolution, ratio) {
|
|
|
58
309
|
}
|
|
59
310
|
/** What one generate costs, in micro-credits. The same function the server charges by. */
|
|
60
311
|
export function studioRunMicro(quote) {
|
|
312
|
+
const model = quote.model ?? DEFAULT_MODEL_FOR[quote.mode];
|
|
61
313
|
if (quote.mode === 'image')
|
|
62
|
-
return imageRunMicro(quote.resolution, quote.hasCharacter);
|
|
314
|
+
return imageRunMicro(model, quote.resolution, quote.hasCharacter);
|
|
63
315
|
return videoRunMicro({
|
|
64
316
|
resolution: VIDEO_RESOLUTION_FOR[quote.resolution],
|
|
65
317
|
seconds: quote.seconds ?? MIN_VIDEO_SECONDS,
|
|
66
318
|
referenceImages: billedVideoReferences({ uploads: 0, hasCharacter: quote.hasCharacter }),
|
|
67
|
-
});
|
|
319
|
+
}, VIDEO_CARD[model], referenceRuleFor(model));
|
|
68
320
|
}
|
|
69
321
|
export const studioRunCredits = (quote) => Math.ceil(studioRunMicro(quote) / MICRO_PER_CREDIT);
|
|
322
|
+
// The seconds a quoted clip runs for, in the per-model price line.
|
|
323
|
+
export const QUOTED_CLIP_SECONDS = 5;
|
|
324
|
+
/**
|
|
325
|
+
* One model's headline price, for the line beside its credits: an image at 1K, or a five-second
|
|
326
|
+
* clip at 1K, both with a character cast. A model that does not sell 1K is quoted at its nearest
|
|
327
|
+
* tier, and `resolution` says which, so the label never names a size the figure is not for.
|
|
328
|
+
*/
|
|
329
|
+
export function modelPriceLine(model) {
|
|
330
|
+
const spec = STUDIO_MODEL_SPECS[model];
|
|
331
|
+
const resolution = spec.resolutions.includes('1k') ? '1k' : spec.resolutions[0];
|
|
332
|
+
const seconds = spec.mode === 'video' ? QUOTED_CLIP_SECONDS : null;
|
|
333
|
+
const micro = studioRunMicro({
|
|
334
|
+
mode: spec.mode,
|
|
335
|
+
resolution,
|
|
336
|
+
seconds: seconds ?? undefined,
|
|
337
|
+
hasCharacter: true,
|
|
338
|
+
model,
|
|
339
|
+
});
|
|
340
|
+
const credits = Math.ceil(micro / MICRO_PER_CREDIT);
|
|
341
|
+
return { mode: spec.mode, resolution, seconds, credits, usd: credits * USD_PER_CREDIT };
|
|
342
|
+
}
|
|
70
343
|
// A community character is named by its gallery slug; the server imports it on first use.
|
|
71
344
|
export const castSchema = z.discriminatedUnion('kind', [
|
|
72
345
|
z.object({ kind: z.literal('own'), characterId: z.uuid() }),
|
|
73
346
|
z.object({ kind: z.literal('community'), slug: z.string().min(1).max(120) }),
|
|
74
347
|
]);
|
|
348
|
+
// Characters in one shot. Images fit them into FLUX.2 Klein's four reference slots with sheets;
|
|
349
|
+
// video gives each at least two of MiniMax H3's nine.
|
|
350
|
+
export const MAX_CAST = 4;
|
|
351
|
+
export const MAX_CAST_FOR = { image: MAX_CAST, video: MAX_CAST };
|
|
352
|
+
const castKey = (cast) => cast.kind === 'own' ? `own:${cast.characterId}` : `community:${cast.slug}`;
|
|
353
|
+
/** Whether two casts name the same character. */
|
|
354
|
+
export const sameCast = (a, b) => !!a && !!b && castKey(a) === castKey(b);
|
|
75
355
|
export const generateBodySchema = z
|
|
76
356
|
.object({
|
|
77
357
|
mode: z.enum(STUDIO_MODES),
|
|
@@ -79,16 +359,61 @@ export const generateBodySchema = z
|
|
|
79
359
|
ratio: z.enum(STUDIO_RATIOS),
|
|
80
360
|
resolution: z.enum(STUDIO_RESOLUTIONS),
|
|
81
361
|
seconds: z.number().int().min(MIN_VIDEO_SECONDS).max(MAX_VIDEO_SECONDS).optional(),
|
|
362
|
+
// Which renderer to use. Optional, so a Studio that predates the choice still sends a body the
|
|
363
|
+
// server accepts and gets the mode's default.
|
|
364
|
+
model: z.enum(STUDIO_MODELS).optional(),
|
|
365
|
+
// In cast order: the first is Image 1 in the prompt the server writes.
|
|
366
|
+
casts: castSchema.array().max(MAX_CAST).default([]),
|
|
367
|
+
// The single-character form a Studio older than `casts` sends. Read as a one-item list.
|
|
82
368
|
cast: castSchema.nullable().default(null),
|
|
369
|
+
// A finished clip of the caller's whose last frame opens this one, as Image 1.
|
|
370
|
+
continueFrom: z.uuid().nullable().default(null),
|
|
371
|
+
// An uploaded clip or picture the shot should move or pose like. The kind travels with the key
|
|
372
|
+
// because a storage key alone does not say which, and the two are bound into different fields.
|
|
373
|
+
reference: z
|
|
374
|
+
.object({
|
|
375
|
+
key: z.string().min(1),
|
|
376
|
+
kind: z.enum(['image', 'video']),
|
|
377
|
+
// Carried so Edit can put the chip back: a storage key is not a thing to show a caller,
|
|
378
|
+
// and the object URL that previewed the file belonged to the browser that uploaded it.
|
|
379
|
+
name: z.string().min(1).max(200).default('reference'),
|
|
380
|
+
seconds: z.number().int().nullable().default(null),
|
|
381
|
+
})
|
|
382
|
+
.nullable()
|
|
383
|
+
.default(null),
|
|
83
384
|
sessionId: z.uuid().optional(),
|
|
84
385
|
})
|
|
85
|
-
.
|
|
86
|
-
|
|
386
|
+
.transform(({ cast, ...body }) => ({
|
|
387
|
+
...body,
|
|
388
|
+
// A Studio tab open from before a renderer was retired still sends it; it gets the successor.
|
|
389
|
+
model: body.model ? (RETIRED_SUCCESSOR[body.model] ?? body.model) : undefined,
|
|
390
|
+
casts: body.casts.length > 0 ? body.casts : cast ? [cast] : [],
|
|
391
|
+
}))
|
|
392
|
+
.refine((body) => body.casts.length <= MAX_CAST_FOR[body.mode], {
|
|
393
|
+
message: 'Too many characters for this mode.',
|
|
394
|
+
path: ['casts'],
|
|
395
|
+
})
|
|
396
|
+
.refine((body) => new Set(body.casts.map(castKey)).size === body.casts.length, {
|
|
397
|
+
message: 'The same character is cast twice.',
|
|
398
|
+
path: ['casts'],
|
|
399
|
+
})
|
|
400
|
+
.refine((body) => !body.model || STUDIO_MODEL_SPECS[body.model].mode === body.mode, {
|
|
401
|
+
message: 'That model does not make this kind of shot.',
|
|
402
|
+
path: ['model'],
|
|
403
|
+
})
|
|
404
|
+
.refine((body) => ratiosFor(body.mode, body.model).includes(body.ratio), {
|
|
405
|
+
message: 'That shape is not available here.',
|
|
87
406
|
path: ['ratio'],
|
|
88
407
|
})
|
|
89
|
-
.refine((body) => resolutionsFor(body.mode).includes(body.resolution), {
|
|
90
|
-
message: '
|
|
408
|
+
.refine((body) => resolutionsFor(body.mode, body.model).includes(body.resolution), {
|
|
409
|
+
message: 'That size is not available here.',
|
|
91
410
|
path: ['resolution'],
|
|
411
|
+
})
|
|
412
|
+
// Krea reads an image and edits it, so with nothing to edit there is no request to send.
|
|
413
|
+
.refine((body) => !body.model || !STUDIO_MODEL_SPECS[body.model].needsCharacter || body.casts.length > 0, { message: 'This model needs a character to work from.', path: ['casts'] })
|
|
414
|
+
.refine((body) => body.continueFrom === null || body.mode === 'video', {
|
|
415
|
+
message: 'Only a video can continue from a clip.',
|
|
416
|
+
path: ['continueFrom'],
|
|
92
417
|
});
|
|
93
418
|
export const generateResponseSchema = z.object({
|
|
94
419
|
runId: z.uuid(),
|
|
@@ -102,10 +427,42 @@ export const studioSettingsSchema = z.object({
|
|
|
102
427
|
ratio: z.enum(STUDIO_RATIOS),
|
|
103
428
|
resolution: z.enum(STUDIO_RESOLUTIONS),
|
|
104
429
|
seconds: z.number().int().nullable(),
|
|
430
|
+
// Which renderer the caller chose, so Run again and Edit prompt use the same one. Null for a run
|
|
431
|
+
// recorded before the choice existed, which reads as the mode's default.
|
|
432
|
+
model: z.enum(STUDIO_MODELS).nullable().default(null),
|
|
433
|
+
// The first character, kept for runs recorded before `casts`.
|
|
105
434
|
characterName: z.string().nullable(),
|
|
106
|
-
// Which character was cast, so Run again and Edit prompt can cast the same one.
|
|
107
435
|
cast: castSchema.nullable().default(null),
|
|
436
|
+
// Every character cast, in order, so Run again and Edit prompt can cast the same ones.
|
|
437
|
+
characterNames: z.array(z.string()).default([]),
|
|
438
|
+
casts: castSchema.array().default([]),
|
|
439
|
+
// The clip whose last frame this one opened on, or null for a fresh shot.
|
|
440
|
+
continueFrom: z.uuid().nullable().default(null),
|
|
441
|
+
// The reference attached to this run, so Edit can put the same one back. The name travels with
|
|
442
|
+
// the key because a storage key is not something to show a caller, and the object URL that
|
|
443
|
+
// previewed it belonged to the browser that uploaded it.
|
|
444
|
+
reference: z
|
|
445
|
+
.object({
|
|
446
|
+
key: z.string().min(1),
|
|
447
|
+
kind: z.enum(['image', 'video']),
|
|
448
|
+
name: z.string(),
|
|
449
|
+
seconds: z.number().int().nullable().default(null),
|
|
450
|
+
})
|
|
451
|
+
.nullable()
|
|
452
|
+
.default(null),
|
|
108
453
|
});
|
|
454
|
+
/** The characters a run was made with, whether it was recorded before or after `casts`. */
|
|
455
|
+
export function settingsCasts(settings) {
|
|
456
|
+
if (settings.casts.length > 0)
|
|
457
|
+
return settings.casts;
|
|
458
|
+
return settings.cast ? [settings.cast] : [];
|
|
459
|
+
}
|
|
460
|
+
/** The names of those characters, in the same order. */
|
|
461
|
+
export function settingsNames(settings) {
|
|
462
|
+
if (settings.characterNames.length > 0)
|
|
463
|
+
return settings.characterNames;
|
|
464
|
+
return settings.characterName ? [settings.characterName] : [];
|
|
465
|
+
}
|
|
109
466
|
// A published character anyone may cast. `coverUrl` is on the media gateway's public route.
|
|
110
467
|
export const communityCharacterSchema = z.object({
|
|
111
468
|
slug: z.string(),
|
package/dist/v1/studio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studio.js","sourceRoot":"","sources":["../../src/v1/studio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,GAEd,MAAM,mBAAmB,CAAA;AAE1B,iGAAiG;AACjG,kFAAkF;AAElF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU,CAAA;AAGvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;AAGrE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAU,CAAA;AAG3E,oGAAoG;AACpG,MAAM,CAAC,MAAM,mBAAmB,GAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAEzF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAgB,EAA0B,EAAE,CACpE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,CAAA;AAExD,iGAAiG;AACjG,yDAAyD;AACzD,MAAM,CAAC,MAAM,wBAAwB,GAAgC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEvF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAgB,EAA+B,EAAE,CAC9E,IAAI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a,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC/D,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;CACzC,CAAC,CAAA"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TEAM_ENVS: readonly ["production", "sandbox"];
|
|
3
|
+
export declare const teamEnvSchema: z.ZodEnum<{
|
|
4
|
+
sandbox: "sandbox";
|
|
5
|
+
production: "production";
|
|
6
|
+
}>;
|
|
7
|
+
export type TeamEnv = z.infer<typeof teamEnvSchema>;
|
|
8
|
+
export declare const KEY_SCOPES: readonly ["chars:read", "chars:write", "licenses:read", "licenses:write", "usage:read"];
|
|
9
|
+
export declare const keyScopeSchema: z.ZodEnum<{
|
|
10
|
+
"chars:read": "chars:read";
|
|
11
|
+
"chars:write": "chars:write";
|
|
12
|
+
"licenses:read": "licenses:read";
|
|
13
|
+
"licenses:write": "licenses:write";
|
|
14
|
+
"usage:read": "usage:read";
|
|
15
|
+
}>;
|
|
16
|
+
export type KeyScope = z.infer<typeof keyScopeSchema>;
|
|
17
|
+
export declare const TEAM_KEY_PREFIX: Record<TeamEnv, string>;
|
|
18
|
+
export declare const teamKeySecretSchema: z.ZodString;
|
|
19
|
+
export declare const TEAM_KEY_STATUSES: readonly ["active", "expiring", "revoked"];
|
|
20
|
+
export declare const teamKeySchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodUUID;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
env: z.ZodEnum<{
|
|
24
|
+
sandbox: "sandbox";
|
|
25
|
+
production: "production";
|
|
26
|
+
}>;
|
|
27
|
+
prefix: z.ZodString;
|
|
28
|
+
hint: z.ZodString;
|
|
29
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
30
|
+
"chars:read": "chars:read";
|
|
31
|
+
"chars:write": "chars:write";
|
|
32
|
+
"licenses:read": "licenses:read";
|
|
33
|
+
"licenses:write": "licenses:write";
|
|
34
|
+
"usage:read": "usage:read";
|
|
35
|
+
}>>;
|
|
36
|
+
createdBy: z.ZodObject<{
|
|
37
|
+
name: z.ZodNullable<z.ZodString>;
|
|
38
|
+
email: z.ZodNullable<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
createdAt: z.ZodISODateTime;
|
|
41
|
+
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
42
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
43
|
+
status: z.ZodEnum<{
|
|
44
|
+
active: "active";
|
|
45
|
+
expiring: "expiring";
|
|
46
|
+
revoked: "revoked";
|
|
47
|
+
}>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type TeamKey = z.infer<typeof teamKeySchema>;
|
|
50
|
+
export declare const teamKeyListSchema: z.ZodObject<{
|
|
51
|
+
items: z.ZodArray<z.ZodObject<{
|
|
52
|
+
id: z.ZodUUID;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
env: z.ZodEnum<{
|
|
55
|
+
sandbox: "sandbox";
|
|
56
|
+
production: "production";
|
|
57
|
+
}>;
|
|
58
|
+
prefix: z.ZodString;
|
|
59
|
+
hint: z.ZodString;
|
|
60
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
61
|
+
"chars:read": "chars:read";
|
|
62
|
+
"chars:write": "chars:write";
|
|
63
|
+
"licenses:read": "licenses:read";
|
|
64
|
+
"licenses:write": "licenses:write";
|
|
65
|
+
"usage:read": "usage:read";
|
|
66
|
+
}>>;
|
|
67
|
+
createdBy: z.ZodObject<{
|
|
68
|
+
name: z.ZodNullable<z.ZodString>;
|
|
69
|
+
email: z.ZodNullable<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
createdAt: z.ZodISODateTime;
|
|
72
|
+
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
73
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
74
|
+
status: z.ZodEnum<{
|
|
75
|
+
active: "active";
|
|
76
|
+
expiring: "expiring";
|
|
77
|
+
revoked: "revoked";
|
|
78
|
+
}>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export declare const createTeamKeyBodySchema: z.ZodObject<{
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
env: z.ZodEnum<{
|
|
84
|
+
sandbox: "sandbox";
|
|
85
|
+
production: "production";
|
|
86
|
+
}>;
|
|
87
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
88
|
+
"chars:read": "chars:read";
|
|
89
|
+
"chars:write": "chars:write";
|
|
90
|
+
"licenses:read": "licenses:read";
|
|
91
|
+
"licenses:write": "licenses:write";
|
|
92
|
+
"usage:read": "usage:read";
|
|
93
|
+
}>>>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
export type CreateTeamKeyBody = z.infer<typeof createTeamKeyBodySchema>;
|
|
96
|
+
export declare const createTeamKeyResponseSchema: z.ZodObject<{
|
|
97
|
+
key: z.ZodObject<{
|
|
98
|
+
id: z.ZodUUID;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
env: z.ZodEnum<{
|
|
101
|
+
sandbox: "sandbox";
|
|
102
|
+
production: "production";
|
|
103
|
+
}>;
|
|
104
|
+
prefix: z.ZodString;
|
|
105
|
+
hint: z.ZodString;
|
|
106
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
107
|
+
"chars:read": "chars:read";
|
|
108
|
+
"chars:write": "chars:write";
|
|
109
|
+
"licenses:read": "licenses:read";
|
|
110
|
+
"licenses:write": "licenses:write";
|
|
111
|
+
"usage:read": "usage:read";
|
|
112
|
+
}>>;
|
|
113
|
+
createdBy: z.ZodObject<{
|
|
114
|
+
name: z.ZodNullable<z.ZodString>;
|
|
115
|
+
email: z.ZodNullable<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
createdAt: z.ZodISODateTime;
|
|
118
|
+
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
119
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
120
|
+
status: z.ZodEnum<{
|
|
121
|
+
active: "active";
|
|
122
|
+
expiring: "expiring";
|
|
123
|
+
revoked: "revoked";
|
|
124
|
+
}>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
secret: z.ZodString;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
export type CreateTeamKeyResponse = z.infer<typeof createTeamKeyResponseSchema>;
|
|
129
|
+
export declare const teamInfoSchema: z.ZodObject<{
|
|
130
|
+
id: z.ZodUUID;
|
|
131
|
+
name: z.ZodString;
|
|
132
|
+
plan: z.ZodEnum<{
|
|
133
|
+
free: "free";
|
|
134
|
+
team: "team";
|
|
135
|
+
starter: "starter";
|
|
136
|
+
partner: "partner";
|
|
137
|
+
}>;
|
|
138
|
+
env: z.ZodEnum<{
|
|
139
|
+
sandbox: "sandbox";
|
|
140
|
+
production: "production";
|
|
141
|
+
}>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
export type TeamInfo = z.infer<typeof teamInfoSchema>;
|
|
144
|
+
//# sourceMappingURL=teamKeys.d.ts.map
|
|
@@ -0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