@sogni-ai/sogni-creative-agent-skill 3.66.0 → 3.67.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 (30) hide show
  1. package/.agents/skills/sogni-creative-agent-skill/SKILL.md +7 -3
  2. package/.agents/skills/sogni-creative-agent-skill/references/h3-video-loras.md +1 -0
  3. package/.agents/skills/sogni-creative-agent-skill/references/hosted-api.md +9 -5
  4. package/.agents/skills/sogni-creative-agent-skill/references/image-prompting.md +3 -1
  5. package/.agents/skills/sogni-creative-agent-skill/references/models.md +41 -10
  6. package/.agents/skills/sogni-creative-agent-skill/references/object-selection.md +64 -0
  7. package/.agents/skills/sogni-creative-agent-skill/references/private-mature-video.md +55 -0
  8. package/.agents/skills/sogni-creative-agent-skill/references/video-prompting.md +10 -9
  9. package/.claude-plugin/plugin.json +1 -1
  10. package/.codex-plugin/plugin.json +1 -1
  11. package/CHANGELOG.md +12 -0
  12. package/README.md +3 -1
  13. package/SKILL.md +11 -11
  14. package/desktop-extension/manifest.json +1 -1
  15. package/generated/creative-agent-runtime.mjs +7 -6
  16. package/llm.txt +1 -1
  17. package/openclaw.plugin.json +1 -1
  18. package/package.json +3 -3
  19. package/plugin-skills/sogni-creative-agent/SKILL.md +2 -1
  20. package/references/h3-video-loras.md +1 -0
  21. package/references/hosted-api.md +9 -5
  22. package/references/image-prompting.md +3 -1
  23. package/references/models.md +41 -10
  24. package/references/object-selection.md +64 -0
  25. package/references/private-mature-video.md +55 -0
  26. package/references/video-prompting.md +10 -9
  27. package/skill-package.json +2 -2
  28. package/skills/video_editing.md +3 -3
  29. package/sogni-agent.mjs +270 -24
  30. package/version.mjs +1 -1
package/sogni-agent.mjs CHANGED
@@ -1593,14 +1593,22 @@ function resolveRtxVsrDimensions(sourceWidth, sourceHeight, { scale = 2, targetL
1593
1593
  };
1594
1594
  }
1595
1595
 
1596
- // Promptless FlashVSR video upscaling (--upscale-video). The server probes the
1596
+ // Promptless FlashVSR and RelayVSR video upscaling (--upscale-video). The server probes the
1597
1597
  // uploaded source and stays authoritative; these public geometry, frame-rate
1598
1598
  // and file-size limits let the CLI explain an unsupported clip before any
1599
1599
  // upload. There is deliberately no frame-count or duration limit here: the
1600
1600
  // server's admission check alone sets the maximum clip length and refuses a
1601
1601
  // source that is too long (see annotateVideoUpscaleError).
1602
1602
  const FLASHVSR_MODEL_ID = 'flashvsr_v1.1_tiny_long_bf16';
1603
+ const RELAYVSR_X2_MODEL_ID = 'relayvsr_x2_lightx2v_int8_convrot';
1604
+ const RELAYVSR_X4_MODEL_ID = 'relayvsr_x4_int8_convrot';
1605
+ const VIDEO_UPSCALE_MODELS = ['flashvsr', 'relayvsr'];
1603
1606
  const VIDEO_UPSCALE_RESOLUTIONS = [1080, 1440];
1607
+ const RELAYVSR_RESOLUTIONS = [1080, 1440, 2160];
1608
+ // Portrait mirrors these.
1609
+ const RELAYVSR_X2_SOURCE = { scale: 2, maxShortEdge: 1080, maxLongEdge: 1920 };
1610
+ const RELAYVSR_X4_SOURCE = { scale: 4, maxShortEdge: 768, maxLongEdge: 1344 };
1611
+ const RELAYVSR_MAX_OUTPUT_LONG_EDGE = 3840;
1604
1612
  const VIDEO_UPSCALE_DEFAULT_RESOLUTION = 1440;
1605
1613
  const VIDEO_UPSCALE_MAX_SOURCE_SHORT_EDGE = 768;
1606
1614
  // Source area counted in 64-pixel blocks: about 1344x768, or 768x1344 in portrait.
@@ -1611,13 +1619,26 @@ const VIDEO_UPSCALE_MAX_BYTES = 100 * 1024 * 1024;
1611
1619
  const VIDEO_UPSCALE_MAX_OUTPUT_LONG_EDGE = 2560;
1612
1620
  const VIDEO_UPSCALE_MAX_OUTPUT_PIXELS = 2560 * 1440;
1613
1621
  const FLASHVSR_UNAVAILABLE_MESSAGE = 'FlashVSR video upscaling is not available yet. Please try again later.';
