@marlinjai/studio-mcp 0.16.0 → 0.18.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 +10 -1
- package/dist/cli.js +83 -28
- package/dist/index.d.ts +1 -1
- package/dist/index.js +83 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -154,6 +154,14 @@ studio_replace_character_in_video
|
|
|
154
154
|
|
|
155
155
|
Reference categories written by the mint: `face`, `three-quarter`, `profile`, `full-body`, `close-up`, `lighting-warm`, `lighting-cool` (the Studio's canonical names, the same ones its in-app mint flow and try-on ranker use).
|
|
156
156
|
|
|
157
|
+
### What changed in 0.18.0
|
|
158
|
+
|
|
159
|
+
No argument was renamed or removed. What changed is how a run priced by a measured clip length is confirmed, and what a company can be charged:
|
|
160
|
+
|
|
161
|
+
- **A new `confirmation_required` reason, `measured_length`.** A run (`studio_run_workflow`) or recipe (`studio_run_published`) with a video-to-video or enhance node is priced by a clip length the Studio measures on the server, a figure no page could show before the request. Such a run refuses with `{ code: "confirmation_required", reason: "measured_length", estimate }` at any amount, not only at the $10 threshold. Show the person `estimate.totalUsd` and resend the same request with `confirm: true` only after they agree. The threshold refusal now carries `reason: "threshold"`. A client that treats every `confirmation_required` the same way (show the estimate, ask, resend with `confirm: true`) needs no change.
|
|
162
|
+
- **A source clip the Studio cannot measure is refused before anything is spent**, with `422` and `{ code: "source_length_unknown", nodeId }`, never priced at a guessed length.
|
|
163
|
+
- **A charge never exceeds the price shown and held.** Every job is debited at most the price it was admitted at; Studio absorbs anything a provider bills above it. Text calls (Improve, shot descriptions, campaign shot ideas) are held at the upper bound of their price, computed from what they send and the most they may write, and a text model is quoted (`/api/v1/prices`) at the most any call of it can be held at.
|
|
164
|
+
|
|
157
165
|
### What changed in 0.6.0
|
|
158
166
|
|
|
159
167
|
No argument and no result field was renamed or removed. What changed is the meaning of the amounts the Studio returns to a company on prepaid credits, since 2026-10-11, and the text of the tools that describe them:
|
|
@@ -169,6 +177,7 @@ Nothing breaks for an existing caller that sends a real brand slug: every argume
|
|
|
169
177
|
- **`studio_generate_image` no longer requires `brandSlug`.** Leave it out and the image is generated without a brand. Up to 0.4.0 the field was required, so an agent of a company with no brand sent a made-up slug. Since 2026-10-11 the Studio refuses a slug that names no brand of the key's company (`404`, `code: "input_not_found"`) instead of generating without a style into a project of that name, which left such an agent with no way to make an image at all.
|
|
170
178
|
- **`studio_generate_image` takes `projectId`.** The image is filed in that project (one of the company's, from `studio_list_projects`). Without it the image lands in the project named after the brand, or in `default` when there is no brand.
|
|
171
179
|
- **The candidate plan is passed through.** The result carries `candidates: { requested, rendered, mayRender? }` as the Studio reported it when it accepted the job, and a `notice` sentence when fewer images will be made than `candidateCount` asked for: most KIE image models render one image whatever the count. Only rendered images are charged.
|
|
180
|
+
- **People never go to KIE.** A request that carries a person (a character, a try-on, a swap, or an uploaded or referenced image or video) runs on the fal model of an automatic entry (`route/...`) only, priced as the fal model, and a model pinned to KIE (`kie/...`) is refused for it with `person_model_not_available` and the fal or automatic entry to use instead.
|
|
172
181
|
- **A refusal reaches the agent as the Studio worded it.** The Studio's `error` sentence, which names the next step, is handed on unchanged, followed by a `hint` the sentence does not already contain and by the machine `code`, for example `POST /api/generate -> 404: Brand 'acme' not found. Create the brand first (POST /api/brands, or the studio_create_brand tool), or leave brandSlug out to generate without a brand. (code: input_not_found)`. Up to 0.4.0 the `code` and the `hint` were dropped. A client that matched a tool error by its exact full text sees the added ` (code: ...)` suffix; the sentence before it is unchanged.
|
|
173
182
|
- **Descriptions match the Studio of 2026-10-11.** `studio_get_usage` describes the `credits` field (balance, daily limit, used today, reset time); `studio_list_characters`, `studio_get_character` and the `characterSlug` arguments describe shared characters (readable and castable, not editable, reference images as Studio addresses); `studio_upload_brand_reference` and `studio_replace_character_in_video` say that a slug the company cannot use is a `404` before anything is spent.
|
|
174
183
|
|
|
@@ -239,7 +248,7 @@ real person: I confirm the likeness acknowledgement for this character.
|
|
|
239
248
|
|
|
240
249
|
```text
|
|
241
250
|
Generate a 16:9 image for brand "busbasis" with Bruno at a workbench in a bright workshop,
|
|
242
|
-
model
|
|
251
|
+
model route/nano-banana-2, and tell me the cost.
|
|
243
252
|
```
|
|
244
253
|
|
|
245
254
|
```text
|
package/dist/cli.js
CHANGED
|
@@ -565,13 +565,14 @@ var veo = (tier, label) => {
|
|
|
565
565
|
fallback: { start: `fal/${slug2}-image-to-video`, startAndEnd: `fal/${slug2}-first-last-frame` }
|
|
566
566
|
};
|
|
567
567
|
};
|
|
568
|
-
var image = (slug2, label, defaultTier) => ({
|
|
568
|
+
var image = (slug2, label, defaultTier, fallbackWithImages) => ({
|
|
569
569
|
kind: "image",
|
|
570
570
|
id: `route/${slug2}`,
|
|
571
571
|
label: `${label} (KIE, fal fallback)`,
|
|
572
572
|
primary: `kie/${slug2}`,
|
|
573
573
|
fallback: `fal/${slug2}`,
|
|
574
|
-
defaultTier
|
|
574
|
+
defaultTier,
|
|
575
|
+
...fallbackWithImages ? { fallbackWithImages } : {}
|
|
575
576
|
});
|
|
576
577
|
var ROUTES = [
|
|
577
578
|
veo("lite", "Veo 3.1 Lite"),
|
|
@@ -650,7 +651,8 @@ var ROUTES = [
|
|
|
650
651
|
primary: "kie/wan-3-0-image-to-video",
|
|
651
652
|
fallback: { start: "fal/wan-3-0-image-to-video" }
|
|
652
653
|
},
|
|
653
|
-
image
|
|
654
|
+
// A character or reference image on the default image route: fal takes it on the edit endpoint.
|
|
655
|
+
image("nano-banana-2", "Nano Banana 2", "1K", "fal/nano-banana-2-edit"),
|
|
654
656
|
image("nano-banana-2-edit", "Nano Banana 2 Edit", "1K"),
|
|
655
657
|
image("nano-banana-pro", "Nano Banana Pro", "1K"),
|
|
656
658
|
image("nano-banana-pro-edit", "Nano Banana Pro Edit", "1K"),
|
|
@@ -1621,11 +1623,22 @@ var CATALOG_ENTRIES = [
|
|
|
1621
1623
|
];
|
|
1622
1624
|
var PINNED_FAL_NOTE = "Pinned to fal: a job on this entry never goes to KIE.";
|
|
1623
1625
|
var PINNED_KIE_NOTE = "Pinned to KIE: no fal fallback. Pick the automatic entry of this model to get one.";
|
|
1626
|
+
var KIE_PERSON_NOTE = "Not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image or video), because KIE offers no data processing agreement.";
|
|
1627
|
+
var ROUTE_PERSON_NOTE = "A request with a person in it (a character, a try-on, a swap, or an uploaded or referenced image or video) skips KIE and runs on fal only, priced as the fal model.";
|
|
1628
|
+
function kiePersonNote(entry) {
|
|
1629
|
+
if (entry.provider !== "kie" || entry.modality !== "image" && entry.modality !== "video") return null;
|
|
1630
|
+
const role = routeRoleOf(entry.id);
|
|
1631
|
+
if (role?.role !== "primary") return `${KIE_PERSON_NOTE} For those, pick a fal model.`;
|
|
1632
|
+
const route = role.route;
|
|
1633
|
+
const twin = route.kind === "image" ? route.fallback : "byResolution" in route.fallback ? Object.values(route.fallback.byResolution)[0] : route.fallback.start;
|
|
1634
|
+
return `${KIE_PERSON_NOTE} For those, pick ${twin} or the automatic entry ${route.id}, which runs them on fal.`;
|
|
1635
|
+
}
|
|
1624
1636
|
function withRouteNote(entry) {
|
|
1625
1637
|
const role = routeRoleOf(entry.id);
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1638
|
+
const person = kiePersonNote(entry);
|
|
1639
|
+
if (!role && !person) return entry;
|
|
1640
|
+
const note = !role ? "" : role.role === "fallback" ? PINNED_FAL_NOTE : PINNED_KIE_NOTE;
|
|
1641
|
+
return { ...entry, description: [entry.description ?? "", note, person ?? ""].filter(Boolean).join(" ").trim() };
|
|
1629
1642
|
}
|
|
1630
1643
|
var MODEL_CATALOG = CATALOG_ENTRIES.map(withRouteNote);
|
|
1631
1644
|
var routeEntries = /* @__PURE__ */ new Map();
|
|
@@ -1642,7 +1655,7 @@ function routeEntry(id) {
|
|
|
1642
1655
|
isDefault: void 0,
|
|
1643
1656
|
id: route.id,
|
|
1644
1657
|
label: route.label,
|
|
1645
|
-
description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
|
|
1658
|
+
description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ${ROUTE_PERSON_NOTE} ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
|
|
1646
1659
|
};
|
|
1647
1660
|
routeEntries.set(id, entry);
|
|
1648
1661
|
return entry;
|
|
@@ -2031,7 +2044,24 @@ var VIDEO_PINNED_DEFAULT_SECONDS = {
|
|
|
2031
2044
|
// LTX-2.5 defaults to "auto", a length nobody can price up front; 6 s is its
|
|
2032
2045
|
// shortest clip on both tiers.
|
|
2033
2046
|
[LTX_25_FAST_I2V_ENDPOINT]: 6,
|
|
2034
|
-
[LTX_25_PRO_I2V_ENDPOINT]: 6
|
|
2047
|
+
[LTX_25_PRO_I2V_ENDPOINT]: 6,
|
|
2048
|
+
// fal's own default is 5 s on these (schemas read 2026-10-25); sent so the
|
|
2049
|
+
// bill cannot drift from the clip if fal ever changes it.
|
|
2050
|
+
"fal-ai/kling-video/v2.5-turbo/pro/image-to-video": 5,
|
|
2051
|
+
"fal-ai/bytedance/seedance/v1/pro/image-to-video": 5,
|
|
2052
|
+
"fal-ai/bytedance/seedance/v1/pro/text-to-video": 5,
|
|
2053
|
+
"blackforestlabs/flux-3/first-last-frame-to-video": 5,
|
|
2054
|
+
"blackforestlabs/flux-3/first-last-frame-to-video/draft": 5,
|
|
2055
|
+
"blackforestlabs/flux-3/keyframes-to-video": 5,
|
|
2056
|
+
"blackforestlabs/flux-3/keyframes-to-video/draft": 5,
|
|
2057
|
+
// `auto` by default on these (fal schemas, 2026-10-25): the model would pick
|
|
2058
|
+
// a length nobody can price. 5 s is the shortest FLUX.3 renders and the clip
|
|
2059
|
+
// the Seedance anchors were priced at.
|
|
2060
|
+
"bytedance/seedance-2.0/image-to-video": 5,
|
|
2061
|
+
"bytedance/seedance-2.5/image-to-video": 5,
|
|
2062
|
+
"bytedance/seedance-2.5/text-to-video": 5,
|
|
2063
|
+
"blackforestlabs/flux-3/image-to-video": 5,
|
|
2064
|
+
"blackforestlabs/flux-3/image-to-video/draft": 5
|
|
2035
2065
|
};
|
|
2036
2066
|
var VIDEO_DEFAULT_RESOLUTION = {
|
|
2037
2067
|
"blackforestlabs/flux-3/keyframes-to-video": "720p",
|
|
@@ -3270,13 +3300,14 @@ var veo2 = (tier, label) => {
|
|
|
3270
3300
|
fallback: { start: `fal/${slug2}-image-to-video`, startAndEnd: `fal/${slug2}-first-last-frame` }
|
|
3271
3301
|
};
|
|
3272
3302
|
};
|
|
3273
|
-
var image2 = (slug2, label, defaultTier) => ({
|
|
3303
|
+
var image2 = (slug2, label, defaultTier, fallbackWithImages) => ({
|
|
3274
3304
|
kind: "image",
|
|
3275
3305
|
id: `route/${slug2}`,
|
|
3276
3306
|
label: `${label} (KIE, fal fallback)`,
|
|
3277
3307
|
primary: `kie/${slug2}`,
|
|
3278
3308
|
fallback: `fal/${slug2}`,
|
|
3279
|
-
defaultTier
|
|
3309
|
+
defaultTier,
|
|
3310
|
+
...fallbackWithImages ? { fallbackWithImages } : {}
|
|
3280
3311
|
});
|
|
3281
3312
|
var ROUTES2 = [
|
|
3282
3313
|
veo2("lite", "Veo 3.1 Lite"),
|
|
@@ -3355,7 +3386,8 @@ var ROUTES2 = [
|
|
|
3355
3386
|
primary: "kie/wan-3-0-image-to-video",
|
|
3356
3387
|
fallback: { start: "fal/wan-3-0-image-to-video" }
|
|
3357
3388
|
},
|
|
3358
|
-
|
|
3389
|
+
// A character or reference image on the default image route: fal takes it on the edit endpoint.
|
|
3390
|
+
image2("nano-banana-2", "Nano Banana 2", "1K", "fal/nano-banana-2-edit"),
|
|
3359
3391
|
image2("nano-banana-2-edit", "Nano Banana 2 Edit", "1K"),
|
|
3360
3392
|
image2("nano-banana-pro", "Nano Banana Pro", "1K"),
|
|
3361
3393
|
image2("nano-banana-pro-edit", "Nano Banana Pro Edit", "1K"),
|
|
@@ -4326,11 +4358,22 @@ var CATALOG_ENTRIES2 = [
|
|
|
4326
4358
|
];
|
|
4327
4359
|
var PINNED_FAL_NOTE2 = "Pinned to fal: a job on this entry never goes to KIE.";
|
|
4328
4360
|
var PINNED_KIE_NOTE2 = "Pinned to KIE: no fal fallback. Pick the automatic entry of this model to get one.";
|
|
4361
|
+
var KIE_PERSON_NOTE2 = "Not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image or video), because KIE offers no data processing agreement.";
|
|
4362
|
+
var ROUTE_PERSON_NOTE2 = "A request with a person in it (a character, a try-on, a swap, or an uploaded or referenced image or video) skips KIE and runs on fal only, priced as the fal model.";
|
|
4363
|
+
function kiePersonNote2(entry) {
|
|
4364
|
+
if (entry.provider !== "kie" || entry.modality !== "image" && entry.modality !== "video") return null;
|
|
4365
|
+
const role = routeRoleOf2(entry.id);
|
|
4366
|
+
if (role?.role !== "primary") return `${KIE_PERSON_NOTE2} For those, pick a fal model.`;
|
|
4367
|
+
const route = role.route;
|
|
4368
|
+
const twin = route.kind === "image" ? route.fallback : "byResolution" in route.fallback ? Object.values(route.fallback.byResolution)[0] : route.fallback.start;
|
|
4369
|
+
return `${KIE_PERSON_NOTE2} For those, pick ${twin} or the automatic entry ${route.id}, which runs them on fal.`;
|
|
4370
|
+
}
|
|
4329
4371
|
function withRouteNote2(entry) {
|
|
4330
4372
|
const role = routeRoleOf2(entry.id);
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4373
|
+
const person = kiePersonNote2(entry);
|
|
4374
|
+
if (!role && !person) return entry;
|
|
4375
|
+
const note = !role ? "" : role.role === "fallback" ? PINNED_FAL_NOTE2 : PINNED_KIE_NOTE2;
|
|
4376
|
+
return { ...entry, description: [entry.description ?? "", note, person ?? ""].filter(Boolean).join(" ").trim() };
|
|
4334
4377
|
}
|
|
4335
4378
|
var MODEL_CATALOG2 = CATALOG_ENTRIES2.map(withRouteNote2);
|
|
4336
4379
|
var routeEntries2 = /* @__PURE__ */ new Map();
|
|
@@ -4347,7 +4390,7 @@ function routeEntry2(id) {
|
|
|
4347
4390
|
isDefault: void 0,
|
|
4348
4391
|
id: route.id,
|
|
4349
4392
|
label: route.label,
|
|
4350
|
-
description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
|
|
4393
|
+
description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ${ROUTE_PERSON_NOTE2} ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
|
|
4351
4394
|
};
|
|
4352
4395
|
routeEntries2.set(id, entry);
|
|
4353
4396
|
return entry;
|
|
@@ -4894,6 +4937,18 @@ function opTouches(doc, op) {
|
|
|
4894
4937
|
}
|
|
4895
4938
|
return [...out];
|
|
4896
4939
|
}
|
|
4940
|
+
var MEDIA_INPUT_KEYS = [
|
|
4941
|
+
"inputImages",
|
|
4942
|
+
"inputImage",
|
|
4943
|
+
"inputImageUrl",
|
|
4944
|
+
"endImageUrl",
|
|
4945
|
+
"keyframeImageUrls",
|
|
4946
|
+
"referenceImageUrls",
|
|
4947
|
+
"inputVideoUrl",
|
|
4948
|
+
"draftCacheUrl",
|
|
4949
|
+
"parentAssetId"
|
|
4950
|
+
];
|
|
4951
|
+
var MEDIA_KEYS = new Set(MEDIA_INPUT_KEYS);
|
|
4897
4952
|
var RECIPE_EFFECT_TYPES = ["createCharacter", "addCharacterReference", "createBrand", "addBrandReference"];
|
|
4898
4953
|
var EffectValueSourceSchema = z5.discriminatedUnion("kind", [
|
|
4899
4954
|
z5.object({ kind: z5.literal("literal"), value: JsonNonNullValueSchema }),
|
|
@@ -5262,7 +5317,7 @@ function documentToDefinition(doc, opts = {}) {
|
|
|
5262
5317
|
const keyframes = port === "image" && task === "image-to-video" && modelAcceptsKeyframes(node.model);
|
|
5263
5318
|
const references = port === "reference";
|
|
5264
5319
|
const listKey = orderedPortKey(task, port, 0, node.model) ?? b.key;
|
|
5265
|
-
const
|
|
5320
|
+
const items2 = [];
|
|
5266
5321
|
const itemSources = [];
|
|
5267
5322
|
let uploading = false;
|
|
5268
5323
|
for (const [ordinal, e] of portWires.entries()) {
|
|
@@ -5303,11 +5358,11 @@ function documentToDefinition(doc, opts = {}) {
|
|
|
5303
5358
|
if (!item) continue;
|
|
5304
5359
|
if (single) inputs[key] = item;
|
|
5305
5360
|
else {
|
|
5306
|
-
|
|
5361
|
+
items2.push(item);
|
|
5307
5362
|
itemSources.push(e.source);
|
|
5308
5363
|
}
|
|
5309
5364
|
}
|
|
5310
|
-
if (references && !uploading &&
|
|
5365
|
+
if (references && !uploading && items2.length > 0) {
|
|
5311
5366
|
const limits = modelCharacterReferences(node.model);
|
|
5312
5367
|
const grouped = limits ? referenceElementsFor(
|
|
5313
5368
|
itemSources,
|
|
@@ -5320,7 +5375,7 @@ function documentToDefinition(doc, opts = {}) {
|
|
|
5320
5375
|
if (grouped.ok) {
|
|
5321
5376
|
inputs[listKey] = {
|
|
5322
5377
|
kind: "list",
|
|
5323
|
-
items: grouped.order.map((i) =>
|
|
5378
|
+
items: grouped.order.map((i) => items2[i])
|
|
5324
5379
|
};
|
|
5325
5380
|
inputs.referenceElementIndexes = {
|
|
5326
5381
|
kind: "literal",
|
|
@@ -5335,9 +5390,9 @@ function documentToDefinition(doc, opts = {}) {
|
|
|
5335
5390
|
}
|
|
5336
5391
|
continue;
|
|
5337
5392
|
}
|
|
5338
|
-
if (!uploading &&
|
|
5339
|
-
inputs[listKey] = { kind: "list", items };
|
|
5340
|
-
if (keyframes && !uploading &&
|
|
5393
|
+
if (!uploading && items2.length > 0)
|
|
5394
|
+
inputs[listKey] = { kind: "list", items: items2 };
|
|
5395
|
+
if (keyframes && !uploading && items2.length > 0) {
|
|
5341
5396
|
const positions = keyframePositionsFor(
|
|
5342
5397
|
portWires.map((e) => e.source),
|
|
5343
5398
|
node.settings
|
|
@@ -7116,7 +7171,7 @@ var studioGenerateImage = defineTool({
|
|
|
7116
7171
|
projectId: z12.string().min(1).optional().describe(
|
|
7117
7172
|
'Optional project to file the image under (an id from studio_list_projects; it must be a project of your company, anything else is a 404). Omit it to use the project named after brandSlug, or "default" when there is no brand.'
|
|
7118
7173
|
),
|
|
7119
|
-
model: z12.string().optional().describe('Image model id (e.g. "
|
|
7174
|
+
model: z12.string().optional().describe('Image model id (e.g. "route/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default. A model pinned to KIE (kie/...) is not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image) and is refused for them: use its fal entry (fal/...) or its automatic entry (route/...), which runs such a request on fal only.'),
|
|
7120
7175
|
aspectRatio: z12.string().optional().describe('Aspect ratio such as "1:1", "16:9", "3:4".'),
|
|
7121
7176
|
imageSize: z12.string().optional().describe('Provider size hint, e.g. "1K", "2K".'),
|
|
7122
7177
|
seed: z12.number().int().optional(),
|
|
@@ -7489,11 +7544,11 @@ var studioUploadBrandReference = defineTool({
|
|
|
7489
7544
|
}
|
|
7490
7545
|
});
|
|
7491
7546
|
var workflowDefinitionSchema = WorkflowDefinitionSchema.describe(
|
|
7492
|
-
`Inline workflow DAG: { id, label?, params?: [{ name, type: string|number|boolean|json, required?, label?, description?, inputType?, cardinality?: one|many, default? }], nodes: [{ id, task (one of the model tasks listed), model (catalog id, e.g. fal/nano-banana-2-edit), inputs, retry? }] }. Node inputs are bindings: {kind:"literal",value}, {kind:"param",name,wrap?:"array"}, {kind:"ref",node,path:"url",wrap?:"array"} or an ordered {kind:"list",items:[...]} of those. Image-edit nodes take inputImages (an array: one wrapped ref/param, or a list in reference order, scene frame first); image-to-video nodes take inputImageUrl (start frame) and optionally endImageUrl (end frame, on models that accept one), EXCEPT on a keyframes model (fal/flux-3-keyframes-to-video and its -draft tier), which instead takes keyframeImageUrls (an ordered list of up to 10 images) with keyframeFrameIndexes (one strictly increasing frame per image on a fixed 24 fps timeline). Pass one shape or the other, never both. To hold a character's identity through the clip, an image-to-video node on a model with character references (route/kling-o3
|
|
7547
|
+
`Inline workflow DAG: { id, label?, params?: [{ name, type: string|number|boolean|json, required?, label?, description?, inputType?, cardinality?: one|many, default? }], nodes: [{ id, task (one of the model tasks listed), model (catalog id, e.g. fal/nano-banana-2-edit), inputs, retry? }] }. Node inputs are bindings: {kind:"literal",value}, {kind:"param",name,wrap?:"array"}, {kind:"ref",node,path:"url",wrap?:"array"} or an ordered {kind:"list",items:[...]} of those. Image-edit nodes take inputImages (an array: one wrapped ref/param, or a list in reference order, scene frame first); image-to-video nodes take inputImageUrl (start frame) and optionally endImageUrl (end frame, on models that accept one), EXCEPT on a keyframes model (fal/flux-3-keyframes-to-video and its -draft tier), which instead takes keyframeImageUrls (an ordered list of up to 10 images) with keyframeFrameIndexes (one strictly increasing frame per image on a fixed 24 fps timeline). Pass one shape or the other, never both. To hold a character's identity through the clip, an image-to-video node on a model with character references (route/kling-o3 or fal/kling-o3-pro-reference-to-video; a model pinned to KIE, kie/..., is not available for images of people and refuses a run whose node carries a character, a try-on, a swap or an uploaded or referenced image or video, so use the fal or route/ entry for those) also takes referenceImageUrls (a list of character photos, grouped by character, each character's frontal view first, 2 to 4 images per character, up to 3 characters) with referenceElementIndexes (the 0-based character of each image, ascending without gaps, e.g. [0,0,0,1,1]); they never count as the start or end frame, and they need inputImageUrl. kie/gemini-omni-flash-1-1-reference-to-video takes the same two fields with 1 to 6 character images in all and no end frame: its start frame goes in as reference image 1, named in the prompt as the exact scene and first frame, because KIE does not lock a first frame in its reference mode. It runs on KIE, so while Studio keeps people off KIE it is refused for character references like every other kie/ model.`
|
|
7493
7548
|
);
|
|
7494
7549
|
var studioRunWorkflow = defineTool({
|
|
7495
7550
|
name: "studio_run_workflow",
|
|
7496
|
-
description: `Run a generation workflow DAG. Pass an inline definition (nodes of provider calls wired by ref bindings; this is what the hosted Studio accepts) or the savedId of a workflow saved in the Studio (the Studio runs that workflow's current document, exactly what the canvas would run). Params fill {kind:"param"} bindings. Returns the runId plus per-node status, URLs and cost; with wait=true (default) it blocks until the run is terminal (succeeded, failed, partial, cancelled). Each node becomes a paid job. Use an inline definition ONLY for the first batch of a new deliverable (one workflow, a node per item, a stable label); a follow-up on an existing item belongs in that saved workflow as a new node (studio_workflow_apply: addNode plus connect from the node it refines) run here with savedId and nodeIds, because every listed inline run is saved as its own workflow. A clip with both a start and an end frame is checked for continuity before it is paid for (see acknowledgeContinuity).`,
|
|
7551
|
+
description: `Run a generation workflow DAG. Pass an inline definition (nodes of provider calls wired by ref bindings; this is what the hosted Studio accepts) or the savedId of a workflow saved in the Studio (the Studio runs that workflow's current document, exactly what the canvas would run). Params fill {kind:"param"} bindings. Returns the runId plus per-node status, URLs and cost; with wait=true (default) it blocks until the run is terminal (succeeded, failed, partial, cancelled). Each node becomes a paid job. Use an inline definition ONLY for the first batch of a new deliverable (one workflow, a node per item, a stable label); a follow-up on an existing item belongs in that saved workflow as a new node (studio_workflow_apply: addNode plus connect from the node it refines) run here with savedId and nodeIds, because every listed inline run is saved as its own workflow. A clip with both a start and an end frame is checked for continuity before it is paid for (see acknowledgeContinuity). A video-to-video node is priced by its source clip's length, which the Studio measures before admission; a source it cannot measure (or one whose length is not known before the run) refuses with 422 { code: "source_length_unknown", nodeId } before anything is spent.`,
|
|
7497
7552
|
inputSchema: {
|
|
7498
7553
|
projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
|
|
7499
7554
|
definition: workflowDefinitionSchema.optional(),
|
|
@@ -7509,7 +7564,7 @@ var studioRunWorkflow = defineTool({
|
|
|
7509
7564
|
'S6b: hard cap on the estimated cost, verified server-side before anything is created. An unverifiable estimate (a credits-only or unpriced executing node) refuses too, never proceeds silently. Refusal: { code: "budget_exceeded", estimate }. For `runs`>1 this is the AGGREGATE cap across every iteration.'
|
|
7510
7565
|
),
|
|
7511
7566
|
confirm: z12.boolean().optional().describe(
|
|
7512
|
-
'S6b: bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", estimate }.'
|
|
7567
|
+
'S6b: bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", reason: "threshold", estimate }. A run with a video-to-video or enhance node is priced by a clip length the server measures, so it refuses with { code: "confirmation_required", reason: "measured_length", estimate } at any figure: show the person estimate.totalUsd and resend with confirm: true only after they agree.'
|
|
7513
7568
|
),
|
|
7514
7569
|
acknowledgeContinuity: z12.boolean().optional().describe(
|
|
7515
7570
|
'Run despite the continuity check. Before a run executes an image-to-video node with BOTH a start frame (inputImageUrl) and an end frame (endImageUrl), the Studio compares the two frames with a vision model (one small paid check per new pair of frames, remembered for your company, so an unchanged pair is never charged twice): a person or a held object in one frame and not the other makes the video model invent or erase it mid-clip. Frames that disagree refuse with { code: "continuity_mismatch", nodes: [{ nodeId, differences }] }; a check that could not run refuses with { code: "continuity_unchecked", nodes: [{ nodeId, reason }] }. Nothing is spent on either. Show the differences to the person you act for and fix the frames; pass true only when they decide to run anyway.'
|
|
@@ -7723,7 +7778,7 @@ var studioRunPublished = defineTool({
|
|
|
7723
7778
|
'Hard cap on the estimated cost, verified server-side before anything is created. An unverifiable estimate (a credits-only or unpriced executing node) refuses too. Refusal: { code: "budget_exceeded", estimate }.'
|
|
7724
7779
|
),
|
|
7725
7780
|
confirm: z12.boolean().optional().describe(
|
|
7726
|
-
'Bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", estimate }.'
|
|
7781
|
+
'Bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", reason: "threshold", estimate }. A recipe with a video-to-video or enhance node is priced by a clip length the server measures, so it refuses with { code: "confirmation_required", reason: "measured_length", estimate } at any figure: show the person estimate.totalUsd and resend with confirm: true only after they agree.'
|
|
7727
7782
|
),
|
|
7728
7783
|
likenessRightsConfirmed: z12.literal(true).optional().describe(`Required when the recipe creates a character; ignored otherwise. ${likenessConfirmationToolDescription()}`),
|
|
7729
7784
|
acknowledgeContinuity: z12.boolean().optional().describe(
|
|
@@ -7842,7 +7897,7 @@ function registerTools(server, base) {
|
|
|
7842
7897
|
|
|
7843
7898
|
// src/server.ts
|
|
7844
7899
|
var SERVER_NAME = "lumitra-studio";
|
|
7845
|
-
var SERVER_VERSION = "0.
|
|
7900
|
+
var SERVER_VERSION = "0.18.0";
|
|
7846
7901
|
function createStudioMcpServer(opts = {}) {
|
|
7847
7902
|
const config = opts.config ?? resolveConfig(opts.env ?? process.env);
|
|
7848
7903
|
const client = new StudioClient(config, {
|
package/dist/index.d.ts
CHANGED
|
@@ -2182,7 +2182,7 @@ declare function registerTools(server: McpServer, base: ToolContext): void;
|
|
|
2182
2182
|
*/
|
|
2183
2183
|
|
|
2184
2184
|
declare const SERVER_NAME = "lumitra-studio";
|
|
2185
|
-
declare const SERVER_VERSION = "0.
|
|
2185
|
+
declare const SERVER_VERSION = "0.18.0";
|
|
2186
2186
|
interface CreateServerOptions {
|
|
2187
2187
|
config?: StudioConfig;
|
|
2188
2188
|
env?: NodeJS.ProcessEnv;
|
package/dist/index.js
CHANGED
|
@@ -557,13 +557,14 @@ var veo = (tier, label) => {
|
|
|
557
557
|
fallback: { start: `fal/${slug2}-image-to-video`, startAndEnd: `fal/${slug2}-first-last-frame` }
|
|
558
558
|
};
|
|
559
559
|
};
|
|
560
|
-
var image = (slug2, label, defaultTier) => ({
|
|
560
|
+
var image = (slug2, label, defaultTier, fallbackWithImages) => ({
|
|
561
561
|
kind: "image",
|
|
562
562
|
id: `route/${slug2}`,
|
|
563
563
|
label: `${label} (KIE, fal fallback)`,
|
|
564
564
|
primary: `kie/${slug2}`,
|
|
565
565
|
fallback: `fal/${slug2}`,
|
|
566
|
-
defaultTier
|
|
566
|
+
defaultTier,
|
|
567
|
+
...fallbackWithImages ? { fallbackWithImages } : {}
|
|
567
568
|
});
|
|
568
569
|
var ROUTES = [
|
|
569
570
|
veo("lite", "Veo 3.1 Lite"),
|
|
@@ -642,7 +643,8 @@ var ROUTES = [
|
|
|
642
643
|
primary: "kie/wan-3-0-image-to-video",
|
|
643
644
|
fallback: { start: "fal/wan-3-0-image-to-video" }
|
|
644
645
|
},
|
|
645
|
-
image
|
|
646
|
+
// A character or reference image on the default image route: fal takes it on the edit endpoint.
|
|
647
|
+
image("nano-banana-2", "Nano Banana 2", "1K", "fal/nano-banana-2-edit"),
|
|
646
648
|
image("nano-banana-2-edit", "Nano Banana 2 Edit", "1K"),
|
|
647
649
|
image("nano-banana-pro", "Nano Banana Pro", "1K"),
|
|
648
650
|
image("nano-banana-pro-edit", "Nano Banana Pro Edit", "1K"),
|
|
@@ -1613,11 +1615,22 @@ var CATALOG_ENTRIES = [
|
|
|
1613
1615
|
];
|
|
1614
1616
|
var PINNED_FAL_NOTE = "Pinned to fal: a job on this entry never goes to KIE.";
|
|
1615
1617
|
var PINNED_KIE_NOTE = "Pinned to KIE: no fal fallback. Pick the automatic entry of this model to get one.";
|
|
1618
|
+
var KIE_PERSON_NOTE = "Not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image or video), because KIE offers no data processing agreement.";
|
|
1619
|
+
var ROUTE_PERSON_NOTE = "A request with a person in it (a character, a try-on, a swap, or an uploaded or referenced image or video) skips KIE and runs on fal only, priced as the fal model.";
|
|
1620
|
+
function kiePersonNote(entry) {
|
|
1621
|
+
if (entry.provider !== "kie" || entry.modality !== "image" && entry.modality !== "video") return null;
|
|
1622
|
+
const role = routeRoleOf(entry.id);
|
|
1623
|
+
if (role?.role !== "primary") return `${KIE_PERSON_NOTE} For those, pick a fal model.`;
|
|
1624
|
+
const route = role.route;
|
|
1625
|
+
const twin = route.kind === "image" ? route.fallback : "byResolution" in route.fallback ? Object.values(route.fallback.byResolution)[0] : route.fallback.start;
|
|
1626
|
+
return `${KIE_PERSON_NOTE} For those, pick ${twin} or the automatic entry ${route.id}, which runs them on fal.`;
|
|
1627
|
+
}
|
|
1616
1628
|
function withRouteNote(entry) {
|
|
1617
1629
|
const role = routeRoleOf(entry.id);
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1630
|
+
const person = kiePersonNote(entry);
|
|
1631
|
+
if (!role && !person) return entry;
|
|
1632
|
+
const note = !role ? "" : role.role === "fallback" ? PINNED_FAL_NOTE : PINNED_KIE_NOTE;
|
|
1633
|
+
return { ...entry, description: [entry.description ?? "", note, person ?? ""].filter(Boolean).join(" ").trim() };
|
|
1621
1634
|
}
|
|
1622
1635
|
var MODEL_CATALOG = CATALOG_ENTRIES.map(withRouteNote);
|
|
1623
1636
|
var routeEntries = /* @__PURE__ */ new Map();
|
|
@@ -1634,7 +1647,7 @@ function routeEntry(id) {
|
|
|
1634
1647
|
isDefault: void 0,
|
|
1635
1648
|
id: route.id,
|
|
1636
1649
|
label: route.label,
|
|
1637
|
-
description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
|
|
1650
|
+
description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ${ROUTE_PERSON_NOTE} ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
|
|
1638
1651
|
};
|
|
1639
1652
|
routeEntries.set(id, entry);
|
|
1640
1653
|
return entry;
|
|
@@ -2023,7 +2036,24 @@ var VIDEO_PINNED_DEFAULT_SECONDS = {
|
|
|
2023
2036
|
// LTX-2.5 defaults to "auto", a length nobody can price up front; 6 s is its
|
|
2024
2037
|
// shortest clip on both tiers.
|
|
2025
2038
|
[LTX_25_FAST_I2V_ENDPOINT]: 6,
|
|
2026
|
-
[LTX_25_PRO_I2V_ENDPOINT]: 6
|
|
2039
|
+
[LTX_25_PRO_I2V_ENDPOINT]: 6,
|
|
2040
|
+
// fal's own default is 5 s on these (schemas read 2026-10-25); sent so the
|
|
2041
|
+
// bill cannot drift from the clip if fal ever changes it.
|
|
2042
|
+
"fal-ai/kling-video/v2.5-turbo/pro/image-to-video": 5,
|
|
2043
|
+
"fal-ai/bytedance/seedance/v1/pro/image-to-video": 5,
|
|
2044
|
+
"fal-ai/bytedance/seedance/v1/pro/text-to-video": 5,
|
|
2045
|
+
"blackforestlabs/flux-3/first-last-frame-to-video": 5,
|
|
2046
|
+
"blackforestlabs/flux-3/first-last-frame-to-video/draft": 5,
|
|
2047
|
+
"blackforestlabs/flux-3/keyframes-to-video": 5,
|
|
2048
|
+
"blackforestlabs/flux-3/keyframes-to-video/draft": 5,
|
|
2049
|
+
// `auto` by default on these (fal schemas, 2026-10-25): the model would pick
|
|
2050
|
+
// a length nobody can price. 5 s is the shortest FLUX.3 renders and the clip
|
|
2051
|
+
// the Seedance anchors were priced at.
|
|
2052
|
+
"bytedance/seedance-2.0/image-to-video": 5,
|
|
2053
|
+
"bytedance/seedance-2.5/image-to-video": 5,
|
|
2054
|
+
"bytedance/seedance-2.5/text-to-video": 5,
|
|
2055
|
+
"blackforestlabs/flux-3/image-to-video": 5,
|
|
2056
|
+
"blackforestlabs/flux-3/image-to-video/draft": 5
|
|
2027
2057
|
};
|
|
2028
2058
|
var VIDEO_DEFAULT_RESOLUTION = {
|
|
2029
2059
|
"blackforestlabs/flux-3/keyframes-to-video": "720p",
|
|
@@ -3262,13 +3292,14 @@ var veo2 = (tier, label) => {
|
|
|
3262
3292
|
fallback: { start: `fal/${slug2}-image-to-video`, startAndEnd: `fal/${slug2}-first-last-frame` }
|
|
3263
3293
|
};
|
|
3264
3294
|
};
|
|
3265
|
-
var image2 = (slug2, label, defaultTier) => ({
|
|
3295
|
+
var image2 = (slug2, label, defaultTier, fallbackWithImages) => ({
|
|
3266
3296
|
kind: "image",
|
|
3267
3297
|
id: `route/${slug2}`,
|
|
3268
3298
|
label: `${label} (KIE, fal fallback)`,
|
|
3269
3299
|
primary: `kie/${slug2}`,
|
|
3270
3300
|
fallback: `fal/${slug2}`,
|
|
3271
|
-
defaultTier
|
|
3301
|
+
defaultTier,
|
|
3302
|
+
...fallbackWithImages ? { fallbackWithImages } : {}
|
|
3272
3303
|
});
|
|
3273
3304
|
var ROUTES2 = [
|
|
3274
3305
|
veo2("lite", "Veo 3.1 Lite"),
|
|
@@ -3347,7 +3378,8 @@ var ROUTES2 = [
|
|
|
3347
3378
|
primary: "kie/wan-3-0-image-to-video",
|
|
3348
3379
|
fallback: { start: "fal/wan-3-0-image-to-video" }
|
|
3349
3380
|
},
|
|
3350
|
-
|
|
3381
|
+
// A character or reference image on the default image route: fal takes it on the edit endpoint.
|
|
3382
|
+
image2("nano-banana-2", "Nano Banana 2", "1K", "fal/nano-banana-2-edit"),
|
|
3351
3383
|
image2("nano-banana-2-edit", "Nano Banana 2 Edit", "1K"),
|
|
3352
3384
|
image2("nano-banana-pro", "Nano Banana Pro", "1K"),
|
|
3353
3385
|
image2("nano-banana-pro-edit", "Nano Banana Pro Edit", "1K"),
|
|
@@ -4318,11 +4350,22 @@ var CATALOG_ENTRIES2 = [
|
|
|
4318
4350
|
];
|
|
4319
4351
|
var PINNED_FAL_NOTE2 = "Pinned to fal: a job on this entry never goes to KIE.";
|
|
4320
4352
|
var PINNED_KIE_NOTE2 = "Pinned to KIE: no fal fallback. Pick the automatic entry of this model to get one.";
|
|
4353
|
+
var KIE_PERSON_NOTE2 = "Not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image or video), because KIE offers no data processing agreement.";
|
|
4354
|
+
var ROUTE_PERSON_NOTE2 = "A request with a person in it (a character, a try-on, a swap, or an uploaded or referenced image or video) skips KIE and runs on fal only, priced as the fal model.";
|
|
4355
|
+
function kiePersonNote2(entry) {
|
|
4356
|
+
if (entry.provider !== "kie" || entry.modality !== "image" && entry.modality !== "video") return null;
|
|
4357
|
+
const role = routeRoleOf2(entry.id);
|
|
4358
|
+
if (role?.role !== "primary") return `${KIE_PERSON_NOTE2} For those, pick a fal model.`;
|
|
4359
|
+
const route = role.route;
|
|
4360
|
+
const twin = route.kind === "image" ? route.fallback : "byResolution" in route.fallback ? Object.values(route.fallback.byResolution)[0] : route.fallback.start;
|
|
4361
|
+
return `${KIE_PERSON_NOTE2} For those, pick ${twin} or the automatic entry ${route.id}, which runs them on fal.`;
|
|
4362
|
+
}
|
|
4321
4363
|
function withRouteNote2(entry) {
|
|
4322
4364
|
const role = routeRoleOf2(entry.id);
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4365
|
+
const person = kiePersonNote2(entry);
|
|
4366
|
+
if (!role && !person) return entry;
|
|
4367
|
+
const note = !role ? "" : role.role === "fallback" ? PINNED_FAL_NOTE2 : PINNED_KIE_NOTE2;
|
|
4368
|
+
return { ...entry, description: [entry.description ?? "", note, person ?? ""].filter(Boolean).join(" ").trim() };
|
|
4326
4369
|
}
|
|
4327
4370
|
var MODEL_CATALOG2 = CATALOG_ENTRIES2.map(withRouteNote2);
|
|
4328
4371
|
var routeEntries2 = /* @__PURE__ */ new Map();
|
|
@@ -4339,7 +4382,7 @@ function routeEntry2(id) {
|
|
|
4339
4382
|
isDefault: void 0,
|
|
4340
4383
|
id: route.id,
|
|
4341
4384
|
label: route.label,
|
|
4342
|
-
description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
|
|
4385
|
+
description: `Runs on KIE first and, when KIE fails on its side, again on fal with the same settings. ${ROUTE_PERSON_NOTE2} ` + `To keep a job off KIE, pin the fal entry of this model. ${primary.description ?? ""}`.trim()
|
|
4343
4386
|
};
|
|
4344
4387
|
routeEntries2.set(id, entry);
|
|
4345
4388
|
return entry;
|
|
@@ -4886,6 +4929,18 @@ function opTouches(doc, op) {
|
|
|
4886
4929
|
}
|
|
4887
4930
|
return [...out];
|
|
4888
4931
|
}
|
|
4932
|
+
var MEDIA_INPUT_KEYS = [
|
|
4933
|
+
"inputImages",
|
|
4934
|
+
"inputImage",
|
|
4935
|
+
"inputImageUrl",
|
|
4936
|
+
"endImageUrl",
|
|
4937
|
+
"keyframeImageUrls",
|
|
4938
|
+
"referenceImageUrls",
|
|
4939
|
+
"inputVideoUrl",
|
|
4940
|
+
"draftCacheUrl",
|
|
4941
|
+
"parentAssetId"
|
|
4942
|
+
];
|
|
4943
|
+
var MEDIA_KEYS = new Set(MEDIA_INPUT_KEYS);
|
|
4889
4944
|
var RECIPE_EFFECT_TYPES = ["createCharacter", "addCharacterReference", "createBrand", "addBrandReference"];
|
|
4890
4945
|
var EffectValueSourceSchema = z5.discriminatedUnion("kind", [
|
|
4891
4946
|
z5.object({ kind: z5.literal("literal"), value: JsonNonNullValueSchema }),
|
|
@@ -5254,7 +5309,7 @@ function documentToDefinition(doc, opts = {}) {
|
|
|
5254
5309
|
const keyframes = port === "image" && task === "image-to-video" && modelAcceptsKeyframes(node.model);
|
|
5255
5310
|
const references = port === "reference";
|
|
5256
5311
|
const listKey = orderedPortKey(task, port, 0, node.model) ?? b.key;
|
|
5257
|
-
const
|
|
5312
|
+
const items2 = [];
|
|
5258
5313
|
const itemSources = [];
|
|
5259
5314
|
let uploading = false;
|
|
5260
5315
|
for (const [ordinal, e] of portWires.entries()) {
|
|
@@ -5295,11 +5350,11 @@ function documentToDefinition(doc, opts = {}) {
|
|
|
5295
5350
|
if (!item) continue;
|
|
5296
5351
|
if (single) inputs[key] = item;
|
|
5297
5352
|
else {
|
|
5298
|
-
|
|
5353
|
+
items2.push(item);
|
|
5299
5354
|
itemSources.push(e.source);
|
|
5300
5355
|
}
|
|
5301
5356
|
}
|
|
5302
|
-
if (references && !uploading &&
|
|
5357
|
+
if (references && !uploading && items2.length > 0) {
|
|
5303
5358
|
const limits = modelCharacterReferences(node.model);
|
|
5304
5359
|
const grouped = limits ? referenceElementsFor(
|
|
5305
5360
|
itemSources,
|
|
@@ -5312,7 +5367,7 @@ function documentToDefinition(doc, opts = {}) {
|
|
|
5312
5367
|
if (grouped.ok) {
|
|
5313
5368
|
inputs[listKey] = {
|
|
5314
5369
|
kind: "list",
|
|
5315
|
-
items: grouped.order.map((i) =>
|
|
5370
|
+
items: grouped.order.map((i) => items2[i])
|
|
5316
5371
|
};
|
|
5317
5372
|
inputs.referenceElementIndexes = {
|
|
5318
5373
|
kind: "literal",
|
|
@@ -5327,9 +5382,9 @@ function documentToDefinition(doc, opts = {}) {
|
|
|
5327
5382
|
}
|
|
5328
5383
|
continue;
|
|
5329
5384
|
}
|
|
5330
|
-
if (!uploading &&
|
|
5331
|
-
inputs[listKey] = { kind: "list", items };
|
|
5332
|
-
if (keyframes && !uploading &&
|
|
5385
|
+
if (!uploading && items2.length > 0)
|
|
5386
|
+
inputs[listKey] = { kind: "list", items: items2 };
|
|
5387
|
+
if (keyframes && !uploading && items2.length > 0) {
|
|
5333
5388
|
const positions = keyframePositionsFor(
|
|
5334
5389
|
portWires.map((e) => e.source),
|
|
5335
5390
|
node.settings
|
|
@@ -7111,7 +7166,7 @@ var studioGenerateImage = defineTool({
|
|
|
7111
7166
|
projectId: z12.string().min(1).optional().describe(
|
|
7112
7167
|
'Optional project to file the image under (an id from studio_list_projects; it must be a project of your company, anything else is a 404). Omit it to use the project named after brandSlug, or "default" when there is no brand.'
|
|
7113
7168
|
),
|
|
7114
|
-
model: z12.string().optional().describe('Image model id (e.g. "
|
|
7169
|
+
model: z12.string().optional().describe('Image model id (e.g. "route/nano-banana-2", "fal/nano-banana-2"). Omit for the Studio default. A model pinned to KIE (kie/...) is not available for images of people (a character, a try-on, a swap, or an uploaded or referenced image) and is refused for them: use its fal entry (fal/...) or its automatic entry (route/...), which runs such a request on fal only.'),
|
|
7115
7170
|
aspectRatio: z12.string().optional().describe('Aspect ratio such as "1:1", "16:9", "3:4".'),
|
|
7116
7171
|
imageSize: z12.string().optional().describe('Provider size hint, e.g. "1K", "2K".'),
|
|
7117
7172
|
seed: z12.number().int().optional(),
|
|
@@ -7484,11 +7539,11 @@ var studioUploadBrandReference = defineTool({
|
|
|
7484
7539
|
}
|
|
7485
7540
|
});
|
|
7486
7541
|
var workflowDefinitionSchema = WorkflowDefinitionSchema.describe(
|
|
7487
|
-
`Inline workflow DAG: { id, label?, params?: [{ name, type: string|number|boolean|json, required?, label?, description?, inputType?, cardinality?: one|many, default? }], nodes: [{ id, task (one of the model tasks listed), model (catalog id, e.g. fal/nano-banana-2-edit), inputs, retry? }] }. Node inputs are bindings: {kind:"literal",value}, {kind:"param",name,wrap?:"array"}, {kind:"ref",node,path:"url",wrap?:"array"} or an ordered {kind:"list",items:[...]} of those. Image-edit nodes take inputImages (an array: one wrapped ref/param, or a list in reference order, scene frame first); image-to-video nodes take inputImageUrl (start frame) and optionally endImageUrl (end frame, on models that accept one), EXCEPT on a keyframes model (fal/flux-3-keyframes-to-video and its -draft tier), which instead takes keyframeImageUrls (an ordered list of up to 10 images) with keyframeFrameIndexes (one strictly increasing frame per image on a fixed 24 fps timeline). Pass one shape or the other, never both. To hold a character's identity through the clip, an image-to-video node on a model with character references (route/kling-o3
|
|
7542
|
+
`Inline workflow DAG: { id, label?, params?: [{ name, type: string|number|boolean|json, required?, label?, description?, inputType?, cardinality?: one|many, default? }], nodes: [{ id, task (one of the model tasks listed), model (catalog id, e.g. fal/nano-banana-2-edit), inputs, retry? }] }. Node inputs are bindings: {kind:"literal",value}, {kind:"param",name,wrap?:"array"}, {kind:"ref",node,path:"url",wrap?:"array"} or an ordered {kind:"list",items:[...]} of those. Image-edit nodes take inputImages (an array: one wrapped ref/param, or a list in reference order, scene frame first); image-to-video nodes take inputImageUrl (start frame) and optionally endImageUrl (end frame, on models that accept one), EXCEPT on a keyframes model (fal/flux-3-keyframes-to-video and its -draft tier), which instead takes keyframeImageUrls (an ordered list of up to 10 images) with keyframeFrameIndexes (one strictly increasing frame per image on a fixed 24 fps timeline). Pass one shape or the other, never both. To hold a character's identity through the clip, an image-to-video node on a model with character references (route/kling-o3 or fal/kling-o3-pro-reference-to-video; a model pinned to KIE, kie/..., is not available for images of people and refuses a run whose node carries a character, a try-on, a swap or an uploaded or referenced image or video, so use the fal or route/ entry for those) also takes referenceImageUrls (a list of character photos, grouped by character, each character's frontal view first, 2 to 4 images per character, up to 3 characters) with referenceElementIndexes (the 0-based character of each image, ascending without gaps, e.g. [0,0,0,1,1]); they never count as the start or end frame, and they need inputImageUrl. kie/gemini-omni-flash-1-1-reference-to-video takes the same two fields with 1 to 6 character images in all and no end frame: its start frame goes in as reference image 1, named in the prompt as the exact scene and first frame, because KIE does not lock a first frame in its reference mode. It runs on KIE, so while Studio keeps people off KIE it is refused for character references like every other kie/ model.`
|
|
7488
7543
|
);
|
|
7489
7544
|
var studioRunWorkflow = defineTool({
|
|
7490
7545
|
name: "studio_run_workflow",
|
|
7491
|
-
description: `Run a generation workflow DAG. Pass an inline definition (nodes of provider calls wired by ref bindings; this is what the hosted Studio accepts) or the savedId of a workflow saved in the Studio (the Studio runs that workflow's current document, exactly what the canvas would run). Params fill {kind:"param"} bindings. Returns the runId plus per-node status, URLs and cost; with wait=true (default) it blocks until the run is terminal (succeeded, failed, partial, cancelled). Each node becomes a paid job. Use an inline definition ONLY for the first batch of a new deliverable (one workflow, a node per item, a stable label); a follow-up on an existing item belongs in that saved workflow as a new node (studio_workflow_apply: addNode plus connect from the node it refines) run here with savedId and nodeIds, because every listed inline run is saved as its own workflow. A clip with both a start and an end frame is checked for continuity before it is paid for (see acknowledgeContinuity).`,
|
|
7546
|
+
description: `Run a generation workflow DAG. Pass an inline definition (nodes of provider calls wired by ref bindings; this is what the hosted Studio accepts) or the savedId of a workflow saved in the Studio (the Studio runs that workflow's current document, exactly what the canvas would run). Params fill {kind:"param"} bindings. Returns the runId plus per-node status, URLs and cost; with wait=true (default) it blocks until the run is terminal (succeeded, failed, partial, cancelled). Each node becomes a paid job. Use an inline definition ONLY for the first batch of a new deliverable (one workflow, a node per item, a stable label); a follow-up on an existing item belongs in that saved workflow as a new node (studio_workflow_apply: addNode plus connect from the node it refines) run here with savedId and nodeIds, because every listed inline run is saved as its own workflow. A clip with both a start and an end frame is checked for continuity before it is paid for (see acknowledgeContinuity). A video-to-video node is priced by its source clip's length, which the Studio measures before admission; a source it cannot measure (or one whose length is not known before the run) refuses with 422 { code: "source_length_unknown", nodeId } before anything is spent.`,
|
|
7492
7547
|
inputSchema: {
|
|
7493
7548
|
projectId: z12.string().min(1).describe("Project id from studio_list_projects."),
|
|
7494
7549
|
definition: workflowDefinitionSchema.optional(),
|
|
@@ -7504,7 +7559,7 @@ var studioRunWorkflow = defineTool({
|
|
|
7504
7559
|
'S6b: hard cap on the estimated cost, verified server-side before anything is created. An unverifiable estimate (a credits-only or unpriced executing node) refuses too, never proceeds silently. Refusal: { code: "budget_exceeded", estimate }. For `runs`>1 this is the AGGREGATE cap across every iteration.'
|
|
7505
7560
|
),
|
|
7506
7561
|
confirm: z12.boolean().optional().describe(
|
|
7507
|
-
'S6b: bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", estimate }.'
|
|
7562
|
+
'S6b: bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", reason: "threshold", estimate }. A run with a video-to-video or enhance node is priced by a clip length the server measures, so it refuses with { code: "confirmation_required", reason: "measured_length", estimate } at any figure: show the person estimate.totalUsd and resend with confirm: true only after they agree.'
|
|
7508
7563
|
),
|
|
7509
7564
|
acknowledgeContinuity: z12.boolean().optional().describe(
|
|
7510
7565
|
'Run despite the continuity check. Before a run executes an image-to-video node with BOTH a start frame (inputImageUrl) and an end frame (endImageUrl), the Studio compares the two frames with a vision model (one small paid check per new pair of frames, remembered for your company, so an unchanged pair is never charged twice): a person or a held object in one frame and not the other makes the video model invent or erase it mid-clip. Frames that disagree refuse with { code: "continuity_mismatch", nodes: [{ nodeId, differences }] }; a check that could not run refuses with { code: "continuity_unchecked", nodes: [{ nodeId, reason }] }. Nothing is spent on either. Show the differences to the person you act for and fix the frames; pass true only when they decide to run anyway.'
|
|
@@ -7718,7 +7773,7 @@ var studioRunPublished = defineTool({
|
|
|
7718
7773
|
'Hard cap on the estimated cost, verified server-side before anything is created. An unverifiable estimate (a credits-only or unpriced executing node) refuses too. Refusal: { code: "budget_exceeded", estimate }.'
|
|
7719
7774
|
),
|
|
7720
7775
|
confirm: z12.boolean().optional().describe(
|
|
7721
|
-
'Bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", estimate }.'
|
|
7776
|
+
'Bypasses the confirmation threshold for this one request (a flat $10 today) when the estimate meets or exceeds it. Without this, such a run refuses with { code: "confirmation_required", reason: "threshold", estimate }. A recipe with a video-to-video or enhance node is priced by a clip length the server measures, so it refuses with { code: "confirmation_required", reason: "measured_length", estimate } at any figure: show the person estimate.totalUsd and resend with confirm: true only after they agree.'
|
|
7722
7777
|
),
|
|
7723
7778
|
likenessRightsConfirmed: z12.literal(true).optional().describe(`Required when the recipe creates a character; ignored otherwise. ${likenessConfirmationToolDescription()}`),
|
|
7724
7779
|
acknowledgeContinuity: z12.boolean().optional().describe(
|
|
@@ -7837,7 +7892,7 @@ function registerTools(server, base) {
|
|
|
7837
7892
|
|
|
7838
7893
|
// src/server.ts
|
|
7839
7894
|
var SERVER_NAME = "lumitra-studio";
|
|
7840
|
-
var SERVER_VERSION = "0.
|
|
7895
|
+
var SERVER_VERSION = "0.18.0";
|
|
7841
7896
|
function createStudioMcpServer(opts = {}) {
|
|
7842
7897
|
const config = opts.config ?? resolveConfig(opts.env ?? process.env);
|
|
7843
7898
|
const client = new StudioClient(config, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marlinjai/studio-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Model Context Protocol (MCP) server over the Lumitra Studio HTTP API: generate images, mint characters, run workflows, swap characters into video.",
|
|
6
6
|
"license": "MIT",
|