@sogni-ai/sogni-creative-agent-skill 3.54.0 → 3.54.2

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.
@@ -3,7 +3,7 @@ name: sogni-creative-agent-skill
3
3
  description: "Generate and edit images, create Pixal3D 3D models, remove backgrounds with BiRefNet, synthesize Qwen3-TTS speech, upscale images, create video and music, animate image folders into seamless reels, and manage reusable personas with Sogni AI. Use when a Hermes user asks to draw, render, upscale, edit or restyle an image, animate an image, make a video, create music or lyrics, build a media workflow, apply a saved identity, or refine an earlier Sogni result."
4
4
  license: MIT
5
5
  metadata:
6
- version: "3.54.0"
6
+ version: "3.54.2"
7
7
  author: Sogni AI
8
8
  hermes:
9
9
  category: creative
@@ -702,6 +702,14 @@ so a prompt is not rewritten twice.
702
702
  - **No edit/extend task:** video references are loose conditioning for a new
703
703
  generation. Alibaba exposes no edit/extend task mode or task-type field; use
704
704
  a dedicated video-to-video model when source-preserving editing is required.
705
+ - **Size:** `--target-resolution 480`, `720` (the default), or `1080` picks the
706
+ tier, and the CLI sends Alibaba's exact size for that tier and
707
+ `--wan3-ratio` (16:9 when adaptive): at 1080 that is 1920x1080, 1440x1080,
708
+ 1080x1080, 1080x1440, or 1080x1920. Image-to-video keeps the first frame's
709
+ shape with its short side at the tier (an 832x1216 frame at 1080 becomes
710
+ 1080x1578); a fixed `--wan3-ratio` does not crop the frame. Explicit
711
+ `-w`/`-h` are sent as given, 480-1920 per side. The network prices the tier
712
+ from the canvas, so 1080P costs twice the 720P rate per second.
705
713
  - **Cost (as of 2026-08):** platform artist pricing is $0.065/s at 480P,
706
714
  $0.13/s at 720P, and $0.26/s at 1080P; native audio does not change the rate.
707
715
 
@@ -717,7 +725,8 @@ the Sogni model `wan3.0-spicy-video`; MuleRouter's provider ID is
717
725
  `w3.0-video`. Public surfaces call it **Wan 3.0 Enhanced**. It renders fixed or
718
726
  smart 2–30 second clips at 30 fps with native audio and 480P, 720P, or 1080P
719
727
  output. Supported ratios are `adaptive`, `16:9`, `9:16`, `1:1`, `4:3`, and
720
- `3:4`.
728
+ `3:4`. Sizes follow the Wan 3 rules above: 720P unless `--target-resolution`
729
+ says otherwise.
721
730
 
722
731
  - Use t2v for prompt-only video, i2v for first/optional last frame, r2v for
723
732
  loose media references, and a2v/ia2v when audio drives the result.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.54.0",
3
+ "version": "3.54.2",
4
4
  "description": "Sogni Creative Agent: image, 3D, speech, video, and music generation via Sogni AI's decentralized GPU network. Supports personas, persistent memories, style transfer, and multi-step creative workflows.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.54.0",
3
+ "version": "3.54.2",
4
4
  "description": "Create images, 3D models, speech, generative video, music, and image-folder loops with Sogni AI.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [3.54.2] - 2026-09-27
2
+
3
+ ### Bug Fixes
4
+
5
+ * Wan 3 and Wan 3.0 Enhanced can render 1080p from the CLI. Every Wan 3 size was cut to a 1536 px long side, so `--target-resolution 1080` (1920x1080) went out as 1536x864, which Sogni prices and renders as 720p. `-w 1080 -h 1920` did the same. Billing matched the 720p that was delivered, but there was no way to get 1080p. The CLI now sends Alibaba's exact size for the tier and ratio. At 1080 that is 1920x1080, 1440x1080, 1080x1080, 1080x1440 or 1080x1920; the ratio comes from `--wan3-ratio`, a ratio named in the prompt, or 16:9. Image-to-video keeps the first frame's shape with its short side at the tier (an 832x1216 frame at 1080 renders at 1080x1578), including a first frame given as a URL. A fixed `--wan3-ratio` that does not match the frame prints a notice instead of cropping it. Explicit `-w`/`-h` are sent as given, up to 1920 per side.
6
+ * The Wan 3 default stays 720p, the size and price CLI renders already had. 1080p is `--target-resolution 1080` and costs twice as much per second (52 instead of 26 Spark per second on Wan 3, 64 instead of 32 on Enhanced, before subscription discounts). `--estimate-video-cost` quotes the size that will be sent.
7
+ * Update the intelligence client to 4.6.2, which lets Wan 3 keep sizes up to 1920 instead of clamping them to 1536.
8
+
9
+ ## [3.54.1] - 2026-09-27
10
+
11
+ ### Bug Fixes
12
+
13
+ * `--upscale` now renders RTX VSR output above 2048 px, up to the 15,360 px long edge the help promises. Every image size above 2048 px was refused with "Width must be between 256 and 2048" before it reached Sogni, so GPT Image up to 3840 px and Krea 2 and Qwen up to 2560 px work again too.
14
+ * A result the Sensitive Content Filter withheld is reported as withheld instead of as "Result download failed: HTTP 404". When nothing was delivered the CLI stops with a `SAFETY_REJECTED` error that suggests rewording the prompt or `--no-filter`; a partly withheld batch saves the rest, marks each withheld result with `urlUnavailable: "sensitiveContent"` in `--json` (as `--result` does) and prints how many were withheld. Multi-angle edits, 360 segments and the looping return clip report it the same way.
15
+ * Update the intelligence client to 4.6.1 and the bundled runtime to creative agent 2.7.1, which carry the image size fix.
16
+
1
17
  ## [3.54.0] - 2026-09-27
