@sogni-ai/sogni-intelligence-client 3.21.0 → 3.22.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 (68) hide show
  1. package/dist/agent/index.d.ts +1 -1
  2. package/dist/agent/index.d.ts.map +1 -1
  3. package/dist/agent/index.js +2 -1
  4. package/dist/agent/index.js.map +1 -1
  5. package/dist/agent/turnAnalysis.d.ts +9 -0
  6. package/dist/agent/turnAnalysis.d.ts.map +1 -1
  7. package/dist/agent/turnAnalysis.js +30 -0
  8. package/dist/agent/turnAnalysis.js.map +1 -1
  9. package/dist/client/SogniClientWrapper.d.ts.map +1 -1
  10. package/dist/client/SogniClientWrapper.js +19 -1
  11. package/dist/client/SogniClientWrapper.js.map +1 -1
  12. package/dist/contracts/imagePrompt.d.ts +17 -1
  13. package/dist/contracts/imagePrompt.d.ts.map +1 -1
  14. package/dist/contracts/imagePrompt.js +394 -0
  15. package/dist/contracts/imagePrompt.js.map +1 -1
  16. package/dist/contracts/index.d.ts +2 -2
  17. package/dist/contracts/index.d.ts.map +1 -1
  18. package/dist/contracts/index.js +5 -2
  19. package/dist/contracts/index.js.map +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +3 -2
  23. package/dist/index.js.map +1 -1
  24. package/dist/openai-tools/_manifests.generated.js +3 -3
  25. package/dist/openai-tools/_manifests.generated.js.map +1 -1
  26. package/dist/openai-tools/generation-tools.json +3 -3
  27. package/dist/schemas/tools/generate_video.schema.json +1 -1
  28. package/dist/schemas/tools/sound_to_video.schema.json +1 -1
  29. package/dist/schemas/tools/video_to_video.schema.json +1 -1
  30. package/dist/tools/definitions/generate-video/definition.js +1 -1
  31. package/dist/tools/definitions/generate-video/definition.js.map +1 -1
  32. package/dist/tools/definitions/sound-to-video/definition.js +1 -1
  33. package/dist/tools/definitions/sound-to-video/definition.js.map +1 -1
  34. package/dist/tools/shared/_catalogs.generated.js +1 -1
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/index.d.ts.map +1 -1
  37. package/dist/types/index.js.map +1 -1
  38. package/dist/utils/helpers.d.ts +2 -0
  39. package/dist/utils/helpers.d.ts.map +1 -1
  40. package/dist/utils/helpers.js +12 -0
  41. package/dist/utils/helpers.js.map +1 -1
  42. package/dist-esm/agent/index.js +1 -1
  43. package/dist-esm/agent/index.js.map +1 -1
  44. package/dist-esm/agent/turnAnalysis.js +29 -0
  45. package/dist-esm/agent/turnAnalysis.js.map +1 -1
  46. package/dist-esm/client/SogniClientWrapper.js +19 -1
  47. package/dist-esm/client/SogniClientWrapper.js.map +1 -1
  48. package/dist-esm/contracts/imagePrompt.js +391 -0
  49. package/dist-esm/contracts/imagePrompt.js.map +1 -1
  50. package/dist-esm/contracts/index.js +1 -1
  51. package/dist-esm/contracts/index.js.map +1 -1
  52. package/dist-esm/index.js +1 -1
  53. package/dist-esm/index.js.map +1 -1
  54. package/dist-esm/openai-tools/_manifests.generated.js +3 -3
  55. package/dist-esm/openai-tools/_manifests.generated.js.map +1 -1
  56. package/dist-esm/openai-tools/generation-tools.json +3 -3
  57. package/dist-esm/schemas/tools/generate_video.schema.json +1 -1
  58. package/dist-esm/schemas/tools/sound_to_video.schema.json +1 -1
  59. package/dist-esm/schemas/tools/video_to_video.schema.json +1 -1
  60. package/dist-esm/tools/definitions/generate-video/definition.js +1 -1
  61. package/dist-esm/tools/definitions/generate-video/definition.js.map +1 -1
  62. package/dist-esm/tools/definitions/sound-to-video/definition.js +1 -1
  63. package/dist-esm/tools/definitions/sound-to-video/definition.js.map +1 -1
  64. package/dist-esm/tools/shared/_catalogs.generated.js +1 -1
  65. package/dist-esm/types/index.js.map +1 -1
  66. package/dist-esm/utils/helpers.js +11 -0
  67. package/dist-esm/utils/helpers.js.map +1 -1
  68. package/package.json +3 -3
@@ -50,6 +50,52 @@ const SD3_GUIDE = `SD3 has improved natural language understanding, multi-subjec
50
50
  - For text in images, spell out exactly what to render in quotes.
51
51
  - Don't over-tag with "masterpiece, best quality" etc. — just describe what you want.
52
52
  - SD3 handles complex scenes better than SD1.5/SDXL.`;
