@sogni-ai/sogni-client 5.68.0 → 5.69.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.
Files changed (60) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +22 -2
  4. package/dist/Account/subscription.types.d.ts +2 -2
  5. package/dist/Chat/ChatTools.js +23 -8
  6. package/dist/Chat/ChatTools.js.map +1 -1
  7. package/dist/Chat/_hostedToolsManifest.generated.js +4 -4
  8. package/dist/Chat/_hostedToolsManifest.generated.js.map +1 -1
  9. package/dist/Chat/modelRouting.d.ts +1 -0
  10. package/dist/Chat/modelRouting.js +17 -2
  11. package/dist/Chat/modelRouting.js.map +1 -1
  12. package/dist/Projects/createJobRequestMessage.js +2 -0
  13. package/dist/Projects/createJobRequestMessage.js.map +1 -1
  14. package/dist/Projects/index.js +1 -1
  15. package/dist/Projects/index.js.map +1 -1
  16. package/dist/Projects/types/index.d.ts +3 -2
  17. package/dist/Projects/types/index.js.map +1 -1
  18. package/dist/index.d.ts +2 -1
  19. package/dist/index.js +5 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/lib/validation.d.ts +18 -0
  22. package/dist/lib/validation.js +60 -0
  23. package/dist/lib/validation.js.map +1 -1
  24. package/dist/types/ErrorData.d.ts +8 -5
  25. package/dist/types/ErrorData.js +4 -2
  26. package/dist/types/ErrorData.js.map +1 -1
  27. package/dist/version.d.ts +1 -1
  28. package/dist/version.js +1 -1
  29. package/dist-esm/Chat/ChatTools.js +24 -9
  30. package/dist-esm/Chat/ChatTools.js.map +1 -1
  31. package/dist-esm/Chat/_hostedToolsManifest.generated.js +4 -4
  32. package/dist-esm/Chat/_hostedToolsManifest.generated.js.map +1 -1
  33. package/dist-esm/Chat/modelRouting.js +18 -3
  34. package/dist-esm/Chat/modelRouting.js.map +1 -1
  35. package/dist-esm/Projects/createJobRequestMessage.js +3 -1
  36. package/dist-esm/Projects/createJobRequestMessage.js.map +1 -1
  37. package/dist-esm/Projects/index.js +1 -1
  38. package/dist-esm/Projects/index.js.map +1 -1
  39. package/dist-esm/Projects/types/index.js.map +1 -1
  40. package/dist-esm/index.js +2 -1
  41. package/dist-esm/index.js.map +1 -1
  42. package/dist-esm/lib/validation.js +57 -0
  43. package/dist-esm/lib/validation.js.map +1 -1
  44. package/dist-esm/types/ErrorData.js +4 -2
  45. package/dist-esm/types/ErrorData.js.map +1 -1
  46. package/dist-esm/version.js +1 -1
  47. package/llms-full.txt +11 -0
  48. package/llms.txt +1 -0
  49. package/package.json +4 -2
  50. package/src/Account/subscription.types.ts +2 -2
  51. package/src/Chat/ChatTools.ts +29 -9
  52. package/src/Chat/_hostedToolsManifest.generated.ts +4 -4
  53. package/src/Chat/modelRouting.ts +21 -1
  54. package/src/Projects/createJobRequestMessage.ts +4 -0
  55. package/src/Projects/index.ts +1 -1
  56. package/src/Projects/types/index.ts +3 -2
  57. package/src/index.ts +3 -0
  58. package/src/lib/validation.ts +68 -0
  59. package/src/types/ErrorData.ts +8 -5
  60. package/src/version.ts +1 -1
@@ -58,6 +58,56 @@ export function validateGptImageOptions(params) {
58
58
  }
59
59
  }
60
60
  }