1622
+ const RELAYVSR_UNAVAILABLE_MESSAGE = 'RelayVSR video upscaling is not available right now. Please try again later.';
1614
1623
 
1615
- function parseVideoUpscaleResolutionValue(raw, flag) {
1624
+ function parseVideoUpscaleResolutionValue(raw, flag, relayVsr = false) {
1616
1625
  const value = Number(String(raw ?? '').trim().toLowerCase().replace(/p$/, ''));
1617
- if (!VIDEO_UPSCALE_RESOLUTIONS.includes(value)) {
1618
- fatalCliError(`${flag} must be 1080 or 1440.`, {
1626
+ const allowed = relayVsr ? RELAYVSR_RESOLUTIONS : VIDEO_UPSCALE_RESOLUTIONS;
1627
+ if (!allowed.includes(value)) {
1628
+ fatalCliError(`${flag} must be ${relayVsr ? '1080, 1440, or 2160' : '1080 or 1440'}.`, {
1619
1629
  code: 'INVALID_ARGUMENT',
1620
- details: { flag, value: raw, allowed: VIDEO_UPSCALE_RESOLUTIONS }
1630
+ details: { flag, value: raw, allowed }
1631
+ });
1632
+ }
1633
+ return value;
1634
+ }
1635
+
1636
+ function parseVideoUpscaleModelValue(raw, flag) {
1637
+ const value = String(raw ?? '').trim().toLowerCase();
1638
+ if (!VIDEO_UPSCALE_MODELS.includes(value)) {
1639
+ fatalCliError(`${flag} must be flashvsr or relayvsr.`, {
1640
+ code: 'INVALID_ARGUMENT',
1641
+ details: { flag, value: raw, allowed: VIDEO_UPSCALE_MODELS }
1621
1642
  });
1622
1643
  }
1623
1644
  return value;
@@ -1673,6 +1694,59 @@ function resolveVideoUpscaleOutput(sourceWidth, sourceHeight, requestedResolutio
1673
1694
  });
1674
1695
  }
1675
1696
 
1697
+ function relayVsrOutputFor(sourceWidth, sourceHeight, resolution) {
1698
+ const shortEdge = Math.min(sourceWidth, sourceHeight);
1699
+ const longEdge = Math.max(sourceWidth, sourceHeight);
1700
+ const ratio = resolution / shortEdge;
1701
+ if (ratio <= 1) {
1702
+ return { problem: `This ${sourceWidth}×${sourceHeight} video is already ${resolution}p or larger.` };
1703
+ }
1704
+ if (ratio > RELAYVSR_X4_SOURCE.scale) {
1705
+ return {
1706
+ problem: `${resolution}p needs a source at least ${Math.ceil(resolution / RELAYVSR_X4_SOURCE.scale)}px on its short edge; this video is ${sourceWidth}×${sourceHeight}.`
1707
+ };
1708
+ }
1709
+ const useX2 = ratio <= RELAYVSR_X2_SOURCE.scale;
1710
+ if (!useX2 && (shortEdge > RELAYVSR_X4_SOURCE.maxShortEdge || longEdge > RELAYVSR_X4_SOURCE.maxLongEdge)) {
1711
+ return {
1712
+ problem: `${resolution}p is more than twice the size of this ${sourceWidth}×${sourceHeight} video; RelayVSR goes past twice the size only for sources up to ${RELAYVSR_X4_SOURCE.maxLongEdge}×${RELAYVSR_X4_SOURCE.maxShortEdge} pixels, or ${RELAYVSR_X4_SOURCE.maxShortEdge}×${RELAYVSR_X4_SOURCE.maxLongEdge} in portrait.`
1713
+ };
1714
+ }
1715
+ const width = Math.round((sourceWidth * ratio) / 2) * 2;
1716
+ const height = Math.round((sourceHeight * ratio) / 2) * 2;
1717
+ if (Math.max(width, height) > RELAYVSR_MAX_OUTPUT_LONG_EDGE) {
1718
+ return {
1719
+ problem: `At ${resolution}p this ${sourceWidth}×${sourceHeight} video would be ${width}×${height}, past the ${RELAYVSR_MAX_OUTPUT_LONG_EDGE}px long-edge upscale output limit.`
1720
+ };
1721
+ }
1722
+ return { modelId: useX2 ? RELAYVSR_X2_MODEL_ID : RELAYVSR_X4_MODEL_ID, resolution, width, height };
1723
+ }
1724
+
1725
+ // X2 when the target is at most twice the source's short edge, otherwise X4.
1726
+ // Without an explicit resolution, 1440p is used when the source allows it and 1080p otherwise.
1727
+ function resolveRelayVsrOutput(sourceWidth, sourceHeight, requestedResolution = null) {
1728
+ if (
1729
+ Math.min(sourceWidth, sourceHeight) > RELAYVSR_X2_SOURCE.maxShortEdge
1730
+ || Math.max(sourceWidth, sourceHeight) > RELAYVSR_X2_SOURCE.maxLongEdge
1731
+ ) {
1732
+ fatalCliError(
1733
+ `This video is ${sourceWidth}×${sourceHeight}; RelayVSR accepts sources up to ${RELAYVSR_X2_SOURCE.maxLongEdge}×${RELAYVSR_X2_SOURCE.maxShortEdge} pixels, or ${RELAYVSR_X2_SOURCE.maxShortEdge}×${RELAYVSR_X2_SOURCE.maxLongEdge} in portrait.`,
1734
+ { code: 'INVALID_UPSCALE_SOURCE', details: { sourceWidth, sourceHeight } }
1735
+ );
1736
+ }
1737
+ const candidates = requestedResolution ? [requestedResolution] : [VIDEO_UPSCALE_DEFAULT_RESOLUTION, 1080];
1738
+ let lastProblem = '';
1739
+ for (const resolution of candidates) {
1740
+ const output = relayVsrOutputFor(sourceWidth, sourceHeight, resolution);
1741
+ if (!output.problem) return output;
1742
+ lastProblem = output.problem;
1743
+ }
1744
+ fatalCliError(lastProblem, {
1745
+ code: 'INVALID_UPSCALE_SIZE',
1746
+ details: { sourceWidth, sourceHeight, requestedResolution }
1747
+ });
1748
+ }
1749
+
1676
1750
  // Read the exact source geometry, frame count, and frame rate with ffprobe so
1677
1751
  // the request matches what the server verifies after upload.
1678
1752
  async function probeVideoUpscaleSource(buffer, sourceLabel) {
@@ -1754,6 +1828,104 @@ async function probeVideoUpscaleSource(buffer, sourceLabel) {
1754
1828
  return { width, height, frames, fps, sizeBytes: buffer.length };
1755
1829
  }
1756
1830
 
1831
+ // RelayVSR only (--upscale-model relayvsr): read the source geometry, frame
1832
+ // count, and frame rate with ffprobe so the request matches what the server
1833
+ // verifies after upload. The server conforms a RelayVSR clip that is off its
1834
+ // average cadence, rotated, or not square-pixel, so its timing is the server's
1835
+ // to settle: `conform` marks those, and the size is the upright picture the
1836
+ // server judges. FlashVSR and --segment-video keep probeVideoUpscaleSource.
1837
+ async function probeConformedVideoUpscaleSource(buffer, sourceLabel) {
1838
+ if (buffer.length > VIDEO_UPSCALE_MAX_BYTES) {
1839
+ fatalCliError('Video upscaling accepts source files up to 100 MB.', {
1840
+ code: 'INVALID_UPSCALE_SOURCE',
1841
+ details: { sizeBytes: buffer.length, maxBytes: VIDEO_UPSCALE_MAX_BYTES }
1842
+ });
1843
+ }
1844
+ const ffprobePath = sanitizePath(getEnv('FFPROBE_PATH') || 'ffprobe', 'FFPROBE_PATH');
1845
+ const tempDir = createTrackedTempDir('sogni-video-upscale-probe-');
1846
+ const inputPath = mediaTempInputPath(tempDir, sourceLabel, '.mp4');
1847
+ let result;
1848
+ try {
1849
+ writeFileSync(inputPath, buffer);
1850
+ result = await runCommand(ffprobePath, [
1851
+ '-v', 'error',
1852
+ '-select_streams', 'v:0',
1853
+ '-count_frames',
1854
+ '-show_frames',
1855
+ '-show_entries',
1856
+ 'stream=width,height,nb_read_frames,avg_frame_rate,r_frame_rate,sample_aspect_ratio,color_transfer:stream_side_data=rotation:frame=best_effort_timestamp_time',
1857
+ '-of', 'json',
1858
+ inputPath,
1859
+ ], { captureOutput: true });
1860
+ } finally {
1861
+ try { if (existsSync(inputPath)) unlinkSync(inputPath); } catch {}
1862
+ try { rmdirSync(tempDir); } catch {}
1863
+ }
1864
+ // A signal means ffprobe started and then crashed on this file; that is
1865
+ // reported with the unreadable-source error below, not as a missing ffprobe.
1866
+ if (result?.error && result.status === null && !result.error.signal) {
1867
+ const err = new Error(`ffprobe is required for --upscale-video, but "${ffprobePath}" could not be started (${result.error.code}).`);
1868
+ err.code = 'MISSING_FFPROBE';
1869
+ err.hint = 'Install ffmpeg/ffprobe (e.g. `brew install ffmpeg` / `apt install ffmpeg`) or set FFPROBE_PATH to a working ffprobe binary. If ffprobe runs in your shell, set FFPROBE_PATH to the full path from `command -v ffprobe`.';
1870
+ err.details = { ffprobePath, reason: result.error.code };
1871
+ throw err;
1872
+ }
1873
+ let probe = null;
1874
+ try {
1875
+ probe = JSON.parse(result?.stdout || '{}');
1876
+ } catch {
1877
+ probe = null;
1878
+ }
1879
+ const stream = probe?.streams?.[0] ?? null;
1880
+ const codedWidth = Number(stream?.width);
1881
+ const codedHeight = Number(stream?.height);
1882
+ const frames = Number(stream?.nb_read_frames);
1883
+ const average = parseFrameRate(stream?.avg_frame_rate);
1884
+ if (result?.status !== 0 || ![codedWidth, codedHeight, frames].every((value) => Number.isSafeInteger(value) && value > 0) || !average) {
1885
+ // -count_frames decodes every frame, so a damaged file can print an error
1886
+ // per frame; keep the tail, where ffprobe names the file-level failure.
1887
+ // ffprobe names the temporary copy, so show the user's source instead.
1888
+ const ffprobeError = [
1889
+ String(result?.stderr || '').split(inputPath).join(sourceLabel).trim().slice(-500),
1890
+ result?.error?.signal ? `ffprobe was stopped by ${result.error.signal}.` : '',
1891
+ ].filter(Boolean).join('\n');
1892
+ fatalCliError('The source video dimensions, frame count, or frame rate could not be read. Use an MP4 or MOV file of 100 MB or less.', {
1893
+ code: 'INVALID_UPSCALE_SOURCE',
1894
+ details: { source: sourceLabel, ...(ffprobeError ? { ffprobeError } : {}) },
1895
+ ...(ffprobeError ? { hint: `ffprobe reported: ${ffprobeError.split('\n').at(-1).trim()}` } : {})
1896
+ });
1897
+ }
1898
+ const times = (probe?.frames ?? [])
1899
+ .map((frame) => Number(frame?.best_effort_timestamp_time))
1900
+ .sort((a, b) => a - b);
1901
+ const onCadence = times.every((time, index) => Math.abs(time - times[0] - index / average) <= 0.001);
1902
+ if (onCadence && (average < VIDEO_UPSCALE_MIN_FPS || average > VIDEO_UPSCALE_MAX_FPS)) {
1903
+ fatalCliError(`This video runs at ${Number(average.toFixed(3))} fps; video upscaling accepts ${VIDEO_UPSCALE_MIN_FPS}-${VIDEO_UPSCALE_MAX_FPS} fps.`, {
1904
+ code: 'INVALID_UPSCALE_SOURCE',
1905
+ details: { fps: average }
1906
+ });
1907
+ }
1908
+ if (['smpte2084', 'arib-std-b67'].includes(stream?.color_transfer ?? '')) {
1909
+ fatalCliError('Convert HDR video to SDR before upscaling.', { code: 'INVALID_UPSCALE_SOURCE' });
1910
+ }
1911
+ const aspect = stream?.sample_aspect_ratio;
1912
+ const square = ['1:1', 'N/A', '0:1', undefined].includes(aspect);
1913
+ const [aspectWidth, aspectHeight] = square ? [1, 1] : aspect.split(':').map(Number);
1914
+ const uprightWidth = square ? codedWidth : Math.round(codedWidth * aspectWidth / aspectHeight / 2) * 2;
1915
+ const rotation = Number(stream?.side_data_list?.find((item) => 'rotation' in item)?.rotation ?? 0);
1916
+ const turned = rotation % 180 !== 0;
1917
+ const conform = !onCadence || rotation % 360 !== 0 || !square;
1918
+ // The server owns the maximum clip length; submit the exact source count.
1919
+ return {
1920
+ width: turned ? codedHeight : uprightWidth,
1921
+ height: turned ? uprightWidth : codedHeight,
1922
+ frames,
1923
+ fps: Math.min(Math.max(average, VIDEO_UPSCALE_MIN_FPS), VIDEO_UPSCALE_MAX_FPS),
1924
+ sizeBytes: buffer.length,
1925
+ ...(conform ? { conform } : {}),
1926
+ };
1927
+ }
1928
+
1757
1929
  // The server's own refusal of a source longer than it accepts. Only the server
1758
1930
  // knows the current maximum, so the CLI relays its sentence rather than
1759
1931
  // restating a limit.
@@ -1765,6 +1937,10 @@ function annotateVideoUpscaleError(error) {
1765
1937
  if (!error.code || error.code === 'PROJECT_ERROR') error.code = 'MODEL_UNAVAILABLE';
1766
1938
  error.hint = 'FlashVSR upscaling workers are not online yet, so nothing was charged. Try again later.';
1767
1939
  }
1940
+ if (error && typeof error === 'object' && message.includes(RELAYVSR_UNAVAILABLE_MESSAGE)) {
1941
+ if (!error.code || error.code === 'PROJECT_ERROR') error.code = 'MODEL_UNAVAILABLE';
1942
+ error.hint = 'No RelayVSR worker is online right now, so nothing was charged. Try again later.';
1943
+ }
1768
1944
  const tooLong = [error?.message, error?.originalError?.message]
1769
1945
  .map((text) => String(text || '').match(VIDEO_UPSCALE_TOO_LONG_PATTERN)?.[0].trim())
1770
1946
  .find(Boolean);
@@ -2884,6 +3060,7 @@ const MINIMAX_H3_MODEL_MODES = new Map([
2884
3060
  ['minimax-h3-fl2va-fp8_i2v_balanced', 'i2v'],
2885
3061
  ['minimax-h3-fl2va-fp8_flf2v_balanced', 'flf2v'],
2886
3062
  ['minimax-h3-ref2va-fp8_r2v_balanced', 'r2v'],
3063
+ ['minimax-h3-prism-int8_r2v', 'r2v'],
2887
3064
  ['minimax-h3-ref2va-fp8_r2v_2stage', 'r2v'],
2888
3065
  ['minimax-h3-ref2va-fp8_r2v_balanced_2stage', 'r2v'],
2889
3066
  ['minimax-h3-fastvideo-omni-int8_r2v_turbo', 'r2v'],
@@ -2969,6 +3146,13 @@ const MINIMAX_H3_TURBO_SAMPLER_SET = new Set(MINIMAX_H3_TURBO_SAMPLERS);
2969
3146
  const MINIMAX_H3_R2V_MODEL_ID = 'minimax-h3-ref2va-fp8_r2v';
2970
3147
  const MINIMAX_H3_R2V_TURBO_MODEL_ID = 'minimax-h3-ref2va-fp8_r2v_turbo';
2971
3148
  const MINIMAX_H3_R2V_BALANCED_MODEL_ID = 'minimax-h3-ref2va-fp8_r2v_balanced';
3149
+ // MiniMax H3 Prism: an optional reference-to-video model for mature themes on
3150
+ // Balanced R2V's graph, with its recipe fixed in the worker (8 Euler steps), so
3151
+ // the CLI sends no steps or sampler, as for Balanced. 768p class only (no
3152
+ // two-stage), Balanced's references, keyframes and LoRAs. It requires
3153
+ // --no-filter and is never a default, a fallback or what a family alias picks.
3154
+ const MINIMAX_H3_R2V_PRISM_MODEL_ID = 'minimax-h3-prism-int8_r2v';
3155
+ const MINIMAX_H3_R2V_PRISM_SELECTOR = 'minimax-h3-r2v-prism';
2972
3156
  // Ref2VA Two-Stage: the Standard (20-step) or Balanced (8-step) R2V request on
2973
3157
  // its own id, rendered on the FastH3 Two-Stage canvas (384, 544 or 768 px short
2974
3158
  // edge) and delivered at exactly twice it. Never Turbo; references, durations
@@ -3210,6 +3394,7 @@ function resolveSkillVideoModelAlias(
3210
3394
  if (normalized === 'minimax-h3-r2v-balanced') {
3211
3395
  return MINIMAX_H3_R2V_BALANCED_MODEL_ID;
3212
3396
  }
3397
+ if (normalized === MINIMAX_H3_R2V_PRISM_SELECTOR) return MINIMAX_H3_R2V_PRISM_MODEL_ID;
3213
3398
  if (normalized === 'minimax-h3-r2v-2stage') return MINIMAX_H3_R2V_TWO_STAGE_MODEL_ID;
3214
3399
  if (normalized === 'minimax-h3-r2v-balanced-2stage') return MINIMAX_H3_R2V_BALANCED_TWO_STAGE_MODEL_ID;
3215
3400
  if (normalized === 'minimax-h3-fasth3-r2v-turbo') return MINIMAX_H3_FASTH3_R2V_MODEL_ID;
@@ -3279,6 +3464,7 @@ function isMiniMaxH3R2vModel(modelId) {
3279
3464
  return normalized === MINIMAX_H3_R2V_MODEL_ID
3280
3465
  || normalized === MINIMAX_H3_R2V_TURBO_MODEL_ID
3281
3466
  || normalized === MINIMAX_H3_R2V_BALANCED_MODEL_ID
3467
+ || normalized === MINIMAX_H3_R2V_PRISM_MODEL_ID
3282
3468
  || normalized === MINIMAX_H3_R2V_TWO_STAGE_MODEL_ID
3283
3469
  || normalized === MINIMAX_H3_R2V_BALANCED_TWO_STAGE_MODEL_ID
3284
3470
  || isMiniMaxH3FastH3R2vModel(normalized);
@@ -3296,6 +3482,12 @@ function miniMaxH3R2vTwoStageSelector(modelId) {
3296
3482
  : 'minimax-h3-r2v-2stage';
3297
3483
  }
3298
3484
 
3485
+ // MiniMax H3 Prism by its selector or worker id: the model that needs --no-filter.
3486
+ function isMiniMaxH3PrismSelectionLocal(modelId) {
3487
+ const normalized = String(modelId || '').trim().toLowerCase();
3488
+ return normalized === MINIMAX_H3_R2V_PRISM_SELECTOR || normalized === MINIMAX_H3_R2V_PRISM_MODEL_ID;
3489
+ }
3490
+
3299
3491
  function isMiniMaxH3R2vTurboSelectionLocal(modelId, workflow = null) {
3300
3492
  const normalized = String(modelId || '').trim().toLowerCase();
3301
3493
  return normalized === 'minimax-h3-r2v-turbo'
@@ -3355,6 +3547,7 @@ function isMiniMaxH3ModelSelectionLocal(modelId) {
3355
3547
  || normalized === 'minimax-h3-i2v-balanced'
3356
3548
  || normalized === 'minimax-h3-flf2v-balanced'
3357
3549
  || normalized === 'minimax-h3-r2v-balanced'
3550
+ || normalized === MINIMAX_H3_R2V_PRISM_SELECTOR
3358
3551
  || normalized === 'minimax-h3-r2v-2stage'
3359
3552
  || normalized === 'minimax-h3-r2v-balanced-2stage'
3360
3553
  || normalized === 'minimax-h3-fasth3-r2v-turbo'
@@ -3401,6 +3594,7 @@ function miniMaxH3ModeFromModelId(modelId) {
3401
3594
  if (normalized === 'minimax-h3-i2v-balanced') return 'i2v';
3402
3595
  if (normalized === 'minimax-h3-flf2v-balanced') return 'flf2v';
3403
3596
  if (normalized === 'minimax-h3-r2v-balanced') return 'r2v';
3597
+ if (normalized === MINIMAX_H3_R2V_PRISM_SELECTOR) return 'r2v';
3404
3598
  if (normalized === 'minimax-h3-r2v-2stage') return 'r2v';
3405
3599
  if (normalized === 'minimax-h3-r2v-balanced-2stage') return 'r2v';
3406
3600
  if (normalized === 'minimax-h3-fasth3-r2v-turbo') return 'r2v';
@@ -3930,8 +4124,9 @@ const options = {
3930
4124
  segmentText: null,
3931
4125
  upscaleScale: 2,
3932
4126
  upscaleTargetLongestEdge: null,
3933
- upscaleVideo: null, // Source video for promptless FlashVSR upscaling
3934
- upscaleResolution: null, // FlashVSR output short edge (1080 | 1440)
4127
+ upscaleVideo: null, // Source video for promptless FlashVSR or RelayVSR upscaling
4128
+ upscaleModel: null, // Video upscaler selector; omitted means FlashVSR
4129
+ upscaleResolution: null, // Upscale output short edge (1080 | 1440, or 2160 on RelayVSR)
3935
4130
  looping: false, // Create looping video (i2v only): generate A→B then B→A and concatenate
3936
4131
  photobooth: false, // Photobooth mode (InstantID face transfer)
3937
4132
  cnStrength: null, // ControlNet strength override
@@ -4130,6 +4325,7 @@ const cliSet = {
4130
4325
  upscaleScale: false,
4131
4326
  upscaleTargetLongestEdge: false,
4132
4327
  upscaleVideo: false,
4328
+ upscaleModel: false,
4133
4329
  upscaleResolution: false,
4134
4330
  looping: false,
4135
4331
  photobooth: false,
@@ -4634,8 +4830,18 @@ for (let i = 0; i < args.length; i++) {
4634
4830
  } else if (arg === '--upscale-resolution') {
4635
4831
  const raw = requireFlagValue(args, i, arg);
4636
4832
  i++;
4637
- options.upscaleResolution = parseVideoUpscaleResolutionValue(raw, arg);
4833
+ const upscaleModelFlag = args.lastIndexOf('--upscale-model');
4834
+ options.upscaleResolution = parseVideoUpscaleResolutionValue(
4835
+ raw,
4836
+ arg,
4837
+ upscaleModelFlag !== -1 && String(args[upscaleModelFlag + 1]).trim().toLowerCase() === 'relayvsr'
4838
+ );
4638
4839
  cliSet.upscaleResolution = true;
4840
+ } else if (arg === '--upscale-model') {
4841
+ const raw = requireFlagValue(args, i, arg);
4842
+ i++;
4843
+ options.upscaleModel = parseVideoUpscaleModelValue(raw, arg);
4844
+ cliSet.upscaleModel = true;
4639
4845
  } else if (arg === '--photobooth') {
4640
4846
  options.photobooth = true;
4641
4847
  cliSet.photobooth = true;
@@ -5338,7 +5544,8 @@ Image Options:
5338
5544
  --segment-frame <index> Zero-based frame the selection refers to (default: 0)
5339
5545
  --segment-object <index> Candidate in confidence order (default: 0)
5340
5546
  --upscale-video <path|url> Promptless FlashVSR upscale of one video to 1080p/1440p (keeps frames, fps, audio)
5341
- --upscale-resolution <p> Output short edge for --upscale-video: 1080 or 1440 (default: 1440; 1080 below 720p)
5547
+ --upscale-model <m> Upscaler for --upscale-video: flashvsr (default) or relayvsr (reaches 2160p)
5548
+ --upscale-resolution <p> Output short edge for --upscale-video: 1080 or 1440, or 2160 with relayvsr (default: 1440; 1080 below 720p)
5342
5549
 
5343
5550
  Photobooth (Face Transfer):
5344
5551
  --photobooth Face transfer mode (InstantID + SDXL Turbo)
@@ -5715,6 +5922,8 @@ state negatives in the structured prompt.):
5715
5922
  minimax-h3-i2v-balanced Balanced I2VA (--ref) or L2VA (--ref-end)
5716
5923
  minimax-h3-flf2v-balanced Balanced first-frame -> last-frame (--ref plus --ref-end)
5717
5924
  minimax-h3-r2v-balanced Balanced Ref2VA with loose image/video/audio references
5925
+ minimax-h3-r2v-prism Optional Ref2VA model for mature themes on Balanced's graph: 768p class,
5926
+ Balanced's references, keyframes and LoRAs; requires --no-filter
5718
5927
  minimax-h3-r2v-2stage Ref2VA Two-Stage: the minimax-h3-r2v request (20 steps), delivered at twice the
5719
5928
  canvas, 2K by default (1344x768 -> 2688x1536); --target-resolution 1080 or 720
5720
5929
  minimax-h3-r2v-balanced-2stage Balanced Ref2VA Two-Stage: the minimax-h3-r2v-balanced request (8 steps),
@@ -6221,6 +6430,12 @@ if (options.video) {
6221
6430
  { code: 'INVALID_ARGUMENT' }
6222
6431
  );
6223
6432
  }
6433
+ if (isMiniMaxH3PrismSelectionLocal(options.model) && !options.noFilter) {
6434
+ fatalCliError(
6435
+ 'MiniMax H3 Prism is an opt-in mature-theme model and requires --no-filter.',
6436
+ { code: 'INVALID_ARGUMENT' }
6437
+ );
6438
+ }
6224
6439
  }
6225
6440
 
6226
6441
  if (options.loraStrengths.length > 0 && options.loras.length === 0) {
@@ -6707,6 +6922,15 @@ if (options.music) {
6707
6922
  options.model = LTX23_WORKFLOW_MODELS[options.videoWorkflow];
6708
6923
  }
6709
6924
  options.model = resolveVideoModelAlias(options.model, options.videoWorkflow);
6925
+ // A configured default (OpenClaw videoModels) reaches here without the -m
6926
+ // check above, so Prism's --no-filter requirement is checked again.
6927
+ if (isMiniMaxH3PrismSelectionLocal(options.model) && !options.noFilter) {
6928
+ fatalCliError('MiniMax H3 Prism requires explicit --no-filter acknowledgement.', {
6929
+ code: 'INVALID_ARGUMENT',
6930
+ details: { model: options.model, requiredFlag: '--no-filter' },
6931
+ hint: 'Retry with --video -m minimax-h3-r2v-prism --ref <image> --no-filter'
6932
+ });
6933
+ }
6710
6934
  try {
6711
6935
  await loadLiveModelDefaults(options.model);
6712
6936
  } catch (error) {
@@ -6844,13 +7068,24 @@ if (options.music) {
6844
7068
  options.timeout = 1800000; // 30 min for queued and long-running video jobs
6845
7069
  }
6846
7070
  } else if (options.upscaleVideo) {
6847
- if (options.model && options.model !== FLASHVSR_MODEL_ID) {
6848
- fatalCliError(`--upscale-video requires model ${FLASHVSR_MODEL_ID}.`, {
6849
- code: 'INVALID_ARGUMENT',
6850
- details: { model: options.model, requiredModel: FLASHVSR_MODEL_ID }
6851
- });
7071
+ if (options.upscaleModel === 'relayvsr') {
7072
+ if (options.model) {
7073
+ fatalCliError('--upscale-model relayvsr picks its own model from the source; omit -m/--model.', {
7074
+ code: 'INVALID_ARGUMENT',
7075
+ details: { model: options.model }
7076
+ });
7077
+ }
7078
+ // Replaced by the X2 or X4 id once the source has been probed.
7079
+ options.model = RELAYVSR_X2_MODEL_ID;
7080
+ } else {
7081
+ if (options.model && options.model !== FLASHVSR_MODEL_ID) {
7082
+ fatalCliError(`--upscale-video requires model ${FLASHVSR_MODEL_ID}.`, {
7083
+ code: 'INVALID_ARGUMENT',
7084
+ details: { model: options.model, requiredModel: FLASHVSR_MODEL_ID }
7085
+ });
7086
+ }
7087
+ options.model = FLASHVSR_MODEL_ID;
6852
7088
  }
6853
- options.model = FLASHVSR_MODEL_ID;
6854
7089
  if (!cliSet.timeout && !timeoutFromConfig && options.timeout === 30000) {
6855
7090
  options.timeout = 1800000; // 30 min for queued video work
6856
7091
  }
@@ -7223,6 +7458,12 @@ if (!options.upscaleVideo && cliSet.upscaleResolution) {
7223
7458
  });
7224
7459
  }
7225
7460
 
7461
+ if (!options.upscaleVideo && cliSet.upscaleModel) {
7462
+ fatalCliError('--upscale-model requires --upscale-video <path|url>.', {
7463
+ code: 'INVALID_ARGUMENT'
7464
+ });
7465
+ }
7466
+
7226
7467
  if (options.legacyWan3TaskType !== null) {
7227
7468
  fatalCliError(
7228
7469
  '--wan3-task-type has been removed because Wan 3 has no provider edit/extend task mode. Use --workflow r2v with --ref-video for loose conditioning, or select a video-to-video model for editing.',
@@ -16149,10 +16390,16 @@ async function main() {
16149
16390
  const result = trackProjectResult(await client.createVideoProject(withBillingMode(config)));
16150
16391
  if (result?.error || result?.message) throw buildProjectResultError(result);
16151
16392
  } else if (options.upscaleVideo) {
16152
- log(`Upscaling video with ${FLASHVSR_MODEL_ID}...`);
16393
+ const relayVsr = options.upscaleModel === 'relayvsr';
16394
+ log(`Upscaling video with ${relayVsr ? 'RelayVSR' : FLASHVSR_MODEL_ID}...`);
16153
16395
  const sourceBuffer = await fetchMediaBuffer(options.upscaleVideo);
16154
- const source = await probeVideoUpscaleSource(sourceBuffer, options.upscaleVideo);
16155
- const target = resolveVideoUpscaleOutput(source.width, source.height, options.upscaleResolution);
16396
+ const source = relayVsr
16397
+ ? await probeConformedVideoUpscaleSource(sourceBuffer, options.upscaleVideo)
16398
+ : await probeVideoUpscaleSource(sourceBuffer, options.upscaleVideo);
16399
+ const target = relayVsr
16400
+ ? resolveRelayVsrOutput(source.width, source.height, options.upscaleResolution)
16401
+ : resolveVideoUpscaleOutput(source.width, source.height, options.upscaleResolution);
16402
+ if (relayVsr) options.model = target.modelId;
16156
16403
  options.width = target.width;
16157
16404
  options.height = target.height;
16158
16405
  options.frames = source.frames;
@@ -16164,17 +16411,16 @@ async function main() {
16164
16411
  `output ${target.width}x${target.height} (${target.resolution}p), every frame and the audio kept.`
16165
16412
  );
16166
16413
 
16167
- // The exact frame count and rate satisfy the SDK's FlashVSR validation;
16168
- // the server re-probes the upload and adopts its verified size, so the
16169
- // output width/height are not sent.
16414
+ // The server re-probes the upload and adopts its verified size, so the
16415
+ // output width/height are not sent; a conformed source's timing is left
16416
+ // to it too, since anything sent that differs refuses the project.
16170
16417
  const upscaleVideoConfig = {
16171
- modelId: FLASHVSR_MODEL_ID,
16418
+ modelId: options.model,
16172
16419
  positivePrompt: '',
16173
16420
  numberOfMedia: 1,
16174
16421
  referenceVideo: sourceBuffer,
16175
16422
  upscaleResolution: target.resolution,
16176
- frames: source.frames,
16177
- fps: source.fps,
16423
+ ...(source.conform ? {} : { frames: source.frames, fps: source.fps }),
16178
16424
  tokenType: options.tokenType || 'spark',
16179
16425
  waitForCompletion: false,
16180
16426
  autoResizeVideoAssets: false
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.66.0';
1
+ export const PACKAGE_VERSION = '3.67.0';