2
18
 
3
19
  ### Features
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://raw.githubusercontent.com/Sogni-AI/sogni-creative-agent-skill/main/docs/screenshot.jpg" alt="Sogni Creative Agent Skill rendering an image from a Telegram-style chat" width="320" />
2
+ <img src="https://raw.githubusercontent.com/Sogni-AI/sogni-creative-agent-skill/main/docs/banner.jpg" alt="Sogni Creative Agent: image, video, and music generation for AI agents. A small robot on a rooftop at dusk paints the sky with a brushstroke of paintings, film, and music above a town of glowing windows." width="100%" />
3
3
  </p>
4
4
 
5
5
  <h1 align="center">Sogni Creative Agent Skill</h1>
@@ -35,6 +35,10 @@ With this skill, an agent can:
35
35
  - save personas, preferences, and last-render state across sessions
36
36
  - check balances, list models, and refine previous results
37
37
 
38
+ <p align="center">
39
+ <img src="https://raw.githubusercontent.com/Sogni-AI/sogni-creative-agent-skill/main/docs/screenshot.jpg" alt="Sogni Creative Agent Skill rendering an image from a Telegram-style chat" width="320" />
40
+ </p>
41
+
38
42
  > **Fastest install:** paste this repo's GitHub URL into your agent and ask it to "install this skill".
39
43
 
40
44
  ---
@@ -468,7 +472,7 @@ sogni-agent --video -m seedance2 --workflow t2v \
468
472
  --ref-audio https://cdn.example.com/music.m4a \
469
473
  "Use @Image1 for product identity, @Video1 for camera movement, and @Audio1 for music rhythm"
470
474
 
471
- # Alibaba Wan 3 unified video (2-30s, fixed 30fps, native audio, 480P/720P/1080P)
475
+ # Alibaba Wan 3 unified video (2-30s, fixed 30fps, native audio, 480P/720P/1080P; 720P by default)
472
476
  sogni-agent --video -m wan3 --target-resolution 1080 --duration 8 \
473
477
  'A presenter walks through a detailed studio and says "Welcome."'
474
478
  sogni-agent --video -m wan3 --ref first.png --ref-end last.png \
@@ -775,7 +779,7 @@ sogni-agent --video -m seedance2-5-v2v --seedance-task-type extend --ref-video s
775
779
  ## Video Sizing & Aspect Ratios
776
780
 
777
781
  - **WAN 2.2 models** use dimensions divisible by 16, each side 480–1536 px, and at most 1,048,576 pixels per frame (1024×1024), so 1280×720, 720×1280, and 1024×1024 fit but 1536×864 and 1080p do not (as of 2026-09). The CLI refuses an explicit `-w`/`-h` or `--target-resolution` above that instead of sending it; sizes it chooses itself are fitted. (Since 2026-09-26 the network itself scales an oversized WAN 2.2 request down to about 1 MP and refuses only a side below 480, error 4101.)
778
- - **Wan 3** (`wan3.0-video`) is a Premium Spark Alibaba model with fixed 30 fps, fixed or smart 2–30 s output, native audio, 480P/720P/1080P tiers, and `adaptive`, `16:9`, `4:3`, `1:1`, `3:4`, or `9:16` output. It accepts one first frame plus an optional last frame, or loose references up to 10 images, 5 videos, and 5 audio clips. It can also use one public document (PDF/Office/text/Markdown/Keynote/Pages/Numbers, up to 100 MB; PDF/DOCX/DOC/PPTX/PPT/Keynote/Pages up to 50 pages) or one public webpage; file and link context are mutually exclusive and cannot be combined with first/last anchors. Each video/audio reference is 1–15 s and each modality's clips total at most 15 s. Video references condition a new generation; Alibaba exposes no edit/extend task mode or task-type field, so use a dedicated video-to-video model when source-preserving editing is required. Provider prompt expansion defaults on; `--no-expand-prompt` preserves the exact prompt. Watermark defaults off. Send no negative prompt, steps, guidance, sampler, scheduler, ControlNet, or mask. Sogni retail rates before subscription discounts are $0.065/$0.13/$0.26 per output second at 480p/720p/1080p (as of 2026-08).
782
+ - **Wan 3** (`wan3.0-video`) is a Premium Spark Alibaba model with fixed 30 fps, fixed or smart 2–30 s output, native audio, 480P/720P/1080P tiers, and `adaptive`, `16:9`, `4:3`, `1:1`, `3:4`, or `9:16` output. It accepts one first frame plus an optional last frame, or loose references up to 10 images, 5 videos, and 5 audio clips. It can also use one public document (PDF/Office/text/Markdown/Keynote/Pages/Numbers, up to 100 MB; PDF/DOCX/DOC/PPTX/PPT/Keynote/Pages up to 50 pages) or one public webpage; file and link context are mutually exclusive and cannot be combined with first/last anchors. Each video/audio reference is 1–15 s and each modality's clips total at most 15 s. Video references condition a new generation; Alibaba exposes no edit/extend task mode or task-type field, so use a dedicated video-to-video model when source-preserving editing is required. Provider prompt expansion defaults on; `--no-expand-prompt` preserves the exact prompt. Watermark defaults off. Send no negative prompt, steps, guidance, sampler, scheduler, ControlNet, or mask. Sogni retail rates before subscription discounts are $0.065/$0.13/$0.26 per output second at 480p/720p/1080p (as of 2026-08). The CLI renders 720P unless `--target-resolution 480` or `1080` is given, sending Alibaba's exact size for that tier and ratio; image-to-video keeps the first frame's shape with its short side at the tier.
779
783
  - **Wan 3.0 Enhanced** (`wan3.0-spicy-video`; MuleRouter provider ID `w3.0-video`; aliases `wan3-enhanced`, `wan3-spicy`) runs at fixed 30 fps with fixed or smart 2–30 s output, native audio, prompt expansion, 480P/720P/1080P, and `adaptive`, `16:9`, `9:16`, `1:1`, `4:3`, or `3:4`. It accepts either first/last-frame anchors or up to 10 image, 5 video, and 5 audio loose references; the two modes cannot be mixed. It has no document/web context, watermark, negative prompt, source-video edit, or extend mode. Standard PAYG is $0.08/$0.16/$0.32 per output second at 480P/720P/1080P (as of 2026-09). Existing paid subscribers receive a one-time $10 Unlimited / $20 Unlimited Pro model credit through September 1, 2026 00:00 UTC (August 31 at 5:00 PM PT); this is a launch credit, not subscription coverage.
