@sogni-ai/sogni-creative-agent-skill 3.23.0 → 3.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sogni-agent.mjs CHANGED
@@ -1867,8 +1867,16 @@ const LTX23_10EROS_MODEL_ID = 'ltx23-22b-10eros-v1.4-fp8mixed_i2v';
1867
1867
  const MINIMAX_H3_MODEL_IDS = new Set([
1868
1868
  'minimax-h3-fl2va-fp8_t2v',
1869
1869
  'minimax-h3-fl2va-fp8_i2v',
1870
- 'minimax-h3-fl2va-fp8_flf2v'
1870
+ 'minimax-h3-fl2va-fp8_flf2v',
1871
+ 'minimax-h3-ref2va-fp8_r2v'
1871
1872
  ]);
1873
+ const MINIMAX_H3_R2V_MODEL_ID = 'minimax-h3-ref2va-fp8_r2v';
1874
+ const MINIMAX_H3_REFERENCE_LIMITS = Object.freeze({
1875
+ images: 9,
1876
+ videos: 3,
1877
+ audios: 3,
1878
+ assets: 12
1879
+ });
1872
1880
  const LTX23_10EROS_FIXED_SETTINGS = Object.freeze({
1873
1881
  steps: 9,
1874
1882
  guidance: 1,
@@ -1887,6 +1895,7 @@ const DR34ML4Y_SUPPORTED_MODEL_IDS = new Set([
1887
1895
  function resolveSkillVideoModelAlias(modelId, workflow = null, hasEndFrame = false) {
1888
1896
  const normalized = String(modelId || '').trim().toLowerCase();
1889
1897
  if (normalized === 'minimax-h3' && workflow) {
1898
+ if (workflow === 'r2v') return MINIMAX_H3_R2V_MODEL_ID;
1890
1899
  if (workflow === 'i2v') {
1891
1900
  return hasEndFrame ? 'minimax-h3-fl2va-fp8_flf2v' : 'minimax-h3-fl2va-fp8_i2v';
1892
1901
  }
@@ -1897,6 +1906,7 @@ function resolveSkillVideoModelAlias(modelId, workflow = null, hasEndFrame = fal
1897
1906
  }
1898
1907
  if (normalized === 'minimax-h3-i2v') return 'minimax-h3-fl2va-fp8_i2v';
1899
1908
  if (normalized === 'minimax-h3-flf2v') return 'minimax-h3-fl2va-fp8_flf2v';
1909
+ if (normalized === 'minimax-h3-r2v') return MINIMAX_H3_R2V_MODEL_ID;
1900
1910
  return normalized === '10eros' || normalized === 'ltx23-eros'
1901
1911
  ? LTX23_10EROS_MODEL_ID
1902
1912
  : modelId;
@@ -1906,6 +1916,29 @@ function isMiniMaxH3Model(modelId) {
1906
1916
  return MINIMAX_H3_MODEL_IDS.has(String(modelId || '').trim().toLowerCase());
1907
1917
  }
1908
1918
 
1919
+ function isMiniMaxH3R2vModel(modelId) {
1920
+ return String(modelId || '').trim().toLowerCase() === MINIMAX_H3_R2V_MODEL_ID;
1921
+ }
1922
+
1923
+ function isMiniMaxH3ModelSelectionLocal(modelId) {
1924
+ const normalized = String(modelId || '').trim().toLowerCase();
1925
+ return normalized === 'minimax-h3'
1926
+ || normalized === 'minimax-h3-t2v'
1927
+ || normalized === 'minimax-h3-i2v'
1928
+ || normalized === 'minimax-h3-flf2v'
1929
+ || normalized === 'minimax-h3-r2v'
1930
+ || isMiniMaxH3Model(normalized);
1931
+ }
1932
+
1933
+ function miniMaxH3ModeFromModelId(modelId) {
1934
+ const normalized = String(modelId || '').trim().toLowerCase();
1935
+ if (normalized === 'minimax-h3-t2v' || normalized === 'minimax-h3-fl2va-fp8_t2v') return 't2v';
1936
+ if (normalized === 'minimax-h3-i2v' || normalized === 'minimax-h3-fl2va-fp8_i2v') return 'i2v';
1937
+ if (normalized === 'minimax-h3-flf2v' || normalized === 'minimax-h3-fl2va-fp8_flf2v') return 'flf2v';
1938
+ if (normalized === 'minimax-h3-r2v' || normalized === MINIMAX_H3_R2V_MODEL_ID) return 'r2v';
1939
+ return null;
1940
+ }
1941
+
1909
1942
  function normalizeMultiAngleValue(value, aliases, allowedKeys, label) {
1910
1943
  if (!value) return null;
1911
1944
  const normalized = value.toLowerCase().replace(/_/g, '-').replace(/\s+/g, ' ').trim();
@@ -3302,7 +3335,7 @@ Music Options:
3302
3335
 
3303
3336
  Video Options:
3304
3337
  --video, -v Generate video instead of image
3305
- --workflow <type> Video workflow: t2v|i2v|s2v|ia2v|a2v|v2v|animate-move|animate-replace
3338
+ --workflow <type> Video workflow: t2v|i2v|r2v|s2v|ia2v|a2v|v2v|animate-move|animate-replace
3306
3339
  --fps <num> Frames per second (model default unless set)
3307
3340
  --duration <sec> Duration in seconds (default: 5)
3308
3341
  --frames <num> Override total frames (optional)
@@ -3310,21 +3343,22 @@ Video Options:
3310
3343
  --auto-resize-assets Auto-resize video reference assets (default)
3311
3344
  --no-auto-resize-assets Disable auto-resize for video assets
3312
3345
  --estimate-video-cost Estimate video cost and exit
3313
- --ref <path|url> Reference image for video (start/first frame on Seedance)
3346
+ --ref <path|url> Reference image for video (start frame; Picture 1 on H3 r2v)
3314
3347
  --ref-end <path|url> End frame for interpolation/morphing; with --ref it
3315
3348
  defaults to the LTX-2.3 transition/morph model
3316
3349
  (last frame on Seedance)
3317
- --ref-audio <path|url> Audio reference. Repeatable on Seedance models (up to 3 total);
3350
+ --ref-audio <path|url> Audio reference. Repeatable on Seedance and H3 r2v (up to 3 total);
3318
3351
  first entry is the primary, extras must be HTTPS URLs in CLI
3319
- direct-gen (use --api-chat for multi local-file uploads).
3352
+ direct-gen for Seedance; H3 r2v uploads local/remote files.
3320
3353
  On LTX/WAN: single primary only (for ia2v/a2v/s2v lip-sync).
3321
3354
  --audio-start <sec> Start offset into --ref-audio for audio-driven clips
3322
3355
  --audio-duration <sec> Duration slice from --ref-audio
3323
3356
  --reference-audio-identity <path> Voice identity clip for LTX native audio
3324
3357
  --voice-persona <name> Use saved persona voice clip as LTX voice identity
3325
- --ref-video <path|url> Video reference. Repeatable on Seedance models (up to 3 total);
3358
+ --ref-video <path|url> Video reference. Repeatable on Seedance and H3 r2v (up to 3 total);
3326
3359
  first entry is the primary, extras must be HTTPS URLs in CLI
3327
- direct-gen. On LTX/WAN: single primary for animate/v2v workflows.
3360
+ direct-gen for Seedance. On LTX/WAN: single primary for animate/v2v.
3361
+ --generate-audio, --no-generate-audio Keep or strip MiniMax H3's generated audio track
3328
3362
 
3329
3363
  Seedance Reference Modes (mutually exclusive on seedance2 / seedance2-mini / seedance2-fast):
3330
3364
  - DEDICATED FRAME MODE: --ref (first frame) and/or --ref-end (last frame).
@@ -3508,6 +3542,17 @@ HappyHorse 1.1 Video Model Selectors (3-15s, fixed 24fps, native audio, 720P/108
3508
3542
  happyhorse-1.1-i2v Image-to-video from a single first-frame image (--ref)
3509
3543
  happyhorse-1.1-r2v Reference-to-video from 1-9 reference images (-c/--context)
3510
3544
 
3545
+ MiniMax H3 Video Model Selectors (fixed 24fps, native 32kHz stereo audio + dialogue,
3546
+ frames 124+n*17 = 5.17-15.08s, sizes /32 up to 1,032,192px, 32GB-class workers.
3547
+ Prompt is natural cinematic prose — a timed shot list ("[0-2 seconds] ...") plus
3548
+ explicit audio direction; see references/video-prompting.md "MiniMax H3
3549
+ Prompting". No negative prompt field: state negatives in the prompt text.):
3550
+ minimax-h3 Text-to-video (also accepts minimax-h3-t2v); --ref/--ref-end pick i2v/flf2v
3551
+ minimax-h3-i2v Image-to-video from a single first-frame image (--ref)
3552
+ minimax-h3-flf2v First-frame -> last-frame transition (--ref plus --ref-end)
3553
+ minimax-h3-r2v Multi-reference video: --ref/-c images, repeatable --ref-video/--ref-audio
3554
+ (9 images / 3 videos / 3 audios / 12 files total)
3555
+
3511
3556
  WAN 2.2 Video Models:
3512
3557
  wan_v2.2-14b-fp8_t2v_lightx2v Text-to-video (fast)
3513
3558
  wan_v2.2-14b-fp8_i2v_lightx2v Default single-image image-to-video (fast)
@@ -3997,12 +4042,15 @@ if (options.video) {
3997
4042
  const normalized = normalizeVideoWorkflow(options.videoWorkflow);
3998
4043
  if (normalized) {
3999
4044
  options.videoWorkflow = normalized;
4000
- } else if (options.videoWorkflow === 'r2v' && isHappyHorseModelSelectionLocal(options.model)) {
4001
- // HappyHorse adds a reference-to-video (r2v) mode that the shared
4002
- // SkillVideoWorkflow enum does not carry; accept it for HappyHorse only.
4045
+ } else if (
4046
+ options.videoWorkflow === 'r2v'
4047
+ && (isHappyHorseModelSelectionLocal(options.model) || isMiniMaxH3ModelSelectionLocal(options.model))
4048
+ ) {
4049
+ // HappyHorse and MiniMax H3 add reference-to-video (r2v) modes that the
4050
+ // shared SkillVideoWorkflow enum does not carry yet.
4003
4051
  options.videoWorkflow = 'r2v';
4004
4052
  } else {
4005
- fatalCliError(`Unknown workflow "${options.videoWorkflow}". Use t2v|i2v|s2v|ia2v|a2v|v2v|animate-move|animate-replace (r2v on HappyHorse).`, {
4053
+ fatalCliError(`Unknown workflow "${options.videoWorkflow}". Use t2v|i2v|s2v|ia2v|a2v|v2v|animate-move|animate-replace (r2v on HappyHorse or MiniMax H3).`, {
4006
4054
  code: 'INVALID_ARGUMENT',
4007
4055
  details: { workflow: options.videoWorkflow }
4008
4056
  });
@@ -4030,6 +4078,31 @@ if (options.video) {
4030
4078
  }
4031
4079
  }
4032
4080
 
4081
+ // MiniMax H3 has four concrete modes. The FL2VA checkpoint covers t2v, i2v,
4082
+ // and first/last-frame (represented by the CLI's i2v workflow); Ref2VA is a
4083
+ // separate r2v checkpoint and is never inferred from loose references alone.
4084
+ // Selecting minimax-h3-r2v or explicitly passing --workflow r2v is required.
4085
+ if (isMiniMaxH3ModelSelectionLocal(options.model)) {
4086
+ const pinnedMode = miniMaxH3ModeFromModelId(options.model);
4087
+ const pinnedWorkflow = pinnedMode === 'flf2v' ? 'i2v' : pinnedMode;
4088
+ if (pinnedWorkflow) {
4089
+ if (options.videoWorkflow && options.videoWorkflow !== pinnedWorkflow) {
4090
+ fatalCliError(`Workflow "${options.videoWorkflow}" does not match model "${options.model}".`, {
4091
+ code: 'INVALID_ARGUMENT',
4092
+ details: { workflow: options.videoWorkflow, model: options.model }
4093
+ });
4094
+ }
4095
+ options.videoWorkflow = pinnedWorkflow;
4096
+ } else if (!options.videoWorkflow) {
4097
+ options.videoWorkflow = (options.refImage || options.refImageEnd) ? 'i2v' : 't2v';
4098
+ }
4099
+ options.model = resolveSkillVideoModelAlias(
4100
+ options.model,
4101
+ options.videoWorkflow,
4102
+ Boolean(options.refImageEnd)
4103
+ );
4104
+ }
4105
+
4033
4106
  // HappyHorse 1.1 has no v2v/ia2v. A concrete `happyhorse-1.1-<mode>` id pins
4034
4107
  // the workflow; the bare `happyhorse` / `happyhorse-1.1` alias infers t2v by
4035
4108
  // default, i2v from a single first-frame image (--ref), and r2v from loose
@@ -4392,6 +4465,8 @@ if (options.photobooth) {
4392
4465
  if (options.video) {
4393
4466
  const isSeedanceVideo = isSeedanceModel(options.model);
4394
4467
  const isHappyHorseVideo = isHappyHorseModel(options.model);
4468
+ const isMiniMaxH3Video = isMiniMaxH3Model(options.model);
4469
+ const isMiniMaxH3R2v = isMiniMaxH3R2vModel(options.model);
4395
4470
  if (isSeedanceVideo && !['t2v', 'ia2v', 'v2v'].includes(options.videoWorkflow)) {
4396
4471
  fatalCliError('Seedance models support only t2v, ia2v, or v2v workflows.', {
4397
4472
  code: 'INVALID_ARGUMENT',
@@ -4404,15 +4479,42 @@ if (options.video) {
4404
4479
  details: { workflow: options.videoWorkflow, model: options.model }
4405
4480
  });
4406
4481
  }
4482
+ if (isMiniMaxH3Video && !['t2v', 'i2v', 'r2v'].includes(options.videoWorkflow)) {
4483
+ fatalCliError('MiniMax H3 models support only t2v, i2v/flf2v, or r2v workflows.', {
4484
+ code: 'INVALID_ARGUMENT',
4485
+ details: { workflow: options.videoWorkflow, model: options.model }
4486
+ });
4487
+ }
4407
4488
  if (isHappyHorseVideo && options.videoControlNetName) {
4408
4489
  fatalCliError('HappyHorse video models do not support ControlNet.', {
4409
4490
  code: 'INVALID_ARGUMENT',
4410
4491
  details: { model: options.model, controlNetName: options.videoControlNetName }
4411
4492
  });
4412
4493
  }
4494
+ if (isMiniMaxH3Video && (options.videoControlNetName || options.refMask || options.referenceAudioIdentity)) {
4495
+ fatalCliError('MiniMax H3 does not support ControlNet, masks, or LTX voice-identity references.', {
4496
+ code: 'INVALID_ARGUMENT',
4497
+ details: { model: options.model }
4498
+ });
4499
+ }
4500
+ if (isMiniMaxH3Video && (cliSet.steps || cliSet.guidance)) {
4501
+ fatalCliError('MiniMax H3 uses fixed sampling settings; omit --steps and --guidance.', {
4502
+ code: 'INVALID_ARGUMENT',
4503
+ details: { model: options.model, steps: options.steps, guidance: options.guidance }
4504
+ });
4505
+ }
4506
+ if (isHappyHorseVideo && options.apiGenerateAudio !== null) {
4507
+ fatalCliError('HappyHorse native audio is always on; omit --generate-audio/--no-generate-audio.', {
4508
+ code: 'INVALID_ARGUMENT',
4509
+ details: { model: options.model }
4510
+ });
4511
+ }
4413
4512
 
4414
4513
  if (options.videoWorkflow === 't2v') {
4415
- if (!isSeedanceVideo && (options.refImage || options.refImageEnd || options.refAudio || options.refVideo)) {
4514
+ if (!isSeedanceVideo && (
4515
+ options.refImage || options.refImageEnd || options.refAudio || options.refVideo
4516
+ || options.contextImages.length > 0 || options.refAudios.length > 0 || options.refVideos.length > 0
4517
+ )) {
4416
4518
  fatalCliError('t2v does not accept reference image/audio/video.', {
4417
4519
  code: 'INVALID_ARGUMENT'
4418
4520
  });
@@ -4428,6 +4530,23 @@ if (options.video) {
4428
4530
  if (options.refAudio || options.refVideo) {
4429
4531
  fatalCliError('HappyHorse i2v does not accept reference audio/video.', { code: 'INVALID_ARGUMENT' });
4430
4532
  }
4533
+ } else if (isMiniMaxH3Video) {
4534
+ const h3Mode = miniMaxH3ModeFromModelId(options.model);
4535
+ if (h3Mode === 'flf2v') {
4536
+ if (!options.refImage || !options.refImageEnd) {
4537
+ fatalCliError('MiniMax H3 flf2v requires both --ref and --ref-end.', { code: 'INVALID_ARGUMENT' });
4538
+ }
4539
+ } else {
4540
+ if (!options.refImage) {
4541
+ fatalCliError('MiniMax H3 i2v requires --ref (a single first-frame image).', { code: 'INVALID_ARGUMENT' });
4542
+ }
4543
+ if (options.refImageEnd) {
4544
+ fatalCliError('MiniMax H3 i2v accepts one first-frame image; use -m minimax-h3-flf2v for --ref plus --ref-end.', { code: 'INVALID_ARGUMENT' });
4545
+ }
4546
+ }
4547
+ if (options.contextImages.length > 0 || options.refAudio || options.refVideo || options.refAudios.length > 0 || options.refVideos.length > 0) {
4548
+ fatalCliError('MiniMax H3 i2v/flf2v accepts only --ref and optional --ref-end image anchors; use minimax-h3-r2v for loose image/video/audio references.', { code: 'INVALID_ARGUMENT' });
4549
+ }
4431
4550
  } else {
4432
4551
  if (!options.refImage && !options.refImageEnd) {
4433
4552
  fatalCliError('i2v requires --ref and/or --ref-end.', { code: 'INVALID_ARGUMENT' });
@@ -4437,15 +4556,25 @@ if (options.video) {
4437
4556
  }
4438
4557
  }
4439
4558
  } else if (options.videoWorkflow === 'r2v') {
4440
- // HappyHorse reference-to-video: 1-9 loose image references via -c/--context.
4441
- if (!Array.isArray(options.contextImages) || options.contextImages.length === 0) {
4442
- fatalCliError('HappyHorse r2v requires 1-9 reference images via -c/--context.', { code: 'INVALID_ARGUMENT' });
4443
- }
4444
- if (options.refImage || options.refImageEnd) {
4445
- fatalCliError('HappyHorse r2v takes reference images via -c/--context, not --ref/--ref-end.', { code: 'INVALID_ARGUMENT' });
4446
- }
4447
- if (options.refAudio || options.refVideo) {
4448
- fatalCliError('HappyHorse r2v does not accept reference audio/video.', { code: 'INVALID_ARGUMENT' });
4559
+ if (isMiniMaxH3R2v) {
4560
+ const imageCount = (options.refImage ? 1 : 0) + options.contextImages.length;
4561
+ if (imageCount === 0) {
4562
+ fatalCliError('MiniMax H3 r2v needs at least one reference image via --ref or -c/--context.', { code: 'INVALID_ARGUMENT' });
4563
+ }
4564
+ if (options.refImageEnd) {
4565
+ fatalCliError('MiniMax H3 r2v has no end-frame anchor; use -c/--context for another loose image or minimax-h3-flf2v for first/last frames.', { code: 'INVALID_ARGUMENT' });
4566
+ }
4567
+ } else {
4568
+ // HappyHorse reference-to-video: 1-9 loose image references via -c/--context.
4569
+ if (!Array.isArray(options.contextImages) || options.contextImages.length === 0) {
4570
+ fatalCliError('HappyHorse r2v requires 1-9 reference images via -c/--context.', { code: 'INVALID_ARGUMENT' });
4571
+ }
4572
+ if (options.refImage || options.refImageEnd) {
4573
+ fatalCliError('HappyHorse r2v takes reference images via -c/--context, not --ref/--ref-end.', { code: 'INVALID_ARGUMENT' });
4574
+ }
4575
+ if (options.refAudio || options.refVideo || options.refAudios.length > 0 || options.refVideos.length > 0) {
4576
+ fatalCliError('HappyHorse r2v does not accept reference audio/video.', { code: 'INVALID_ARGUMENT' });
4577
+ }
4449
4578
  }
4450
4579
  } else if (options.videoWorkflow === 's2v') {
4451
4580
  if (!options.refImage || !options.refAudio) {
@@ -4525,15 +4654,15 @@ if (options.video) {
4525
4654
  }
4526
4655
  // Non-Seedance video models do not understand multi-ref audio/video extras —
4527
4656
  // they only support a single primary --ref-audio / --ref-video each.
4528
- if (!isSeedanceVideo) {
4657
+ if (!isSeedanceVideo && !isMiniMaxH3R2v) {
4529
4658
  if (Array.isArray(options.refAudios) && options.refAudios.length > 0) {
4530
- fatalCliError('Multiple --ref-audio entries are only supported for Seedance models (seedance2, seedance2-mini, seedance2-fast).', {
4659
+ fatalCliError('Multiple --ref-audio entries are supported only for Seedance loose references and MiniMax H3 r2v.', {
4531
4660
  code: 'INVALID_ARGUMENT',
4532
4661
  details: { model: options.model, extras: options.refAudios },
4533
4662
  });
4534
4663
  }
4535
4664
  if (Array.isArray(options.refVideos) && options.refVideos.length > 0) {
4536
- fatalCliError('Multiple --ref-video entries are only supported for Seedance models (seedance2, seedance2-mini, seedance2-fast).', {
4665
+ fatalCliError('Multiple --ref-video entries are supported only for Seedance loose references and MiniMax H3 r2v.', {
4537
4666
  code: 'INVALID_ARGUMENT',
4538
4667
  details: { model: options.model, extras: options.refVideos },
4539
4668
  });
@@ -7990,6 +8119,34 @@ function enforceHappyHorseReferenceCaps() {
7990
8119
  }
7991
8120
  }
7992
8121
 
8122
+ function enforceMiniMaxH3ReferenceCaps() {
8123
+ const { images, videos, audios } = effectiveSeedanceReferenceCounts();
8124
+ const total = images + videos + audios;
8125
+ const checks = [
8126
+ ['images', images, MINIMAX_H3_REFERENCE_LIMITS.images],
8127
+ ['videos', videos, MINIMAX_H3_REFERENCE_LIMITS.videos],
8128
+ ['audios', audios, MINIMAX_H3_REFERENCE_LIMITS.audios]
8129
+ ];
8130
+ for (const [kind, count, maximum] of checks) {
8131
+ if (count > maximum) {
8132
+ fatalCliError(`MiniMax H3 r2v supports at most ${maximum} reference ${kind} (got ${count}).`, {
8133
+ code: 'MINIMAX_H3_REFERENCE_LIMIT_EXCEEDED',
8134
+ details: { kind, count, maximum, limits: MINIMAX_H3_REFERENCE_LIMITS }
8135
+ });
8136
+ }
8137
+ }
8138
+ if (total > MINIMAX_H3_REFERENCE_LIMITS.assets) {
8139
+ fatalCliError(
8140
+ `MiniMax H3 r2v supports at most ${MINIMAX_H3_REFERENCE_LIMITS.assets} reference files in total `
8141
+ + `(got ${total}: ${images} image, ${videos} video, ${audios} audio).`,
8142
+ {
8143
+ code: 'MINIMAX_H3_REFERENCE_LIMIT_EXCEEDED',
8144
+ details: { images, videos, audios, total, limits: MINIMAX_H3_REFERENCE_LIMITS }
8145
+ }
8146
+ );
8147
+ }
8148
+ }
8149
+
7993
8150
  function resolveMultiAngleOutputConfig(outputPath, outputFormat) {
7994
8151
  if (!outputPath) return null;
7995
8152
  const ext = extname(outputPath);
@@ -10397,11 +10554,17 @@ async function main() {
10397
10554
  if (options.refImage) log(`Reference image: ${options.refImage}`);
10398
10555
  if (options.refImageEnd) log(`End frame: ${options.refImageEnd}`);
10399
10556
  if (options.refAudio) log(`Reference audio: ${options.refAudio}`);
10557
+ for (const referenceAudio of options.refAudios) log(`Additional reference audio: ${referenceAudio}`);
10400
10558
  if (options.referenceAudioIdentity) log(`Voice identity: ${options._voicePersonaResolvedName || options.referenceAudioIdentity}`);
10401
10559
  if (options.refVideo) log(`Reference video: ${options.refVideo}`);
10560
+ for (const referenceVideo of options.refVideos) log(`Additional reference video: ${referenceVideo}`);
10561
+ if (options.videoWorkflow === 'r2v') {
10562
+ for (const contextImage of options.contextImages) log(`Loose reference image: ${contextImage}`);
10563
+ }
10402
10564
 
10403
10565
  const isSeedanceVideo = isSeedanceModel(options.model);
10404
10566
  const isHappyHorseVideo = isHappyHorseModel(options.model);
10567
+ const isMiniMaxH3R2v = isMiniMaxH3R2vModel(options.model);
10405
10568
  // Vendor video models forward image references as HTTPS URL arrays (or
10406
10569
  // Sogni-hosted uploads) instead of inline buffers; HappyHorse takes
10407
10570
  // image-only references (i2v first_frame, r2v reference_image).
@@ -10416,6 +10579,9 @@ async function main() {
10416
10579
  // HAPPYHORSE_REFERENCE_LIMITS (per-mode image-only caps).
10417
10580
  enforceHappyHorseReferenceCaps();
10418
10581
  }
10582
+ if (isMiniMaxH3R2v) {
10583
+ enforceMiniMaxH3ReferenceCaps();
10584
+ }
10419
10585
  const seedanceReferenceImageUrls = [];
10420
10586
  const seedanceReferenceVideoUrls = [];
10421
10587
  const seedanceReferenceAudioUrls = [];
@@ -10531,9 +10697,25 @@ async function main() {
10531
10697
  let audioBuffer = options.refAudio && !useRefAudioUrl ? await fetchMediaBuffer(options.refAudio) : undefined;
10532
10698
  let videoBuffer = options.refVideo && !useRefVideoUrl ? await fetchMediaBuffer(options.refVideo) : undefined;
10533
10699
  let maskBuffer = options.refMask ? await fetchMediaBuffer(options.refMask) : undefined;
10700
+ const contextImageBuffers = isMiniMaxH3R2v
10701
+ ? await Promise.all(options.contextImages.map((reference) => fetchMediaBuffer(reference)))
10702
+ : [];
10703
+ let additionalAudioBuffers = isMiniMaxH3R2v
10704
+ ? await Promise.all(options.refAudios.map((reference) => fetchMediaBuffer(reference)))
10705
+ : [];
10706
+ const additionalVideoBuffers = isMiniMaxH3R2v
10707
+ ? await Promise.all(options.refVideos.map((reference) => fetchMediaBuffer(reference)))
10708
+ : [];
10534
10709
  if (audioBuffer) {
10535
10710
  audioBuffer = await prepareReferenceAudioForVideoBuffer(audioBuffer, options.refAudio);
10536
10711
  }
10712
+ if (additionalAudioBuffers.length > 0) {
10713
+ additionalAudioBuffers = await Promise.all(
10714
+ additionalAudioBuffers.map((buffer, index) =>
10715
+ prepareReferenceAudioForVideoBuffer(buffer, options.refAudios[index])
10716
+ )
10717
+ );
10718
+ }
10537
10719
  if (
10538
10720
  videoBuffer
10539
10721
  && isSeedanceVideo
@@ -10689,6 +10871,9 @@ async function main() {
10689
10871
  if (endImageBuffer) {
10690
10872
  projectConfig.referenceImageEnd = endImageBuffer;
10691
10873
  }
10874
+ if (contextImageBuffers.length > 0) {
10875
+ projectConfig.contextImages = contextImageBuffers;
10876
+ }
10692
10877
  applyLtxTransitionLora(
10693
10878
  projectConfig,
10694
10879
  options.model,
@@ -10698,6 +10883,9 @@ async function main() {
10698
10883
  if (audioBuffer) {
10699
10884
  projectConfig.referenceAudio = audioBuffer;
10700
10885
  }
10886
+ if (additionalAudioBuffers.length > 0) {
10887
+ projectConfig.referenceAudios = additionalAudioBuffers;
10888
+ }
10701
10889
  if (options.audioStart !== null && !useRefAudioUrl) {
10702
10890
  projectConfig.audioStart = options.audioStart;
10703
10891
  }
@@ -10710,6 +10898,9 @@ async function main() {
10710
10898
  if (videoBuffer) {
10711
10899
  projectConfig.referenceVideo = videoBuffer;
10712
10900
  }
10901
+ if (additionalVideoBuffers.length > 0) {
10902
+ projectConfig.referenceVideos = additionalVideoBuffers;
10903
+ }
10713
10904
  if (seedanceReferenceImageUrls.length > 0) {
10714
10905
  projectConfig.referenceImageUrls = seedanceReferenceImageUrls;
10715
10906
  }
@@ -10725,21 +10916,25 @@ async function main() {
10725
10916
  if (options.seed !== null && options.seed !== undefined) {
10726
10917
  projectConfig.seed = options.seed;
10727
10918
  }
10728
- if (Number.isFinite(steps) && !isHappyHorseVideo) {
10919
+ if (options.apiGenerateAudio !== null && isMiniMaxH3Model(options.model)) {
10920
+ projectConfig.generateAudio = options.apiGenerateAudio;
10921
+ }
10922
+ if (Number.isFinite(steps) && !isHappyHorseVideo && !isMiniMaxH3Model(options.model)) {
10729
10923
  // HappyHorse routes through the vendor-job path and ignores `steps`,
10730
- // mirroring Seedance (whose model defaults already omit them).
10924
+ // mirroring Seedance (whose model defaults already omit them). H3 has
10925
+ // fixed sampling parameters and should receive no overrides.
10731
10926
  projectConfig.steps = steps;
10732
10927
  }
10733
- if (guidance !== null && guidance !== undefined) {
10928
+ if (guidance !== null && guidance !== undefined && !isMiniMaxH3Model(options.model)) {
10734
10929
  projectConfig.guidance = guidance;
10735
10930
  }
10736
- if (modelDefaults?.sampler) {
10931
+ if (modelDefaults?.sampler && !isMiniMaxH3Model(options.model)) {
10737
10932
  projectConfig.sampler = modelDefaults.sampler;
10738
10933
  }
10739
- if (modelDefaults?.scheduler) {
10934
+ if (modelDefaults?.scheduler && !isMiniMaxH3Model(options.model)) {
10740
10935
  projectConfig.scheduler = modelDefaults.scheduler;
10741
10936
  }
10742
- if (modelDefaults?.shift !== null && modelDefaults?.shift !== undefined) {
10937
+ if (modelDefaults?.shift !== null && modelDefaults?.shift !== undefined && !isMiniMaxH3Model(options.model)) {
10743
10938
  projectConfig.shift = modelDefaults.shift;
10744
10939
  }
10745
10940
  if (options.videoControlNetName && !isSeedanceModel(options.model)) {
@@ -11114,6 +11309,7 @@ async function main() {
11114
11309
  if (options.audioStart !== null) renderInfo.audioStart = options.audioStart;
11115
11310
  if (options.audioDuration !== null) renderInfo.audioDuration = options.audioDuration;
11116
11311
  }
11312
+ if (options.refAudios.length > 0) renderInfo.refAudios = options.refAudios;
11117
11313
  if (options.referenceAudioIdentity) {
11118
11314
  renderInfo.referenceAudioIdentity = options.referenceAudioIdentity;
11119
11315
  if (options._voicePersonaResolvedName || options.voicePersonaName) {
@@ -11124,6 +11320,10 @@ async function main() {
11124
11320
  renderInfo.refVideo = options.refVideo;
11125
11321
  if (options.videoStart !== null) renderInfo.videoStart = options.videoStart;
11126
11322
  }
11323
+ if (options.refVideos.length > 0) renderInfo.refVideos = options.refVideos;
11324
+ if (options.apiGenerateAudio !== null && isMiniMaxH3Model(options.model)) {
11325
+ renderInfo.generateAudio = options.apiGenerateAudio;
11326
+ }
11127
11327
  if (options.videoControlNetName && !isSeedanceModel(options.model)) {
11128
11328
  renderInfo.controlNet = {
11129
11329
  name: options.videoControlNetName,
@@ -11341,6 +11541,7 @@ async function main() {
11341
11541
  if (options.audioStart !== null) output.audioStart = options.audioStart;
11342
11542
  if (options.audioDuration !== null) output.audioDuration = options.audioDuration;
11343
11543
  }
11544
+ if (options.refAudios.length > 0) output.refAudios = options.refAudios;
11344
11545
  if (options.referenceAudioIdentity) {
11345
11546
  output.referenceAudioIdentity = options.referenceAudioIdentity;
11346
11547
  if (options._voicePersonaResolvedName || options.voicePersonaName) {
@@ -11351,6 +11552,10 @@ async function main() {
11351
11552
  output.refVideo = options.refVideo;
11352
11553
  if (options.videoStart !== null) output.videoStart = options.videoStart;
11353
11554
  }
11555
+ if (options.refVideos.length > 0) output.refVideos = options.refVideos;
11556
+ if (options.apiGenerateAudio !== null && isMiniMaxH3Model(options.model)) {
11557
+ output.generateAudio = options.apiGenerateAudio;
11558
+ }
11354
11559
  if (options.videoControlNetName && !isSeedanceModel(options.model)) {
11355
11560
  output.controlNet = {
11356
11561
  name: options.videoControlNetName,
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.23.0';
1
+ export const PACKAGE_VERSION = '3.26.0';