53
+ const KREA2_GUIDE = `Krea 2 and Krea 2 Turbo are caption-conditioned image models built for aesthetic exploration and precise creative steering.
54
+ - Write one dense but fluent visual caption, usually 50-120 words. Krea 2 was trained on rich captions; do not reduce the request to SD-style keyword soup.
55
+ - Preserve ambiguity when the user wants exploration. When the user specifies a direction, make subject, action, composition, medium, palette, lighting, texture, and atmosphere concrete enough to narrow the output deliberately.
56
+ - Describe observable visual qualities instead of generic quality boosters such as "masterpiece" or "8K".
57
+ - Keep the subject and requested content dominant. Do not bury a simple idea under invented props, wardrobe, characters, symbols, or narrative beats.
58
+ - If visible text is requested, reproduce the exact wording in double quotes and state its placement and treatment.
59
+ - Krea 2 Turbo is distilled for few-step generation; use a cohesive caption with strong nouns and visual relationships rather than repeated emphasis tokens or prompt weights.`;
60
+ const QWEN_GUIDE = `Qwen Image 2512 uses detailed natural-language image descriptions and is especially strong at instruction following, spatial composition, human realism, fine natural detail, and visible text.
61
+ - Write a cohesive descriptive prompt with the subject and action first, followed by spatial layout, environment, composition, lighting, materials, and style.
62
+ - State poses, relative positions, viewing angle, and important geometric relationships explicitly.
63
+ - For any requested visible text, preserve the exact wording in double quotes and specify carrier, placement, layout direction, typography, color, and scale. Do not invent visible text when none was requested.
64
+ - Add concrete detail where the request is sparse, but never alter proper nouns or invent new subjects, objects, actions, labels, or story events.
65
+ - Avoid SD-style score tags and repeated quality tokens.`;
66
+ const Z_IMAGE_GUIDE = `Z-Image and Z-Image Turbo use instruction-aware natural-language captions and are strong at photorealism, bilingual text rendering, and precise prompt adherence.
67
+ - Use a compact, information-dense description: subject and appearance, action or pose, environment, composition, lighting, material detail, and requested style.
68
+ - Prefer concrete visual nouns and relationships over abstract quality claims or comma-separated SD tag piles.
69
+ - Quote exact visible text and preserve its language, capitalization, and punctuation.
70
+ - For Turbo, keep the prompt direct and avoid repeated emphasis or weighting syntax; its distilled low-guidance path should receive one clear visual direction.
71
+ - Do not invent subjects, props, labels, or narrative events that the user did not request.`;
72
+ const GPT_IMAGE_GUIDE = `GPT Image 2 follows direct natural-language creative direction for both simple scenes and complex layouts.
73
+ - State the intended artifact and composition clearly, then describe subjects, actions, spatial layout, style, palette, lighting, materials, and finishing details in priority order.
74
+ - For typography, diagrams, panels, packaging, signs, or UI, provide exact visible copy in double quotes and specify placement, hierarchy, alignment, and visual treatment.
75
+ - Preserve every requested constraint and proper noun exactly. Do not add labels, slogans, logos, panels, or decorative copy unless requested.
76
+ - Use explicit relationships and layout instructions instead of diffusion-model weighting syntax, score tags, or generic quality-token piles.`;
77
+ const QWEN_EDIT_GUIDE = `Qwen Image Edit 2511 follows direct natural-language edit instructions and can combine up to three ordered context images.
78
+ - Describe the requested transformation, not a fresh standalone scene caption. Name what changes and what remains fixed.
79
+ - When multiple references are part of the request, assign each one an explicit role using context_image_0, context_image_1, and context_image_2 in attachment order.
80
+ - Keep identity, composition, lighting, materials, and untouched regions stable when the user asks to preserve them.
81
+ - For added or replaced visible text, quote the exact wording and specify its placement and treatment.
82
+ - Prefer short, concrete instructions; use longer structured prose only for multi-element layouts or complex compositing.`;
83
+ const KREA2_EDIT_GUIDE = `Krea 2 Identity Edit performs best with a concise delta instruction grounded in one or two ordered context images.
84
+ - For one reference, state the requested change in 1-4 concrete sentences. Name only the details that change and the few details that must remain fixed; do not restate the full source image or dump a facial-feature inventory.
85
+ - For two references, assign roles explicitly: context_image_0 is the base scene/image and context_image_1 is the person, outfit, pose, detail, or style reference.
86
+ - End with a short preservation clause only when useful. Keep likeness, source composition, or untouched regions stable exactly when requested.
87
+ - Longer structured prompts are appropriate only for character sheets, grids, editorial layouts, or exact visible text.`;
88
+ const GPT_IMAGE_EDIT_GUIDE = `GPT Image 2 editing follows precise natural-language transformation instructions and ordered image references.
89
+ - Say exactly what to add, remove, replace, restyle, reposition, or preserve. Treat unmentioned source content as unchanged when that matches the request.
90
+ - Refer to ordered inputs as Image 1, Image 2, and so on, assigning each a clear role when multiple references are involved.
91
+ - For visible text edits, preserve exact wording in double quotes and specify placement, hierarchy, typography, and treatment.
92
+ - Use explicit layout and preservation requirements rather than diffusion weights, score tags, or a negative-prompt list.`;
93
+ const FLUX_EDIT_GUIDE = `FLUX editing models use direct natural-language transformation instructions with explicit reference roles.
94
+ - State the edit goal first, then name the source elements to preserve and the concrete visual changes to make.
95
+ - Refer to multiple images by their ordered role when supplied; do not merge identities, styles, or objects implicitly.
96
+ - Use positive desired-state language. FLUX.2 does not support negative prompts.
97
+ - Quote exact visible text and describe its placement when typography is requested.
98
+ - Keep simple edits concise; use detailed spatial and material direction only when the edit requires it.`;
53
99
  const EDITING_GUIDE = `Image editing models accept reference images alongside text prompts. The prompt acts as an instruction for how to modify or build upon the input image(s).
54
100
  - Write prompts as transformation instructions referencing the existing image.
55
101
  - Describe changes as transformations: "is now wearing", "now has", "the background changes to".
@@ -65,6 +111,14 @@ const PROMPTING_GUIDES = {
65
111
  fast: FAST_GUIDE,
66
112
  sd3: SD3_GUIDE,
67
113
  editing: EDITING_GUIDE,
114
+ krea2: KREA2_GUIDE,
115
+ qwen: QWEN_GUIDE,
116
+ "z-image": Z_IMAGE_GUIDE,
117
+ "gpt-image": GPT_IMAGE_GUIDE,
118
+ "qwen-edit": QWEN_EDIT_GUIDE,
119
+ "krea2-edit": KREA2_EDIT_GUIDE,
120
+ "gpt-image-edit": GPT_IMAGE_EDIT_GUIDE,
121
+ "flux-edit": FLUX_EDIT_GUIDE,
68
122
  video: "",
69
123
  };
70
124
  function buildSystemPrompt(promptingType, modelTitle) {
@@ -159,4 +213,341 @@ export function buildImagePromptMessages(inputOrPrompt, stylePrompt = "", prompt
159
213
  export function parseToolCallPrompt(args) {
160
214
  return String(args.prompt || "").trim();
161
215
  }
216
+ const SDXL_MODEL_NAMES = new Set([
217
+ "sdxl",
218
+ "stable-diffusion-xl",
219
+ "stable-diffusion-xl-1-0",
220
+ "albedo-xl",
221
+ "animagine-xl",
222
+ "anima-pencil-xl",
223
+ "art-universe-xl",
224
+ "hyphoria-real",
225
+ "analog-madness-xl",
226
+ "cyberrealistic-xl",
227
+ "real-dream-xl",
228
+ "faetastic-xl",
229
+ "zavychroma-xl",
230
+ "dreamshaper-xl",
231
+ ]);
232
+ const PONY_MODEL_NAMES = new Set([
233
+ "pony",
234
+ "pony-xl",
235
+ "pony-v7",
236
+ "pony-faetality",
237
+ "one-obsession-v22",
238
+ "cyberrealistic-pony-v7",
239
+ ]);
240
+ const FLUX_MODEL_NAMES = new Set([
241
+ "flux",
242
+ "flux-1",
243
+ "flux-1-schnell",
244
+ "flux-schnell",
245
+ "flux1-krea",
246
+ "flux-1-krea",
247
+ "flux2",
248
+ "flux-2",
249
+ "flux-2-dev",
250
+ "chroma-v46-flash",
251
+ "chroma1-hd",
252
+ "chroma-detail",
253
+ ]);
254
+ const KREA2_MODEL_NAMES = new Set([
255
+ "krea-2",
256
+ "krea2",
257
+ "krea-2-turbo",
258
+ "krea2-turbo",
259
+ "krea2-turbo-fp8-scaled",
260
+ "dark-beast-krea2",
261
+ "dark-beast-krea-2",
262
+ "dark-beast-krea2-fp8",
263
+ ]);
264
+ const QWEN_GENERATE_MODEL_NAMES = new Set([
265
+ "qwen-image",
266
+ "qwen-image-2512",
267
+ "qwen-2512",
268
+ "qwen-2512-lightning",
269
+ "qwen-image-2512-lightning",
270
+ ]);
271
+ const QWEN_EDIT_MODEL_NAMES = new Set([
272
+ "qwen",
273
+ "qwen-edit",
274
+ "qwen-lightning",
275
+ "qwen-image-edit",
276
+ "qwen-image-edit-2511",
277
+ "qwen-image-edit-2511-lightning",
278
+ ]);
279
+ const KREA2_EDIT_MODEL_NAMES = new Set([
280
+ "krea-identity-edit",
281
+ "krea-2-identity-edit",
282
+ "krea2-identity-edit",
283
+ "krea2-identity-edit-v1-2",
284
+ "dark-beast-krea2-identity-edit",
285
+ "dark-beast-krea-2-identity-edit",
286
+ ]);
287
+ const GPT_IMAGE_MODEL_NAMES = new Set([
288
+ "gpt-image-2",
289
+ "gpt-image2",
290
+ "gpt-2-image",
291
+ "openai-gpt-image-2",
292
+ "chatgpt-image-2",
293
+ ]);
294
+ const FLUX_EDIT_MODEL_NAMES = new Set([
295
+ "flux2",
296
+ "flux-2",
297
+ "flux-2-dev",
298
+ ]);
299
+ function normalizeImagePromptModelName(value) {
300
+ return value
301
+ .trim()
302
+ .toLowerCase()
303
+ .replace(/\b(?:model|renderer)\b/g, " ")
304
+ .replace(/[^a-z0-9]+/g, "-")
305
+ .replace(/^-+|-+$/g, "")
306
+ .replace(/-+/g, "-");
307
+ }
308
+ function normalizeImagePromptOperation(value) {
309
+ if (!value)
310
+ return null;
311
+ const normalized = value.trim().toLowerCase().replace(/[\s_]+/g, "-");
312
+ if (normalized === "generate"
313
+ || normalized === "generation"
314
+ || normalized === "t2i"
315
+ || normalized === "txt2img"
316
+ || normalized === "text-to-image") {
317
+ return "generate";
318
+ }
319
+ if (normalized === "edit"
320
+ || normalized === "editing"
321
+ || normalized === "image-edit"
322
+ || normalized === "instruction-edit"
323
+ || normalized === "i2i"
324
+ || normalized === "img2img"
325
+ || normalized === "image-to-image") {
326
+ return "edit";
327
+ }
328
+ return null;
329
+ }
330
+ function imageProfile(args) {
331
+ return {
332
+ id: args.id,
333
+ modelTitle: args.modelTitle,
334
+ promptingType: args.promptingType,
335
+ operation: args.operation,
336
+ outputFormat: args.outputFormat ?? "prompt",
337
+ };
338
+ }
339
+ export function resolveImagePromptAuthoringProfile(targetModel, requestedOperation) {
340
+ const model = normalizeImagePromptModelName(targetModel);
341
+ const intrinsicEdit = QWEN_EDIT_MODEL_NAMES.has(model) || KREA2_EDIT_MODEL_NAMES.has(model);
342
+ const normalizedRequestedOperation = normalizeImagePromptOperation(requestedOperation);
343
+ if (requestedOperation && !normalizedRequestedOperation)
344
+ return null;
345
+ const operation = normalizedRequestedOperation ?? (intrinsicEdit ? "edit" : "generate");
346
+ if (intrinsicEdit && operation !== "edit")
347
+ return null;
348
+ if (GPT_IMAGE_MODEL_NAMES.has(model)) {
349
+ return imageProfile({
350
+ id: operation === "edit" ? "gpt-image-2-edit" : "gpt-image-2-generate",
351
+ modelTitle: "GPT Image 2",
352
+ promptingType: operation === "edit" ? "gpt-image-edit" : "gpt-image",
353
+ operation,
354
+ });
355
+ }
356
+ if (QWEN_EDIT_MODEL_NAMES.has(model)) {
357
+ return imageProfile({
358
+ id: "qwen-image-edit-2511",
359
+ modelTitle: "Qwen Image Edit 2511",
360
+ promptingType: "qwen-edit",
361
+ operation: "edit",
362
+ });
363
+ }
364
+ if (KREA2_EDIT_MODEL_NAMES.has(model)) {
365
+ return imageProfile({
366
+ id: "krea-2-identity-edit",
367
+ modelTitle: "Krea 2 Identity Edit",
368
+ promptingType: "krea2-edit",
369
+ operation: "edit",
370
+ });
371
+ }
372
+ if (FLUX_MODEL_NAMES.has(model)) {
373
+ if (operation === "edit" && !FLUX_EDIT_MODEL_NAMES.has(model))
374
+ return null;
375
+ return imageProfile({
376
+ id: operation === "edit" ? "flux-edit" : "flux-generate",
377
+ modelTitle: model.startsWith("chroma") ? "Chroma" : "FLUX",
378
+ promptingType: operation === "edit" ? "flux-edit" : "flux",
379
+ operation,
380
+ });
381
+ }
382
+ if (KREA2_MODEL_NAMES.has(model)) {
383
+ if (operation !== "generate")
384
+ return null;
385
+ return imageProfile({
386
+ id: "krea-2-generate",
387
+ modelTitle: model.startsWith("dark-beast") ? "Dark Beast Krea 2" : "Krea 2 Turbo",
388
+ promptingType: "krea2",
389
+ operation: "generate",
390
+ });
391
+ }
392
+ if (QWEN_GENERATE_MODEL_NAMES.has(model)) {
393
+ if (operation === "edit")
394
+ return null;
395
+ return imageProfile({
396
+ id: "qwen-image-2512",
397
+ modelTitle: "Qwen Image 2512",
398
+ promptingType: "qwen",
399
+ operation: "generate",
400
+ outputFormat: "positive_negative",
401
+ });
402
+ }
403
+ if (model === "z-image" || model === "zimage") {
404
+ if (operation !== "generate")
405
+ return null;
406
+ return imageProfile({
407
+ id: "z-image-generate",
408
+ modelTitle: "Z-Image",
409
+ promptingType: "z-image",
410
+ operation: "generate",
411
+ outputFormat: "positive_negative",
412
+ });
413
+ }
414
+ if (model === "z-turbo"
415
+ || model === "z-image-turbo"
416
+ || model === "zimage-turbo"
417
+ || model === "dark-beast-z-turbo"
418
+ || model === "dark-beast-z-image-turbo") {
419
+ if (operation !== "generate")
420
+ return null;
421
+ return imageProfile({
422
+ id: "z-image-turbo-generate",
423
+ modelTitle: model.startsWith("dark-beast") ? "Dark Beast Z-Image Turbo" : "Z-Image Turbo",
424
+ promptingType: "z-image",
425
+ operation: "generate",
426
+ });
427
+ }
428
+ if (PONY_MODEL_NAMES.has(model)) {
429
+ if (operation !== "generate")
430
+ return null;
431
+ return imageProfile({
432
+ id: "pony-generate",
433
+ modelTitle: "Pony Diffusion XL",
434
+ promptingType: "pony",
435
+ operation: "generate",
436
+ outputFormat: "positive_negative",
437
+ });
438
+ }
439
+ if (SDXL_MODEL_NAMES.has(model)) {
440
+ if (operation !== "generate")
441
+ return null;
442
+ return imageProfile({
443
+ id: "sdxl-generate",
444
+ modelTitle: "Stable Diffusion XL",
445
+ promptingType: "sdxl",
446
+ operation: "generate",
447
+ outputFormat: "positive_negative",
448
+ });
449
+ }
450
+ if (model === "sd-1-5"
451
+ || model === "sd15"
452
+ || model === "stable-diffusion-1-5"
453
+ || model === "stable-diffusion-v1-5") {
454
+ if (operation !== "generate")
455
+ return null;
456
+ return imageProfile({
457
+ id: "sd15-generate",
458
+ modelTitle: "Stable Diffusion 1.5",
459
+ promptingType: "sd15",
460
+ operation: "generate",
461
+ outputFormat: "positive_negative",
462
+ });
463
+ }
464
+ if (model === "sdxl-turbo"
465
+ || model === "sdxl-lightning"
466
+ || model === "stable-diffusion-xl-turbo"
467
+ || model === "lcm") {
468
+ if (operation !== "generate")
469
+ return null;
470
+ return imageProfile({
471
+ id: "fast-diffusion-generate",
472
+ modelTitle: "Fast distilled Stable Diffusion",
473
+ promptingType: "fast",
474
+ operation: "generate",
475
+ });
476
+ }
477
+ if (model === "sd3" || model === "stable-diffusion-3" || model === "stable-diffusion-3-5") {
478
+ if (operation !== "generate")
479
+ return null;
480
+ return imageProfile({
481
+ id: "sd3-generate",
482
+ modelTitle: "Stable Diffusion 3",
483
+ promptingType: "sd3",
484
+ operation: "generate",
485
+ outputFormat: "positive_negative",
486
+ });
487
+ }
488
+ return null;
489
+ }
490
+ function imageAuthoringOutputInstruction(profile) {
491
+ if (profile.outputFormat === "positive_negative") {
492
+ return `OUTPUT CONTRACT: Return exactly two single-line fields in this order:
493
+ positive_prompt: <the model-ready positive prompt>
494
+ negative_prompt: <a concise model-native negative prompt>
495
+ Use the negative field for explicit exclusions and relevant rendering failure modes only. Never contradict or weaken requested content. Do not add any other line, heading, explanation, Markdown fence, or preamble.`;
496
+ }
497
+ return "OUTPUT CONTRACT: Return only the directly runnable prompt text. Do not add field labels, a preamble, explanation, Markdown fence, tips, or a render offer.";
498
+ }
499
+ export function buildImagePromptAuthoringMessages(input) {
500
+ const guide = PROMPTING_GUIDES[input.profile.promptingType];
501
+ const operationLabel = input.profile.operation === "edit"
502
+ ? "image editing"
503
+ : "text-to-image generation";
504
+ const system = `You author directly runnable prompts for ${input.profile.modelTitle} ${operationLabel}.
505
+
506
+ MODEL-SPECIFIC PROMPTING GUIDE:
507
+ ${guide}
508
+
509
+ AUTHORING RULES:
510
+ - Preserve every user-specified subject, action, setting, style, color, spatial relationship, exact quoted text, proper noun, and constraint.
511
+ - Treat the user's request as source material. Meta-language asking you to write a prompt is not visual content for the image.
512
+ - Add only concrete visual detail that supports the requested image or edit. Never invent extra subjects, props, labels, slogans, symbols, panels, or story events.
513
+ - Preserve emotional polarity, audience, genre, intensity, and content boundaries exactly.
514
+ - Commit to one observable composition or one precise edit. Do not hedge with alternatives.
515
+ - If the request is already production-ready, polish it lightly instead of replacing its direction.
516
+ - Never claim to have inspected a reference image that is not attached to this authoring request.
517
+
518
+ ${imageAuthoringOutputInstruction(input.profile)}`;
519
+ return [
520
+ { role: "system", content: system },
521
+ {
522
+ role: "user",
523
+ content: [
524
+ `Target model: ${input.profile.modelTitle}`,
525
+ `Operation: ${input.profile.operation}`,
526
+ "<request>",
527
+ input.prompt,
528
+ "</request>",
529
+ ].join("\n"),
530
+ },
531
+ ];
532
+ }
533
+ export function assertImagePromptAuthoringOutput(profile, output) {
534
+ const trimmed = output.trim();
535
+ if (!trimmed)
536
+ throw new Error("image-prompt authoring returned an empty prompt");
537
+ if (/```|^\s*(?:here(?:'s| is)|prompt\s+for\b)/i.test(trimmed)) {
538
+ throw new Error("image-prompt authoring added a wrapper or preamble");
539
+ }
540
+ if (profile.outputFormat === "positive_negative") {
541
+ const lines = trimmed.split(/\r?\n/);
542
+ if (lines.length !== 2
543
+ || !/^positive_prompt:\s*\S.+$/i.test(lines[0])
544
+ || !/^negative_prompt:\s*\S.+$/i.test(lines[1])) {
545
+ throw new Error("image-prompt authoring must return exactly positive_prompt and negative_prompt single-line fields");
546
+ }
547
+ return;
548
+ }
549
+ if (/^(?:positive_prompt|negative_prompt):/im.test(trimmed)) {
550
+ throw new Error("this image model expects prompt text without positive/negative field wrappers");
551
+ }
552
+ }
162
553
  //# sourceMappingURL=imagePrompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"imagePrompt.js","sourceRoot":"","sources":["../../src/contracts/imagePrompt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAanD,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,MAAM,UAAU,GAAG;;;;;;;;gGAQ6E,CAAC;AAEjG,MAAM,UAAU,GAAG;;;;;;;;+GAQ4F,CAAC;AAEhH,MAAM,UAAU,GAAG;;;;;;;;;sDASmC,CAAC;AAEvD,MAAM,UAAU,GAAG;;;;;;;yIAOsH,CAAC;AAE1I,MAAM,UAAU,GAAG;;;;;;gEAM6C,CAAC;AAEjE,MAAM,SAAS,GAAG;;;;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,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;eAC5C,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC/C,CAAC;YACD,MAAM,IAAI,KAAK,CACb,mGAAmG,CACpG,CAAC;QACJ,CAAC;QACD,OAAO;IACT,CAAC;IACD,IAAI,yCAAyC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;IACnG,CAAC;AACH,CAAC"}
