@sogni-ai/sogni-client 5.79.0 → 5.80.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/CHANGELOG.md +15 -0
- package/README.md +85 -0
- package/dist/Chat/_hostedToolsManifest.generated.js +20 -7
- package/dist/Chat/_hostedToolsManifest.generated.js.map +1 -1
- package/dist/Projects/createJobRequestMessage.js +72 -30
- package/dist/Projects/createJobRequestMessage.js.map +1 -1
- package/dist/Projects/index.d.ts +2 -0
- package/dist/Projects/index.js +11 -0
- package/dist/Projects/index.js.map +1 -1
- package/dist/Projects/types/index.d.ts +89 -3
- package/dist/Projects/types/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/getUUID.d.ts +11 -0
- package/dist/lib/getUUID.js +32 -3
- package/dist/lib/getUUID.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist-esm/Chat/_hostedToolsManifest.generated.js +20 -7
- package/dist-esm/Chat/_hostedToolsManifest.generated.js.map +1 -1
- package/dist-esm/Projects/createJobRequestMessage.js +72 -30
- package/dist-esm/Projects/createJobRequestMessage.js.map +1 -1
- package/dist-esm/Projects/index.js +11 -0
- package/dist-esm/Projects/index.js.map +1 -1
- package/dist-esm/Projects/types/index.js.map +1 -1
- package/dist-esm/index.js.map +1 -1
- package/dist-esm/lib/getUUID.js +32 -3
- package/dist-esm/lib/getUUID.js.map +1 -1
- package/dist-esm/version.js +1 -1
- package/llms-full.txt +85 -0
- package/llms.txt +85 -0
- package/package.json +3 -3
- package/src/Chat/_hostedToolsManifest.generated.ts +20 -7
- package/src/Projects/createJobRequestMessage.ts +112 -20
- package/src/Projects/index.ts +11 -0
- package/src/Projects/types/index.ts +95 -3
- package/src/index.ts +6 -0
- package/src/lib/getUUID.ts +33 -4
- package/src/version.ts +1 -1
package/llms-full.txt
CHANGED
|
@@ -2901,3 +2901,88 @@ coordinates against the complete source frame. Inputs must be constant-frame-rat
|
|
|
2901
2901
|
SDR video, up to 30 seconds, 900 frames, 2560 pixels on either edge and 100 MB.
|
|
2902
2902
|
|
|
2903
2903
|
See `examples/workflow_sam3_video_segment.mjs` for a runnable paid request.
|
|
2904
|
+
|
|
2905
|
+
#### Selection options
|
|
2906
|
+
|
|
2907
|
+
`sam3VideoPrompt` takes four more fields. They are optional and off by default.
|
|
2908
|
+
A prompt without them runs and is priced exactly as before. They run on Comfy
|
|
2909
|
+
worker 1.0.253 or newer; if none is online, the request is refused at once with
|
|
2910
|
+
error 4044 and nothing is charged.
|
|
2911
|
+
|
|
2912
|
+
`mask` selects a region you draw, instead of `text`, `points` or `boxes`.
|
|
2913
|
+
`polygons` holds 1 to 64 rings of normalized `[x, y]` points, 3 to 2048 points
|
|
2914
|
+
per ring and 4096 per region. A ring inside another ring is a hole.
|
|
2915
|
+
|
|
2916
|
+
```javascript
|
|
2917
|
+
sam3VideoPrompt: {
|
|
2918
|
+
frameIndex: 0,
|
|
2919
|
+
mask: { polygons: [[[0.42, 0.18], [0.58, 0.18], [0.61, 0.55], [0.39, 0.55]]] }
|
|
2920
|
+
}
|
|
2921
|
+
```
|
|
2922
|
+
|
|
2923
|
+
The region starts the tracker on its prompt frame, as a click does. That
|
|
2924
|
+
frame's mask is the tracker's own shape for the region, not the exact drawing,
|
|
2925
|
+
so a looping clip does not jump between its last and first frames. Draw the
|
|
2926
|
+
region tight: background, or something in front of the object, inside the
|
|
2927
|
+
region stays in the mask for several frames before the tracker corrects it.
|
|
2928
|
+
`mask` cannot be combined with `text`, `points`, `boxes`, `threshold` or
|
|
2929
|
+
`multimask`, and `objectIndex` must be 0 or left out. A region that covers no
|
|
2930
|
+
pixel of the source frame is refused and not charged.
|
|
2931
|
+
|
|
2932
|
+
`objects` tracks 2 to 16 things together, one selection each, and requires
|
|
2933
|
+
`combine: "union"`. Every output frame is the union of their masks. All the
|
|
2934
|
+
selections refer to the top-level `frameIndex`. Use it for a crowd or several
|
|
2935
|
+
separate things: one selection that covers several similar things settles on
|
|
2936
|
+
just one of them. Top-level `text`, `points`, `boxes`, `mask`, `threshold`,
|
|
2937
|
+
`multimask` and `objectIndex` are refused alongside `objects`.
|
|
2938
|
+
|
|
2939
|
+
```javascript
|
|
2940
|
+
sam3VideoPrompt: {
|
|
2941
|
+
combine: "union",
|
|
2942
|
+
objects: [
|
|
2943
|
+
{ points: [{ x: 0.21, y: 0.48, label: "positive" }] },
|
|
2944
|
+
{ points: [{ x: 0.52, y: 0.45, label: "positive" }] }
|
|
2945
|
+
]
|
|
2946
|
+
}
|
|
2947
|
+
```
|
|
2948
|
+
|
|
2949
|
+
`frames` selects the same thing on 2 to 8 different frames, each entry with its
|
|
2950
|
+
own `frameIndex` and selection. Each output frame follows the nearest prompted
|
|
2951
|
+
frame; ties go to the earlier one. For a loop whose first and last frames are
|
|
2952
|
+
the same still, select the same thing on frame 0 and on the last frame. You can
|
|
2953
|
+
also add a middle frame to correct drift. `frames` cannot be combined with
|
|
2954
|
+
`objects`, a top-level `frameIndex` or a top-level selection.
|
|
2955
|
+
|
|
2956
|
+
```javascript
|
|
2957
|
+
sam3VideoPrompt: {
|
|
2958
|
+
frames: [
|
|
2959
|
+
{ frameIndex: 0, points: [{ x: 0.47, y: 0.62, label: "positive" }] },
|
|
2960
|
+
{ frameIndex: 120, points: [{ x: 0.47, y: 0.62, label: "positive" }] }
|
|
2961
|
+
]
|
|
2962
|
+
}
|
|
2963
|
+
```
|
|
2964
|
+
|
|
2965
|
+
`memory` sets how tracking carries between 32-frame chunks. `"chunk"`, the
|
|
2966
|
+
default and the original behaviour, starts each chunk from the previous
|
|
2967
|
+
chunk's last mask; an object lost at the end of a chunk is not found again.
|
|
2968
|
+
`"anchor"` starts each chunk again from the prompt frame and its selection:
|
|
2969
|
+
errors do not carry over and a lost object can be found again, but the mask
|
|
2970
|
+
can shift where a chunk starts. It works with any of the other options.
|
|
2971
|
+
|
|
2972
|
+
```javascript
|
|
2973
|
+
sam3VideoPrompt: { text: "unicorn horn", frameIndex: 127, memory: "anchor" }
|
|
2974
|
+
```
|
|
2975
|
+
|
|
2976
|
+
A prompt holds at most 4096 region points across all its objects and frames.
|
|
2977
|
+
|
|
2978
|
+
Each object after the first adds 8% of one selection's work, and anchor memory
|
|
2979
|
+
adds 1/31. `frames` and `mask` add nothing. Pass the job's own
|
|
2980
|
+
`sam3VideoPrompt` to `estimateVideoCost()` and the quote includes them:
|
|
2981
|
+
|
|
2982
|
+
```javascript
|
|
2983
|
+
const quote = await sogni.projects.estimateVideoCost({
|
|
2984
|
+
tokenType: "spark", model: "sam3_video_segment_fp16",
|
|
2985
|
+
width: 1920, height: 1080, frames: 121, fps: 24, steps: 1,
|
|
2986
|
+
sam3VideoPrompt
|
|
2987
|
+
});
|
|
2988
|
+
```
|
package/llms.txt
CHANGED
|
@@ -1217,3 +1217,88 @@ coordinates against the complete source frame. Inputs must be constant-frame-rat
|
|
|
1217
1217
|
SDR video, up to 30 seconds, 900 frames, 2560 pixels on either edge and 100 MB.
|
|
1218
1218
|
|
|
1219
1219
|
See `examples/workflow_sam3_video_segment.mjs` for a runnable paid request.
|
|
1220
|
+
|
|
1221
|
+
#### Selection options
|
|
1222
|
+
|
|
1223
|
+
`sam3VideoPrompt` takes four more fields. They are optional and off by default.
|
|
1224
|
+
A prompt without them runs and is priced exactly as before. They run on Comfy
|
|
1225
|
+
worker 1.0.253 or newer; if none is online, the request is refused at once with
|
|
1226
|
+
error 4044 and nothing is charged.
|
|
1227
|
+
|
|
1228
|
+
`mask` selects a region you draw, instead of `text`, `points` or `boxes`.
|
|
1229
|
+
`polygons` holds 1 to 64 rings of normalized `[x, y]` points, 3 to 2048 points
|
|
1230
|
+
per ring and 4096 per region. A ring inside another ring is a hole.
|
|
1231
|
+
|
|
1232
|
+
```javascript
|
|
1233
|
+
sam3VideoPrompt: {
|
|
1234
|
+
frameIndex: 0,
|
|
1235
|
+
mask: { polygons: [[[0.42, 0.18], [0.58, 0.18], [0.61, 0.55], [0.39, 0.55]]] }
|
|
1236
|
+
}
|
|
1237
|
+
```
|
|
1238
|
+
|
|
1239
|
+
The region starts the tracker on its prompt frame, as a click does. That
|
|
1240
|
+
frame's mask is the tracker's own shape for the region, not the exact drawing,
|
|
1241
|
+
so a looping clip does not jump between its last and first frames. Draw the
|
|
1242
|
+
region tight: background, or something in front of the object, inside the
|
|
1243
|
+
region stays in the mask for several frames before the tracker corrects it.
|
|
1244
|
+
`mask` cannot be combined with `text`, `points`, `boxes`, `threshold` or
|
|
1245
|
+
`multimask`, and `objectIndex` must be 0 or left out. A region that covers no
|
|
1246
|
+
pixel of the source frame is refused and not charged.
|
|
1247
|
+
|
|
1248
|
+
`objects` tracks 2 to 16 things together, one selection each, and requires
|
|
1249
|
+
`combine: "union"`. Every output frame is the union of their masks. All the
|
|
1250
|
+
selections refer to the top-level `frameIndex`. Use it for a crowd or several
|
|
1251
|
+
separate things: one selection that covers several similar things settles on
|
|
1252
|
+
just one of them. Top-level `text`, `points`, `boxes`, `mask`, `threshold`,
|
|
1253
|
+
`multimask` and `objectIndex` are refused alongside `objects`.
|
|
1254
|
+
|
|
1255
|
+
```javascript
|
|
1256
|
+
sam3VideoPrompt: {
|
|
1257
|
+
combine: "union",
|
|
1258
|
+
objects: [
|
|
1259
|
+
{ points: [{ x: 0.21, y: 0.48, label: "positive" }] },
|
|
1260
|
+
{ points: [{ x: 0.52, y: 0.45, label: "positive" }] }
|
|
1261
|
+
]
|
|
1262
|
+
}
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
`frames` selects the same thing on 2 to 8 different frames, each entry with its
|
|
1266
|
+
own `frameIndex` and selection. Each output frame follows the nearest prompted
|
|
1267
|
+
frame; ties go to the earlier one. For a loop whose first and last frames are
|
|
1268
|
+
the same still, select the same thing on frame 0 and on the last frame. You can
|
|
1269
|
+
also add a middle frame to correct drift. `frames` cannot be combined with
|
|
1270
|
+
`objects`, a top-level `frameIndex` or a top-level selection.
|
|
1271
|
+
|
|
1272
|
+
```javascript
|
|
1273
|
+
sam3VideoPrompt: {
|
|
1274
|
+
frames: [
|
|
1275
|
+
{ frameIndex: 0, points: [{ x: 0.47, y: 0.62, label: "positive" }] },
|
|
1276
|
+
{ frameIndex: 120, points: [{ x: 0.47, y: 0.62, label: "positive" }] }
|
|
1277
|
+
]
|
|
1278
|
+
}
|
|
1279
|
+
```
|
|
1280
|
+
|
|
1281
|
+
`memory` sets how tracking carries between 32-frame chunks. `"chunk"`, the
|
|
1282
|
+
default and the original behaviour, starts each chunk from the previous
|
|
1283
|
+
chunk's last mask; an object lost at the end of a chunk is not found again.
|
|
1284
|
+
`"anchor"` starts each chunk again from the prompt frame and its selection:
|
|
1285
|
+
errors do not carry over and a lost object can be found again, but the mask
|
|
1286
|
+
can shift where a chunk starts. It works with any of the other options.
|
|
1287
|
+
|
|
1288
|
+
```javascript
|
|
1289
|
+
sam3VideoPrompt: { text: "unicorn horn", frameIndex: 127, memory: "anchor" }
|
|
1290
|
+
```
|
|
1291
|
+
|
|
1292
|
+
A prompt holds at most 4096 region points across all its objects and frames.
|
|
1293
|
+
|
|
1294
|
+
Each object after the first adds 8% of one selection's work, and anchor memory
|
|
1295
|
+
adds 1/31. `frames` and `mask` add nothing. Pass the job's own
|
|
1296
|
+
`sam3VideoPrompt` to `estimateVideoCost()` and the quote includes them:
|
|
1297
|
+
|
|
1298
|
+
```javascript
|
|
1299
|
+
const quote = await sogni.projects.estimateVideoCost({
|
|
1300
|
+
tokenType: "spark", model: "sam3_video_segment_fp16",
|
|
1301
|
+
width: 1920, height: 1080, frames: 121, fps: 24, steps: 1,
|
|
1302
|
+
sam3VideoPrompt
|
|
1303
|
+
});
|
|
1304
|
+
```
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "5.
|
|
6
|
+
"version": "5.80.0",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=22"
|
|
9
9
|
},
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
"test:project-cancellation": "npm run build && node scripts/check-project-cancellation.cjs",
|
|
99
99
|
"test:project-request-session": "npm run build && node scripts/check-project-request-session.cjs",
|
|
100
100
|
"test:auth-session": "npm run build && node scripts/check-auth-session.cjs",
|
|
101
|
+
"test:uuid": "npm run build && node scripts/check-uuid.cjs",
|
|
101
102
|
"test:account-login": "npm run build && node scripts/check-account-login.cjs",
|
|
102
103
|
"test:project-timeouts": "npm run build && node scripts/check-project-timeouts.cjs",
|
|
103
104
|
"test:project-recovery": "npm run build && node scripts/check-project-recovery.cjs",
|
|
@@ -142,8 +143,7 @@
|
|
|
142
143
|
},
|
|
143
144
|
"homepage": "https://github.com/Sogni-AI/sogni-client#readme",
|
|
144
145
|
"dependencies": {
|
|
145
|
-
"@
|
|
146
|
-
"@sogni-ai/sogni-protocol": "1.0.0-alpha.59",
|
|
146
|
+
"@sogni-ai/sogni-protocol": "1.0.0-alpha.60",
|
|
147
147
|
"@types/js-cookie": "^3.0.6",
|
|
148
148
|
"@types/lodash": "^4.17.23",
|
|
149
149
|
"@types/ws": "^8.5.13",
|
|
@@ -56,7 +56,7 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
|
|
|
56
56
|
"gpt-image-2.6-sunburst",
|
|
57
57
|
"gpt-image-2.6-flare"
|
|
58
58
|
],
|
|
59
|
-
"description": "DO NOT SET THIS PARAMETER unless the user names a specific model, requests an animated GIF, asks for a very complex image render, asks for a video storyboard/storyboard sheet/contact sheet/panel layout image, asks for anime without naming a model, requests permitted NSFW/nudity content, or explicitly asks for Z-image/Z-image Turbo/Krea 2 Turbo image-to-image. The app auto-selects based on quality settings. For an animated GIF, select gpt-image-2.6-flare unless the user names another compatible 2.6 variant; use generate_image
|
|
59
|
+
"description": "DO NOT SET THIS PARAMETER unless the user names a specific model, requests an animated GIF, asks for a very complex image render, asks for a video storyboard/storyboard sheet/contact sheet/panel layout image, asks for anime without naming a model, requests permitted NSFW/nudity content, or explicitly asks for Z-image/Z-image Turbo/Krea 2 Turbo image-to-image. The app auto-selects based on quality settings. For an animated GIF, select gpt-image-2.6-flare unless the user names another compatible 2.6 variant; use generate_image without references, or edit_image when reference images guide the animation. Set \"gpt-image-2.5-flare\" when the user asks for a ChatGPT, OpenAI, GPT, or GPT Image image/model without naming a version. Set \"gpt-image-2\" only when the user explicitly names GPT Image 2, GPT-2, or gpt-image-2; GPT Image 2 is never a default. Set \"gpt-image-2.5-sunburst\" when the user explicitly requests very strong text rendering, and by default for video storyboards and other complex single-image renders that need dense labels, crisp typography, multi-panel composition, timing notes, foley notes, professional storyboard-sheet layout, or a comprehensive character/mascot/model sheet with turnarounds, expressions, accessories, palette swatches, and brand notes. Set \"one-obsession-v22\" when the user asks for an anime or anime-style image and has not named a specific image model. Set \"z-turbo\" when the user asks for Z-image Turbo; set \"z-image\" when they ask for Z-image without Turbo. Set \"krea-2-turbo\" when the user asks for Krea 2 Turbo. Set \"flux-3-klein\" when the user asks for FLUX 3 or FLUX 3 Image Klein. If the user names another image model, honor that requested model instead. A model preference usually does not change which tool to use; the Z-image and Krea 2 Turbo image-to-image exception uses sourceImageIndex plus starting_image_strength on this tool. NSFW rule: GPT Image models and Qwen image models CANNOT do nudity. For permitted NSFW/nudity content, prefer \"dark-beast-krea2\", then \"dark-beast-z-turbo\"; \"chroma1-hd\", \"pony-v7\", \"chroma-detail\", \"chroma-v46-flash\", \"z-turbo\", \"moss-image\", and \"moss-image-8step\" are compatible fallbacks. GPT Image 2.5 adds two distinct models: use \"gpt-image-2.5-sunburst\" for an explicit Sunburst request and \"gpt-image-2.5-flare\" for an explicit Flare request. For GPT Image 2.5 without a named variant, use Flare. Preserve explicit GPT Image 2.0 as \"gpt-image-2\". Sunburst is positioned for difficult images and precise edits; Flare for faster everyday generation. Both generate and edit. Model choice is independent of rendering quality. Set \"moss-image\" when the user requests MOSS-Image or MOSS-Image SFT. Set \"moss-image-8step\" when the user requests MOSS 8-step or MOSS DMD; this preset uses 8 steps and guidance 1. Both MOSS presets are uncensored and support compatible Personal LoRAs. MOSS-Image SFT is text-to-image only; it has no uploaded-image instruction-editing input. For its JSON layouts, send one complete literal layout per call; numberOfVariations varies seeds. Use separate calls for different layouts, and do not put Dynamic Prompt choices inside layout JSON."
|
|
60
60
|
},
|
|
61
61
|
"width": {
|
|
62
62
|
"type": "number",
|
|
@@ -112,7 +112,7 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
|
|
|
112
112
|
"webp",
|
|
113
113
|
"gif"
|
|
114
114
|
],
|
|
115
|
-
"description": "
|
|
115
|
+
"description": "Set only when the user explicitly requests a file format. Otherwise leave outputFormat unset. GIF requires GPT Image 2.6. Use edit_image when reference images guide the animation. Normalize jpeg to jpg."
|
|
116
116
|
},
|
|
117
117
|
"aspectRatio": {
|
|
118
118
|
"type": "string",
|
|
@@ -542,7 +542,7 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
|
|
|
542
542
|
"type": "function",
|
|
543
543
|
"function": {
|
|
544
544
|
"name": "edit_image",
|
|
545
|
-
"description": "Generate images guided by reference photos. Supports GPT Image 2 up to 16 images, FLUX 3 Image Klein up to 10 images, Qwen up to 3 images, and Krea 2 Identity Edit / Dark Beast Krea 2 Identity Edit up to 2 images. Best for style-guided generation, combining elements from multiple images, ANY persona image creation, identity-preserving Krea edits, and any uploaded brand asset reuse — logos, brand marks, mascots, product shots, photos, screenshots, sketches, or character designs the user expects to appear in or guide the result. ALWAYS use this (never generate_image) when persona photos OR uploaded image assets meant for reuse are in context — even if a specific edit model is requested. Exception: explicit Z-image/Z-image Turbo/Krea 2 Turbo uploaded-image enhancement uses generate_image with sourceImageIndex and starting_image_strength because those base image-to-image models are not edit_image models. If a previous edit_image attempt did not preserve the uploaded asset well, stay on edit_image and tighten the prompt or switch model; generate_image has no access to the upload.",
|
|
545
|
+
"description": "Generate images guided by reference photos. Supports GPT Image 2 up to 16 images, FLUX 3 Image Klein up to 10 images, Qwen up to 3 images, and Krea 2 Identity Edit / Dark Beast Krea 2 Identity Edit up to 2 images. Best for style-guided generation, combining elements from multiple images, ANY persona image creation, identity-preserving Krea edits, and any uploaded brand asset reuse — logos, brand marks, mascots, product shots, photos, screenshots, sketches, or character designs the user expects to appear in or guide the result. ALWAYS use this (never generate_image) when persona photos OR uploaded image assets meant for reuse are in context — even if a specific edit model is requested. Exception: explicit Z-image/Z-image Turbo/Krea 2 Turbo uploaded-image enhancement uses generate_image with sourceImageIndex and starting_image_strength because those base image-to-image models are not edit_image models. If a previous edit_image attempt did not preserve the uploaded asset well, stay on edit_image and tighten the prompt or switch model; generate_image has no access to the upload. For an animated GIF, select gpt-image-2.6-flare unless the user names another compatible 2.6 variant; use edit_image when reference images guide the animation and generate_image otherwise. Set outputFormat=gif and describe the motion and loop. GIF output cannot combine with masks or markup.",
|
|
546
546
|
"parameters": {
|
|
547
547
|
"type": "object",
|
|
548
548
|
"properties": {
|
|
@@ -564,7 +564,7 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
|
|
|
564
564
|
"gpt-image-2.6-sunburst",
|
|
565
565
|
"gpt-image-2.6-flare"
|
|
566
566
|
],
|
|
567
|
-
"description": "The app auto-selects Fast→Qwen Lightning and HQ/Pro→full Qwen only for ordinary identity-neutral edits. REQUIRED IDENTITY DEFAULT: set \"krea-identity-edit\" whenever an edit of a referenced person or character must keep likeness or character identity while changing clothing, hair or makeup, pose or position, face/head/body, background, lighting, or visual style. Infer that semantic intent in any language; never route from keyword or regex matching. Also use it for a non-Pro single-character sheet. This default applies even when the user did not name Krea; an explicitly requested model always wins. Set \"dark-beast-krea2-identity-edit\" only when the user explicitly requests that model, its uncensored/community variant, or dark_beast_krea2_identity_edit_v1_2. Set \"gpt-image-2\" only when the user explicitly names legacy GPT Image 2 (GPT Image 2, GPT-2, or gpt-image-2); it is never a default. A ChatGPT, OpenAI, GPT, or GPT Image edit request that names no version uses \"gpt-image-2.5-flare\". Set \"gpt-image-2.5-sunburst\" when precise typography, dense labels, or a professional multi-panel layout is the primary requirement; Pro character sheets use Sunburst unless the user names another model. If GPT Image 2.5 Sunburst is unavailable for detail-critical layout work, fall back to full \"qwen\", never \"qwen-lightning\". Krea identity edit models require at least one reference image, accept up to two context images, and work best at 512-2048px. Set \"flux-3-klein\" when the user asks for FLUX 3 or FLUX 3 Image Klein; it accepts 1-10 reference images and works at 256-4096px, including 4K. For it, describe the whole result as a full scene caption that folds the requested change into a description of the reference, and refer to references in order (the first image, the second image); guidance is fixed and a negative prompt has no effect, so do not send one. Let the model tier and worker choose current steps, guidance, sampler, scheduler, grounding, and reference-boost defaults; do not send a negative prompt. When Krea is selected, override the generic prompt-length guidance with a concise 1-4 sentence delta instruction; name only the requested change and details that must remain fixed. Put the base scene/image first and an optional person/detail reference second. Z-image, Z-image Turbo, and base Krea 2 Turbo are generate_image img2img models, not edit_image selectors. If the user names another edit/image model, honor it. GPT Image 2 always processes input images at high fidelity; do not set input_fidelity. GPT Image 2.5 adds two distinct models: use \"gpt-image-2.5-sunburst\" for an explicit Sunburst request and \"gpt-image-2.5-flare\" for an explicit Flare request. For GPT Image 2.5 without a named variant, use Flare. Preserve explicit GPT Image 2.0 as \"gpt-image-2\". Sunburst is positioned for difficult images and precise edits; Flare for faster everyday generation. Both generate and edit. Model choice is independent of rendering quality."
|
|
567
|
+
"description": "The app auto-selects Fast→Qwen Lightning and HQ/Pro→full Qwen only for ordinary identity-neutral edits. REQUIRED IDENTITY DEFAULT: set \"krea-identity-edit\" whenever an edit of a referenced person or character must keep likeness or character identity while changing clothing, hair or makeup, pose or position, face/head/body, background, lighting, or visual style. Infer that semantic intent in any language; never route from keyword or regex matching. Also use it for a non-Pro single-character sheet. This default applies even when the user did not name Krea; an explicitly requested model always wins. Set \"dark-beast-krea2-identity-edit\" only when the user explicitly requests that model, its uncensored/community variant, or dark_beast_krea2_identity_edit_v1_2. Set \"gpt-image-2\" only when the user explicitly names legacy GPT Image 2 (GPT Image 2, GPT-2, or gpt-image-2); it is never a default. A ChatGPT, OpenAI, GPT, or GPT Image edit request that names no version uses \"gpt-image-2.5-flare\". Set \"gpt-image-2.5-sunburst\" when precise typography, dense labels, or a professional multi-panel layout is the primary requirement; Pro character sheets use Sunburst unless the user names another model. If GPT Image 2.5 Sunburst is unavailable for detail-critical layout work, fall back to full \"qwen\", never \"qwen-lightning\". Krea identity edit models require at least one reference image, accept up to two context images, and work best at 512-2048px. Set \"flux-3-klein\" when the user asks for FLUX 3 or FLUX 3 Image Klein; it accepts 1-10 reference images and works at 256-4096px, including 4K. For it, describe the whole result as a full scene caption that folds the requested change into a description of the reference, and refer to references in order (the first image, the second image); guidance is fixed and a negative prompt has no effect, so do not send one. Let the model tier and worker choose current steps, guidance, sampler, scheduler, grounding, and reference-boost defaults; do not send a negative prompt. When Krea is selected, override the generic prompt-length guidance with a concise 1-4 sentence delta instruction; name only the requested change and details that must remain fixed. Put the base scene/image first and an optional person/detail reference second. Z-image, Z-image Turbo, and base Krea 2 Turbo are generate_image img2img models, not edit_image selectors. If the user names another edit/image model, honor it. GPT Image 2 always processes input images at high fidelity; do not set input_fidelity. GPT Image 2.5 adds two distinct models: use \"gpt-image-2.5-sunburst\" for an explicit Sunburst request and \"gpt-image-2.5-flare\" for an explicit Flare request. For GPT Image 2.5 without a named variant, use Flare. Preserve explicit GPT Image 2.0 as \"gpt-image-2\". Sunburst is positioned for difficult images and precise edits; Flare for faster everyday generation. Both generate and edit. Model choice is independent of rendering quality. For an animated GIF, select gpt-image-2.6-flare unless the user names another compatible 2.6 variant; use edit_image when reference images guide the animation and generate_image otherwise. Set outputFormat=gif and describe the motion and loop. GIF output cannot combine with masks or markup."
|
|
568
568
|
},
|
|
569
569
|
"sourceImageIndex": {
|
|
570
570
|
"type": "number",
|
|
@@ -605,9 +605,10 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
|
|
|
605
605
|
"png",
|
|
606
606
|
"jpg",
|
|
607
607
|
"jpeg",
|
|
608
|
-
"webp"
|
|
608
|
+
"webp",
|
|
609
|
+
"gif"
|
|
609
610
|
],
|
|
610
|
-
"description": "
|
|
611
|
+
"description": "Set only when the user explicitly requests a file format. Otherwise leave outputFormat unset. GIF requires GPT Image 2.6 Sunburst or Flare and supports ordered reference images; masks and markup cannot combine with GIF. Hosts should normalize \"jpeg\" to the Sogni project format \"jpg\"."
|
|
611
612
|
},
|
|
612
613
|
"personaName": {
|
|
613
614
|
"type": "string",
|
|
@@ -663,6 +664,18 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
|
|
|
663
664
|
"markup_image_url": {
|
|
664
665
|
"type": "string",
|
|
665
666
|
"description": "GPT Image 2.6 edit annotation layer for the first reference. Cannot combine with mask_image_url."
|
|
667
|
+
},
|
|
668
|
+
"gptImageFrameCount": {
|
|
669
|
+
"type": "integer",
|
|
670
|
+
"minimum": 2,
|
|
671
|
+
"maximum": 16,
|
|
672
|
+
"description": "GPT Image 2.6 GIF only: frame count, default 9. Frames must fit the request pixel budget."
|
|
673
|
+
},
|
|
674
|
+
"gptImageFrameDurationMs": {
|
|
675
|
+
"type": "integer",
|
|
676
|
+
"minimum": 20,
|
|
677
|
+
"maximum": 2000,
|
|
678
|
+
"description": "GPT Image 2.6 GIF only: milliseconds per frame, rounded to 10 ms; default 200."
|
|
666
679
|
}
|
|
667
680
|
},
|
|
668
681
|
"required": [
|
|
@@ -733,7 +746,7 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
|
|
|
733
746
|
"fast",
|
|
734
747
|
"hq"
|
|
735
748
|
],
|
|
736
|
-
"description": "DO NOT SET THIS PARAMETER unless the user explicitly asks for \"high quality\" or \"fast\". The app auto-selects based on quality settings.
|
|
749
|
+
"description": "DO NOT SET THIS PARAMETER unless the user explicitly asks for \"high quality\" or \"fast\". The app auto-selects based on quality settings."
|
|
737
750
|
},
|
|
738
751
|
"scale": {
|
|
739
752
|
"type": "number",
|
|
@@ -1617,8 +1617,15 @@ function applyImageParams(
|
|
|
1617
1617
|
}
|
|
1618
1618
|
keyFrame.sizePreset = effectiveSizePreset;
|
|
1619
1619
|
|
|
1620
|
-
if (
|
|
1621
|
-
|
|
1620
|
+
if (
|
|
1621
|
+
params.outputFormat === 'gif' &&
|
|
1622
|
+
(!effectiveSizePreset || effectiveSizePreset === 'custom' || params.width || params.height)
|
|
1623
|
+
) {
|
|
1624
|
+
const dimensions = resolveGptImageGifSize(
|
|
1625
|
+
params.width,
|
|
1626
|
+
params.height,
|
|
1627
|
+
params.gptImageFrameCount
|
|
1628
|
+
);
|
|
1622
1629
|
keyFrame.sizePreset = 'custom';
|
|
1623
1630
|
keyFrame.width = dimensions.width;
|
|
1624
1631
|
keyFrame.height = dimensions.height;
|
|
@@ -1633,7 +1640,12 @@ function applyImageParams(
|
|
|
1633
1640
|
});
|
|
1634
1641
|
}
|
|
1635
1642
|
validateGptImageOptions(params);
|
|
1636
|
-
for (const field of [
|
|
1643
|
+
for (const field of [
|
|
1644
|
+
'gptImageComplexity',
|
|
1645
|
+
'gptImageFrameCount',
|
|
1646
|
+
'gptImageFrameDurationMs',
|
|
1647
|
+
'gptImageMarkupUrl'
|
|
1648
|
+
] as const) {
|
|
1637
1649
|
if (params[field] !== undefined) keyFrame[field] = params[field];
|
|
1638
1650
|
}
|
|
1639
1651
|
validateSeedreamOptions(params);
|
|
@@ -1685,6 +1697,21 @@ function validateVideoUpscaleTiming(params: VideoProjectParams): void {
|
|
|
1685
1697
|
}
|
|
1686
1698
|
}
|
|
1687
1699
|
|
|
1700
|
+
/** Opt-in `sam3VideoPrompt` fields; a prompt without any of them is sent exactly as before. */
|
|
1701
|
+
const SAM3_VIDEO_OPT_IN_KEYS = ['mask', 'objects', 'combine', 'frames', 'memory'] as const;
|
|
1702
|
+
|
|
1703
|
+
/** Video selection adopts the verified source; values a caller sends must look like source metadata. */
|
|
1704
|
+
function withSam3VideoSourceMetadata<T extends Record<string, any>>(keyFrame: T, params: VideoProjectParams): T {
|
|
1705
|
+
for (const name of ['width', 'height', 'frames', 'fps'] as const) {
|
|
1706
|
+
const value = params[name];
|
|
1707
|
+
if (value !== undefined) {
|
|
1708
|
+
if (!Number.isFinite(value) || value <= 0 || (name !== 'fps' && !Number.isSafeInteger(value))) throw new Error(`Video selection ${name} must match the source video.`);
|
|
1709
|
+
Object.assign(keyFrame, { [name]: value });
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
return keyFrame;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1688
1715
|
function applyVideoParams(
|
|
1689
1716
|
inputKeyframe: Record<string, any>,
|
|
1690
1717
|
params: VideoProjectParams,
|
|
@@ -1699,30 +1726,92 @@ function applyVideoParams(
|
|
|
1699
1726
|
}
|
|
1700
1727
|
validateVideoWorkflowAssets(params);
|
|
1701
1728
|
if (isVideoSegmentationModel(params.modelId)) {
|
|
1702
|
-
if (!params.referenceVideo || params.numberOfMedia !== 1)
|
|
1729
|
+
if (!params.referenceVideo || params.numberOfMedia !== 1)
|
|
1730
|
+
throw new Error('Video selection requires one uploaded referenceVideo and numberOfMedia: 1.');
|
|
1703
1731
|
if (!params.sam3VideoPrompt) throw new Error('Video selection requires sam3VideoPrompt.');
|
|
1704
|
-
if (
|
|
1705
|
-
|
|
1732
|
+
if (
|
|
1733
|
+
params.positivePrompt?.trim() ||
|
|
1734
|
+
params.negativePrompt?.trim() ||
|
|
1735
|
+
params.stylePrompt?.trim() ||
|
|
1736
|
+
params.referenceImage ||
|
|
1737
|
+
params.referenceImageEnd ||
|
|
1738
|
+
params.referenceAudio ||
|
|
1739
|
+
params.controlNet ||
|
|
1740
|
+
params.videoStart != null ||
|
|
1741
|
+
params.trimEndFrame ||
|
|
1742
|
+
params.teacacheThreshold != null ||
|
|
1743
|
+
params.loras?.length ||
|
|
1744
|
+
params.referenceAudioIdentity
|
|
1745
|
+
) {
|
|
1706
1746
|
throw new Error('Video selection accepts one complete source video and selection prompts.');
|
|
1707
1747
|
}
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1748
|
+
// The opt-in selection options (mask, objects, frames, memory) are carried to
|
|
1749
|
+
// the server unchanged; it validates them against the verified source. A
|
|
1750
|
+
// prompt without them takes the original path below, byte for byte.
|
|
1751
|
+
const sam3VideoPrompt = params.sam3VideoPrompt;
|
|
1752
|
+
if (SAM3_VIDEO_OPT_IN_KEYS.some((key) => sam3VideoPrompt[key] !== undefined)) {
|
|
1753
|
+
return withSam3VideoSourceMetadata(
|
|
1754
|
+
{
|
|
1755
|
+
...inputKeyframe,
|
|
1756
|
+
hasReferenceVideo: true,
|
|
1757
|
+
sam3VideoPrompt: { ...sam3VideoPrompt },
|
|
1758
|
+
steps: 1,
|
|
1759
|
+
seed: 0,
|
|
1760
|
+
interpolation: 'none',
|
|
1761
|
+
generateAudio: false
|
|
1762
|
+
},
|
|
1763
|
+
params
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1766
|
+
const {
|
|
1767
|
+
frameIndex = 0,
|
|
1768
|
+
objectIndex = 0,
|
|
1769
|
+
output = 'mask',
|
|
1770
|
+
edges = 'hard',
|
|
1771
|
+
...selection
|
|
1772
|
+
} = params.sam3VideoPrompt;
|
|
1773
|
+
if (
|
|
1774
|
+
!Number.isSafeInteger(frameIndex) ||
|
|
1775
|
+
frameIndex < 0 ||
|
|
1776
|
+
frameIndex >= 900 ||
|
|
1777
|
+
!Number.isSafeInteger(objectIndex) ||
|
|
1778
|
+
objectIndex < 0 ||
|
|
1779
|
+
objectIndex > 31
|
|
1780
|
+
)
|
|
1781
|
+
throw new Error('Use a valid source frameIndex and objectIndex from 0 to 31.');
|
|
1782
|
+
if (output !== 'mask' || edges !== 'hard')
|
|
1783
|
+
throw new Error('Video selection supports hard mask output.');
|
|
1711
1784
|
const imageSelection: NonNullable<ImageProjectParams['sam3Prompt']> = selection;
|
|
1712
|
-
if (
|
|
1785
|
+
if (
|
|
1786
|
+
imageSelection.applyMask ||
|
|
1787
|
+
(imageSelection.maxInstances !== undefined && imageSelection.maxInstances !== 1)
|
|
1788
|
+
)
|
|
1789
|
+
throw new Error('Video selection tracks one object; choose it with objectIndex.');
|
|
1713
1790
|
const prompt = normalizeSam3Prompt(selection);
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
Object.assign(keyFrame, { [name]: value });
|
|
1720
|
-
}
|
|
1791
|
+
if (!prompt.text && prompt.points?.length && objectIndex !== 0) {
|
|
1792
|
+
throw new Error('Point selections require objectIndex 0.');
|
|
1793
|
+
}
|
|
1794
|
+
if (!prompt.text && !prompt.points?.length && objectIndex >= (prompt.boxes?.length ?? 0)) {
|
|
1795
|
+
throw new Error('objectIndex must refer to a supplied box.');
|
|
1721
1796
|
}
|
|
1722
|
-
|
|
1797
|
+
const keyFrame = withSam3VideoSourceMetadata(
|
|
1798
|
+
{
|
|
1799
|
+
...inputKeyframe,
|
|
1800
|
+
hasReferenceVideo: true,
|
|
1801
|
+
sam3VideoPrompt: { ...prompt, maxInstances: 1, frameIndex, objectIndex, output, edges },
|
|
1802
|
+
steps: 1,
|
|
1803
|
+
seed: 0,
|
|
1804
|
+
interpolation: 'none',
|
|
1805
|
+
generateAudio: false
|
|
1806
|
+
},
|
|
1807
|
+
params
|
|
1808
|
+
);
|
|
1809
|
+
if (params.frames !== undefined && frameIndex >= params.frames)
|
|
1810
|
+
throw new Error('frameIndex must refer to a source frame.');
|
|
1723
1811
|
return keyFrame;
|
|
1724
1812
|
}
|
|
1725
|
-
if (params.sam3VideoPrompt !== undefined)
|
|
1813
|
+
if (params.sam3VideoPrompt !== undefined)
|
|
1814
|
+
throw new Error('sam3VideoPrompt requires the SAM 3 video selection model.');
|
|
1726
1815
|
if (isVideoUpscaleModel(params.modelId)) {
|
|
1727
1816
|
if (
|
|
1728
1817
|
params.detailPreference != null &&
|
|
@@ -2071,7 +2160,10 @@ function applyAudioParams(
|
|
|
2071
2160
|
}
|
|
2072
2161
|
|
|
2073
2162
|
function createJobRequestMessage(id: string, params: ProjectParams, options: ModelOptions) {
|
|
2074
|
-
if (
|
|
2163
|
+
if (
|
|
2164
|
+
(params as VideoProjectParams).sam3VideoPrompt !== undefined &&
|
|
2165
|
+
!isVideoSegmentationModel(params.modelId)
|
|
2166
|
+
) {
|
|
2075
2167
|
throw new Error('sam3VideoPrompt requires the SAM 3 video selection model.');
|
|
2076
2168
|
}
|
|
2077
2169
|
const template = getTemplate();
|
package/src/Projects/index.ts
CHANGED
|
@@ -3465,6 +3465,8 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
3465
3465
|
* - referenceVideoDurationSeconds: Combined duration of MiniMax H3 r2v video input.
|
|
3466
3466
|
* - keyframeCount / keyframes: MiniMax H3 intermediate keyframes (0-8). The first two are
|
|
3467
3467
|
* included; each extra keyframe adds 0.75 s of output time on FastH3 and 0.3 s on other tiers.
|
|
3468
|
+
* - sam3VideoPrompt: SAM 3 video selection's prompt; its `objects` count and `memory` mode are
|
|
3469
|
+
* priced. A prompt without them quotes exactly as before.
|
|
3468
3470
|
* - seedanceDraft: Seedance 2.5 480p draft, priced like the same 480p job.
|
|
3469
3471
|
* - seedanceDraftJobId: Seedance 2.5 finalize of that draft at 1080p, priced by the server from
|
|
3470
3472
|
* the draft (duration, aspect ratio, input video); width, height, duration and fps do not change it.
|
|
@@ -3536,6 +3538,15 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
3536
3538
|
if (Number.isFinite(keyframeCount) && (keyframeCount as number) > 0) {
|
|
3537
3539
|
query.set('keyframeCount', String(Math.floor(keyframeCount as number)));
|
|
3538
3540
|
}
|
|
3541
|
+
// SAM 3 video options that change the price; the server holds them to the
|
|
3542
|
+
// limits admission applies to the same prompt.
|
|
3543
|
+
const sam3VideoPrompt = params.sam3VideoPrompt;
|
|
3544
|
+
if (sam3VideoPrompt && Array.isArray(sam3VideoPrompt.objects)) {
|
|
3545
|
+
query.set('sam3ObjectCount', String(sam3VideoPrompt.objects.length));
|
|
3546
|
+
}
|
|
3547
|
+
if (sam3VideoPrompt?.memory !== undefined) {
|
|
3548
|
+
query.set('sam3Memory', String(sam3VideoPrompt.memory));
|
|
3549
|
+
}
|
|
3539
3550
|
// Unpinned, the job renders on the connection's network, so quote that one.
|
|
3540
3551
|
const network = params.network ?? this._currentNetworkType;
|
|
3541
3552
|
if (network) query.set('network', network);
|
|
@@ -875,14 +875,100 @@ export interface Sam3PromptBox {
|
|
|
875
875
|
label?: 'positive' | 'negative';
|
|
876
876
|
}
|
|
877
877
|
|
|
878
|
-
/**
|
|
878
|
+
/**
|
|
879
|
+
* A selection made from a drawn region instead of clicks, boxes or text. The
|
|
880
|
+
* region starts the tracker on the prompt frame, as a click does, so that
|
|
881
|
+
* frame's mask is the tracker's own shape for the region rather than the exact
|
|
882
|
+
* drawing, consistent with the frames around it. Draw it tight: background or
|
|
883
|
+
* a foreground object inside the region stays in the mask for several frames.
|
|
884
|
+
*/
|
|
885
|
+
export interface Sam3PromptMask {
|
|
886
|
+
/**
|
|
887
|
+
* 1 to 64 rings of `[x, y]` points, each 3 to 2048 points and 4096 points in
|
|
888
|
+
* total; a whole prompt holds at most 4096 across its objects and frames.
|
|
889
|
+
* Coordinates are normalized to the source frame (0 to 1, origin top
|
|
890
|
+
* left). Rings fill even-odd: a ring inside another ring is a hole.
|
|
891
|
+
*/
|
|
892
|
+
polygons: Array<Array<[number, number]>>;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* One object to select in a video: exactly one of `points` (with at most one
|
|
897
|
+
* box), `boxes`, `text` (with optional signed boxes) or `mask`.
|
|
898
|
+
*/
|
|
899
|
+
export interface Sam3VideoSelection extends Pick<
|
|
900
|
+
Sam3ImagePrompt,
|
|
901
|
+
'points' | 'boxes' | 'text' | 'threshold' | 'multimask'
|
|
902
|
+
> {
|
|
903
|
+
/**
|
|
904
|
+
* Select this drawn region. Not combinable with `points`, `boxes`, `text`,
|
|
905
|
+
* `threshold` or `multimask`; `objectIndex` must be 0 or absent.
|
|
906
|
+
*/
|
|
907
|
+
mask?: Sam3PromptMask;
|
|
908
|
+
/** Zero-based candidate in confidence order. Defaults to the best match. */
|
|
909
|
+
objectIndex?: number;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/** One prompted frame of `Sam3VideoPrompt.frames`: a selection plus the source frame it refers to. */
|
|
913
|
+
export type Sam3VideoFramePrompt = Sam3VideoSelection & {
|
|
914
|
+
/** Zero-based source frame. Each entry names a different frame. */
|
|
915
|
+
frameIndex: number;
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* A bounded prompt for SAM 3 video selection. Output is one hard binary mask
|
|
920
|
+
* video. By default it selects one object (`points`, `boxes` or `text`) on one
|
|
921
|
+
* frame and tracks it through the clip.
|
|
922
|
+
*
|
|
923
|
+
* `mask`, `objects`, `frames` and `memory` are optional and absent by default;
|
|
924
|
+
* a prompt without them behaves exactly as before.
|
|
925
|
+
*/
|
|
879
926
|
export interface Sam3VideoPrompt extends Omit<Sam3ImagePrompt, 'applyMask' | 'maxInstances'> {
|
|
880
|
-
/**
|
|
927
|
+
/**
|
|
928
|
+
* Zero-based source frame the selection refers to. Defaults to 0. Not used
|
|
929
|
+
* with `frames`, where each entry carries its own.
|
|
930
|
+
*/
|
|
881
931
|
frameIndex?: number;
|
|
882
|
-
/** Zero-based candidate
|
|
932
|
+
/** Zero-based text candidate or supplied box. Point prompts require 0. Defaults to 0. */
|
|
883
933
|
objectIndex?: number;
|
|
884
934
|
output?: 'mask';
|
|
885
935
|
edges?: 'hard';
|
|
936
|
+
/**
|
|
937
|
+
* Select a drawn region on the prompt frame instead of `points`, `boxes` or
|
|
938
|
+
* `text`. Not combinable with them, nor with `threshold` or `multimask`;
|
|
939
|
+
* `objectIndex` must be 0 or absent.
|
|
940
|
+
*/
|
|
941
|
+
mask?: Sam3PromptMask;
|
|
942
|
+
/**
|
|
943
|
+
* Track 2 to 16 objects together and merge them into one mask: a crowd, a
|
|
944
|
+
* figure plus the prop it holds, a monitor plus the webcam on it. Every
|
|
945
|
+
* object is selected on `frameIndex` and tracked jointly; every output frame
|
|
946
|
+
* is the union of their masks. Requires `combine: 'union'`. Put each object's
|
|
947
|
+
* selection inside its entry: the top-level `points`, `boxes`, `text`,
|
|
948
|
+
* `mask`, `threshold`, `multimask` and `objectIndex` are rejected alongside
|
|
949
|
+
* `objects`, and so is `frames`.
|
|
950
|
+
*/
|
|
951
|
+
objects?: Sam3VideoSelection[];
|
|
952
|
+
/** How `objects` combine into the output. Required with `objects`; `'union'` is the only value. */
|
|
953
|
+
combine?: 'union';
|
|
954
|
+
/**
|
|
955
|
+
* Prompt the same object on 2 to 8 different source frames. Each output frame
|
|
956
|
+
* takes the track from the nearest prompted frame (ties go to the earlier
|
|
957
|
+
* one), so the whole clip is still tracked about once. Use it for a loop
|
|
958
|
+
* whose last frame repeats its first (prompt frame 0 and the last frame with
|
|
959
|
+
* the same selection), or to correct drift mid-clip. Rejected together with
|
|
960
|
+
* the top-level `frameIndex`, the top-level selection fields and `objects`.
|
|
961
|
+
*/
|
|
962
|
+
frames?: Sam3VideoFramePrompt[];
|
|
963
|
+
/**
|
|
964
|
+
* How tracking carries from one 32-frame chunk to the next. `'chunk'` (the
|
|
965
|
+
* default, the original behaviour) seeds each chunk from the previous chunk's
|
|
966
|
+
* last mask; an object lost at the end of a chunk is not found again.
|
|
967
|
+
* `'anchor'` tracks every chunk from the prompt frame and its selection
|
|
968
|
+
* instead, so tracking errors do not carry from chunk to chunk and a lost
|
|
969
|
+
* object can be picked up again, but the mask can shift where a chunk starts.
|
|
970
|
+
*/
|
|
971
|
+
memory?: 'chunk' | 'anchor';
|
|
886
972
|
}
|
|
887
973
|
|
|
888
974
|
export interface Sam3ImagePrompt {
|
|
@@ -1408,6 +1494,12 @@ export interface VideoEstimateRequest {
|
|
|
1408
1494
|
keyframeCount?: number;
|
|
1409
1495
|
/** The job's `keyframes`; only their count is used, to price them. */
|
|
1410
1496
|
keyframes?: readonly unknown[];
|
|
1497
|
+
/**
|
|
1498
|
+
* SAM 3 video selection: the job's own `sam3VideoPrompt`. Only the options that
|
|
1499
|
+
* change its price are sent: the number of `objects` and the `memory` mode. A
|
|
1500
|
+
* prompt without them quotes exactly as before.
|
|
1501
|
+
*/
|
|
1502
|
+
sam3VideoPrompt?: Sam3VideoPrompt;
|
|
1411
1503
|
/**
|
|
1412
1504
|
* Combined duration of MiniMax H3 r2v reference-video input, in seconds.
|
|
1413
1505
|
* The estimate bills it at the selected output resolution/tier rate.
|
package/src/index.ts
CHANGED
|
@@ -67,7 +67,10 @@ import {
|
|
|
67
67
|
Pixal3dTemplateVariant,
|
|
68
68
|
Sam3ImagePrompt,
|
|
69
69
|
Sam3VideoPrompt,
|
|
70
|
+
Sam3VideoSelection,
|
|
71
|
+
Sam3VideoFramePrompt,
|
|
70
72
|
Sam3PromptBox,
|
|
73
|
+
Sam3PromptMask,
|
|
71
74
|
Sam3PromptPoint,
|
|
72
75
|
Sam3Selection,
|
|
73
76
|
ProjectParams,
|
|
@@ -360,7 +363,10 @@ export type {
|
|
|
360
363
|
Pixal3dTemplateVariant,
|
|
361
364
|
Sam3ImagePrompt,
|
|
362
365
|
Sam3VideoPrompt,
|
|
366
|
+
Sam3VideoSelection,
|
|
367
|
+
Sam3VideoFramePrompt,
|
|
363
368
|
Sam3PromptBox,
|
|
369
|
+
Sam3PromptMask,
|
|
364
370
|
Sam3PromptPoint,
|
|
365
371
|
Sam3Selection,
|
|
366
372
|
JobStatus,
|