780
784
  - **MiniMax H3 Standard, Balanced, LightX2V Turbo, and FastH3 Turbo** use a 32 px grid, fixed 24 fps, native 32 kHz stereo audio, 124–362 frames (`124 + n×17`, i.e. 5.17–15.08 s), and a 1,032,192-pixel render cap. Standard, Balanced, LightX2V FL2VA Turbo, and FastH3 normally default to 1344×768 or 768×1344; Ref2VA Turbo defaults to 960×544. Standard uses 20 steps; Balanced uses fixed 8-step Euler/simple acceleration, with LightX2V for FL2VA and Larry v4 for Ref2VA; both Turbo engines use 4 steps. FL2VA H3 Turbo defaults to `er_sde` on Socket and permits `euler`, `er_sde`, or `sa_solver`; Ref2VA Turbo and the separate FastVideo VSA FastH3 engine use Euler/simple only. The CLI omits the sampler unless `--sampler` is passed. FastH3 is about 2x faster than LightX2V Turbo and up to 6x faster than Standard for comparable 768p, 15-second requests; it supports T2V/I2V/FLF2V, never R2V. Guidance 1 is fixed and there is no negative-prompt input. Every Ref2VA tier accepts up to 9 images, 3 videos, and 3 audios, capped at 12 files; at least one visual reference is required. FastH3 keeps the FastVideo engine when an H3 LoRA is attached: base jobs require 23 GB and jobs with an H3 LoRA require 32 GB. The other FL2VA/Balanced/Turbo and image-only R2V paths require 32 GB-class workers, while video-conditioned R2V requires above 40 GB. See `references/video-prompting.md` § MiniMax H3 Prompting for the exact contracts.
781
785
  - **LTX family** (`ltx2-*`, `ltx23-*`, `ltx25-*`) uses dimensions divisible by 64. The current wrapper caps non-WAN video dimensions at 2048 px on the long side.
package/SKILL.md CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sogni-creative-agent-skill
3
3
  description: "CLI and agent skill for personal LoRAs, image, video, and music generation using Sogni AI's decentralized GPU network. Supports Pixal3D single- and multi-view image-to-GLB, BiRefNet background removal, Qwen3-TTS speech/voice cloning/design, MiniMax Music 3, SAM 3 object selection, promptless RTX VSR image upscaling through 16K, promptless FlashVSR video upscaling to 1080p/1440p, one-click image-folder loop reels, personas (named people with saved reference photos and voice clips), persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/H3 Balanced/LightX2V Turbo/FastH3 Turbo (including audio-to-video from an uploaded track)/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"upscale an image\", \"upscale a video\", \"make a video/animate\", \"turn this image folder into a loop\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
4
4
  metadata:
5
- version: "3.54.0"
5
+ version: "3.54.2"
6
6
  homepage: https://sogni.ai
7
7
  openclaw:
8
8
  emoji: "🎨"
@@ -243,7 +243,7 @@ sogni-agent --video -m happyhorse --ref first-frame.png "Bring the scene to life
243
243
  sogni-agent --video -m happyhorse-1.1-r2v -c ref1.png -c ref2.png "Blend the references into one continuous shot"
244
244
 
245
245
  # Alibaba Wan 3 unified video (2-30s, fixed 30fps, native audio,
246
- # 480P/720P/1080P). --ref/--ref-end are frame anchors; r2v/a2v/ia2v
246
+ # 480P/720P/1080P, 720P by default). --ref/--ref-end are frame anchors; r2v/a2v/ia2v
247
247
  # use loose Image 1 / Video 1 / Audio 1 references instead. A video reference
248
248
  # conditions a new generation; it is not an edit/extend task.
249
249
  sogni-agent --video -m wan3 --target-resolution 1080 --duration 8 'A presenter says "Welcome." in a detailed studio'