@@ -16,7 +16,7 @@ export { CAMPAIGN_STORYBOARD_METADATA_PREFIX, CAMPAIGN_STORYBOARD_SCHEMA_VERSION
16
16
  export * from './hostedToolValidation.js';
17
17
  export { RANDOM_THEMES, RANDOM_LYRICS_THEMES, getRandomTheme, getRandomLyricsTheme, } from './randomThemes.js';
18
18
  export { ID_LORA_MAX_TOKENS, ID_LORA_COMPOSITION_TOOL, buildIdLoRaConversionMessages, parseToolCallIdLoRaParts, formatIdLoRaPrompt, } from './idLoraPrompt.js';
19
- export { IMAGE_PROMPT_MAX_TOKENS, IMAGE_PROMPT_TOOL, buildImagePromptMessages, parseToolCallPrompt, } from './imagePrompt.js';
19
+ export { IMAGE_PROMPT_MAX_TOKENS, IMAGE_PROMPT_TOOL, buildImagePromptMessages, buildImagePromptAuthoringMessages, resolveImagePromptAuthoringProfile, assertImagePromptAuthoringOutput, parseToolCallPrompt, } from './imagePrompt.js';
20
20
  export { LYRICS_MAX_TOKENS, LYRICS_COMPOSITION_TOOL, INSTRUMENTAL_COMPOSITION_TOOL, buildLyricsMessages, buildInstrumentalMessages, parseToolCallResult, } from './musicComposition.js';
21
21
  export { SCRIPT_MAX_TOKENS, SCRIPT_COMPOSITION_TOOL, CHARACTER_REFERENCE_VIDEO_COMPOSITION_SYSTEM_PROMPT, buildLtxScriptMessages, buildWanScriptMessages, parseToolCallScript, buildCharacterReferenceVideoCompositionMessages, parseCompositionToolScriptFromResult, } from './videoComposition.js';
22
22
  export { HOSTED_COMPOSITION_ROUTER_MAX_TOKENS, buildEnhancePromptToolArgs, buildLyricsCompositionToolArgs, buildInstrumentalCompositionToolArgs, buildScriptCompositionToolArgs, buildComposeWorkflowToolArgs, buildComposeWorkflowTemplateToolArgs, buildWanScriptCompositionToolArgs, buildHostedCompositionToolMessages, } from './hostedComposition.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAOvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAO/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAOtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAUnD,OAAO,EACL,gBAAgB,EAChB,+BAA+B,EAC/B,qCAAqC,EACrC,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,kBAAkB,CAAC;AAW1B,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,4BAA4B,EAC5B,+BAA+B,EAC/B,0CAA0C,EAC1C,8BAA8B,EAC9B,gCAAgC,EAChC,wB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BAAyB,EACzB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAY/B,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,mDAAmD,EACnD,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,+CAA+C,EAC/C,oCAAoC,GACrC,MAAM,uBAAuB,CAAC;AAiB/B,OAAO,EACL,oCAAoC,EACpC,0BAA0B,EAC1B,8BAA8B,EAC9B,oCAAoC,EACpC,8BAA8B,EAC9B,4BAA4B,EAC5B,oCAAoC,EACpC,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,wBAAwB,CAAC;AAehC,OAAO,EACL,oCAAoC,GACrC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,kCAAkC,EAClC,iDAAiD,EACjD,gDAAgD,EAChD,2CAA2C,EAC3C,sCAAsC,EACtC,oCAAoC,EACpC,kCAAkC,EAClC,2CAA2C,GAC5C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iBAAiB,EACjB,+BAA+B,EAC/B,8BAA8B,EAC9B,qCAAqC,EACrC,+BAA+B,GAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC"}
package/dist-esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { SogniClientWrapper } from './client/SogniClientWrapper.js';
2
2
  export { ClientEvent } from './types/index.js';
3
3
  export { SogniError, SogniConnectionError, SogniAuthenticationError, SogniProjectError, SogniTimeoutError, SogniBalanceError, SogniValidationError, SogniConfigurationError, SogniModelNotFoundError, SogniNetworkError, } from './utils/errors.js';
4
- export { generateAppId, validateClientConfig, validateProjectConfig, isImageProjectConfig, isVideoProjectConfig, isAudioProjectConfig, isWanVideoModel, isLtxVideoModel, isSeedanceVideoModel, isHappyHorseVideoModel, getVideoDimensionRules, isCookieAuth, sleep, retry, formatBytes, formatDuration, getMaxContextImages, supportsContextImages, } from './utils/helpers.js';
4
+ export { generateAppId, validateClientConfig, validateProjectConfig, isImageProjectConfig, isVideoProjectConfig, isAudioProjectConfig, isWanVideoModel, isLtxVideoModel, isSeedanceVideoModel, isHappyHorseVideoModel, isMiniMaxH3VideoModel, getVideoDimensionRules, isCookieAuth, sleep, retry, formatBytes, formatDuration, getMaxContextImages, supportsContextImages, } from './utils/helpers.js';
5
5
  export { ChatStream, CreativeWorkflowsApi, SogniClient, SogniTools, isSogniToolCall, parseCreativeWorkflowSseChunk, parseToolCallArguments, } from '@sogni-ai/sogni-client';
6
6
  export { extractDynamicPromptBranches, isolateDynamicPromptSlot, buildDynamicPromptSlotPrompts, validateSceneDynamicPromptBatch, validateSingleDynamicPromptBranch, promptHasStoryboardBatchLanguage, promptHasLinkedVariantBatchLanguage, isStoryboardKeyframeBatchPrompt, } from './tools/shared/dynamicPromptBranches.js';
7
7
  export { textExplicitlyRequestsMultipleImageOutputs } from './tools/shared/multiImageIntent.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AA2GpE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,EACZ,KAAK,EACL,KAAK,EACL,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,o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BAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,KAAK,EACL,KAAK,EACL,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,eAAe,EACf,6BAA6B,EAC7B,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAGL,4BAA4B,EAC5B,wBAAwB,EACxB,6BAA6B,EAC7B,+BAA+B,EAC/B,iCAAiC,EACjC,gCAAgC,EAChC,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,0CAA0C,EAAE,MAAM,oCAAoC,CAAC;AAChG,OAAO,EAAE,gDAAgD,EAAE,MAAM,+CAA+C,CAAC;AAIjH,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAMnC,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,wBAAwB,EAExB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,EAC1B,+BAA+B,EAC/B,0BAA0B,EAC1B,sBAAsB,EACtB,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAQ7C,OAAO,EAAE,kBAAkB,IAAI,OAAO,EAAE,MAAM,gCAAgC,CAAC"}
@@ -703,7 +703,7 @@ export const generationToolsManifest = {
703
703
  "minimax-h3-r2v",
704
704
  "minimax-h3-r2v-turbo"
705
705
  ],
706
- "description": "Video model. \"ltx25\" (default): LTX 2.5 with native audio; Fast/HQ use the official distilled INT8 workflow and Pro uses dev INT8 with the required official distilled Speed LoRA in stage 2. \"ltx23\": LTX 2.3 rollback with its existing distilled/dev quality routing. \"wan22\": Fast 4-step, simple motion, no audio. Default: \"ltx25\". HappyHorse 1.1 can be used here for \"happyhorse-1.1-t2v\" text-to-video, \"happyhorse-1.1-i2v\" with one uploaded/generated first-frame image via referenceImageIndices, or \"happyhorse-1.1-r2v\" with 1-9 image references. For a locked still image/source-frame animation, animate_photo with videoModel=\"happyhorse-1.1-i2v\" is also valid. HappyHorse supports 720p/1080p, 3-15s clips, native synchronized audio that is always on, image-only references, and no negativePrompt or generateAudio input. MiniMax H3 standard text-to-video uses \"minimax-h3-t2v\"; use \"minimax-h3-t2v-turbo\" for the 4-step Turbo tier. The Turbo image-to-video and first-to-last-frame selectors are \"minimax-h3-i2v-turbo\" and \"minimax-h3-flf2v-turbo\"; they keep H3's standard geometry, frame grid, and native-audio contract. MiniMax H3 Ref2VA Turbo uses \"minimax-h3-r2v-turbo\", the dedicated four-step Euler/simple R2V tier with a 960x544 upstream-aligned default. H3 renders 5.17-15.08s clips at a fixed 24 fps inside a 1344x768 pixel budget on a 32px grid, jointly generates its own stereo audio, takes no negativePrompt input, and supports generateAudio=false to return a video without an audio track. MiniMax H3 reference-to-video uses \"minimax-h3-r2v\" for standard quality or \"minimax-h3-r2v-turbo\" for the dedicated four-step Turbo LoRA, a separate ref2va checkpoint and the only H3 mode that takes loose references: up to 9 reference images, 3 reference videos (24 fps, 2-15s, each with an optional soundtrack) and 3 standalone audio tracks, no more than 12 reference files in total, passed with referenceImageIndices/referenceVideoIndices/referenceAudioIndices. At least one visual reference is required: one or more images and/or videos. A video can be the only visual input; audio cannot be the sole input. H3 r2v references are NOT locked frames — name them in the prompt with H3's own 1-based per-type labels <Picture 1>/<Video 1>/<Audio 1> and give every one an explicit job (identity, style, camera movement, voice character), stating which reference wins when two disagree. Use animate_photo with \"minimax-h3-i2v\" for a first-frame animation or \"minimax-h3-flf2v\" with frameRole=\"both\" for a first-to-last-frame transition. Seedance quality is selected only by model: use \"seedance2-mini\" for fast, lower-cost 720p Seedance draft iteration, and use \"seedance2\" for the full Seedance 2.0 model, explicit full-quality requests, 1080p/4K requests, or generated/uploaded storyboard images unless the user explicitly asks for a draft or Mini. Do not use Default Media Quality Fast/HQ/Pro or targetResolution to represent Seedance quality. Seedance supports multimodal loose reference assets. Seedance 2.0 and Mini accept images (up to 9), videos (up to 3), and audios (up to 3), with no more than 12 asset files total; Seedance 2.5 accepts images (up to 30), videos (up to 10), and audios (up to 10), with no more than 30 reference media files total. 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. \"seedance2-5\": Seedance 2.5, the newest Seedance generation — 480p and 720p ONLY (it cannot render 1080p or 4K), 4-30s per clip at a fixed 24 fps, native audio, and a much larger reference budget than Seedance 2.0: up to 30 images, 10 videos, and 10 audios, with no more than 30 reference media files in total. Seedance 2.5 covers text-to-video, image-to-video from a first frame, image-to-video with both a first and a last frame, and multimodal reference-to-video (including video editing and video extension). Pick \"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 natively instead of being split and stitched), or wants a first-and-last-frame Seedance transition. It does not replace \"seedance2\" for 1080p/4K requests, which Seedance 2.5 cannot satisfy. Seedance 2.5 is premium/subscriber-gated like the rest of the Seedance family."
706
+ "description": "Video model. \"ltx25\" (default): LTX 2.5 with native audio; Fast/HQ use the official distilled INT8 workflow and Pro uses dev INT8 with the required official distilled Speed LoRA in stage 2. \"ltx23\": LTX 2.3 rollback with its existing distilled/dev quality routing. \"wan22\": Fast 4-step, simple motion, no audio. Default: \"ltx25\". HappyHorse 1.1 can be used here for \"happyhorse-1.1-t2v\" text-to-video, \"happyhorse-1.1-i2v\" with one uploaded/generated first-frame image via referenceImageIndices, or \"happyhorse-1.1-r2v\" with 1-9 image references. For a locked still image/source-frame animation, animate_photo with videoModel=\"happyhorse-1.1-i2v\" is also valid. HappyHorse supports 720p/1080p, 3-15s clips, native synchronized audio that is always on, image-only references, and no negativePrompt or generateAudio input. MiniMax H3 standard text-to-video uses \"minimax-h3-t2v\"; use \"minimax-h3-t2v-turbo\" for the 4-step Turbo tier. The Turbo image-to-video and first-to-last-frame selectors are \"minimax-h3-i2v-turbo\" and \"minimax-h3-flf2v-turbo\"; they keep H3's standard geometry, frame grid, and native-audio contract. MiniMax H3 Ref2VA Turbo uses \"minimax-h3-r2v-turbo\", the dedicated four-step Euler/simple R2V tier with a 960x544 upstream-aligned default. H3 renders 5.17-15.08s clips at a fixed 24 fps inside a 1344x768 pixel budget on a 32px grid, jointly generates its own stereo audio, takes no negativePrompt input, and supports generateAudio=false to return a video without an audio track. MiniMax H3 reference-to-video uses \"minimax-h3-r2v\" for standard quality or \"minimax-h3-r2v-turbo\" for the dedicated four-step Turbo LoRA, a separate ref2va checkpoint and the only H3 mode that takes loose references: up to 9 reference images, 3 reference videos (24 fps, 2-15s, each with an optional soundtrack) and 3 standalone audio tracks, no more than 12 reference files in total, passed with referenceImageIndices/referenceVideoIndices/referenceAudioIndices. At least one visual reference is required: one or more images and/or videos. A video can be the only visual input; audio cannot be the sole input. H3 r2v references are NOT locked frames — name them in the prompt with H3's own 1-based per-type labels <Picture 1>/<Video 1>/<Audio 1> and give every one an explicit job (identity, style, camera movement, voice character), stating which reference wins when two disagree. Use animate_photo with \"minimax-h3-i2v\" for a first-frame animation or \"minimax-h3-flf2v\" with frameRole=\"both\" for a first-to-last-frame transition. Seedance quality is selected only by model: use \"seedance2-mini\" for fast, lower-cost 720p Seedance draft iteration, and use \"seedance2\" for the full Seedance 2.0 model, explicit full-quality requests, 1080p/4K requests, or generated/uploaded storyboard images unless the user explicitly asks for a draft or Mini. Do not use Default Media Quality Fast/HQ/Pro or targetResolution to represent Seedance quality. Seedance supports multimodal loose reference assets. Seedance 2.0 and Mini accept images (up to 9), videos (up to 3), and audios (up to 3), with no more than 12 asset files total; Seedance 2.5 accepts images (up to 30), videos (up to 10), and audios (up to 10), 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. \"seedance2-5\": Seedance 2.5, the newest Seedance generation — 480p and 720p ONLY (it cannot render 1080p or 4K), 4-30s per clip at a fixed 24 fps, native audio, and a much larger reference budget than Seedance 2.0: up to 30 images, 10 videos, and 10 audios, with up to 50 reference media files total, subject to those per-modality caps. Seedance 2.5 covers text-to-video, image-to-video from a first frame, image-to-video with both a first and a last frame, and multimodal reference-to-video (including video editing and video extension). Pick \"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 natively instead of being split and stitched), or wants a first-and-last-frame Seedance transition. It does not replace \"seedance2\" for 1080p/4K requests, which Seedance 2.5 cannot satisfy. Seedance 2.5 is premium/subscriber-gated like the rest of the Seedance family."
707
707
  },