61
+ /**
62
+ * Seedream 5.0 Pro Uncensored: ByteDance's Seedream 5.0 Pro, an external
63
+ * API-backed image model for text-to-image and for edits from 1-10 reference
64
+ * images (`contextImages`). Spark-only, with no negative prompt, seed or steps.
65
+ * Each account must accept the one-time likeness and consent agreement that
66
+ * Seedance 2.5 Uncensored uses (key `seedance-2-5-uncensored`) in a Sogni app
67
+ * first; until then its jobs fail with error code 4103
68
+ * (`MODEL_CONSENT_REQUIRED_ERROR_CODE`).
69
+ */
70
+ export const SEEDREAM_5_PRO_UNCENSORED_MODEL_ID = 'seedream-5-0-pro-uncensored';
71
+ const SEEDREAM_MODEL_IDS = new Set([SEEDREAM_5_PRO_UNCENSORED_MODEL_ID]);
72
+ const SEEDREAM_MAX_CONTEXT_IMAGES = 10;
73
+ // Output limits: 921,600 (1280x720) to 4,194,304 (2048x2048) pixels, aspect
74
+ // ratio from 1:16 to 16:1. Together they bound each edge to 240-8192 px
75
+ // (3840x240 and 8192x512 are the extremes).
76
+ const SEEDREAM_MIN_PIXELS = 921600;
77
+ const SEEDREAM_MAX_PIXELS = 4194304;
78
+ const SEEDREAM_MAX_ASPECT_RATIO = 16;
79
+ /** Whether `modelId` is a Seedream image model (today only Seedream 5.0 Pro Uncensored). */
80
+ export function isSeedreamModel(modelId) {
81
+ return modelId !== undefined && SEEDREAM_MODEL_IDS.has(modelId);
82
+ }
83
+ /**
84
+ * Check a Seedream request before anything is uploaded: at most 10 non-empty
85
+ * reference images, and a custom size inside the pixel and aspect-ratio limits.
86
+ */
87
+ export function validateSeedreamOptions(params) {
88
+ if (!isSeedreamModel(params.modelId))
89
+ return;
90
+ if (params.contextImages !== undefined &&
91
+ (!Array.isArray(params.contextImages) ||
92
+ params.contextImages.length > SEEDREAM_MAX_CONTEXT_IMAGES ||
93
+ params.contextImages.some((image) => !image))) {
94
+ throw new Error(`${params.modelId} accepts up to ${SEEDREAM_MAX_CONTEXT_IMAGES} non-empty reference images in source order`);
95
+ }
96
+ const isCustomSize = (params.sizePreset === undefined || params.sizePreset === 'custom') &&
97
+ !!params.width &&
98
+ !!params.height;
99
+ if (!isCustomSize)
100
+ return;
101
+ const width = Number(params.width);
102
+ const height = Number(params.height);
103
+ const pixels = width * height;
104
+ const aspectRatio = Math.max(width, height) / Math.min(width, height);
105
+ if (pixels < SEEDREAM_MIN_PIXELS ||
106
+ pixels > SEEDREAM_MAX_PIXELS ||
107
+ aspectRatio > SEEDREAM_MAX_ASPECT_RATIO) {
108
+ throw new Error(`${params.modelId} renders 921,600 to 4,194,304 pixels at an aspect ratio from 1:16 to 16:1; got ${width}x${height}`);
109
+ }
110
+ }
61
111
  const EXTENDED_IMAGE_SIZE_MODEL_IDS = new Set([
62
112
  'z_image_bf16',
63
113
  'z_image_turbo_bf16',
@@ -106,6 +156,9 @@ function getCustomImageSizeBounds(modelId) {
106
156
  if (isGptImageModel(modelId)) {
107
157
  return { min: 256, max: 3840 };
108
158
  }
159
+ if (isSeedreamModel(modelId)) {
160
+ return { min: 240, max: 8192 };
161
+ }
109
162
  if (modelId && isFlux3ImageKleinModel(modelId)) {
110
163
  return { min: 256, max: 4096 };
111
164
  }
@@ -196,6 +249,7 @@ export function isComfyModel(modelId) {
196
249
  /**
197
250
  * Get the maximum number of context images supported by a model.
198
251
  * - GPT Image 2: 16 images
252
+ * - Seedream 5.0 Pro Uncensored: 10 images
199
253
  * - FLUX 3 Image Klein: 10 images (optional)
200
254
  * - Qwen Image Edit: 3 images
201
255
  * - Krea 2 Identity Edit: 2 images
@@ -208,6 +262,9 @@ export function getMaxContextImages(modelId) {
208
262
  if (isGptImageModel(modelId)) {
209
263
  return 16;
210
264
  }
265
+ if (isSeedreamModel(modelId)) {
266
+ return SEEDREAM_MAX_CONTEXT_IMAGES;
267
+ }
211
268
  if (isFlux3ImageKleinModel(modelId)) {
212
269
  return 10;
213
270
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/lib/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAIjD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,aAAa;IACb,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,CAAC,MAA0B;;IAChE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACrC,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,eAAe;YAC/C,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,OAA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,10 @@
1
1
  /**
2
2
  * Socket error code for a job refused because its model requires a one-time
3
3
  * likeness and consent agreement the account has not accepted. Seedance 2.5
4
- * Uncensored (`seedance-2-5-uncensored`) and Seedance 2.0 Mini Uncensored
5
- * (`seedance-2-0-mini-uncensored`) require one, and share the same agreement.
4
+ * Uncensored (`seedance-2-5-uncensored`), Seedance 2.0 Mini Uncensored
5
+ * (`seedance-2-0-mini-uncensored`) and the image model Seedream 5.0 Pro
6
+ * Uncensored (`seedream-5-0-pro-uncensored`) require one, and share the same
7
+ * agreement. Image and video jobs are refused the same way.
6
8
  *
7
9
  * The error carries {@link ErrorData.consentRequired}. The agreement is
8
10
  * accepted in a Sogni app; the SDK never accepts it and API-key sessions
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorData.js","sourceRoot":"","sources":["../../src/types/ErrorData.ts"],"names":[],"mappings":"AAiEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,qCAAqC,EAAE,IAAI;CACnC,CAAC"}
1
+ {"version":3,"file":"ErrorData.js","sourceRoot":"","sources":["../../src/types/ErrorData.ts"],"names":[],"mappings":"AAkEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,qCAAqC,EAAE,IAAI;CACnC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  // AUTO-GENERATED by scripts/generate-version.mjs — do not edit.
2
2
  // Source of truth: package.json version.
3
- export const LIB_VERSION = '5.68.0';
3
+ export const LIB_VERSION = '5.69.0';
4
4
  //# sourceMappingURL=version.js.map
package/llms-full.txt CHANGED
@@ -501,6 +501,17 @@ GPT Image 2 uses `modelId: 'gpt-image-2'`, supports up to 16 `contextImages`,
501
501
  accepts `gptImageQuality: 'low' | 'medium' | 'high'`, supports
502
502
  `outputFormat: 'png' | 'jpg' | 'webp'`, and is Spark-only.
503
503
 
504
+ Seedream 5.0 Pro Uncensored uses `modelId: 'seedream-5-0-pro-uncensored'`
505
+ (exported as `SEEDREAM_5_PRO_UNCENSORED_MODEL_ID`; test with `isSeedreamModel()`):
506
+ text-to-image, or edits from 1-10 `contextImages` in source order. It is
507
+ Spark-only and takes no negative prompt, seed, or steps. Custom sizes run from
508
+ 921,600 to 4,194,304 pixels at an aspect ratio from 1:16 to 16:1 (for example
509
+ 1536x1536, 2048x2048, 2560x1440, 3024x1296). It shares the Seedance 2.5
510
+ Uncensored one-time likeness and consent agreement: until the account accepts
511
+ it in a Sogni app, its jobs fail with `MODEL_CONSENT_REQUIRED_ERROR_CODE` (4103)
512
+ carrying `consentRequired: { key: 'seedance-2-5-uncensored', version, modelId }`.
513
+ Hosted chat tools use it only when the call names it.
514
+
504
515
  RECOMMENDED MODELS:
505
516
  | Model ID | Type | Steps | Guidance | Notes |
506
517
  |----------|------|-------|----------|-------|
package/llms.txt CHANGED
@@ -257,6 +257,7 @@ The full catalog is dynamic — enumerate it at runtime with
257
257
  | `dark_beast_krea2_identity_edit_v1_2` | Dark Beast Krea 2 Identity Edit — community identity edit LoRA with 1-2 reference images |
258
258
  | `qwen_image_2512_fp8` / `_lightning` | Qwen Image 2512 — text rendering |
259
259
  | `gpt-image-2` | GPT Image 2 — OpenAI partner (premium, Spark-only) |
260
+ | `seedream-5-0-pro-uncensored` | Seedream 5.0 Pro Uncensored — ByteDance partner (premium, Spark-only); text-to-image and edits from 1-10 `contextImages`; 921,600-4,194,304 pixels at 1:16 to 16:1; no negative prompt, seed, or steps; shares the Seedance 2.5 Uncensored one-time agreement (error 4103 until accepted) |
260
261
 
261
262
  Community fine-tunes (uncensored; pass the id directly):
262
263
  `dark_beast_z_image_turbo_v9_bf16` (fast Z-Image fine-tune, 2K needs 24GB VRAM),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "5.68.0",
6
+ "version": "5.69.0",
7
7
  "engines": {
8
8
  "node": ">=22"
9
9
  },
@@ -17,6 +17,7 @@
17
17
  "wan",
18
18
  "ltx",
19
19
  "seedance",
20
+ "seedream",
20
21
  "happyhorse",
21
22
  "alibaba",
22
23
  "text-to-image",
@@ -117,6 +118,7 @@
117
118
  "postdocs": "node -p \"'sdk-docs.sogni.ai'\" > docs/CNAME",
118
119
  "prepare": "npm run codegen && husky",
119
120
  "test:gpt-image-25": "npm run build && node scripts/check-gpt-image-25.cjs",
121
+ "test:seedream-5-pro-uncensored": "npm run build && node scripts/check-seedream-5-pro-uncensored.cjs",
120
122
  "test:job-reassignment": "npm run build && node scripts/check-job-reassignment.cjs",
121
123
  "test:result-download-endpoint": "npm run build && node scripts/check-result-download-endpoint.cjs",
122
124
  "test:remote-media-hosts": "npm run build && node scripts/check-remote-media-hosts.cjs",
@@ -135,7 +137,7 @@
135
137
  "homepage": "https://github.com/Sogni-AI/sogni-client#readme",
136
138
  "dependencies": {
137
139
  "@lukeed/uuid": "^2.0.1",
138
- "@sogni-ai/sogni-protocol": "1.0.0-alpha.52",
140
+ "@sogni-ai/sogni-protocol": "1.0.0-alpha.54",
139
141
  "@types/js-cookie": "^3.0.6",
140
142
  "@types/lodash": "^4.17.23",
141
143
  "@types/ws": "^8.5.13",
@@ -140,7 +140,7 @@ export interface SubscriptionEntitlementSnapshot {
140
140
  * receives on the artist-facing price of premium third-party vendor models
141
141
  * (`gpt-image-2`, `seedance-2-0`, `seedance-2-0-mini`, `seedance-2-0-mini-uncensored`,
142
142
  * `seedance-2-0-fast`, `seedance-2-5`, `seedance-2-5-uncensored`, `happyhorse-1.1-*`,
143
- * `wan3.0-video`, `wan3.0-spicy-video`). Present only when the
143
+ * `wan3.0-video`, `wan3.0-spicy-video`, `seedream-5-0-pro-uncensored`). Present only when the
144
144
  * entitlement is active (the discount applies); absent otherwise. The
145
145
  * authoritative charge is enforced server-side; this drives UI display. For
146
146
  * example `500` = 5% (Unlimited), `1000` = 10% (Unlimited Pro).
@@ -231,7 +231,7 @@ export interface SubscriptionPlan {
231
231
  * the artist-facing price of premium third-party vendor models
232
232
  * (`gpt-image-2`, `seedance-2-0`, `seedance-2-0-mini`, `seedance-2-0-mini-uncensored`,
233
233
  * `seedance-2-0-fast`, `seedance-2-5`, `seedance-2-5-uncensored`, `happyhorse-1.1-*`,
234
- * `wan3.0-video`, `wan3.0-spicy-video`) while the member is
234
+ * `wan3.0-video`, `wan3.0-spicy-video`, `seedream-5-0-pro-uncensored`) while the member is
235
235
  * subscribed. Drives member-benefit display and non-member upsell copy so
236
236
  * consumers render the rate without hardcoding it (`500` = 5%, `1000` = 10%).
237
237
  * The discount itself is enforced server-side at the cost layer.
@@ -2,7 +2,7 @@ import type ProjectsApi from '../Projects/index.js';
2
2
  import type { AuthManager } from '../lib/AuthManager/index.js';
3
3
  import { captureRequestSession } from '../lib/requestSession.js';
4
4
  import type { AvailableModel } from '../Projects/types/index.js';
5
- import { getMaxContextImages } from '../lib/validation.js';
5
+ import { getMaxContextImages, isSeedreamModel } from '../lib/validation.js';
6
6
  import {
7
7
  getMinimaxH3FramesForAudioDuration,
8
8
  isMinimaxH3AudioGuideModel
@@ -140,6 +140,19 @@ function normalizeImageOutputFormat(value: unknown): string | undefined {
140
140
  : undefined;
141
141
  }
142
142
 
143
+ /**
144
+ * Image models a tool call may land on. Seedream 5.0 Pro Uncensored needs a
145
+ * one-time agreement and is Spark-only, so it is chosen only when the call
146
+ * names it; a call that names no image model keeps choosing among the others.
147
+ */
148
+ function imageModelFilter(
149
+ requestedModel: string | undefined,
150
+ filter?: (modelId: string) => boolean
151
+ ): (modelId: string) => boolean {
152
+ return (modelId) =>
153
+ (!filter || filter(modelId)) && (modelId === requestedModel || !isSeedreamModel(modelId));
154
+ }
155
+
143
156
  function applyHostedImageOptions(
144
157
  projectParams: Record<string, unknown>,
145
158
  args: Record<string, unknown>
@@ -461,10 +474,14 @@ class ChatToolsApi {
461
474
  args: Record<string, unknown>,
462
475
  options?: ToolExecutionOptions
463
476
  ): Promise<ToolExecutionResult> {
477
+ const requestedModel = resolveHostedToolModelSelector('generate_image', args);
464
478
  const modelId = await this.selectModel({
465
479
  mediaType: 'image',
466
- requestedModel: resolveHostedToolModelSelector('generate_image', args)
480
+ requestedModel,
481
+ filter: imageModelFilter(requestedModel)
467
482
  });
483
+ // Seedream takes no negative prompt, seed or steps.
484
+ const takesSampling = !isSeedreamModel(modelId);
468
485
 
469
486
  const projectParams: Record<string, unknown> = {
470
487
  type: 'image' as const,
@@ -473,14 +490,14 @@ class ChatToolsApi {
473
490
  numberOfMedia: getVariationCount(args, options)
474
491
  };
475
492
 
476
- if (args.negative_prompt) projectParams.negativePrompt = args.negative_prompt;
493
+ if (takesSampling && args.negative_prompt) projectParams.negativePrompt = args.negative_prompt;
477
494
  if (args.width && args.height) {
478
495
  projectParams.width = args.width;
479
496
  projectParams.height = args.height;
480
497
  projectParams.sizePreset = 'custom';
481
498
  }
482
- if (args.steps !== undefined) projectParams.steps = args.steps;
483
- if (args.seed !== undefined) projectParams.seed = args.seed;
499
+ if (takesSampling && args.steps !== undefined) projectParams.steps = args.steps;
500
+ if (takesSampling && args.seed !== undefined) projectParams.seed = args.seed;
484
501
  applyHostedImageOptions(projectParams, args);
485
502
  if (options?.tokenType) projectParams.tokenType = options.tokenType;
486
503
  if (options?.network) projectParams.network = options.network;
@@ -508,11 +525,14 @@ class ChatToolsApi {
508
525
  throw new Error('edit_image requires source_image_url or reference_image_urls');
509
526
  }
510
527
 
528
+ const requestedModel = resolveHostedToolModelSelector('edit_image', args);
511
529
  const modelId = await this.selectModel({
512
530
  mediaType: 'image',
513
- requestedModel: resolveHostedToolModelSelector('edit_image', args),
514
- filter: isEditImageModel
531
+ requestedModel,
532
+ filter: imageModelFilter(requestedModel, isEditImageModel)
515
533
  });
534
+ // Seedream takes no negative prompt or seed.
535
+ const takesSampling = !isSeedreamModel(modelId);
516
536
  const maxContextImages = getMaxContextImages(modelId);
517
537
  // A model never receives more references than it accepts; none are dropped.
518
538
  if (inputUrls.length > maxContextImages) {
@@ -537,13 +557,13 @@ class ChatToolsApi {
537
557
  contextImages
538
558
  };
539
559
 
540
- if (args.negative_prompt) projectParams.negativePrompt = args.negative_prompt;
560
+ if (takesSampling && args.negative_prompt) projectParams.negativePrompt = args.negative_prompt;
541
561
  if (args.width && args.height) {
542
562
  projectParams.width = args.width;
543
563
  projectParams.height = args.height;
544
564
  projectParams.sizePreset = 'custom';
545
565
  }
546
- if (args.seed !== undefined) projectParams.seed = args.seed;
566
+ if (takesSampling && args.seed !== undefined) projectParams.seed = args.seed;
547
567
  applyHostedImageOptions(projectParams, args);
548
568
  if (options?.tokenType) projectParams.tokenType = options.tokenType;
549
569
  if (options?.network) projectParams.network = options.network;
@@ -232,6 +232,8 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
232
232
  "minimax-h3-r2v-turbo",
233
233
  "minimax-h3-r2v-2stage",
234
234
  "minimax-h3-r2v-balanced-2stage",
235
+ "minimax-h3-fasth3-r2v-turbo",
236
+ "minimax-h3-fasth3-r2v-turbo-2stage",
235
237
  "wan3.0-video",
236
238
  "wan3.0-spicy-video",
237
239
  "minimax-h3-turbo",
@@ -239,11 +241,9 @@ export const SOGNI_HOSTED_TOOLS_MANIFEST: unknown = {
239
241
  "minimax-h3-fasth3-turbo-2stage",
240
242
  "minimax-h3-balanced",
241
243
  "minimax-h3-t2v-balanced",
242
- "minimax-h3-r2v-balanced",
243
- "minimax-h3-fasth3-r2v-turbo",
244
- "minimax-h3-fasth3-r2v-turbo-2stage"
244
+ "minimax-h3-r2v-balanced"
245
245
  ],
246
- "description": "\"ltx25\" (default): LTX 2.5 with native audio; Fast, HQ, and Pro currently use the release-validated official Distilled INT8 workflow. The Dev checkpoints are not publicly routed until upstream publishes and Sogni validates an official ComfyUI Dev recipe. Video model. \"ltx23\": LTX 2.3 rollback with native audio. \"wan22\": quick simple motion without audio. \"minimax-h3-t2v\": standard 20-step MiniMax H3 text-to-video; \"minimax-h3-t2v-turbo\": the existing 4-step LightX2V Turbo text-to-video; \"minimax-h3-fasth3-t2v-turbo\": the separate FastVideo VSA four-step FastH3 engine, about 2x faster and fixed to Euler/simple; \"minimax-h3-fasth3-t2v-turbo-2stage\": the two-stage FastH3 engine: FastH3 renders the canvas, then the worker enlarges it 2x and refines it, so the clip is delivered at twice the canvas width and height with the same length and audio. targetResolution picks the delivered class: 1080 renders a 544px short-edge canvas (960x544 is delivered at 1920x1088) for 10 Spark per second, 1440 or omitted renders the 768p canvas for 2K (1344x768 is delivered at 2688x1536) for 16 Spark per second, and 720 renders a 384px canvas (672x384 is delivered at 1344x768) for the regular FastH3 price of 4 Spark per second. The estimate prices every request. It takes the same inputs, durations and LoRAs as \"minimax-h3-fasth3-t2v-turbo\". Choose it when the user asks for 1080p, 1440p or 2K MiniMax H3 output, for two-stage output, or for the sharpest/best H3 quality; for ordinary 768p FastH3 output keep the regular FastH3 selector at targetResolution 768. All use native audio, fixed 24fps, 5.17-15.08s, and a 768p-class 32px-grid canvas; use animate_photo for H3 image-conditioned modes. Base and Turbo T2V/I2V/FLF2V prompts use the exact ordered fields integrated_multimodal_description, overall_soundscape, and non_diegetic_music; I2V/FLF2V prepend the official alignment line. \"minimax-h3-r2v\": standard 20-step MiniMax H3 reference-to-video; \"minimax-h3-r2v-turbo\": the dedicated LightX2V 4-step Ref2VA Turbo workflow using Euler/simple and a 960x544 default. \"minimax-h3-r2v-2stage\" (Standard, 20 steps, res_multistep/simple) and \"minimax-h3-r2v-balanced-2stage\" (Balanced, 8 steps, Euler/simple) are the two-stage reference-to-video forms: the tier renders the canvas, then the worker enlarges it 2x and refines it, so the clip is delivered at twice the canvas width and height with the same length, audio and references. targetResolution names the delivered class exactly as for the FastH3 two-stage selectors: 1080 renders a 544px short-edge canvas (960x544 is delivered at 1920x1088), 1440 or omitted renders the 768p canvas for 2K (1344x768 is delivered at 2688x1536), and 720 renders a 384px canvas (672x384 is delivered at 1344x768). Each bills its tier's own per-second rate plus the two-stage surcharge of the delivered class (none at 720p); the estimate prices every request. Choose one when the user asks for 1080p, 1440p or 2K MiniMax H3 reference-to-video output; keep the one-stage \"minimax-h3-r2v\" or Balanced selector for ordinary 768p output. Every R2V selector accepts up to 9 images, 3 videos, and 3 audios (12 files total); at least one visual reference (image or video) is required and audio alone is invalid. Select references with referenceImageIndices/referenceVideoIndices/referenceAudioIndices and address them with the official <Subject N>/<Picture N>/<Video N>/<Audio N> semantics. Seedance quality is selected only by model: use \"seedance2-mini\" for Seedance 2.0 Mini or faster/lower-cost 720p iteration, use \"seedance2-5\" at targetResolution=1080 for generated/uploaded storyboard images and current high-quality Seedance generation unless the user explicitly requests another model or resolution, and use \"seedance2\" for Seedance 2.0 or 4K requests because Seedance 2.5 supports up to 1080p. Do not use Default Media Quality Fast/HQ/Pro to represent Seedance quality. \"seedance2-5\": Seedance 2.5, the newest Seedance generation — 480p, 720p, and 1080p (4K is unsupported), 4-30s per clip at a fixed 24 fps, native audio, first-and-last-frame conditioning, and a much larger reference budget than the 2.0 family: up to 30 images, 10 videos, and 10 audios, with up to 50 reference media files total, subject to those per-modality caps. Choose \"seedance2-5\" when the user asks for Seedance 2.5, wants a single continuous Seedance clip longer than 15s (2.5 renders up to 30s in one call instead of being split and stitched), or wants a first-and-last-frame Seedance transition. Keep \"seedance2\" for 4K requests; Seedance 2.5 supports up to 1080p. \"seedance2-5-uncensored\": Seedance 2.5 Uncensored — the uncensored variant of Seedance 2.5, with every mode, resolution, duration, reference limit, and output option described for \"seedance2-5\". Choose it only when the user asks for Seedance 2.5 Uncensored (including \"Seedance Uncensored\" or \"Seedance Spicy\") or for uncensored Seedance output; never swap it in for \"seedance2-5\" otherwise. Each account must accept a one-time likeness and consent agreement in the Sogni app before its first render; until then the job fails with error 4103, so tell the user to accept it in the Sogni app instead of retrying. \"seedance2-mini-uncensored\": Seedance 2.0 Mini Uncensored — the uncensored variant of Seedance 2.0 Mini, with every mode, resolution (480p/720p), duration (4-15s), reference limit, and output option of \"seedance2-mini\". Choose it only when the user asks for Seedance 2.0 Mini Uncensored (including \"Seedance Mini Uncensored\" or \"Seedance Mini Spicy\") or for uncensored Seedance Mini output; never swap it in for \"seedance2-mini\" or \"seedance2-5-uncensored\" otherwise. It shares the Seedance 2.5 Uncensored likeness and consent agreement: until the account accepts it in the Sogni app the job fails with error 4103, so tell the user to accept it there instead of retrying. Seedance supports multimodal loose reference assets. Seedance 2.0 and Mini accept up to 9 images, 3 videos, and 3 audios, with no more than 12 asset files total. Seedance 2.5 accepts up to 30 images, 10 videos, and 10 audios, with up to 50 reference media files total, subject to those per-modality caps. Use @Image1/@Video1/@Audio1 style references in creative briefs when assigning roles. Assign every useful reference asset a role and prefer positive preservation constraints. If an uploaded video is the source clip to transform, upscale, enhance, restyle, or remaster, use video_to_video with controlMode=\"seedance-v2v\" instead of generate_video referenceVideoIndices. Alibaba HappyHorse 1.1 video models (third-party vendor — requires Premium Spark). Select by mode: \"happyhorse-1.1-t2v\" for text-to-video, \"happyhorse-1.1-i2v\" for image-to-video from one first-frame image, and \"happyhorse-1.1-r2v\" for reference-to-video with up to 9 reference images. Resolutions 720P and 1080P; duration 3-15 seconds at 24 fps; native synchronized audio is always generated (do not set generateAudio or negativePrompt). Supported aspect ratios: 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9. HappyHorse 1.1 takes image references only and renders a native synchronized audio track (always on; do not set generateAudio or a negative prompt). Pick the model by mode: happyhorse-1.1-t2v for text-to-video (no reference image), happyhorse-1.1-i2v for image-to-video from a single first frame, and happyhorse-1.1-r2v for reference-to-video with 1 to 9 reference images. For r2v, tag the images in the prompt as [Image 1]…[Image 9] and assign each a clear role. HappyHorse does not accept reference videos or reference audios. \"wan3.0-video\" is Alibaba Wan 3 and \"wan3.0-spicy-video\" is MuleRouter w3.0-video. Both render 2-30s at fixed 30 fps with optional native audio, provider prompt expansion, 480p/720p/1080p, adaptive/fixed ratios, first/last frames, and up to 10 image/5 video/5 audio references. Only Alibaba wan3.0-video accepts document/web context and watermark. Frame anchors and loose references are mutually exclusive. Do not send negativePrompt; video references are loose conditioning for a new result, not source-video editing or extension. MiniMax H3 Balanced uses the LightX2V 8-step 768p accelerator for FL2VA and Larry v4 step-600 EMA for Ref2VA, between 4-step Turbo and 20-step Standard; use \"minimax-h3-balanced\" or \"minimax-h3-t2v-balanced\" for FL2VA text-to-video and \"minimax-h3-r2v-balanced\" for Ref2VA reference-to-video. Sources: https://huggingface.co/lightx2v/Minimax-h3-Turbo/tree/f3d9da6dac47dcb985684ca150f02893f619a171 and https://huggingface.co/larryvrh/MiniMax-H3-Turbo-Lora/tree/7b7ac96b0616100db75ea285090210c3ddf37c04. MiniMax H3 FastH3 Turbo is the separate FastVideo VSA four-step engine, qualified only with Euler/simple; use \"minimax-h3-fasth3-turbo\" or \"minimax-h3-fasth3-t2v-turbo\" for text-to-video. Existing \"minimax-h3-turbo\" selectors remain LightX2V Turbo. MiniMax H3 FastH3 Two-Stage renders the FastH3 canvas, then enlarges it 2x and refines it, delivering twice the canvas with the same length and audio; use \"minimax-h3-fasth3-turbo-2stage\" or \"minimax-h3-fasth3-t2v-turbo-2stage\" for two-stage text-to-video. Its targetResolution names the delivered class: 1080 (544px canvas, 960x544 delivers 1920x1088), 1440 or omitted for 2K (768p canvas, 1344x768 delivers 2688x1536), or 720 (384px canvas, 672x384 delivers 1344x768). MiniMax H3 Two-Stage Reference-to-Video is the Standard or Balanced Ref2VA request delivered at twice the canvas with the same length, audio and references; use \"minimax-h3-r2v-2stage\" (20 steps) or \"minimax-h3-r2v-balanced-2stage\" (8 steps). targetResolution names the delivered class exactly as for the FastH3 two-stage selectors (1080, 1440 or omitted for 2K, 720), and each bills its tier's rate plus the two-stage surcharge of that class; keep \"minimax-h3-r2v\" or \"minimax-h3-r2v-balanced\" for ordinary 768p output. MiniMax H3 FastH3 Reference is the FastH3 tier's reference-to-video engine, FastVideo's FastH3 Omni on its own distilled Ref2VA checkpoint, about twice as fast as Balanced Reference; use \"minimax-h3-fasth3-r2v-turbo\" with the same references, durations and catalog LoRAs as the other R2V selectors (Personal LoRAs are not available on it). \"minimax-h3-fasth3-r2v-turbo-2stage\" is its two-stage form: targetResolution names the delivered class exactly as for the other two-stage selectors (1080, 1440 or omitted for 2K, 720), and it bills its own rate plus the two-stage surcharge of that class."
246
+ "description": "\"ltx25\" (default): LTX 2.5 with native audio; Fast, HQ, and Pro currently use the release-validated official Distilled INT8 workflow. The Dev checkpoints are not publicly routed until upstream publishes and Sogni validates an official ComfyUI Dev recipe. Video model. \"ltx23\": LTX 2.3 rollback with native audio. \"wan22\": quick simple motion without audio. \"minimax-h3-t2v\": standard 20-step MiniMax H3 text-to-video; \"minimax-h3-t2v-turbo\": the existing 4-step LightX2V Turbo text-to-video; \"minimax-h3-fasth3-t2v-turbo\": the separate FastVideo VSA four-step FastH3 engine, about 2x faster and fixed to Euler/simple; \"minimax-h3-fasth3-t2v-turbo-2stage\": the two-stage FastH3 engine: FastH3 renders the canvas, then the worker enlarges it 2x and refines it, so the clip is delivered at twice the canvas width and height with the same length and audio. targetResolution picks the delivered class: 1080 renders a 544px short-edge canvas (960x544 is delivered at 1920x1088) for 10 Spark per second, 1440 or omitted renders the 768p canvas for 2K (1344x768 is delivered at 2688x1536) for 16 Spark per second, and 720 renders a 384px canvas (672x384 is delivered at 1344x768) for the regular FastH3 price of 4 Spark per second. The estimate prices every request. It takes the same inputs, durations and LoRAs as \"minimax-h3-fasth3-t2v-turbo\". Choose it when the user asks for 1080p, 1440p or 2K MiniMax H3 output, for two-stage output, or for the sharpest/best H3 quality; for ordinary 768p FastH3 output keep the regular FastH3 selector at targetResolution 768. All use native audio, fixed 24fps, 5.17-15.08s, and a 768p-class 32px-grid canvas; use animate_photo for H3 image-conditioned modes. Base and Turbo T2V/I2V/FLF2V prompts use the exact ordered fields integrated_multimodal_description, overall_soundscape, and non_diegetic_music; I2V/FLF2V prepend the official alignment line. \"minimax-h3-r2v\": standard 20-step MiniMax H3 reference-to-video; \"minimax-h3-r2v-turbo\": the dedicated LightX2V 4-step Ref2VA Turbo workflow using Euler/simple and a 960x544 default. \"minimax-h3-r2v-2stage\" (Standard, 20 steps, res_multistep/simple) and \"minimax-h3-r2v-balanced-2stage\" (Balanced, 8 steps, Euler/simple) are the two-stage reference-to-video forms: the tier renders the canvas, then the worker enlarges it 2x and refines it, so the clip is delivered at twice the canvas width and height with the same length, audio and references. targetResolution names the delivered class exactly as for the FastH3 two-stage selectors: 1080 renders a 544px short-edge canvas (960x544 is delivered at 1920x1088), 1440 or omitted renders the 768p canvas for 2K (1344x768 is delivered at 2688x1536), and 720 renders a 384px canvas (672x384 is delivered at 1344x768). Each bills its tier's own per-second rate plus the two-stage surcharge of the delivered class (none at 720p); the estimate prices every request. Choose one when the user asks for 1080p, 1440p or 2K MiniMax H3 reference-to-video output; keep the one-stage \"minimax-h3-r2v\" or Balanced selector for ordinary 768p output. FastH3 Reference is the FastH3 tier's reference-to-video engine, FastVideo's FastH3 Omni on its own distilled Ref2VA checkpoint: use \"minimax-h3-fasth3-r2v-turbo\" with the same references, durations and catalog and Personal LoRAs as the other R2V selectors. It is faster than Balanced at 768p, while Turbo Reference stays faster for 480p-class output. \"minimax-h3-fasth3-r2v-turbo-2stage\" is its two-stage form: targetResolution names the delivered class exactly as for the other two-stage selectors (1080, 1440 or omitted for 2K, 720). Every R2V selector accepts up to 9 images, 3 videos, and 3 audios (12 files total); at least one visual reference (image or video) is required and audio alone is invalid. Select references with referenceImageIndices/referenceVideoIndices/referenceAudioIndices and address them with the official <Subject N>/<Picture N>/<Video N>/<Audio N> semantics. Seedance quality is selected only by model: use \"seedance2-mini\" for Seedance 2.0 Mini or faster/lower-cost 720p iteration, use \"seedance2-5\" at targetResolution=1080 for generated/uploaded storyboard images and current high-quality Seedance generation unless the user explicitly requests another model or resolution, and use \"seedance2\" for Seedance 2.0 or 4K requests because Seedance 2.5 supports up to 1080p. Do not use Default Media Quality Fast/HQ/Pro to represent Seedance quality. \"seedance2-5\": Seedance 2.5, the newest Seedance generation — 480p, 720p, and 1080p (4K is unsupported), 4-30s per clip at a fixed 24 fps, native audio, first-and-last-frame conditioning, and a much larger reference budget than the 2.0 family: up to 30 images, 10 videos, and 10 audios, with up to 50 reference media files total, subject to those per-modality caps. Choose \"seedance2-5\" when the user asks for Seedance 2.5, wants a single continuous Seedance clip longer than 15s (2.5 renders up to 30s in one call instead of being split and stitched), or wants a first-and-last-frame Seedance transition. Keep \"seedance2\" for 4K requests; Seedance 2.5 supports up to 1080p. \"seedance2-5-uncensored\": Seedance 2.5 Uncensored — the uncensored variant of Seedance 2.5, with every mode, resolution, duration, reference limit, and output option described for \"seedance2-5\". Choose it only when the user asks for Seedance 2.5 Uncensored (including \"Seedance Uncensored\" or \"Seedance Spicy\") or for uncensored Seedance output; never swap it in for \"seedance2-5\" otherwise. Each account must accept a one-time likeness and consent agreement in the Sogni app before its first render; until then the job fails with error 4103, so tell the user to accept it in the Sogni app instead of retrying. \"seedance2-mini-uncensored\": Seedance 2.0 Mini Uncensored — the uncensored variant of Seedance 2.0 Mini, with every mode, resolution (480p/720p), duration (4-15s), reference limit, and output option of \"seedance2-mini\". Choose it only when the user asks for Seedance 2.0 Mini Uncensored (including \"Seedance Mini Uncensored\" or \"Seedance Mini Spicy\") or for uncensored Seedance Mini output; never swap it in for \"seedance2-mini\" or \"seedance2-5-uncensored\" otherwise. It shares the Seedance 2.5 Uncensored likeness and consent agreement: until the account accepts it in the Sogni app the job fails with error 4103, so tell the user to accept it there instead of retrying. Seedance supports multimodal loose reference assets. Seedance 2.0 and Mini accept up to 9 images, 3 videos, and 3 audios, with no more than 12 asset files total. Seedance 2.5 accepts up to 30 images, 10 videos, and 10 audios, with up to 50 reference media files total, subject to those per-modality caps. Use @Image1/@Video1/@Audio1 style references in creative briefs when assigning roles. Assign every useful reference asset a role and prefer positive preservation constraints. If an uploaded video is the source clip to transform, upscale, enhance, restyle, or remaster, use video_to_video with controlMode=\"seedance-v2v\" instead of generate_video referenceVideoIndices. Alibaba HappyHorse 1.1 video models (third-party vendor — requires Premium Spark). Select by mode: \"happyhorse-1.1-t2v\" for text-to-video, \"happyhorse-1.1-i2v\" for image-to-video from one first-frame image, and \"happyhorse-1.1-r2v\" for reference-to-video with up to 9 reference images. Resolutions 720P and 1080P; duration 3-15 seconds at 24 fps; native synchronized audio is always generated (do not set generateAudio or negativePrompt). Supported aspect ratios: 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9. HappyHorse 1.1 takes image references only and renders a native synchronized audio track (always on; do not set generateAudio or a negative prompt). Pick the model by mode: happyhorse-1.1-t2v for text-to-video (no reference image), happyhorse-1.1-i2v for image-to-video from a single first frame, and happyhorse-1.1-r2v for reference-to-video with 1 to 9 reference images. For r2v, tag the images in the prompt as [Image 1]…[Image 9] and assign each a clear role. HappyHorse does not accept reference videos or reference audios. \"wan3.0-video\" is Alibaba Wan 3 and \"wan3.0-spicy-video\" is MuleRouter w3.0-video. Both render 2-30s at fixed 30 fps with optional native audio, provider prompt expansion, 480p/720p/1080p, adaptive/fixed ratios, first/last frames, and up to 10 image/5 video/5 audio references. Only Alibaba wan3.0-video accepts document/web context and watermark. Frame anchors and loose references are mutually exclusive. Do not send negativePrompt; video references are loose conditioning for a new result, not source-video editing or extension. MiniMax H3 Balanced uses the LightX2V 8-step 768p accelerator for FL2VA and Larry v4 step-600 EMA for Ref2VA, between 4-step Turbo and 20-step Standard; use \"minimax-h3-balanced\" or \"minimax-h3-t2v-balanced\" for FL2VA text-to-video and \"minimax-h3-r2v-balanced\" for Ref2VA reference-to-video. Sources: https://huggingface.co/lightx2v/Minimax-h3-Turbo/tree/f3d9da6dac47dcb985684ca150f02893f619a171 and https://huggingface.co/larryvrh/MiniMax-H3-Turbo-Lora/tree/7b7ac96b0616100db75ea285090210c3ddf37c04. MiniMax H3 FastH3 Turbo is the separate FastVideo VSA four-step engine, qualified only with Euler/simple; use \"minimax-h3-fasth3-turbo\" or \"minimax-h3-fasth3-t2v-turbo\" for text-to-video. Existing \"minimax-h3-turbo\" selectors remain LightX2V Turbo. MiniMax H3 FastH3 Two-Stage renders the FastH3 canvas, then enlarges it 2x and refines it, delivering twice the canvas with the same length and audio; use \"minimax-h3-fasth3-turbo-2stage\" or \"minimax-h3-fasth3-t2v-turbo-2stage\" for two-stage text-to-video. Its targetResolution names the delivered class: 1080 (544px canvas, 960x544 delivers 1920x1088), 1440 or omitted for 2K (768p canvas, 1344x768 delivers 2688x1536), or 720 (384px canvas, 672x384 delivers 1344x768). MiniMax H3 Two-Stage Reference-to-Video is the Standard or Balanced Ref2VA request delivered at twice the canvas with the same length, audio and references; use \"minimax-h3-r2v-2stage\" (20 steps) or \"minimax-h3-r2v-balanced-2stage\" (8 steps). targetResolution names the delivered class exactly as for the FastH3 two-stage selectors (1080, 1440 or omitted for 2K, 720), and each bills its tier's rate plus the two-stage surcharge of that class; keep \"minimax-h3-r2v\" or \"minimax-h3-r2v-balanced\" for ordinary 768p output. MiniMax H3 FastH3 Reference is the FastH3 tier's reference-to-video engine, FastVideo's FastH3 Omni on its own distilled Ref2VA checkpoint, about twice as fast as Balanced Reference; use \"minimax-h3-fasth3-r2v-turbo\" with the same references, durations, catalog LoRAs and Personal LoRAs as the other R2V selectors. \"minimax-h3-fasth3-r2v-turbo-2stage\" is its two-stage form: targetResolution names the delivered class exactly as for the other two-stage selectors (1080, 1440 or omitted for 2K, 720), and it bills its own rate plus the two-stage surcharge of that class."
247
247
  },
248
248
  "generateAudio": {
249
249
  "type": "boolean",
@@ -12,7 +12,9 @@ import {
12
12
  import {
13
13
  isFlux3ImageKleinModel,
14
14
  isKreaIdentityEditModel,
15
- isQwenImageEditModel
15
+ isQwenImageEditModel,
16
+ isSeedreamModel,
17
+ SEEDREAM_5_PRO_UNCENSORED_MODEL_ID
16
18
  } from '../lib/validation.js';
17
19
 
18
20
  export {
@@ -98,6 +100,9 @@ export const PREFERRED_MODEL_IDS = {
98
100
  gptImage2: 'gpt-image-2',
99
101
  gptImage25Sunburst: 'gpt-image-2.5-sunburst',
100
102
  gptImage25Flare: 'gpt-image-2.5-flare',
103
+ // Seedream 5.0 Pro Uncensored: requires the one-time agreement Seedance 2.5
104
+ // Uncensored uses, and is only ever chosen by name.
105
+ seedream5ProUncensored: 'seedream-5-0-pro-uncensored',
101
106
  flux1Schnell: 'flux1-schnell-fp8',
102
107
  chromaFlash: 'chroma-v.46-flash_fp8',
103
108
  zTurbo: 'z_image_turbo_bf16',
@@ -264,11 +269,24 @@ const GPT_IMAGE_25_SELECTORS: Record<string, string> = {
264
269
  flare: PREFERRED_MODEL_IDS.image.gptImage25Flare
265
270
  };
266
271
 
272
+ // Seedream 5.0 Pro Uncensored is one model for text-to-image and 1-10
273
+ // reference edits, so generate_image and edit_image share its selectors. Every
274
+ // selector names the uncensored model: no standard Seedream ships, and a bare
275
+ // "seedream" is left free for one.
276
+ const SEEDREAM_SELECTORS: Record<string, string> = {
277
+ 'seedream-5-pro-uncensored': SEEDREAM_5_PRO_UNCENSORED_MODEL_ID,
278
+ 'seedream-5.0-pro-uncensored': SEEDREAM_5_PRO_UNCENSORED_MODEL_ID,
279
+ 'seedream-uncensored': SEEDREAM_5_PRO_UNCENSORED_MODEL_ID,
280
+ 'seedream-5-pro-spicy': SEEDREAM_5_PRO_UNCENSORED_MODEL_ID,
281
+ 'seedream-5.0-pro-spicy': SEEDREAM_5_PRO_UNCENSORED_MODEL_ID
282
+ };
283
+
267
284
  const IMAGE_MODEL_SELECTORS: Record<string, string> = {
268
285
  ...Object.fromEntries(
269
286
  GPT_IMAGE_MODEL_ALIASES.map((alias) => [alias, PREFERRED_MODEL_IDS.image.gptImage2])
270
287
  ),
271
288
  ...GPT_IMAGE_25_SELECTORS,
289
+ ...SEEDREAM_SELECTORS,
272
290
  'z-turbo': 'z_image_turbo_bf16',
273
291
  'krea-2-turbo': 'krea2_turbo_fp8_scaled',
274
292
  'krea2-turbo': 'krea2_turbo_fp8_scaled',
@@ -311,6 +329,7 @@ const EDIT_IMAGE_MODEL_SELECTORS: Record<string, string> = {
311
329
  GPT_IMAGE_MODEL_ALIASES.map((alias) => [alias, PREFERRED_MODEL_IDS.image.gptImage2])
312
330
  ),
313
331
  ...GPT_IMAGE_25_SELECTORS,
332
+ ...SEEDREAM_SELECTORS,
314
333
  'qwen-lightning': 'qwen_image_edit_2511_fp8_lightning',
315
334
  qwen: 'qwen_image_edit_2511_fp8',
316
335
  ...FLUX3_IMAGE_KLEIN_SELECTORS,
@@ -623,6 +642,7 @@ export function isEditImageModel(modelId: string): boolean {
623
642
  modelId === PREFERRED_MODEL_IDS.image.gptImage2 ||
624
643
  modelId === PREFERRED_MODEL_IDS.image.gptImage25Sunburst ||
625
644
  modelId === PREFERRED_MODEL_IDS.image.gptImage25Flare ||
645
+ isSeedreamModel(modelId) ||
626
646
  isQwenImageEditModel(modelId) ||
627
647
  isKreaIdentityEditModel(modelId) ||
628
648
  isFlux3ImageKleinModel(modelId)
@@ -19,9 +19,11 @@ import {
19
19
  validateNumber,
20
20
  validateCustomImageSize,
21
21
  validateGptImageOptions,
22
+ validateSeedreamOptions,
22
23
  validateVideoSize,
23
24
  validateTeacacheThreshold,
24
25
  isComfyModel,
26
+ isSeedreamModel,
25
27
  validateVideoDuration,
26
28
  validateSampler,
27
29
  validateScheduler,
@@ -1546,6 +1548,7 @@ function applyImageParams(
1546
1548
  });
1547
1549
  }
1548
1550
  validateGptImageOptions(params);
1551
+ validateSeedreamOptions(params);
1549
1552
  if (params.gptImageMask) {
1550
1553
  keyFrame.hasReferenceMask = true;
1551
1554
  keyFrame.referenceMaskContentType = 'image/png';
@@ -1960,6 +1963,7 @@ function createJobRequestMessage(id: string, params: ProjectParams, options: Mod
1960
1963
  };
1961
1964
  if (
1962
1965
  isAudioParams(params) ||
1966
+ (isImageParams(params) && isSeedreamModel(params.modelId)) ||
1963
1967
  (isVideoParams(params) &&
1964
1968
  (isExternalApiVideoModel(params.modelId) || isMinimaxH3Model(params.modelId)))
1965
1969
  ) {
@@ -2406,7 +2406,7 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
2406
2406
  await this.uploadCNImage(project.id, data.controlNet.image);
2407
2407
  }
2408
2408
 
2409
- // Context images (GPT Image 2 supports up to 16; FLUX 3 Image Klein up to 10; Qwen Image Edit supports up to 3; Krea 2 Identity Edit and legacy Flux Kontext support up to 2)
2409
+ // Context images (GPT Image 2 supports up to 16; Seedream 5.0 Pro Uncensored and FLUX 3 Image Klein up to 10; Qwen Image Edit supports up to 3; Krea 2 Identity Edit and legacy Flux Kontext support up to 2)
2410
2410
  if (data.contextImages?.length) {
2411
2411
  const maxContextImages = getMaxContextImages(data.modelId);
2412
2412
  if (data.contextImages.length > maxContextImages) {
@@ -270,8 +270,8 @@ export interface MinimaxH3Keyframe {
270
270
  * using the `_2stage` model id and that canvas.
271
271
  * - FastH3 Reference (`minimax-h3-fastvideo-omni-int8_r2v_turbo`) is
272
272
  * FastVideo's FastH3 Omni, its own distilled `r2v` checkpoint, with the same
273
- * references, catalog LoRAs, frame grid and canvas as the other `r2v` IDs;
274
- * Personal LoRAs are not available on it. Its
273
+ * references, catalog and Personal LoRAs, frame grid and canvas as the other
274
+ * `r2v` IDs. Its
275
275
  * two-stage ID (`minimax-h3-fastvideo-omni-int8_r2v_turbo_2stage`) takes the
276
276
  * same request and delivers twice the canvas, with the same 384/544/768 px
277
277
  * canvas choices as the other Two-Stage IDs.
@@ -990,6 +990,7 @@ export interface ImageProjectParams
990
990
  /**
991
991
  * Context images for multi-reference image generation.
992
992
  * GPT Image 2 supports up to 16 context images.
993
+ * Seedream 5.0 Pro Uncensored supports up to 10 context images.
993
994
  * Qwen Image Edit supports up to 3 context images.
994
995
  * Krea 2 Identity Edit supports up to 2 context images.
995
996
  * Legacy Flux Kontext matching supports up to 2 context images.
package/src/index.ts CHANGED
@@ -49,6 +49,7 @@ import {
49
49
  isVideoUpscaleModel,
50
50
  requiresStartingImage
51
51
  } from './Projects/utils/index.js';
52
+ import { SEEDREAM_5_PRO_UNCENSORED_MODEL_ID, isSeedreamModel } from './lib/validation.js';
52
53
  import ProjectsApi from './Projects/index.js';
53
54
  import Job, { JobStatus } from './Projects/Job.js';
54
55
  import Project, { ProjectStatus } from './Projects/Project.js';
@@ -498,6 +499,7 @@ export {
498
499
  PIXAL3D_MULTIVIEW_IMAGE_TO_3D_MODEL_ID,
499
500
  PIXAL3D_ORBIT_VIEW_SLOTS,
500
501
  SAM3_IMAGE_SEGMENT_MODEL_ID,
502
+ SEEDREAM_5_PRO_UNCENSORED_MODEL_ID,
501
503
  calculateVideoFrames,
502
504
  getMinimaxH3FramesForAudioDuration,
503
505
  getPixal3dOrbitViewSlots,
@@ -508,6 +510,7 @@ export {
508
510
  isPixal3dModel,
509
511
  isPixal3dMultiViewModel,
510
512
  isSegmentationModel,
513
+ isSeedreamModel,
511
514
  isVideoModel,
512
515
  isVideoUpscaleModel,
513
516
  requiresStartingImage,
@@ -70,6 +70,67 @@ export function validateGptImageOptions(params: ImageProjectParams): void {
70
70
  }
71
71
  }
72
72
 
73
+ /**
74
+ * Seedream 5.0 Pro Uncensored: ByteDance's Seedream 5.0 Pro, an external
75
+ * API-backed image model for text-to-image and for edits from 1-10 reference
76
+ * images (`contextImages`). Spark-only, with no negative prompt, seed or steps.
77
+ * Each account must accept the one-time likeness and consent agreement that
78
+ * Seedance 2.5 Uncensored uses (key `seedance-2-5-uncensored`) in a Sogni app
79
+ * first; until then its jobs fail with error code 4103
80
+ * (`MODEL_CONSENT_REQUIRED_ERROR_CODE`).
81
+ */
82
+ export const SEEDREAM_5_PRO_UNCENSORED_MODEL_ID = 'seedream-5-0-pro-uncensored';
83
+
84
+ const SEEDREAM_MODEL_IDS = new Set([SEEDREAM_5_PRO_UNCENSORED_MODEL_ID]);
85
+ const SEEDREAM_MAX_CONTEXT_IMAGES = 10;
86
+ // Output limits: 921,600 (1280x720) to 4,194,304 (2048x2048) pixels, aspect
87
+ // ratio from 1:16 to 16:1. Together they bound each edge to 240-8192 px
88
+ // (3840x240 and 8192x512 are the extremes).
89
+ const SEEDREAM_MIN_PIXELS = 921_600;
90
+ const SEEDREAM_MAX_PIXELS = 4_194_304;
91
+ const SEEDREAM_MAX_ASPECT_RATIO = 16;
92
+
93
+ /** Whether `modelId` is a Seedream image model (today only Seedream 5.0 Pro Uncensored). */
94
+ export function isSeedreamModel(modelId?: string): boolean {
95
+ return modelId !== undefined && SEEDREAM_MODEL_IDS.has(modelId);
96
+ }
97
+
98
+ /**
99
+ * Check a Seedream request before anything is uploaded: at most 10 non-empty
100
+ * reference images, and a custom size inside the pixel and aspect-ratio limits.
101
+ */
102
+ export function validateSeedreamOptions(params: ImageProjectParams): void {
103
+ if (!isSeedreamModel(params.modelId)) return;
104
+ if (
105
+ params.contextImages !== undefined &&
106
+ (!Array.isArray(params.contextImages) ||
107
+ params.contextImages.length > SEEDREAM_MAX_CONTEXT_IMAGES ||
108
+ params.contextImages.some((image) => !image))
109
+ ) {
110
+ throw new Error(
111
+ `${params.modelId} accepts up to ${SEEDREAM_MAX_CONTEXT_IMAGES} non-empty reference images in source order`
112
+ );
113
+ }
114
+ const isCustomSize =
115
+ (params.sizePreset === undefined || params.sizePreset === 'custom') &&
116
+ !!params.width &&
117
+ !!params.height;
118
+ if (!isCustomSize) return;
119
+ const width = Number(params.width);
120
+ const height = Number(params.height);
121
+ const pixels = width * height;
122
+ const aspectRatio = Math.max(width, height) / Math.min(width, height);
123
+ if (
124
+ pixels < SEEDREAM_MIN_PIXELS ||
125
+ pixels > SEEDREAM_MAX_PIXELS ||
126
+ aspectRatio > SEEDREAM_MAX_ASPECT_RATIO
127
+ ) {
128
+ throw new Error(
129
+ `${params.modelId} renders 921,600 to 4,194,304 pixels at an aspect ratio from 1:16 to 16:1; got ${width}x${height}`
130
+ );
131
+ }
132
+ }
133
+
73
134
  const EXTENDED_IMAGE_SIZE_MODEL_IDS = new Set([
74
135
  'z_image_bf16',
75
136
  'z_image_turbo_bf16',
@@ -132,6 +193,9 @@ function getCustomImageSizeBounds(modelId?: string): { min: number; max: number
132
193
  if (isGptImageModel(modelId)) {
133
194
  return { min: 256, max: 3840 };
134
195
  }
196
+ if (isSeedreamModel(modelId)) {
197
+ return { min: 240, max: 8192 };
198
+ }
135
199
  if (modelId && isFlux3ImageKleinModel(modelId)) {
136
200
  return { min: 256, max: 4096 };
137
201
  }
@@ -242,6 +306,7 @@ export function isComfyModel(modelId: string): boolean {
242
306
  /**
243
307
  * Get the maximum number of context images supported by a model.
244
308
  * - GPT Image 2: 16 images
309
+ * - Seedream 5.0 Pro Uncensored: 10 images
245
310
  * - FLUX 3 Image Klein: 10 images (optional)
246
311
  * - Qwen Image Edit: 3 images
247
312
  * - Krea 2 Identity Edit: 2 images
@@ -253,6 +318,9 @@ export function getMaxContextImages(modelId: string): number {
253
318
  if (isGptImageModel(modelId)) {
254
319
  return 16;
255
320
  }
321
+ if (isSeedreamModel(modelId)) {
322
+ return SEEDREAM_MAX_CONTEXT_IMAGES;
323
+ }
256
324
  if (isFlux3ImageKleinModel(modelId)) {
257
325
  return 10;
258
326
  }