@sogni-ai/sogni-creative-agent-skill 3.36.0 → 3.38.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
@@ -1379,7 +1379,7 @@ const MAX_COUNT = (() => {
1379
1379
 
1380
1380
  function parseSeedValue(raw, flagName) {
1381
1381
  const num = parseIntegerValue(raw, flagName);
1382
- if (num < 0 || num > 0xFFFFFFFF) {
1382
+ if (num < -1 || num > 0xFFFFFFFF) {
1383
1383
  fatalCliError(`${flagName} must be between 0 and 4294967295.`, {
1384
1384
  code: 'INVALID_ARGUMENT',
1385
1385
  details: { flag: flagName, value: raw }
@@ -1617,7 +1617,7 @@ const SEEDANCE_25_MODEL_SELECTIONS = new Set([
1617
1617
  ]);
1618
1618
 
1619
1619
  const WAN3_MODEL_ID = 'wan3.0-video';
1620
- const WAN3_MODEL_SELECTIONS = new Set([
1620
+ const WAN3_REGULAR_MODEL_SELECTIONS = new Set([
1621
1621
  WAN3_MODEL_ID,
1622
1622
  'wan3',
1623
1623
  'wan3.0',
@@ -1625,6 +1625,14 @@ const WAN3_MODEL_SELECTIONS = new Set([
1625
1625
  'wan-3',
1626
1626
  'wan-3.0',
1627
1627
  ]);
1628
+ const WAN3_ENHANCED_MODEL_ID = 'wan3.0-spicy-video';
1629
+ const WAN3_ENHANCED_MODEL_SELECTIONS = new Set([
1630
+ WAN3_ENHANCED_MODEL_ID,
1631
+ 'wan3-enhanced',
1632
+ 'wan3.0-enhanced',
1633
+ 'wan3-spicy',
1634
+ 'wan3.0-spicy',
1635
+ ]);
1628
1636
  const WAN3_REFERENCE_LIMITS = Object.freeze({
1629
1637
  images: 10,
1630
1638
  videos: 5,
@@ -1638,11 +1646,23 @@ const WAN3_SUPPORTED_RATIOS = new Set(['adaptive', '16:9', '4:3', '1:1', '3:4',
1638
1646
  const WAN3_MAX_SEED = 0x7fffffff;
1639
1647
 
1640
1648
  function isWan3ModelSelectionLocal(modelId) {
1641
- return WAN3_MODEL_SELECTIONS.has(String(modelId || '').trim().toLowerCase().replace(/_/g, '-'));
1649
+ const normalized = String(modelId || '').trim().toLowerCase().replace(/_/g, '-');
1650
+ return WAN3_REGULAR_MODEL_SELECTIONS.has(normalized) || WAN3_ENHANCED_MODEL_SELECTIONS.has(normalized);
1651
+ }
1652
+
1653
+ function isWan3EnhancedModelSelectionLocal(modelId) {
1654
+ return WAN3_ENHANCED_MODEL_SELECTIONS.has(
1655
+ String(modelId || '').trim().toLowerCase().replace(/_/g, '-'),
1656
+ );
1642
1657
  }
1643
1658
 
1644
1659
  function isWan3ModelLocal(modelId) {
1645
- return String(modelId || '').trim().toLowerCase() === WAN3_MODEL_ID;
1660
+ const normalized = String(modelId || '').trim().toLowerCase();
1661
+ return normalized === WAN3_MODEL_ID || normalized === WAN3_ENHANCED_MODEL_ID;
1662
+ }
1663
+
1664
+ function isWan3EnhancedModelLocal(modelId) {
1665
+ return String(modelId || '').trim().toLowerCase() === WAN3_ENHANCED_MODEL_ID;
1646
1666
  }
1647
1667
 
1648
1668
  function isSeedance25ModelSelectionLocal(modelId) {
@@ -2126,7 +2146,11 @@ const MINIMAX_H3_MODEL_MODES = new Map([
2126
2146
  ['minimax-h3-fl2va-fp8_t2v_turbo', 't2v'],
2127
2147
  ['minimax-h3-fl2va-fp8_i2v_turbo', 'i2v'],
2128
2148
  ['minimax-h3-fl2va-fp8_flf2v_turbo', 'flf2v'],
2129
- ['minimax-h3-ref2va-fp8_r2v_turbo', 'r2v']
2149
+ ['minimax-h3-ref2va-fp8_r2v_turbo', 'r2v'],
2150
+ ['minimax-h3-fl2va-fp8_t2v_balanced', 't2v'],
2151
+ ['minimax-h3-fl2va-fp8_i2v_balanced', 'i2v'],
2152
+ ['minimax-h3-fl2va-fp8_flf2v_balanced', 'flf2v'],
2153
+ ['minimax-h3-ref2va-fp8_r2v_balanced', 'r2v']
2130
2154
  ]);
2131
2155
  const MINIMAX_H3_MODEL_IDS = new Set(MINIMAX_H3_MODEL_MODES.keys());
2132
2156
  const MINIMAX_H3_TURBO_MODEL_IDS = new Set([
@@ -2139,6 +2163,7 @@ const MINIMAX_H3_TURBO_SAMPLERS = Object.freeze(['euler', 'er_sde', 'sa_solver']
2139
2163
  const MINIMAX_H3_TURBO_SAMPLER_SET = new Set(MINIMAX_H3_TURBO_SAMPLERS);
2140
2164
  const MINIMAX_H3_R2V_MODEL_ID = 'minimax-h3-ref2va-fp8_r2v';
2141
2165
  const MINIMAX_H3_R2V_TURBO_MODEL_ID = 'minimax-h3-ref2va-fp8_r2v_turbo';
2166
+ const MINIMAX_H3_R2V_BALANCED_MODEL_ID = 'minimax-h3-ref2va-fp8_r2v_balanced';
2142
2167
  const MINIMAX_H3_REFERENCE_LIMITS = Object.freeze({
2143
2168
  images: 9,
2144
2169
  videos: 3,
@@ -2194,6 +2219,7 @@ function resolveSkillVideoModelAlias(
2194
2219
  hasEndFrame = false,
2195
2220
  ) {
2196
2221
  const normalized = String(modelId || '').trim().toLowerCase();
2222
+ if (isWan3EnhancedModelSelectionLocal(normalized)) return WAN3_ENHANCED_MODEL_ID;
2197
2223
  if (isWan3ModelSelectionLocal(normalized)) return WAN3_MODEL_ID;
2198
2224
  if (normalized === 'ltx25' || normalized === 'ltx25-t2v') {
2199
2225
  const mode = ['i2v', 'a2v', 'ia2v', 'v2v'].includes(workflow) ? workflow : 't2v';
@@ -2239,6 +2265,29 @@ function resolveSkillVideoModelAlias(
2239
2265
  if (normalized === 'minimax-h3-flf2v-turbo') {
2240
2266
  return 'minimax-h3-fl2va-fp8_flf2v_turbo';
2241
2267
  }
2268
+ if (normalized === 'minimax-h3-balanced' && workflow) {
2269
+ if (workflow === 'r2v') {
2270
+ return MINIMAX_H3_R2V_BALANCED_MODEL_ID;
2271
+ }
2272
+ if (workflow === 'i2v') {
2273
+ return hasStartFrame && hasEndFrame
2274
+ ? 'minimax-h3-fl2va-fp8_flf2v_balanced'
2275
+ : 'minimax-h3-fl2va-fp8_i2v_balanced';
2276
+ }
2277
+ return 'minimax-h3-fl2va-fp8_t2v_balanced';
2278
+ }
2279
+ if (normalized === 'minimax-h3-t2v-balanced') {
2280
+ return 'minimax-h3-fl2va-fp8_t2v_balanced';
2281
+ }
2282
+ if (normalized === 'minimax-h3-i2v-balanced') {
2283
+ return 'minimax-h3-fl2va-fp8_i2v_balanced';
2284
+ }
2285
+ if (normalized === 'minimax-h3-flf2v-balanced') {
2286
+ return 'minimax-h3-fl2va-fp8_flf2v_balanced';
2287
+ }
2288
+ if (normalized === 'minimax-h3-r2v-balanced') {
2289
+ return MINIMAX_H3_R2V_BALANCED_MODEL_ID;
2290
+ }
2242
2291
  return normalized === '10eros' || normalized === 'ltx23-eros'
2243
2292
  ? LTX23_10EROS_MODEL_ID
2244
2293
  : modelId;
@@ -2254,7 +2303,9 @@ function isMiniMaxH3TurboModel(modelId) {
2254
2303
 
2255
2304
  function isMiniMaxH3R2vModel(modelId) {
2256
2305
  const normalized = String(modelId || '').trim().toLowerCase();
2257
- return normalized === MINIMAX_H3_R2V_MODEL_ID || normalized === MINIMAX_H3_R2V_TURBO_MODEL_ID;
2306
+ return normalized === MINIMAX_H3_R2V_MODEL_ID
2307
+ || normalized === MINIMAX_H3_R2V_TURBO_MODEL_ID
2308
+ || normalized === MINIMAX_H3_R2V_BALANCED_MODEL_ID;
2258
2309
  }
2259
2310
 
2260
2311
  function isMiniMaxH3R2vTurboSelectionLocal(modelId, workflow = null) {
@@ -2276,6 +2327,11 @@ function isMiniMaxH3ModelSelectionLocal(modelId) {
2276
2327
  || normalized === 'minimax-h3-i2v-turbo'
2277
2328
  || normalized === 'minimax-h3-flf2v-turbo'
2278
2329
  || normalized === 'minimax-h3-r2v-turbo'
2330
+ || normalized === 'minimax-h3-balanced'
2331
+ || normalized === 'minimax-h3-t2v-balanced'
2332
+ || normalized === 'minimax-h3-i2v-balanced'
2333
+ || normalized === 'minimax-h3-flf2v-balanced'
2334
+ || normalized === 'minimax-h3-r2v-balanced'
2279
2335
  || isMiniMaxH3Model(normalized);
2280
2336
  }
2281
2337
 
@@ -2299,6 +2355,10 @@ function miniMaxH3ModeFromModelId(modelId) {
2299
2355
  if (normalized === 'minimax-h3-i2v-turbo') return 'i2v';
2300
2356
  if (normalized === 'minimax-h3-flf2v-turbo') return 'flf2v';
2301
2357
  if (normalized === 'minimax-h3-r2v-turbo') return 'r2v';
2358
+ if (normalized === 'minimax-h3-t2v-balanced') return 't2v';
2359
+ if (normalized === 'minimax-h3-i2v-balanced') return 'i2v';
2360
+ if (normalized === 'minimax-h3-flf2v-balanced') return 'flf2v';
2361
+ if (normalized === 'minimax-h3-r2v-balanced') return 'r2v';
2302
2362
  return MINIMAX_H3_MODEL_MODES.get(normalized) || null;
2303
2363
  }
2304
2364
 
@@ -4087,7 +4147,7 @@ HappyHorse 1.1 Video Model Selectors (3-15s, fixed 24fps, native audio, 720P/108
4087
4147
  happyhorse-1.1-r2v Reference-to-video from 1-9 reference images (-c/--context)
4088
4148
 
4089
4149
  MiniMax H3 Video Model Selectors (fixed 24fps, native 32kHz stereo audio + dialogue,
4090
- frames 124+n*17 = 5.17-15.08s, sizes /32 up to 1,032,192px. FL2VA/Turbo and
4150
+ frames 124+n*17 = 5.17-15.08s, sizes /32 up to 1,032,192px. FL2VA/Balanced/Turbo and
4091
4151
  image-only R2V need 32GB-class workers; video-conditioned R2V needs above 40GB.
4092
4152
  Prompts use MiniMax's exact ordered-field contracts and [Shot N] notation; see
4093
4153
  references/video-prompting.md "MiniMax H3 Prompting". No negative prompt field:
@@ -4097,6 +4157,11 @@ state negatives in the structured prompt.):
4097
4157
  minimax-h3-flf2v First-frame -> last-frame transition (--ref plus --ref-end)
4098
4158
  minimax-h3-r2v Multi-reference video: --ref/-c images, repeatable --ref-video/--ref-audio
4099
4159
  (9 images / 3 videos / 3 audios / 12 files total; requires an image or video)
4160
+ minimax-h3-balanced Fixed 8-step Euler/simple PDD tier; infers T2VA/I2VA/L2VA/FL2VA
4161
+ minimax-h3-t2v-balanced Balanced text-to-video
4162
+ minimax-h3-i2v-balanced Balanced I2VA (--ref) or L2VA (--ref-end)
4163
+ minimax-h3-flf2v-balanced Balanced first-frame -> last-frame (--ref plus --ref-end)
4164
+ minimax-h3-r2v-balanced Balanced Ref2VA with loose image/video/audio references
4100
4165
  minimax-h3-turbo 4-step Turbo; --ref selects I2VA, --ref-end L2VA, and both FL2VA
4101
4166
  minimax-h3-t2v-turbo 4-step Turbo text-to-video
4102
4167
  minimax-h3-i2v-turbo 4-step Turbo I2VA (--ref) or L2VA (--ref-end)
@@ -4737,6 +4802,7 @@ if (options.video) {
4737
4802
  // In audio/video workflows --ref is a loose reference image. In i2v it is a
4738
4803
  // dedicated first-frame anchor and may be paired with --ref-end.
4739
4804
  if (isWan3ModelSelectionLocal(options.model)) {
4805
+ const isEnhancedSelection = isWan3EnhancedModelSelectionLocal(options.model);
4740
4806
  if (!options.videoWorkflow) {
4741
4807
  const hasLooseImages = Array.isArray(options.contextImages) && options.contextImages.length > 0;
4742
4808
  const hasAudio = Boolean(options.refAudio || options.refAudios.length > 0);
@@ -4755,14 +4821,15 @@ if (options.video) {
4755
4821
  options.videoWorkflow = 't2v';
4756
4822
  }
4757
4823
  }
4758
- options.model = WAN3_MODEL_ID;
4824
+ options.model = isEnhancedSelection ? WAN3_ENHANCED_MODEL_ID : WAN3_MODEL_ID;
4759
4825
  }
4760
4826
 
4761
- // MiniMax H3 has four concrete worker selectors and five prompt shapes. The
4762
- // FL2VA checkpoint covers t2v, first-frame i2v, last-frame-only l2v, and
4763
- // first/last-frame (represented by the CLI's i2v workflow); Ref2VA is a
4764
- // separate r2v checkpoint and is never inferred from loose references alone.
4765
- // Selecting minimax-h3-r2v or explicitly passing --workflow r2v is required.
4827
+ // Each MiniMax H3 tier has four concrete worker selectors and five prompt
4828
+ // shapes. The FL2VA checkpoint covers t2v, first-frame i2v, last-frame-only
4829
+ // l2v, and first/last-frame (represented by the CLI's i2v workflow); Ref2VA
4830
+ // is a separate r2v checkpoint and is never inferred from loose references.
4831
+ // Selecting the tier's minimax-h3-r2v* alias or explicitly passing
4832
+ // --workflow r2v with its bare tier selector is required.
4766
4833
  if (isMiniMaxH3ModelSelectionLocal(options.model)) {
4767
4834
  const pinnedMode = miniMaxH3ModeFromModelId(options.model);
4768
4835
  const pinnedWorkflow = pinnedMode === 'flf2v' ? 'i2v' : pinnedMode;
@@ -5242,6 +5309,7 @@ if (options.video) {
5242
5309
  const isSeedance25Video = isSeedance25ModelSelectionLocal(options.model);
5243
5310
  const isHappyHorseVideo = isHappyHorseModel(options.model);
5244
5311
  const isWan3Video = isWan3ModelLocal(options.model);
5312
+ const isWan3EnhancedVideo = isWan3EnhancedModelLocal(options.model);
5245
5313
  const isMiniMaxH3Video = isMiniMaxH3Model(options.model);
5246
5314
  const isMiniMaxH3R2v = isMiniMaxH3R2vModel(options.model);
5247
5315
  if (options.seedanceTaskType && !SEEDANCE_TASK_TYPES.has(options.seedanceTaskType)) {
@@ -5257,7 +5325,18 @@ if (options.video) {
5257
5325
  });
5258
5326
  }
5259
5327
  if ((cliSet.wan3Ratio || options.wan3SmartDuration || options.wan3ReferenceFileUrl || options.wan3ReferenceLinkUrl || options.wan3Watermark) && !isWan3Video) {
5260
- fatalCliError('Wan 3 controls are supported only by wan3 / wan3.0-video.', {
5328
+ fatalCliError('Wan 3 controls are supported only by Wan 3 or Wan 3.0 Enhanced.', {
5329
+ code: 'INVALID_ARGUMENT',
5330
+ details: { model: options.model }
5331
+ });
5332
+ }
5333
+ if (
5334
+ isWan3EnhancedVideo &&
5335
+ (options.wan3ReferenceFileUrl ||
5336
+ options.wan3ReferenceLinkUrl ||
5337
+ options.wan3Watermark)
5338
+ ) {
5339
+ fatalCliError('Wan 3.0 Enhanced does not support document/web context or watermark.', {
5261
5340
  code: 'INVALID_ARGUMENT',
5262
5341
  details: { model: options.model }
5263
5342
  });
@@ -5423,8 +5502,15 @@ if (options.video) {
5423
5502
  details: { promptLength: options.prompt.length, maximum: 20000 }
5424
5503
  });
5425
5504
  }
5426
- if (isWan3Video && cliSet.seed && (!Number.isInteger(options.seed) || options.seed < 0 || options.seed > WAN3_MAX_SEED)) {
5427
- fatalCliError(`Wan 3 --seed must be an integer from 0 through ${WAN3_MAX_SEED}.`, {
5505
+ const minimumWan3Seed = 0;
5506
+ if (cliSet.seed && options.seed === -1) {
5507
+ fatalCliError('--seed must be between 0 and 4294967295.', {
5508
+ code: 'INVALID_ARGUMENT',
5509
+ details: { seed: options.seed }
5510
+ });
5511
+ }
5512
+ if (isWan3Video && cliSet.seed && (!Number.isInteger(options.seed) || options.seed < minimumWan3Seed || options.seed > WAN3_MAX_SEED)) {
5513
+ fatalCliError(`Wan 3 --seed must be an integer from ${minimumWan3Seed} through ${WAN3_MAX_SEED}.`, {
5428
5514
  code: 'INVALID_ARGUMENT',
5429
5515
  details: { seed: options.seed }
5430
5516
  });
@@ -5464,15 +5550,15 @@ if (options.video) {
5464
5550
  code: 'INVALID_ARGUMENT'
5465
5551
  });
5466
5552
  }
5467
- if (options.refImageEnd && !options.refImage) {
5553
+ if (!isWan3EnhancedVideo && options.refImageEnd && !options.refImage) {
5468
5554
  fatalCliError('Wan 3 last-frame generation requires --ref as the first-frame image.', { code: 'INVALID_ARGUMENT' });
5469
5555
  }
5470
5556
  if (options.videoWorkflow === 't2v' && (hasFrameInputs || looseTotal > 0 || options.refImageEnd)) {
5471
5557
  fatalCliError('Wan 3 t2v does not accept reference media; choose i2v, r2v, a2v, or ia2v.', { code: 'INVALID_ARGUMENT' });
5472
5558
  }
5473
5559
  if (options.videoWorkflow === 'i2v') {
5474
- if (!options.refImage) {
5475
- fatalCliError('Wan 3 i2v requires --ref as its first-frame image.', { code: 'INVALID_ARGUMENT' });
5560
+ if (!options.refImage && !(isWan3EnhancedVideo && options.refImageEnd)) {
5561
+ fatalCliError('Wan 3 i2v requires --ref as its first-frame image, or Enhanced may use --ref-end alone.', { code: 'INVALID_ARGUMENT' });
5476
5562
  }
5477
5563
  if (options.contextImages.length > 0 || looseVideos > 0 || looseAudios > 0) {
5478
5564
  fatalCliError('Wan 3 first/last-frame anchors cannot be combined with loose image, video, or audio references.', { code: 'INVALID_ARGUMENT' });
@@ -11293,6 +11379,10 @@ function buildMiniMaxH3EstimateUnavailableError(cause) {
11293
11379
 
11294
11380
  async function ensureSufficientVideoBalance(client, log) {
11295
11381
  if (!options.video || options.estimateVideoCost) return;
11382
+ // Wan 3.0 Enhanced launch credits live in the server-side model ledger and
11383
+ // cannot be inferred from wallet balance. Let the socket apply credit first,
11384
+ // then enforce PAYG balance for any remainder.
11385
+ if (isWan3EnhancedModelLocal(options.model)) return;
11296
11386
  // Sogni Unlimited bills covered video jobs to the subscription, so a low
11297
11387
  // token balance must not block them client-side. Vendor models
11298
11388
  // (Seedance/HappyHorse) always bill Premium Spark and keep the check, as
@@ -12223,6 +12313,7 @@ async function main() {
12223
12313
  const isSeedanceVideo = isSeedanceModel(options.model);
12224
12314
  const isHappyHorseVideo = isHappyHorseModel(options.model);
12225
12315
  const isWan3Video = isWan3ModelLocal(options.model);
12316
+ const isWan3EnhancedVideo = isWan3EnhancedModelLocal(options.model);
12226
12317
  const isMiniMaxH3R2v = isMiniMaxH3R2vModel(options.model);
12227
12318
  // Vendor video models forward image references as HTTPS URL arrays (or
12228
12319
  // Sogni-hosted uploads) instead of inline buffers; HappyHorse takes
@@ -12668,10 +12759,12 @@ async function main() {
12668
12759
  projectConfig.ratio = options.wan3Ratio;
12669
12760
  projectConfig.generateAudio = options.apiGenerateAudio ?? true;
12670
12761
  projectConfig.promptExtend = options.apiExpandPrompt ?? true;
12671
- projectConfig.watermark = options.wan3Watermark;
12672
12762
  if (options.wan3SmartDuration) projectConfig.smartDuration = true;
12673
- if (options.wan3ReferenceFileUrl) projectConfig.referenceFileUrl = options.wan3ReferenceFileUrl;
12674
- if (options.wan3ReferenceLinkUrl) projectConfig.referenceLinkUrl = options.wan3ReferenceLinkUrl;
12763
+ if (!isWan3EnhancedVideo) {
12764
+ projectConfig.watermark = options.wan3Watermark;
12765
+ if (options.wan3ReferenceFileUrl) projectConfig.referenceFileUrl = options.wan3ReferenceFileUrl;
12766
+ if (options.wan3ReferenceLinkUrl) projectConfig.referenceLinkUrl = options.wan3ReferenceLinkUrl;
12767
+ }
12675
12768
  }
12676
12769
 
12677
12770
  if (options.outputFormat) {
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.36.0';
1
+ export const PACKAGE_VERSION = '3.38.0';