@@ -475,7 +475,7 @@ Eligible Sogni-hosted renders use Unlimited coverage when active; otherwise rend
475
475
  - **Auth errors:** check `SOGNI_API_KEY` or `~/.config/sogni/credentials` (key from https://dashboard.sogni.ai, account menu).
476
476
  - **Error 4061 / too many app IDs:** the CLI leases stable IDs from the persistent pool in `~/.config/sogni/app-ids/`. Do not delete that directory between runs. For ephemeral/container homes, set the same `SOGNI_APP_ID` on every session. An existing block may require waiting before retrying after upgrading.
477
477
  - **Kicked mid-render / SWITCH_CONNECTION 4015:** two processes shared one app ID. The slot pool prevents this for concurrent CLI runs; if a long-lived daemon also uses this account, give it its own pinned `SOGNI_APP_ID`.
478
- - **Video size errors:** sizes are model-specific (WAN 2.2 ÷16, sides 480–1536, at most 1,048,576 pixels, so no 1080p; Wan 3 uses its exact 480P/720P/1080P ratio buckets; LTX ÷64, long side ≤2048). The CLI auto-adjusts for local refs; `--strict-size` makes it fail with a suggested size instead. Details in [`references/models.md`](./references/models.md).
478
+ - **Video size errors:** sizes are model-specific (WAN 2.2 ÷16, sides 480–1536, at most 1,048,576 pixels, so no 1080p; Wan 3 uses its exact 480P/720P/1080P ratio buckets, 720P unless `--target-resolution 1080`; LTX ÷64, long side ≤2048). The CLI auto-adjusts for local refs; `--strict-size` makes it fail with a suggested size instead. Details in [`references/models.md`](./references/models.md).
479
479
  - **Timeouts / no workers:** a timeout never cancels; the project finishes on Sogni and `sogni-agent --result <id>` fetches it (`details.resultCommands`). For long videos use `--detach`, not a large `-t`. `--status <id>` says whether it waits on the plan limit or on workers; for network status see https://sogni.ai.
480
480
 
481
481
  ## Reference Index (read before acting)
@@ -2,7 +2,7 @@
2
2
  "manifest_version": "0.3",
3
3
  "name": "sogni-creative-agent",
4
4
  "display_name": "Sogni Creative Agent",
5
- "version": "3.54.0",
5
+ "version": "3.54.2",
6
6
  "description": "Generate images, video, and music on Sogni AI's decentralized GPU network — with personas, memories, and safe video editing tools.",
7
7
  "author": { "name": "Sogni AI", "url": "https://sogni.ai" },
8
8
  "homepage": "https://sogni.ai",
@@ -2,7 +2,7 @@
2
2
  "id": "sogni-creative-agent-skill",
3
3
  "name": "Sogni Creative Agent Skill — Image, Video & Music Generation",
4
4
  "description": "Agent skill and CLI for Sogni AI image, video, and music generation.",
5
- "version": "3.54.0",
5
+ "version": "3.54.2",
6
6
  "skills": [
7
7
  "."
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sogni-ai/sogni-creative-agent-skill",
3
- "version": "3.54.0",
3
+ "version": "3.54.2",
4
4
  "description": "Sogni Creative Agent Skill: agent skill and CLI for Sogni AI image, 3D, speech, video, and music generation.",
5
5
  "type": "module",
6
6
  "main": "sogni-agent.mjs",
@@ -100,7 +100,7 @@
100
100
  "media-utilities.mjs"
101
101
  ],
102
102
  "dependencies": {
103
- "@sogni-ai/sogni-intelligence-client": "4.6.0",
103
+ "@sogni-ai/sogni-intelligence-client": "4.6.2",
104
104
  "execa": "^10.0.1",
105
105
  "json5": "^2.2.3",
106
106
  "sharp": "0.35.4"
@@ -702,6 +702,14 @@ so a prompt is not rewritten twice.
702
702
  - **No edit/extend task:** video references are loose conditioning for a new
703
703
  generation. Alibaba exposes no edit/extend task mode or task-type field; use
704
704
  a dedicated video-to-video model when source-preserving editing is required.
705
+ - **Size:** `--target-resolution 480`, `720` (the default), or `1080` picks the
706
+ tier, and the CLI sends Alibaba's exact size for that tier and
707
+ `--wan3-ratio` (16:9 when adaptive): at 1080 that is 1920x1080, 1440x1080,
708
+ 1080x1080, 1080x1440, or 1080x1920. Image-to-video keeps the first frame's
709
+ shape with its short side at the tier (an 832x1216 frame at 1080 becomes
710
+ 1080x1578); a fixed `--wan3-ratio` does not crop the frame. Explicit
711
+ `-w`/`-h` are sent as given, 480-1920 per side. The network prices the tier
712
+ from the canvas, so 1080P costs twice the 720P rate per second.
705
713
  - **Cost (as of 2026-08):** platform artist pricing is $0.065/s at 480P,
706
714
  $0.13/s at 720P, and $0.26/s at 1080P; native audio does not change the rate.
707
715
 
@@ -717,7 +725,8 @@ the Sogni model `wan3.0-spicy-video`; MuleRouter's provider ID is
717
725
  `w3.0-video`. Public surfaces call it **Wan 3.0 Enhanced**. It renders fixed or
718
726
  smart 2–30 second clips at 30 fps with native audio and 480P, 720P, or 1080P
719
727
  output. Supported ratios are `adaptive`, `16:9`, `9:16`, `1:1`, `4:3`, and
720
- `3:4`.
728
+ `3:4`. Sizes follow the Wan 3 rules above: 720P unless `--target-resolution`
729
+ says otherwise.
721
730
 
722
731
  - Use t2v for prompt-only video, i2v for first/optional last frame, r2v for
723
732
  loose media references, and a2v/ia2v when audio drives the result.
@@ -3,7 +3,7 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@sogni-ai/sogni-intelligence-client": "4.6.0",
6
+ "@sogni-ai/sogni-intelligence-client": "4.6.2",
7
7
  "execa": "^10.0.1",
8
8
  "json5": "^2.2.3",
9
9
  "sharp": "0.35.4"
package/sogni-agent.mjs CHANGED
@@ -1902,6 +1902,60 @@ const WAN3_SUPPORTED_WORKFLOWS = new Set(['t2v', 'i2v', 'r2v', 'a2v', 'ia2v']);
1902
1902
  const WAN3_SUPPORTED_RESOLUTIONS = new Set([480, 720, 1080]);
1903
1903
  const WAN3_SUPPORTED_RATIOS = new Set(['adaptive', '16:9', '4:3', '1:1', '3:4', '9:16']);
1904
1904
  const WAN3_MAX_SEED = 0x7fffffff;
1905
+ // Wan 3 renders Alibaba's fixed sizes: the short side is the tier (480, 720 or
1906
+ // 1080) and the ratio sets the long side. The network prices and dispatches the
1907
+ // tier from the canvas, so the CLI sends these exact sizes. Same table as
1908
+ // sogni-api WAN3_DIMENSION_BUCKETS and sogni-web's Wan 3 presets.
1909
+ const WAN3_DIMENSION_BUCKETS = Object.freeze({
1910
+ '16:9': { 480: [854, 480], 720: [1280, 720], 1080: [1920, 1080] },
1911
+ '4:3': { 480: [640, 480], 720: [960, 720], 1080: [1440, 1080] },
1912
+ '1:1': { 480: [480, 480], 720: [720, 720], 1080: [1080, 1080] },
1913
+ '3:4': { 480: [480, 640], 720: [720, 960], 1080: [1080, 1440] },
1914
+ '9:16': { 480: [480, 854], 720: [720, 1280], 1080: [1080, 1920] },
1915
+ });
1916
+ // 720p is what CLI renders were priced and delivered at while the pinned client
1917
+ // clamped Wan 3 to 1536x864, so the default keeps that price. 1080p is
1918
+ // --target-resolution 1080 and costs twice as much per second.
1919
+ const WAN3_DEFAULT_RESOLUTION = 720;
1920
+ const WAN3_MAX_SIDE = 1920;
1921
+
1922
+ function wan3ResolutionTier(value) {
1923
+ const numeric = Number(value);
1924
+ if (numeric >= 1080) return 1080;
1925
+ if (numeric >= 720) return 720;
1926
+ return 480;
1927
+ }
1928
+
1929
+ function nearestWan3Ratio(width, height) {
1930
+ const aspect = Number(width) / Number(height);
1931
+ if (!(aspect > 0) || !Number.isFinite(aspect)) return '16:9';
1932
+ return Object.keys(WAN3_DIMENSION_BUCKETS)
1933
+ .map((ratio) => {
1934
+ const [ratioW, ratioH] = ratio.split(':').map(Number);
1935
+ return { ratio, distance: Math.abs(Math.log(aspect / (ratioW / ratioH))) };
1936
+ })
1937
+ .sort((left, right) => left.distance - right.distance)[0].ratio;
1938
+ }
1939
+
1940
+ function wan3BucketCanvas(ratio, tier) {
1941
+ const [width, height] = (WAN3_DIMENSION_BUCKETS[ratio] || WAN3_DIMENSION_BUCKETS['16:9'])[tier];
1942
+ return { width, height };
1943
+ }
1944
+
1945
+ // A first frame is fitted inside the canvas and the canvas then takes the fitted
1946
+ // frame's size, so a canvas in any other shape would shrink below the tier. Keep
1947
+ // the frame's shape with its short side at the tier, capping the long side.
1948
+ function wan3FrameCanvas(frameWidth, frameHeight, tier) {
1949
+ const landscape = frameWidth >= frameHeight;
1950
+ const aspect = Math.max(frameWidth, frameHeight) / Math.min(frameWidth, frameHeight);
1951
+ let shortSide = tier;
1952
+ let longSide = Math.round(tier * aspect);
1953
+ if (longSide > WAN3_MAX_SIDE) {
1954
+ longSide = WAN3_MAX_SIDE;
1955
+ shortSide = Math.round(WAN3_MAX_SIDE / aspect);
1956
+ }
1957
+ return landscape ? { width: longSide, height: shortSide } : { width: shortSide, height: longSide };
1958
+ }
1905
1959
 
1906
1960
  function isWan3ModelSelectionLocal(modelId) {
1907
1961
  const normalized = String(modelId || '').trim().toLowerCase().replace(/_/g, '-');
@@ -2079,11 +2133,13 @@ function videoModelDimensionDefaultsLikeWrapper(modelId) {
2079
2133
  return { defaultWidth: 1920, defaultHeight: 1080, maxDimension: 1920, dimensionMultiple: 1 };
2080
2134
  }
2081
2135
  if (isWan3ModelSelectionLocal(modelId)) {
2136
+ // Placeholder only: the Wan 3 preflight replaces it with the exact size for
2137
+ // the requested tier and ratio (WAN3_DIMENSION_BUCKETS).
2082
2138
  return {
2083
- defaultWidth: 1920,
2084
- defaultHeight: 1080,
2139
+ defaultWidth: 1280,
2140
+ defaultHeight: 720,
2085
2141
  minDimension: 480,
2086
- maxDimension: 1920,
2142
+ maxDimension: WAN3_MAX_SIDE,
2087
2143
  dimensionMultiple: 1,
2088
2144
  };
2089
2145
  }
@@ -4656,7 +4712,7 @@ Video Options:
4656
4712
  --fps <num> Frames per second (model default unless set)
4657
4713
  --duration <sec> Duration in seconds (default: 5); Seedance 2.5 edit requires @Video1's source duration
4658
4714
  --frames <num> Override total frames (optional)
4659
- --target-resolution <px> Short-side target that preserves aspect ratio (Seedance 2.5: 480, 720 or 1080).
4715
+ --target-resolution <px> Short-side target that preserves aspect ratio (Seedance 2.5: 480, 720 or 1080; Wan 3: 480, 720 (default) or 1080).
4660
4716
  MiniMax H3 FastH3 and Ref2VA Two-Stage: the delivered size, 720, 1080, or 2K (1440; default),
4661
4717
  rendered on a half-size canvas (672x384, 960x544, 1344x768)
4662
4718
  --auto-resize-assets Auto-resize video reference assets (default)
@@ -5980,7 +6036,13 @@ if (options.music) {
5980
6036
  options.height = canvas.height;
5981
6037
  }
5982
6038
  }
5983
- const videoShortSide = isTwoStageVideo
6039
+ // Wan 3 takes Alibaba's exact sizes (applyWan3Canvas), never the generic
6040
+ // short-side or prompt-aspect scaling below.
6041
+ const isWan3Canvas = isWan3ModelLocal(options.model);
6042
+ if (isWan3Canvas && !hasExplicitVideoCanvas) {
6043
+ applyWan3Canvas();
6044
+ }
6045
+ const videoShortSide = (isTwoStageVideo || isWan3Canvas)
5984
6046
  ? null
5985
6047
  : ((cliSet.targetResolution || targetResolutionFromPrompt)
5986
6048
  ? options.targetResolution
@@ -5990,7 +6052,7 @@ if (options.music) {
5990
6052
  options.width = dims.width;
5991
6053
  options.height = dims.height;
5992
6054
  }
5993
- if (aspectRatioFromPrompt && !cliSet.width && !cliSet.height && !isTwoStageVideo) {
6055
+ if (aspectRatioFromPrompt && !cliSet.width && !cliSet.height && !isTwoStageVideo && !isWan3Canvas) {
5994
6056
  const dims = dimensionsForAspectRatio(options.width, options.height, aspectRatioFromPrompt);
5995
6057
  if (dims) {
5996
6058
  options.width = dims.width;
@@ -11165,6 +11227,18 @@ function writeOutputFileSafe(filePath, buffer, label = 'output') {
11165
11227
  }
11166
11228
  }
11167
11229
 
11230
+ // With the Sensitive Content Filter on, the server withholds a flagged result:
11231
+ // the job completes with no media, and any URL it still carries answers 404.
11232
+ // Report the filter, never a failed download.
11233
+ function sensitiveContentWithheldError(totalCount = 1) {
11234
+ const err = new Error(totalCount > 1
11235
+ ? `The Sensitive Content Filter withheld all ${totalCount} results, so there is nothing to download.`
11236
+ : 'The Sensitive Content Filter withheld this result, so there is nothing to download.');
11237
+ err.code = 'SAFETY_REJECTED';
11238
+ err.hint = 'Reword the prompt, or add --no-filter to turn the filter off.';
11239
+ return err;
11240
+ }
11241
+
11168
11242
  async function downloadUrlToFile(url, filePath) {
11169
11243
  const response = await fetchWithTimeout(url);
11170
11244
  if (!response.ok) {
@@ -12698,14 +12772,16 @@ async function runImageEditProjectWithEvents(client, editConfig, expectedCount,
12698
12772
  if (projectId && data.projectId !== projectId) return;
12699
12773
  if (!projectId) projectId = data.projectId;
12700
12774
  const jobData = data.job?.data || {};
12775
+ const withheld = data.job?.isWithheld === true;
12701
12776
  results.push({
12702
- resultUrl: data.resultUrl || data.imageUrl,
12777
+ resultUrl: withheld ? null : data.resultUrl || data.imageUrl,
12703
12778
  seed: jobData.seed,
12704
12779
  jobIndex: data.jobIndex,
12705
- projectId: data.projectId
12780
+ projectId: data.projectId,
12781
+ ...(withheld ? { urlUnavailable: 'sensitiveContent' } : {})
12706
12782
  });
12707
12783
  completed++;
12708
- log(`Image ${completed}/${expectedCount}${label ? ` (${label})` : ''} completed`);
12784
+ log(`Image ${completed}/${expectedCount}${label ? ` (${label})` : ''} ${withheld ? 'withheld by the Sensitive Content Filter' : 'completed'}`);
12709
12785
  if (completed >= expectedCount) {
12710
12786
  cleanup();
12711
12787
  resolvePromise({ results, projectId });
@@ -12856,6 +12932,9 @@ async function runMultiAngleFlow(client, log) {
12856
12932
  azimuth
12857
12933
  );
12858
12934
  const urls = results.map((r) => r.resultUrl).filter(Boolean);
12935
+ if (urls.length === 0 && results.some((r) => r.urlUnavailable === 'sensitiveContent')) {
12936
+ throw sensitiveContentWithheldError(results.length);
12937
+ }
12859
12938
  const seeds = results.map((r) => r.seed ?? options.seed);
12860
12939
 
12861
12940
  if (outputConfig) {
@@ -13047,6 +13126,9 @@ async function runMultiAngleFlow(client, log) {
13047
13126
  throw buildProjectResultError(clipResult);
13048
13127
  }
13049
13128
 
13129
+ if (clipResult?.project?.jobs?.some((job) => job.isWithheld)) {
13130
+ throw sensitiveContentWithheldError();
13131
+ }
13050
13132
  const clipUrl = clipResult?.videoUrls?.[0];
13051
13133
  if (!clipUrl) {
13052
13134
  throw new Error('No video URL returned for 360 segment.');
@@ -13100,6 +13182,60 @@ async function runMultiAngleFlow(client, log) {
13100
13182
  }
13101
13183
  }
13102
13184
 
13185
+ // Wan 3 preflight canvas: the requested tier (480/720/1080, default 720) at the
13186
+ // requested ratio, or in the first frame's shape for image-to-video. Explicit
13187
+ // -w/-h (or exact pixels in the prompt) skip this and are sent as given.
13188
+ function applyWan3Canvas() {
13189
+ const requestedTier = (cliSet.targetResolution || targetResolutionFromPrompt)
13190
+ ? options.targetResolution
13191
+ : WAN3_DEFAULT_RESOLUTION;
13192
+ options._wan3Tier = wan3ResolutionTier(requestedTier);
13193
+ if (options.videoWorkflow === 'i2v' && (options.refImage || options.refImageEnd)) {
13194
+ // A URL frame is measured again once it is downloaded (see
13195
+ // applyWan3FrameCanvas at the render), so its canvas is provisional here.
13196
+ options._wan3CanvasFollowsFrame = true;
13197
+ const framePath = options.refImage || options.refImageEnd;
13198
+ if (!isHttpUrl(framePath) && existsSync(framePath)) {
13199
+ const dims = getImageDimensionsFromBuffer(readFileSync(framePath));
13200
+ if (dims?.width && dims?.height) {
13201
+ applyWan3FrameCanvas(dims.width, dims.height);
13202
+ return;
13203
+ }
13204
+ }
13205
+ }
13206
+ let ratio = wan3FixedRatio();
13207
+ if (!ratio && aspectRatioFromPrompt) {
13208
+ const promptShape = dimensionsForAspectRatio(1000, 1000, aspectRatioFromPrompt);
13209
+ if (promptShape) ratio = nearestWan3Ratio(promptShape.width, promptShape.height);
13210
+ }
13211
+ const canvas = wan3BucketCanvas(ratio || '16:9', options._wan3Tier);
13212
+ options.width = canvas.width;
13213
+ options.height = canvas.height;
13214
+ }
13215
+
13216
+ function wan3FixedRatio() {
13217
+ return options.wan3Ratio !== 'adaptive' && Object.hasOwn(WAN3_DIMENSION_BUCKETS, options.wan3Ratio)
13218
+ ? options.wan3Ratio
13219
+ : null;
13220
+ }
13221
+
13222
+ // Returns true when the canvas changed.
13223
+ function applyWan3FrameCanvas(frameWidth, frameHeight) {
13224
+ const fixedRatio = wan3FixedRatio();
13225
+ if (fixedRatio && nearestWan3Ratio(frameWidth, frameHeight) !== fixedRatio && !options.quiet && !options._wan3RatioNoticeShown) {
13226
+ options._wan3RatioNoticeShown = true;
13227
+ console.error(
13228
+ `Wan 3 image-to-video follows the first frame's shape (${frameWidth}x${frameHeight}); ` +
13229
+ `--wan3-ratio ${fixedRatio} does not crop it. Crop the image first for a ${fixedRatio} video.`
13230
+ );
13231
+ }
13232
+ const canvas = wan3FrameCanvas(frameWidth, frameHeight, options._wan3Tier);
13233
+ const changed = canvas.width !== options.width || canvas.height !== options.height;
13234
+ options.width = canvas.width;
13235
+ options.height = canvas.height;
13236
+ return changed;
13237
+ }
13238
+
13103
13239
  // The images of the MiniMax H3 FastH3 ia2v/flfa2v audio guide are first/last
13104
13240
  // frame anchors exactly like i2v's, so they follow i2v's canvas and
13105
13241
  // reference-resize rules. (Other ia2v models treat --ref as a loose reference.)
@@ -14099,17 +14235,19 @@ async function main() {
14099
14235
 
14100
14236
  client.on(ClientEvent.JOB_COMPLETED, (data) => {
14101
14237
  const jobData = data.job?.data || {};
14238
+ const withheld = data.job?.isWithheld === true;
14102
14239
  results.push({
14103
- resultUrl: data.resultUrl || ((options.music || options.speech) ? data.audioUrl : (options.video || options.upscaleVideo) ? data.videoUrl : data.imageUrl),
14104
- lastFrameUrl: data.lastFrameUrl || data.job?.lastFrameUrl || jobData.lastFrameUrl,
14240
+ resultUrl: withheld ? null : data.resultUrl || ((options.music || options.speech) ? data.audioUrl : (options.video || options.upscaleVideo) ? data.videoUrl : data.imageUrl),
14241
+ lastFrameUrl: withheld ? null : data.lastFrameUrl || data.job?.lastFrameUrl || jobData.lastFrameUrl,
14105
14242
  seed: jobData.seed,
14106
14243
  jobIndex: data.jobIndex,
14107
14244
  projectId: data.projectId,
14108
14245
  nsfwDetected: data.job?.nsfwDetected ?? jobData.nsfwDetected ?? false,
14109
- nsfwSources: data.job?.nsfwSources ?? jobData.nsfwSources ?? []
14246
+ nsfwSources: data.job?.nsfwSources ?? jobData.nsfwSources ?? [],
14247
+ ...(withheld ? { urlUnavailable: 'sensitiveContent' } : {})
14110
14248
  });
14111
14249
  completedJobs++;
14112
- log(`${options.speech ? 'Speech' : options.imageTo3d ? '3D model' : options.music ? 'Music' : (options.video || options.upscaleVideo) ? 'Video' : 'Image'} ${completedJobs}/${options.count} completed`);
14250
+ log(`${options.speech ? 'Speech' : options.imageTo3d ? '3D model' : options.music ? 'Music' : (options.video || options.upscaleVideo) ? 'Video' : 'Image'} ${completedJobs}/${options.count} ${withheld ? 'withheld by the Sensitive Content Filter' : 'completed'}`);
14113
14251
 
14114
14252
  if (completedJobs >= options.count) {
14115
14253
  projectWait.stop();
@@ -14538,6 +14676,15 @@ async function main() {
14538
14676
  }
14539
14677
  }
14540
14678
 
14679
+ // Wan 3: size the canvas from the frame actually being sent, which the
14680
+ // preflight could not measure when --ref/--ref-end is a URL.
14681
+ if (isWan3Video && options._wan3CanvasFollowsFrame && (imageBuffer || endImageBuffer)) {
14682
+ const frameDims = await getVideoImageDimensionsFromBuffer(imageBuffer || endImageBuffer);
14683
+ if (frameDims?.width && frameDims?.height && applyWan3FrameCanvas(frameDims.width, frameDims.height) && !options.quiet) {
14684
+ console.error(`Sized the Wan 3 canvas to the first frame: ${options.width}x${options.height} (${options._wan3Tier}p).`);
14685
+ }
14686
+ }
14687
+
14541
14688
  // Pre-resize reference images to model-compatible dimensions if needed for i2v workflow.
14542
14689
  // The earlier preflight can inspect local files, but HTTPS references are downloaded only
14543
14690
  // here. Re-check the actual buffer so remote and local inputs follow the same grid rules.
@@ -15197,6 +15344,8 @@ async function main() {
15197
15344
 
15198
15345
  if (results.length > 0) {
15199
15346
  const urls = results.map(r => r.resultUrl).filter(Boolean);
15347
+ const withheldCount = results.filter(r => r.urlUnavailable === 'sensitiveContent').length;
15348
+ if (urls.length === 0 && withheldCount > 0) throw sensitiveContentWithheldError(results.length);
15200
15349
  const firstResult = results[0];
15201
15350
 
15202
15351
  // Save last render info
@@ -15213,8 +15362,8 @@ async function main() {
15213
15362
  seeds,
15214
15363
  projectId: firstResult.projectId,
15215
15364
  urls: urls,
15216
- results: results.map(({ resultUrl, seed, jobIndex, nsfwDetected, nsfwSources }) => ({
15217
- url: resultUrl, seed, jobIndex, nsfwDetected, nsfwSources
15365
+ results: results.map(({ resultUrl, seed, jobIndex, nsfwDetected, nsfwSources, urlUnavailable }) => ({
15366
+ url: resultUrl, seed, jobIndex, nsfwDetected, nsfwSources, ...(urlUnavailable ? { urlUnavailable } : {})
15218
15367
  })),
15219
15368
  localPath: options.output || null,
15220
15369
  tokenType: options.tokenType || 'spark',
@@ -15395,6 +15544,10 @@ async function main() {
15395
15544
  client2.on(ClientEvent.JOB_COMPLETED, async (data) => {
15396
15545
  try {
15397
15546
  clearTimeout(timeout);
15547
+ if (data.job?.isWithheld === true) {
15548
+ reject(sensitiveContentWithheldError());
15549
+ return;
15550
+ }
15398
15551
  const clip2Url = data.resultUrl || data.videoUrl;
15399
15552
  if (!clip2Url) {
15400
15553
  reject(new Error('No video URL returned for second clip.'));
@@ -15403,6 +15556,7 @@ async function main() {
15403
15556
 
15404
15557
  // Download second clip
15405
15558
  const response2 = await fetchWithTimeout(clip2Url);
15559
+ if (!response2.ok) throw new Error(`Second clip download failed: HTTP ${response2.status}`);
15406
15560
  const buffer2 = Buffer.from(await response2.arrayBuffer());
15407
15561
  writeFileSync(clip2Path, buffer2);
15408
15562
 
@@ -15611,6 +15765,7 @@ async function main() {
15611
15765
  console.log(JSON.stringify(output));
15612
15766
  } else {
15613
15767
  urls.forEach(url => console.log(url));
15768
+ if (withheldCount > 0) console.log(`${withheldCount} of ${results.length} results withheld by the Sensitive Content Filter`);
15614
15769
  if (options.returnLastFrame) {
15615
15770
  results.forEach(result => { if (result.lastFrameUrl) console.log(`Last frame: ${result.lastFrameUrl}`); });
15616
15771
  }
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.54.0';
1
+ export const PACKAGE_VERSION = '3.54.2';