@sogni-ai/sogni-intelligence-client 4.5.2 → 4.6.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 (82) hide show
  1. package/dist/client/SogniClientWrapper.d.ts.map +1 -1
  2. package/dist/client/SogniClientWrapper.js +22 -0
  3. package/dist/client/SogniClientWrapper.js.map +1 -1
  4. package/dist/contracts/data/promptContracts.d.ts.map +1 -1
  5. package/dist/contracts/data/promptContracts.js +25 -3
  6. package/dist/contracts/data/promptContracts.js.map +1 -1
  7. package/dist/contracts/hostedToolValidation.d.ts.map +1 -1
  8. package/dist/contracts/hostedToolValidation.js +63 -0
  9. package/dist/contracts/hostedToolValidation.js.map +1 -1
  10. package/dist/contracts/index.d.ts +1 -1
  11. package/dist/contracts/index.d.ts.map +1 -1
  12. package/dist/contracts/index.js +9 -1
  13. package/dist/contracts/index.js.map +1 -1
  14. package/dist/contracts/toolPromptMarkers.d.ts +7 -0
  15. package/dist/contracts/toolPromptMarkers.d.ts.map +1 -1
  16. package/dist/contracts/toolPromptMarkers.js +8 -1
  17. package/dist/contracts/toolPromptMarkers.js.map +1 -1
  18. package/dist/media/index.d.ts +1 -0
  19. package/dist/media/index.d.ts.map +1 -1
  20. package/dist/media/index.js +1 -0
  21. package/dist/media/index.js.map +1 -1
  22. package/dist/media/minimaxH3Keyframes.d.ts +33 -0
  23. package/dist/media/minimaxH3Keyframes.d.ts.map +1 -0
  24. package/dist/media/minimaxH3Keyframes.js +180 -0
  25. package/dist/media/minimaxH3Keyframes.js.map +1 -0
  26. package/dist/public-skill-runtime/index.d.ts.map +1 -1
  27. package/dist/public-skill-runtime/index.js +3 -0
  28. package/dist/public-skill-runtime/index.js.map +1 -1
  29. package/dist/tools/definitions/animate-photo/definition.d.ts.map +1 -1
  30. package/dist/tools/definitions/animate-photo/definition.js +17 -0
  31. package/dist/tools/definitions/animate-photo/definition.js.map +1 -1
  32. package/dist/tools/definitions/generate-video/definition.d.ts.map +1 -1
  33. package/dist/tools/definitions/generate-video/definition.js +17 -0
  34. package/dist/tools/definitions/generate-video/definition.js.map +1 -1
  35. package/dist/tools/definitions/sound-to-video/definition.d.ts.map +1 -1
  36. package/dist/tools/definitions/sound-to-video/definition.js +19 -1
  37. package/dist/tools/definitions/sound-to-video/definition.js.map +1 -1
  38. package/dist/tools/index.d.ts +2 -1
  39. package/dist/tools/index.d.ts.map +1 -1
  40. package/dist/tools/index.js +13 -2
  41. package/dist/tools/index.js.map +1 -1
  42. package/dist/tools/normalizeArgs.d.ts.map +1 -1
  43. package/dist/tools/normalizeArgs.js +1 -1
  44. package/dist/tools/normalizeArgs.js.map +1 -1
  45. package/dist/tools/shared/modelRegistry.d.ts +3 -0
  46. package/dist/tools/shared/modelRegistry.d.ts.map +1 -1
  47. package/dist/tools/shared/modelRegistry.js +25 -1
  48. package/dist/tools/shared/modelRegistry.js.map +1 -1
  49. package/dist/utils/videoModelIds.d.ts.map +1 -1
  50. package/dist/utils/videoModelIds.js +9 -0
  51. package/dist/utils/videoModelIds.js.map +1 -1
  52. package/dist-esm/client/SogniClientWrapper.js +22 -0
  53. package/dist-esm/client/SogniClientWrapper.js.map +1 -1
  54. package/dist-esm/contracts/data/promptContracts.js +25 -3
  55. package/dist-esm/contracts/data/promptContracts.js.map +1 -1
  56. package/dist-esm/contracts/hostedToolValidation.js +63 -0
  57. package/dist-esm/contracts/hostedToolValidation.js.map +1 -1
  58. package/dist-esm/contracts/index.js +1 -1
  59. package/dist-esm/contracts/index.js.map +1 -1
  60. package/dist-esm/contracts/toolPromptMarkers.js +7 -0
  61. package/dist-esm/contracts/toolPromptMarkers.js.map +1 -1
  62. package/dist-esm/media/index.js +1 -0
  63. package/dist-esm/media/index.js.map +1 -1
  64. package/dist-esm/media/minimaxH3Keyframes.js +168 -0
  65. package/dist-esm/media/minimaxH3Keyframes.js.map +1 -0
  66. package/dist-esm/public-skill-runtime/index.js +3 -0
  67. package/dist-esm/public-skill-runtime/index.js.map +1 -1
  68. package/dist-esm/tools/definitions/animate-photo/definition.js +18 -1
  69. package/dist-esm/tools/definitions/animate-photo/definition.js.map +1 -1
  70. package/dist-esm/tools/definitions/generate-video/definition.js +18 -1
  71. package/dist-esm/tools/definitions/generate-video/definition.js.map +1 -1
  72. package/dist-esm/tools/definitions/sound-to-video/definition.js +20 -2
  73. package/dist-esm/tools/definitions/sound-to-video/definition.js.map +1 -1
  74. package/dist-esm/tools/index.js +2 -1
  75. package/dist-esm/tools/index.js.map +1 -1
  76. package/dist-esm/tools/normalizeArgs.js +1 -1
  77. package/dist-esm/tools/normalizeArgs.js.map +1 -1
  78. package/dist-esm/tools/shared/modelRegistry.js +22 -0
  79. package/dist-esm/tools/shared/modelRegistry.js.map +1 -1
  80. package/dist-esm/utils/videoModelIds.js +9 -0
  81. package/dist-esm/utils/videoModelIds.js.map +1 -1
  82. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"toolPromptMarkers.js","sourceRoot":"","sources":["../../src/contracts/toolPromptMarkers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,MAAM,6BAA6B,GACxC,GAAG,uBAAuB,oFAAoF,CAAC;AAEjH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,gMAAgM,CAAC;AAEnM,MAAM,CAAC,MAAM,iDAAiD,GAC5D,ikBAAikB,CAAC;AAEpkB,MAAM,CAAC,MAAM,gDAAgD,GAC3D,ipBAAipB,CAAC;AAEppB,MAAM,CAAC,MAAM,gCAAgC,GAC3C,GAAG,uBAAuB,iDAAiD,CAAC;AAE9E,MAAM,CAAC,MAAM,2CAA2C,GAAG,ygBAAygB,CAAC;AAErkB,MAAM,CAAC,MAAM,oCAAoC,GAAG,oQAAoQ,CAAC;AAEzT,MAAM,CAAC,MAAM,sCAAsC,GAAG,+VAA+V,CAAC;AAEtZ,MAAM,CAAC,MAAM,kCAAkC,GAAG,khBAAkhB,CAAC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CAAC;AAErkB,MAAM,CAAC,MAAM,2CAA2C,GACtD,mgBAAmgB;IACngB,kCAAkC,CAAC;AAOrC,MAAM,CAAC,MAAM,0DAA0D,GACrE,ilBAAilB,CAAC;AAEplB,MAAM,CAAC,MAAM,uDAAuD,GAClE,8xDAA8xD,CAAC;AAEjyD,MAAM,CAAC,MAAM,kDAAkD,GAC7D,mdAAmd,CAAC;AAEtd,MAAM,CAAC,MAAM,qDAAqD,GAChE,+OAA+O,CAAC;AAElP,MAAM,CAAC,MAAM,8CAA8C,GACzD,yHAAyH,CAAC;AAE5H,MAAM,CAAC,MAAM,2CAA2C,GACtD,uOAAuO,CAAC;AAE1O,MAAM,CAAC,MAAM,iDAAiD,GAC5D,sHAAsH,CAAC;AAEzH,MAAM,CAAC,MAAM,kDAAkD,GAC7D,+IAA+I,CAAC;AASlJ,MAAM,CAAC,MAAM,gCAAgC,GAC3C,ulBAAulB,CAAC;AAE1lB,MAAM,CAAC,MAAM,2CAA2C,GACtD,sIAAsI,CAAC;AAEzI,MAAM,CAAC,MAAM,0CAA0C,GACrD,yJAAyJ,CAAC;AAE5J,MAAM,CAAC,MAAM,8CAA8C,GACzD,GAAG,gCAAgC,+UAA+U,CAAC;AAErX,MAAM,CAAC,MAAM,+CAA+C,GAC1D,GAAG,gCAAgC,ilBAAilB,CAAC;AAEvnB,MAAM,CAAC,MAAM,+CAA+C,GAC1D,GAAG,gCAAgC,qYAAqY,CAAC;AAE3a,MAAM,CAAC,MAAM,6BAA6B,GACxC,gsBAAgsB,CAAC;AAEnsB,MAAM,CAAC,MAAM,yCAAyC,GACpD,oXAAoX,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from './imageDimensions.js';
2
2
  export * from './videoSettings.js';
3
+ export * from './minimaxH3Keyframes.js';
3
4
  export * from './aspectRatio.js';
4
5
  export * from './gptImage.js';
5
6
  export * from './characterSheet.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/media/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/media/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,168 @@
1
+ import { calculateVideoFrames, isMinimaxH3AudioGuideModelId } from './videoSettings.js';
2
+ export const MINIMAX_H3_MAX_KEYFRAMES = 8;
3
+ export const MINIMAX_H3_KEYFRAME_FPS = 24;
4
+ const MINIMAX_H3_SHORTEST_CLIP_FRAMES = 124;
5
+ const MINIMAX_H3_FRAME_STEP = 17;
6
+ const MINIMAX_H3_LONGEST_CLIP_FRAMES = 362;
7
+ const KEYFRAME_WORKFLOWS = new Set([
8
+ 'i2v',
9
+ 'flf2v',
10
+ 'ia2v',
11
+ 'flfa2v',
12
+ 'a2v',
13
+ 'r2v',
14
+ ]);
15
+ export function minimaxH3KeyframeWorkflow(modelId) {
16
+ if (typeof modelId !== 'string')
17
+ return null;
18
+ const normalized = modelId.trim().toLowerCase().replace(/[\s_.]+/g, '-').replace(/-+/g, '-');
19
+ if (!normalized.startsWith('minimax-h3-'))
20
+ return null;
21
+ const workflow = normalized.split('-').find(token => KEYFRAME_WORKFLOWS.has(token));
22
+ return workflow ?? null;
23
+ }
24
+ export function isMinimaxH3KeyframeModelId(modelId) {
25
+ return minimaxH3KeyframeWorkflow(modelId) !== null;
26
+ }
27
+ export function minimaxH3KeyframeFrameIndex(atSeconds) {
28
+ return Math.round(atSeconds * MINIMAX_H3_KEYFRAME_FPS);
29
+ }
30
+ export function minimaxH3KeyframeSeconds(frameIndex) {
31
+ return frameIndex / MINIMAX_H3_KEYFRAME_FPS;
32
+ }
33
+ export function minimaxH3FramesForDuration(durationSeconds) {
34
+ if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) {
35
+ throw new RangeError(`MiniMax H3 duration must be a finite number of seconds greater than 0; received ${String(durationSeconds)}`);
36
+ }
37
+ return calculateVideoFrames(durationSeconds, 'minimax-h3-i2v');
38
+ }
39
+ export function minimaxH3AudioGuideFramesForDuration(durationSeconds) {
40
+ if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) {
41
+ throw new RangeError(`MiniMax H3 duration must be a finite number of seconds greater than 0; received ${String(durationSeconds)}`);
42
+ }
43
+ const neededFrames = Math.ceil(durationSeconds * MINIMAX_H3_KEYFRAME_FPS - 1e-6);
44
+ const steps = Math.max(0, Math.ceil((neededFrames - MINIMAX_H3_SHORTEST_CLIP_FRAMES) / MINIMAX_H3_FRAME_STEP));
45
+ return Math.min(MINIMAX_H3_LONGEST_CLIP_FRAMES, MINIMAX_H3_SHORTEST_CLIP_FRAMES + steps * MINIMAX_H3_FRAME_STEP);
46
+ }
47
+ export function minimaxH3JobFramesForDuration(modelId, durationSeconds) {
48
+ return isMinimaxH3AudioGuideModelId(modelId)
49
+ ? minimaxH3AudioGuideFramesForDuration(durationSeconds)
50
+ : minimaxH3FramesForDuration(durationSeconds);
51
+ }
52
+ function isRecord(value) {
53
+ return !!value && typeof value === 'object' && !Array.isArray(value);
54
+ }
55
+ function formatClipSeconds(seconds) {
56
+ const rounded = Math.round(seconds * 100) / 100;
57
+ return Number.isInteger(rounded) ? rounded.toFixed(1) : String(rounded);
58
+ }
59
+ function keyframeWindow(frames) {
60
+ const latest = Math.floor(((frames - 2) / MINIMAX_H3_KEYFRAME_FPS) * 10 + 1e-9) / 10;
61
+ return { earliest: '0.1', latest: latest.toFixed(1) };
62
+ }
63
+ function shortestDurationFor(frameIndex, modelId) {
64
+ const neededFrames = frameIndex + 2;
65
+ if (neededFrames > MINIMAX_H3_LONGEST_CLIP_FRAMES)
66
+ return null;
67
+ let seconds = Math.max(1, Math.floor(neededFrames / MINIMAX_H3_KEYFRAME_FPS));
68
+ while (minimaxH3JobFramesForDuration(modelId, seconds) < neededFrames)
69
+ seconds += 1;
70
+ return seconds;
71
+ }
72
+ export function minimaxH3KeyframeEdgeHint(modelId) {
73
+ switch (minimaxH3KeyframeWorkflow(modelId)) {
74
+ case 'i2v':
75
+ case 'flf2v':
76
+ case 'flfa2v':
77
+ return 'the first and last frames come from sourceImageIndex and endImageIndex';
78
+ case 'ia2v':
79
+ return 'the first frame comes from sourceImageIndex, and the last frame cannot be pinned';
80
+ case 'a2v':
81
+ return 'audio-only clips cannot pin their first or last frame';
82
+ case 'r2v':
83
+ return 'reference-to-video cannot pin its first or last frame';
84
+ default:
85
+ return 'the first and last frames are never keyframes';
86
+ }
87
+ }
88
+ export function checkMinimaxH3Keyframes(keyframes, options = {}) {
89
+ const errors = [];
90
+ if (keyframes === undefined || keyframes === null) {
91
+ return { ok: true, errors, keyframes: [] };
92
+ }
93
+ if (!Array.isArray(keyframes)) {
94
+ errors.push('"keyframes" must be a list of {imageIndex, atSeconds} items.');
95
+ return { ok: false, errors, keyframes: [] };
96
+ }
97
+ if (keyframes.length > MINIMAX_H3_MAX_KEYFRAMES) {
98
+ const extra = keyframes.length - MINIMAX_H3_MAX_KEYFRAMES;
99
+ errors.push(`"keyframes" has ${keyframes.length} items; MiniMax H3 pins at most ${MINIMAX_H3_MAX_KEYFRAMES}. Remove ${extra} of them.`);
100
+ }
101
+ const frames = options.frames;
102
+ if (frames !== undefined && (!Number.isInteger(frames) || frames < 3)) {
103
+ throw new RangeError(`MiniMax H3 keyframes need the job's frame count; received ${String(frames)}`);
104
+ }
105
+ const lastPinnable = (frames ?? MINIMAX_H3_LONGEST_CLIP_FRAMES) - 2;
106
+ const window = keyframeWindow(lastPinnable + 2);
107
+ const keep = `keep keyframes between ${window.earliest} s and ${window.latest} s`;
108
+ const edge = options.edgeHint ? ` (${options.edgeHint})` : '';
109
+ const checked = [];
110
+ keyframes.forEach((entry, argumentIndex) => {
111
+ const label = `keyframes[${argumentIndex}]`;
112
+ if (!isRecord(entry)) {
113
+ errors.push(`${label} must be an object {imageIndex, atSeconds}.`);
114
+ return;
115
+ }
116
+ const { imageIndex, atSeconds } = entry;
117
+ let wellFormed = true;
118
+ if (typeof imageIndex !== 'number' || !Number.isInteger(imageIndex)) {
119
+ errors.push(`${label}.imageIndex must be a whole-number image index (-1 = first upload, -2 = second upload, 0 and up = generated results).`);
120
+ wellFormed = false;
121
+ }
122
+ if (typeof atSeconds !== 'number' || !Number.isFinite(atSeconds)) {
123
+ errors.push(`${label}.atSeconds must be a number of seconds from the start of the video.`);
124
+ wellFormed = false;
125
+ }
126
+ if (!wellFormed)
127
+ return;
128
+ const seconds = atSeconds;
129
+ const frameIndex = minimaxH3KeyframeFrameIndex(seconds);
130
+ if (seconds < 0) {
131
+ errors.push(`${label} at ${seconds} s is before the video starts; ${keep}.`);
132
+ return;
133
+ }
134
+ if (frameIndex < 1) {
135
+ errors.push(`${label} at ${seconds} s lands on the first frame, which is never a keyframe${edge}; ${keep}.`);
136
+ return;
137
+ }
138
+ if (frames !== undefined && frameIndex === frames - 1) {
139
+ errors.push(`${label} at ${seconds} s lands on the last frame of the ${formatClipSeconds(frames / MINIMAX_H3_KEYFRAME_FPS)} s clip, which is never a keyframe${edge}; ${keep}.`);
140
+ return;
141
+ }
142
+ if (frameIndex > lastPinnable) {
143
+ if (frames === undefined) {
144
+ errors.push(`${label} at ${seconds} s is at or past the end of the longest MiniMax H3 clip (${formatClipSeconds(MINIMAX_H3_LONGEST_CLIP_FRAMES / MINIMAX_H3_KEYFRAME_FPS)} s); ${keep}.`);
145
+ return;
146
+ }
147
+ const source = options.framesSource ? ` (${options.framesSource})` : '';
148
+ const longer = options.suggestDuration ? shortestDurationFor(frameIndex, options.modelId) : null;
149
+ errors.push(`${label} at ${seconds} s is past the ${formatClipSeconds(frames / MINIMAX_H3_KEYFRAME_FPS)} s clip${source}; ${keep}${longer ? `, or set duration to at least ${longer} s` : ''}.`);
150
+ return;
151
+ }
152
+ checked.push({ imageIndex: imageIndex, atSeconds: seconds, argumentIndex, frameIndex });
153
+ });
154
+ const byFrame = new Map();
155
+ for (const keyframe of checked) {
156
+ const earlier = byFrame.get(keyframe.frameIndex);
157
+ if (earlier) {
158
+ errors.push(`keyframes[${earlier.argumentIndex}] and keyframes[${keyframe.argumentIndex}] both land on frame ${keyframe.frameIndex} (${formatClipSeconds(minimaxH3KeyframeSeconds(keyframe.frameIndex))} s); give each keyframe its own time, at least 0.1 s apart.`);
159
+ continue;
160
+ }
161
+ byFrame.set(keyframe.frameIndex, keyframe);
162
+ }
163
+ const sorted = [...checked].sort((left, right) => left.frameIndex - right.frameIndex);
164
+ return errors.length === 0
165
+ ? { ok: true, errors, keyframes: sorted }
166
+ : { ok: false, errors, keyfram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EAAE,CAAC;AAC3C,CAAC"}
@@ -5,6 +5,7 @@ import { resolveRegisteredVideoModelFamily } from '../utils/videoModelIds.js';
5
5
  import { resolveRegisteredImageReferenceModelId } from '../utils/imageReferenceModelIds.js';
6
6
  import { isGptImageModel, normalizeGptImageModelAlias } from '../media/gptImage.js';
7
7
  import { WAN22_MAX_VIDEO_PIXELS } from '../media/videoSettings.js';
8
+ import { MINIMAX_H3_KEYFRAMES_GUIDANCE } from '../contracts/toolPromptMarkers.js';
8
9
  function isLtxWorkflow(workflow) {
9
10
  return workflow === 't2v' || workflow === 'i2v' || workflow === 'ia2v' || workflow === 'a2v' || workflow === 'v2v';
10
11
  }
@@ -666,6 +667,7 @@ export const VIDEO_GENERATION_SKILL = {
666
667
  'For My Personas video requests, default to image_editing first to produce a conditioned scene image before animation. Use direct video only when the user explicitly asks to animate an existing persona image/reference or no source image is available for a voice-only request.',
667
668
  'Wan 3.0 Enhanced uses exact Sogni model id wan3.0-spicy-video (MuleRouter provider id w3.0-video): 2-30 seconds at 30 fps, 480p/720p/1080p, native audio, prompt expansion, adaptive/fixed ratios, and up to 10 image/5 video/5 audio references. First/last-frame mode and loose-reference mode are mutually exclusive. It has no document/web context, watermark, negative prompt, source-video edit, or extend mode.',
668
669
  'MiniMax H3 two-stage: 1080p and 2K H3 delivery is its own selector, not an option. minimax-h3-fasth3-t2v-turbo-2stage on generate_video (animate_photo carries minimax-h3-fasth3-i2v-turbo-2stage and minimax-h3-fasth3-flf2v-turbo-2stage) renders the FastH3 canvas, then the worker enlarges it 2x and refines it, so the clip is delivered at twice the canvas with the same length and audio. targetResolution names the delivered class: 1080 renders a 544px short-edge canvas (960x544 becomes 1920x1088) for 10 Spark per second, 1440 or omitted renders the 768p canvas for 2K (1344x768 becomes 2688x1536) for 16 Spark per second, and 720 renders a 384px canvas (672x384 becomes 1344x768) for the regular FastH3 price of 4 Spark per second. Choose it when the user asks for 1080p, 1440p or 2K H3 output, for two-stage output, or for the sharpest/best H3 quality, and send the same prompt contract, durations and LoRAs as the matching FastH3 selector; keep ordinary 768p FastH3 output on the regular FastH3 selector at targetResolution 768. Reference-to-video has its own two-stage selectors on generate_video: minimax-h3-r2v-2stage (Standard, 20 steps) and minimax-h3-r2v-balanced-2stage (Balanced, 8 steps) take exactly the references, prompt contract, durations and LoRAs of minimax-h3-r2v and minimax-h3-r2v-balanced, deliver twice the canvas, and read targetResolution the same way; each bills its tier\'s rate plus the two-stage surcharge of the delivered class. Keep the one-stage R2V selectors for ordinary 768p output.',
670
+ `${MINIMAX_H3_KEYFRAMES_GUIDANCE} On generate_video only the MiniMax H3 reference-to-video selectors take keyframes, never text-to-video; the keyframe images are not references and do not go in referenceImageIndices.`,
669
671
  ],
670
672
  };
671
673
  export const VIDEO_EDITING_SKILL = {
@@ -690,6 +692,7 @@ export const VIDEO_EDITING_SKILL = {
690
692
  'animate_photo errors with all_failed must surface to the user; do not auto-retry from inside the chat loop.',
691
693
  'Use upscale_video for a promptless 1080p/1440p resolution increase of an existing video; it keeps every frame, the frame rate, and the audio. Do not substitute video_to_video unless the user explicitly asks a generative model such as Seedance to re-render the clip.',
692
694
  'MiniMax H3 audio guide: sound_to_video takes minimax-h3-fasth3-ia2v-turbo (first-frame image + audio), minimax-h3-fasth3-flfa2v-turbo (first and last frame + audio, with endImageIndex) and minimax-h3-fasth3-a2v-turbo (audio only), each with a -2stage form for 1080p or 2K output. The uploaded audio drives the picture from frame 0 and stays in the output; clips are 5.2-15.1 seconds at 24 fps, audioStart picks the window, and MiniMax H3 catalog and Personal LoRAs work across audio modes and tiers; generateAudio false and negativePrompt are refused. Use them only when the user asks for MiniMax H3 or FastH3; the LTX 2.5 audio selectors stay the default.',
695
+ `${MINIMAX_H3_KEYFRAMES_GUIDANCE} animate_photo takes keyframes on every MiniMax H3 image-to-video and first-and-last-frame selector, and sound_to_video on every MiniMax H3 audio selector (set duration with keyframes; the audio selectors render the shortest H3 length that covers it, so duration 6 renders 6.58 s).`,
693
696
  ],
694
697
  };
695
698
  export const MUSIC_GENERATION_SKILL = {