708
708
  "generateAudio": {
709
709
  "type": "boolean",
@@ -1259,7 +1259,7 @@ export const generationToolsManifest = {
1259
1259
  "seedance2-mini",
1260
1260
  "seedance2-5"
1261
1261
  ],
1262
- "description": "Model selector for this video-to-video request. Usually omit; controlMode chooses the non-Seedance model. \"ltx25-v2v\" is the default LTX 2.5 control path; \"ltx23-v2v\" remains the rollback selector. For controlMode=\"seedance-v2v\", Seedance quality is selected only by model: use \"seedance2-mini\" for fast, lower-cost 720p Seedance V2V, and use \"seedance2\" for full-quality Seedance or 1080p/4K. Do not infer the Seedance model from Default Media Quality Fast/HQ/Pro or from 480p/720p resolution requests alone. \"seedance2-5\": Seedance 2.5, the newest Seedance generation — 480p and 720p ONLY (it cannot render 1080p or 4K), 4-30s per clip at a fixed 24 fps, native audio, and a much larger reference budget than Seedance 2.0: up to 30 images, 10 videos, and 10 audios, with no more than 30 reference media files in total. Seedance 2.5 covers text-to-video, image-to-video from a first frame, image-to-video with both a first and a last frame, and multimodal reference-to-video (including video editing and video extension). Pick \"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 natively instead of being split and stitched), or wants a first-and-last-frame Seedance transition. It does not replace \"seedance2\" for 1080p/4K requests, which Seedance 2.5 cannot satisfy. Seedance 2.5 is premium/subscriber-gated like the rest of the Seedance family."
1262
+ "description": "Model selector for this video-to-video request. Usually omit; controlMode chooses the non-Seedance model. \"ltx25-v2v\" is the default LTX 2.5 control path; \"ltx23-v2v\" remains the rollback selector. For controlMode=\"seedance-v2v\", Seedance quality is selected only by model: use \"seedance2-mini\" for fast, lower-cost 720p Seedance V2V, and use \"seedance2\" for full-quality Seedance or 1080p/4K. Do not infer the Seedance model from Default Media Quality Fast/HQ/Pro or from 480p/720p resolution requests alone. \"seedance2-5\": Seedance 2.5, the newest Seedance generation — 480p and 720p ONLY (it cannot render 1080p or 4K), 4-30s per clip at a fixed 24 fps, native audio, and a much larger reference budget than Seedance 2.0: up to 30 images, 10 videos, and 10 audios, with up to 50 reference media files total, subject to those per-modality caps. Seedance 2.5 covers text-to-video, image-to-video from a first frame, image-to-video with both a first and a last frame, and multimodal reference-to-video (including video editing and video extension). Pick \"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 natively instead of being split and stitched), or wants a first-and-last-frame Seedance transition. It does not replace \"seedance2\" for 1080p/4K requests, which Seedance 2.5 cannot satisfy. Seedance 2.5 is premium/subscriber-gated like the rest of the Seedance family."
1263
1263
  },
