@sogni-ai/sogni-client 5.78.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 +22 -0
- package/README.md +89 -2
- 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/lib/validation.js +6 -9
- package/dist/lib/validation.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/lib/validation.js +6 -9
- package/dist-esm/lib/validation.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/lib/validation.ts +2 -5
- package/src/version.ts +1 -1
|
@@ -12,7 +12,7 @@ export function isGptImageModel(modelId) {
|
|
|
12
12
|
return modelId !== undefined && GPT_IMAGE_MODEL_IDS.has(modelId);
|
|
13
13
|
}
|
|
14
14
|
export function validateGptImageOptions(params) {
|
|
15
|
-
var _a, _b, _c
|
|
15
|
+
var _a, _b, _c;
|
|
16
16
|
const is26 = params.modelId === 'gpt-image-2.6-sunburst' || params.modelId === 'gpt-image-2.6-flare';
|
|
17
17
|
const advancedFormat = params.outputFormat === 'gif';
|
|
18
18
|
if (!is26 &&
|
|
@@ -31,11 +31,8 @@ export function validateGptImageOptions(params) {
|
|
|
31
31
|
!['low', 'medium', 'high'].includes(params.gptImageComplexity))
|
|
32
32
|
throw new Error('Unsupported GPT Image complexity');
|
|
33
33
|
if (advancedFormat &&
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
params.gptImageMaskUrl ||
|
|
37
|
-
params.gptImageMarkupUrl))
|
|
38
|
-
throw new Error('GIF output require text-to-image generation');
|
|
34
|
+
(params.gptImageMask || params.gptImageMaskUrl || params.gptImageMarkupUrl))
|
|
35
|
+
throw new Error('GIF output cannot combine with masks or markup');
|
|
39
36
|
if (params.outputFormat !== 'gif' &&
|
|
40
37
|
(params.gptImageFrameCount !== undefined || params.gptImageFrameDurationMs !== undefined))
|
|
41
38
|
throw new Error('Frame options require GIF output');
|
|
@@ -51,7 +48,7 @@ export function validateGptImageOptions(params) {
|
|
|
51
48
|
throw new Error('GIF frame duration must be an integer from 20 to 2000 ms');
|
|
52
49
|
if (params.gptImageMarkupUrl !== undefined &&
|
|
53
50
|
(!params.gptImageMarkupUrl.trim() ||
|
|
54
|
-
!((
|
|
51
|
+
!((_a = params.contextImages) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
55
52
|
params.gptImageMask ||
|
|
56
53
|
params.gptImageMaskUrl))
|
|
57
54
|
throw new Error('Markup requires a first edit reference and cannot combine with a mask');
|
|
@@ -65,7 +62,7 @@ export function validateGptImageOptions(params) {
|
|
|
65
62
|
}
|
|
66
63
|
if (params.gptImageMask && params.gptImageMaskUrl)
|
|
67
64
|
throw new Error('Provide one GPT Image mask');
|
|
68
|
-
if (params.gptImageMask && !((
|
|
65
|
+
if (params.gptImageMask && !((_b = params.contextImages) === null || _b === void 0 ? void 0 : _b.length))
|
|
69
66
|
throw new Error('GPT Image mask requires a first reference image');
|
|
70
67
|
if (params.contextImages !== undefined &&
|
|
71
68
|
(!Array.isArray(params.contextImages) ||
|
|
@@ -76,7 +73,7 @@ export function validateGptImageOptions(params) {
|
|
|
76
73
|
if (params.gptImageMaskUrl !== undefined &&
|
|
77
74
|
(typeof params.gptImageMaskUrl !== 'string' ||
|
|
78
75
|
!params.gptImageMaskUrl.trim() ||
|
|
79
|
-
!((
|
|
76
|
+
!((_c = params.contextImages) === null || _c === void 0 ? void 0 : _c.length))) {
|
|
80
77
|
throw new Error('GPT Image mask requires a mask URL and a first reference image');
|
|
81
78
|
}
|
|
82
79
|
const is25 = params.modelId !== 'gpt-image-2';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/lib/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAIjD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,aAAa;IACb,wBAAwB;IACxB,qBAAqB;IACrB,wBAAwB;IACxB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,OAAO,OAAO,KAAK,SAAS,IAAI,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,uBAAuB,C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AAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAClF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAyB,EAAE,OAAqB;;IAC1E,IAAI,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,GAAG,0CAAE,OAAO,CAAC,MAAM,CAAA,IAAI,CAAC,KAAK,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,cAAc,CACnB,KAAK,EACL,OAAO,CAAC,GAAG,CAAC,OAAO,EACnB,eAAe,KAAK,qBAAqB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAC9E,CAAC;AACJ,CAAC"}
|
package/dist-esm/version.js
CHANGED
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);
|