1264
1264
  "generateAudio": {
1265
1265
  "type": "boolean",
@@ -1515,7 +1515,7 @@ export const generationToolsManifest = {
1515
1515
  "ltx23-ia2v",
1516
1516
  "ltx23-a2v"
1517
1517
  ],
1518
- "description": "Video model. \"ltx25-ia2v\" (default when image available) and \"ltx25-a2v\" (default without an image) use LTX 2.5; Fast/HQ use official distilled INT8 and Pro uses dev INT8 with the required official distilled Speed LoRA in stage 2. \"ltx23-ia2v\" and \"ltx23-a2v\" retain the LTX 2.3 rollback paths with their existing quality-tier routing. \"wan-s2v\": WAN 2.2 sound-to-video, best for lip-sync with a face image, fast 4-step. \"seedance2\": full Seedance 2.0 audio-reference video, 4-15s; this tool supplies the audio plus a required reference image because Seedance text+audio without image/video is unsupported. \"seedance2-mini\": Seedance 2.0 Mini for faster, lower-cost 720p iteration. Seedance quality is selected only by this model value: pick \"seedance2-mini\" for faster draft/lower-cost Seedance, and pick \"seedance2\" for full-quality Seedance or 1080p/4K. Do not infer the Seedance model from Default Media Quality Fast/HQ/Pro. For Seedance audio-reference prompts, preserve exact spoken dialogue when the user supplied it, and assign @Image1/@Audio1 roles. If the user asks for speech without words, describe the vocal performance without inventing quoted dialogue. Treat lip-sync, voice cloning, and real-human reference behavior as provider-sensitive rather than guaranteed. Omit to auto-select based on whether an image is present. \"seedance2-5\": Seedance 2.5, the newest Seedance generation — 480p and 720p ONLY (it cannot render 1080p or 4K), 4-30s per clip at a fixed 24 fps, native audio, and a much larger reference budget than Seedance 2.0: up to 30 images, 10 videos, and 10 audios, with no more than 30 reference media files in total. Seedance 2.5 covers text-to-video, image-to-video from a first frame, image-to-video with both a first and a last frame, and multimodal reference-to-video (including video editing and video extension). Pick \"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 natively instead of being split and stitched), or wants a first-and-last-frame Seedance transition. It does not replace \"seedance2\" for 1080p/4K requests, which Seedance 2.5 cannot satisfy. Seedance 2.5 is premium/subscriber-gated like the rest of the Seedance family."
1518
+ "description": "Video model. \"ltx25-ia2v\" (default when image available) and \"ltx25-a2v\" (default without an image) use LTX 2.5; Fast/HQ use official distilled INT8 and Pro uses dev INT8 with the required official distilled Speed LoRA in stage 2. \"ltx23-ia2v\" and \"ltx23-a2v\" retain the LTX 2.3 rollback paths with their existing quality-tier routing. \"wan-s2v\": WAN 2.2 sound-to-video, best for lip-sync with a face image, fast 4-step. \"seedance2\": full Seedance 2.0 audio-reference video, 4-15s; this tool supplies the audio plus a required reference image because Seedance text+audio without image/video is unsupported. \"seedance2-mini\": Seedance 2.0 Mini for faster, lower-cost 720p iteration. Seedance quality is selected only by this model value: pick \"seedance2-mini\" for faster draft/lower-cost Seedance, and pick \"seedance2\" for full-quality Seedance or 1080p/4K. Do not infer the Seedance model from Default Media Quality Fast/HQ/Pro. For Seedance audio-reference prompts, preserve exact spoken dialogue when the user supplied it, and assign @Image1/@Audio1 roles. If the user asks for speech without words, describe the vocal performance without inventing quoted dialogue. Treat lip-sync, voice cloning, and real-human reference behavior as provider-sensitive rather than guaranteed. Omit to auto-select based on whether an image is present. \"seedance2-5\": Seedance 2.5, the newest Seedance generation — 480p and 720p ONLY (it cannot render 1080p or 4K), 4-30s per clip at a fixed 24 fps, native audio, and a much larger reference budget than Seedance 2.0: up to 30 images, 10 videos, and 10 audios, with up to 50 reference media files total, subject to those per-modality caps. Seedance 2.5 covers text-to-video, image-to-video from a first frame, image-to-video with both a first and a last frame, and multimodal reference-to-video (including video editing and video extension). Pick \"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 natively instead of being split and stitched), or wants a first-and-last-frame Seedance transition. It does not replace \"seedance2\" for 1080p/4K requests, which Seedance 2.5 cannot satisfy. Seedance 2.5 is premium/subscriber-gated like the rest of the Seedance family."
1519
1519
  },
1520
1520
  "generateAudio": {
1521
1521
  "type": "boolean",