@sogni-ai/sogni-creative-agent-skill 3.35.0 → 3.35.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, 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.35.0"
6
+ version: "3.35.2"
7
7
  author: Sogni AI
8
8
  hermes:
9
9
  category: creative
@@ -4,7 +4,7 @@ Use this guide only when the creator asks for prompt text as the deliverable. A
4
4
  prompt-only request does not authorize a render. Require both the exact target
5
5
  model/version and the operation (`generate` or `edit`). If either is missing,
6
6
  ask for it. If the exact pair is not registered, report that limitation; never
7
- substitute a generic image prompt or another model's format.
7
+ substitute another destination model's prompt contract.
8
8
 
9
9
  ## Output contracts by family
10
10
 
@@ -280,8 +280,8 @@ no negative prompt and no ControlNet.
280
280
  - **Audio-only reference**: unlike 2.0, Seedance 2.5 accepts standalone audio as
281
281
  its only loose reference.
282
282
 
283
- The pinned `@sogni-ai/sogni-intelligence-client` 3.23.2 runtime recognizes
284
- `seedance-2-5`, and the package override pins `@sogni-ai/sogni-client` 5.19.2
283
+ The pinned `@sogni-ai/sogni-intelligence-client` 3.24.1 runtime recognizes
284
+ `seedance-2-5`, and the package override pins `@sogni-ai/sogni-client` 5.20.0
285
285
  for typed task transport. The direct CLI applies Seedance's fixed 24 fps,
286
286
  4-30 s duration window, larger reference caps, reference-mode exclusivity, and
287
287
  HTTPS reference forwarding before dispatch.
@@ -350,12 +350,15 @@ IDs. It renders 2–30 second clips at fixed 30 fps with native audio (enabled b
350
350
  default, disable with `--no-generate-audio`) at 480P, 720P, or 1080P.
351
351
  Supported ratios are `adaptive`, `16:9`, `4:3`, `1:1`, `3:4`, and `9:16`.
352
352
  Use `--smart-duration` for provider-selected timing or `--duration 2..30` for
353
- an exact request. Provider prompt expansion defaults on; use
354
- `--no-expand-prompt` only when the submitted wording must remain exact.
353
+ an exact request. `--no-expand-prompt` bypasses local prompt guardrails and
354
+ sends literal wording; hosted agent paths run Sogni's exact-model shaper. The
355
+ configured Alibaba Model Studio WAN3 endpoint accepts no provider-side
356
+ `prompt_extend` behavior is coordinated with Sogni's own model-specific shaping
357
+ so a prompt is not rewritten twice.
355
358
 
356
359
  - **Frame mode:** `--ref` is the first frame; optional `--ref-end` is the last
357
360
  frame. A last frame requires a first frame.
358
- - **Loose-reference mode:** select `r2v`, `a2v`, `ia2v`, or `v2v`. In these
361
+ - **Loose-reference mode:** select `r2v`, `a2v`, or `ia2v`. In these
359
362
  modes `--ref` is a loose `Image 1`; `--ref-video` and `--ref-audio` are
360
363
  repeatable loose `Video N` / `Audio N` inputs. Give every reference one
361
364
  explicit job in the prompt.
@@ -370,15 +373,13 @@ an exact request. Provider prompt expansion defaults on; use
370
373
  - **Caps:** 10 images, 5 videos, and 5 audio clips. There is no additional
371
374
  aggregate media-count cap in the upstream contract.
372
375
  Each video/audio input is 1–15 seconds; total video input is at most 15
373
- seconds, and video-input duration plus requested output duration is at most
374
- 30 seconds.
376
+ seconds.
375
377
  - **Inputs:** a prompt or at least one media input is required; prompts allow up
376
378
  to 20,000 characters. Send no negative prompt, steps, guidance, sampler,
377
379
  scheduler, ControlNet, or mask. Seeds are integers from 0 through 2147483647.
378
- - **Edit/extend:** `--wan3-task-type edit` and `extend` require a source video.
379
- Extension also requires `--wan3-ratio adaptive` and a prompt that clearly
380
- asks to continue the supplied video. Input video plus output is at most 30
381
- seconds.
380
+ - **No edit/extend task:** video references are loose conditioning for a new
381
+ generation. Alibaba exposes no edit/extend task mode or task-type field; use
382
+ a dedicated video-to-video model when source-preserving editing is required.
382
383
  - **Cost (as of 2026-08):** platform artist pricing is $0.065/s at 480P,
383
384
  $0.13/s at 720P, and $0.26/s at 1080P; native audio does not change the rate.
384
385
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.35.0",
3
+ "version": "3.35.2",
4
4
  "description": "Sogni Creative Agent: image, 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.35.0",
3
+ "version": "3.35.2",
4
4
  "description": "Create images, generative video, music, and polished image-folder loops with Sogni AI.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## [3.35.2](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.35.1...v3.35.2) (2026-08-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **video:** align exact-model skill contracts ([ba3a071](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/ba3a071406d2000ad65ee4c1a5d1ce1b71eeff53))
7
+ * **video:** align public model-native contracts ([9d44147](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/9d44147dd9aef334c60690e3ad9eda26f40e2ed7))
8
+ * **video:** correct Wan 3 provider semantics ([a54fb89](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/a54fb891b2606e096215058e2ce98674c7b2cb37))
9
+ * **video:** merge exact-model public contracts ([c8381b3](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/c8381b3c99d91912412ef0d2e6fd017822b4d403))
10
+
11
+ ## [3.35.1](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.35.0...v3.35.1) (2026-08-26)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **deps:** consume corrected Wan 3 video quotes ([d805281](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/d805281fb85183696c26abfecb6ef87f49a4674c))
17
+ * **deps:** consume R2V canvas runtime ([82b4436](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/82b4436e36318614aaeeb295f0a8026ddf6f0a37))
18
+ * **video:** protect loose references from canvas resizing ([b996acc](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/b996accfeddb88a03c2d2b644bc7add751e852c5))
19
+
1
20
  # [3.35.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.34.0...v3.35.0) (2026-08-25)
2
21
 
3
22
 
package/README.md CHANGED
@@ -444,13 +444,11 @@ sogni-agent --video -m wan3 --ref first.png --ref-end last.png \
444
444
  "Move smoothly between the supplied endpoint frames"
445
445
  sogni-agent --video -m wan3 --workflow ia2v --ref presenter.png --ref-audio dialogue.mp3 \
446
446
  "Use Image 1 for the presenter and Audio 1 for the performance"
447
- sogni-agent --video -m wan3 --workflow v2v --ref-video source.mp4 \
448
- "Edit Video 1 into a rainy night scene while preserving its action"
447
+ sogni-agent --video -m wan3 --workflow r2v --ref-video motion.mp4 \
448
+ "Use Video 1 as loose motion and pacing guidance for a new rainy-night scene"
449
449
  sogni-agent --video -m wan3 --smart-duration --wan3-ratio 9:16 --no-expand-prompt \
450
450
  --reference-file-url https://cdn.example.com/brief.pdf \
451
451
  "Use the supplied brief exactly"
452
- sogni-agent --video -m wan3 --workflow v2v --wan3-task-type extend \
453
- --wan3-ratio adaptive --ref-video source.mp4 "Continue Video 1 after its ending"
454
452
 
455
453
  # MiniMax H3 standard and 4-step Turbo video (native 32 kHz stereo audio)
456
454
  sogni-agent --video -m minimax-h3 --duration 10 "<three-field H3 prompt>"
@@ -577,7 +575,7 @@ Run `sogni-agent --help` for the full CLI. Below are the options and tables most
577
575
  | `--ref`, `-c`, `--ref-audio`, `--ref-video` | Frame/loose image/audio/video references; audio/video repeat for H3 r2v and Seedance loose refs |
578
576
  | `--target-resolution <px>` | Target the short side, preserving aspect ratio |
579
577
  | `--workflow <type>` | Force `t2v`, `i2v`, `r2v`, `s2v`, `ia2v`, `a2v`, `v2v`, or animate workflows |
580
- | `--wan3-task-type`, `--wan3-ratio`, `--smart-duration`, `--reference-file-url`, `--reference-link-url`, `--watermark` | Wan 3 task, adaptive/fixed ratio, smart timing, document/web context, and watermark controls |
578
+ | `--wan3-ratio`, `--smart-duration`, `--reference-file-url`, `--reference-link-url`, `--watermark` | Wan 3 adaptive/fixed ratio, smart timing, document/web context, and watermark controls |
581
579
  | `--expand-prompt`, `--no-expand-prompt` | Enable Alibaba prompt expansion for direct Wan 3 video, or preserve the exact submitted prompt |
582
580
  | `--generate-audio`, `--no-generate-audio` | Keep/strip MiniMax H3's track, enable/disable Wan 3 native audio, or control generated-keyframe workflows |
583
581
  | `--sampler <name>` | Image/music sampler; FL2VA H3 Turbo accepts `euler`, `er_sde`, or `sa_solver` and defaults to `er_sde` on Socket. Ref2VA Turbo accepts Euler only. The CLI omits this field unless explicitly set. |
@@ -678,7 +676,7 @@ sogni-agent --video -m seedance2-5-v2v --seedance-task-type extend --ref-video s
678
676
  ## Video Sizing & Aspect Ratios
679
677
 
680
678
  - **WAN 2.2 models** use dimensions divisible by 16, min 480 px, max 1536 px.
681
- - **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; input-video duration plus output duration is at most 30 s. Edit/extend require source video, and extend requires `adaptive` ratio plus explicit continuation intent. 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).
679
+ - **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).
682
680
  - **MiniMax H3 and H3 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 and FL2VA Turbo normally default to 1344×768 or 768×1344; Ref2VA Turbo defaults to 960×544 but supports other valid shapes. `--duration` snaps to the frame grid, so H3 delivers the nearest grid point rather than the exact requested seconds. Standard H3 uses 20 steps; Turbo uses 4 steps. FL2VA H3 Turbo defaults to `er_sde` on Socket, and the CLI omits the sampler unless `--sampler` is passed; FL2VA A/B tests may select `euler`, `er_sde`, or `sa_solver`. Ref2VA Turbo follows its exact upstream Euler/simple recipe and accepts only `--sampler euler`. Guidance 1 is fixed and there is no negative-prompt input. Base and Turbo t2v/i2v/flf2v prompts use the exact ordered three fields; standard and Turbo Ref2VA use exactly `subject_definitions`, `summary`, `retention_analysis`, `detailed_description`, `overall_soundscape`, and `non_diegetic_music`. Both Ref2VA selectors accept up to 9 images, 3 videos, and 3 audios, capped at 12 files; at least one visual reference is required, audio-only input is invalid, and r2v is never inferred. `--no-generate-audio` strips the jointly generated track from the result. This is the 768p-class open-weights release, not MiniMax's hosted 2K stage. FL2VA/Turbo and image-only R2V require 32 GB-class workers; video-conditioned R2V requires above 40 GB. See `references/video-prompting.md` § MiniMax H3 Prompting for the exact contracts.
683
681
  - **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.
684
682
  - **Seedance** runs at fixed 24 fps. The 2.0 family (`seedance2`, `seedance2-mini`, `seedance2-fast`) supports 4–15 s durations; full `seedance2` supports native 4K via `--target-resolution 2160` while `seedance2-mini` and `seedance2-fast` remain capped to the 720p lower-resolution path. `seedance2-5` renders 4–30 s single clips but caps at 480p/720p (no 1080p or 4K). Other default/WAN paths support up to 10 s; LTX and WAN animate workflows support up to 20 s.
package/SKILL.md CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sogni-creative-agent-skill
3
3
  description: "Sogni Creative Agent Skill: agent skill and CLI for image, video, and music generation using Sogni AI's decentralized GPU network. Supports promptless RTX VSR image upscaling through 16K, 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 Turbo/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\", \"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.35.0"
5
+ version: "3.35.2"
6
6
  homepage: https://sogni.ai
7
7
  openclaw:
8
8
  emoji: "🎨"
@@ -212,14 +212,14 @@ sogni-agent --video -m happyhorse --ref first-frame.png "Bring the scene to life
212
212
  sogni-agent --video -m happyhorse-1.1-r2v -c ref1.png -c ref2.png "Blend the references into one continuous shot"
213
213
 
214
214
  # Alibaba Wan 3 unified video (2-30s, fixed 30fps, native audio,
215
- # 480P/720P/1080P). --ref/--ref-end are frame anchors; r2v/a2v/ia2v/v2v
216
- # use loose Image 1 / Video 1 / Audio 1 references instead.
215
+ # 480P/720P/1080P). --ref/--ref-end are frame anchors; r2v/a2v/ia2v
216
+ # use loose Image 1 / Video 1 / Audio 1 references instead. A video reference
217
+ # conditions a new generation; it is not an edit/extend task.
217
218
  sogni-agent --video -m wan3 --target-resolution 1080 --duration 8 'A presenter says "Welcome." in a detailed studio'
218
219
  sogni-agent --video -m wan3 --ref first.png --ref-end last.png "Move smoothly between the supplied frames"
219
220
  sogni-agent --video -m wan3 --workflow ia2v --ref presenter.png --ref-audio dialogue.mp3 "Use Image 1 and Audio 1 for the performance"
220
- sogni-agent --video -m wan3 --workflow v2v --ref-video source.mp4 "Edit Video 1 into a rainy night scene"
221
+ sogni-agent --video -m wan3 --workflow r2v --ref-video motion.mp4 "Use Video 1 as loose motion and pacing guidance for a new rainy-night scene"
221
222
  sogni-agent --video -m wan3 --smart-duration --wan3-ratio 9:16 --no-expand-prompt --reference-file-url https://cdn.example.com/brief.pdf "Use the supplied brief exactly"
222
- sogni-agent --video -m wan3 --workflow v2v --wan3-task-type extend --wan3-ratio adaptive --ref-video source.mp4 "Continue Video 1 after its ending"
223
223
 
224
224
  # Balances / last render / inbound media / health (no prompt required)
225
225
  sogni-agent --json --balance
@@ -252,9 +252,9 @@ sogni-agent doctor --json
252
252
  | `--workflow <t>` | Force `t2v\|i2v\|r2v\|s2v\|ia2v\|a2v\|v2v\|animate-move\|animate-replace` | inferred |
253
253
  | `--ref`, `-c`, `--ref-end`, `--ref-audio`, `--ref-video`, `--mask` | Frame / loose image / audio / video / mask references; audio/video repeat for H3 r2v | - |
254
254
  | `--seedance-task-type reference\|edit\|extend` | Explicit Seedance 2.5 loose-reference operation; v2v defaults to edit | - |
255
- | `--wan3-task-type create\|edit\|extend`, `--wan3-ratio`, `--smart-duration` | Wan 3 operation, adaptive/fixed ratio, and provider-selected 2–30s duration | create / adaptive / fixed |
255
+ | `--wan3-ratio`, `--smart-duration` | Wan 3 adaptive/fixed ratio and provider-selected 2–30s duration | adaptive / fixed |
256
256
  | `--reference-file-url`, `--reference-link-url` | One public Wan 3 document or webpage context URL (mutually exclusive) | - |
257
- | `--expand-prompt`, `--no-expand-prompt`, `--watermark`, `--no-watermark` | Wan 3 provider prompt expansion and watermark controls | expansion on / watermark off |
257
+ | `--expand-prompt`, `--no-expand-prompt`, `--watermark`, `--no-watermark` | Local video prompt rewriting and Wan 3 watermark control | rewrite on / watermark off |
258
258
  | `--generate-audio`, `--no-generate-audio` | Keep/strip MiniMax H3's track or enable/disable Wan 3 native audio | keep / enabled |
259
259
  | `--sampler <name>` | Image/music sampler; FL2VA H3 Turbo: `euler\|er_sde\|sa_solver`; Ref2VA Turbo: `euler` only | FL2VA H3 Turbo defaults to `er_sde` on Socket; CLI omits unless set |
260
260
  | `--control-type`, `--outpaint-position`, `--outpaint-aspect-ratio` | LTX v2v control mode and outpaint canvas controls (`ltx25-v2v` default) | - |
@@ -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.35.0",
5
+ "version": "3.35.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",
@@ -2321,11 +2321,11 @@ const PROMPT_CONTRACTS = [
2321
2321
  "contractId": "video_to_video_v1",
2322
2322
  "version": "1.0.0",
2323
2323
  "toolName": "video_to_video",
2324
- "baseDescription": "video_to_video transforms an uploaded video. Use for uploaded-video restyling, enhancement,\nupscaling/remastering, motion transfer from video to image, subject replacement, edge/pose/\ndepth-guided restyle, or explicit Seedance/Wan 3 V2V transforms.\nFor an explicit Wan 3 edit or continuation, set videoModel=\"wan3.0-video\"; the uploaded\nsource is sent as reference_video and total input-plus-output duration must remain at most\n30 seconds. Wan 3 uses the prompt itself to express edit or extension intent.\n\nThis tool requires an uploaded video source. Do not use it for generated video indices. For\ngenerated or uploaded partial edits use replace_video_segment; for appended time use\nextend_video; for logos/text overlays use overlay_video; for stitching use stitch_video.\n\nChoose controlMode by intent. Use detailer for quality-only enhancement without restyling.\nUse seedance-v2v only when the user asks to transform/enhance/remaster an uploaded video\nwith Seedance, including uploaded-video upscale/remaster requests. For detailer,\ndescribe the original scene plus quality terms, not new content.\nUse outpaint to extend/expand the frame or change aspect ratio (positional, mask-free); set\noutpaintPosition and optionally outpaintAspectRatio. Use inpaint to regenerate a region\nwhile preserving the rest. If the user supplied a mask, set maskImageIndex; otherwise\nomit maskImageIndex so execution derives one from the source video and prompt.",
2324
+ "baseDescription": "video_to_video transforms an uploaded video. Use for uploaded-video restyling, enhancement,\nupscaling/remastering, motion transfer from video to image, subject replacement, edge/pose/\ndepth-guided restyle, or explicit Seedance V2V transforms. Wan 3 is not a V2V model;\nits video inputs are loose references for new generation through generate_video.\n\nThis tool requires an uploaded video source. Do not use it for generated video indices. For\ngenerated or uploaded partial edits use replace_video_segment; for appended time use\nextend_video; for logos/text overlays use overlay_video; for stitching use stitch_video.\n\nChoose controlMode by intent. Use detailer for quality-only enhancement without restyling.\nUse seedance-v2v only when the user asks to transform/enhance/remaster an uploaded video\nwith Seedance, including uploaded-video upscale/remaster requests. For detailer,\ndescribe the original scene plus quality terms, not new content.\nUse outpaint to extend/expand the frame or change aspect ratio (positional, mask-free); set\noutpaintPosition and optionally outpaintAspectRatio. Use inpaint to regenerate a region\nwhile preserving the rest. If the user supplied a mask, set maskImageIndex; otherwise\nomit maskImageIndex so execution derives one from the source video and prompt.",
2325
2325
  "parameterDocs": {
2326
2326
  "prompt": "Describe the target appearance in present tense. For detailer, describe the original content plus quality qualifiers only. For outpaint, describe what fills the new area; for inpaint, describe only the masked region.",
2327
2327
  "videoSourceIndex": "Uploaded video index. Omit when there is one uploaded video; use 0 for first uploaded video or -1 if using negative upload notation.",
2328
- "controlMode": "Pick from intent: detailer for enhance, seedance-v2v for explicit Seedance or Wan 3 V2V, canny/depth for video-only control restyles, pose for motion transfer onto a reference-image subject, animate-move/replace for WAN Animate, outpaint to extend/expand the canvas, inpaint to regenerate a masked region.",
2328
+ "controlMode": "Pick from intent: detailer for enhance, seedance-v2v for explicit Seedance V2V, canny/depth for video-only control restyles, pose for motion transfer onto a reference-image subject, animate-move/replace for WAN Animate, outpaint to extend/expand the canvas, inpaint to regenerate a masked region.",
2329
2329
  "sourceImageIndex": "Required for animate-move, animate-replace, and pose when more than one image is available; the sole reference image may be auto-selected. LTX pose always needs a reference image. Ignored by canny, depth, detailer, outpaint, and inpaint.",
2330
2330
  "outpaintPosition": "outpaint only. Where the original frame sits in the expanded canvas (center/top/bottom/left/right); determines grow direction. Default center.",
2331
2331
  "outpaintAspectRatio": "outpaint only, optional. Target aspect ratio (e.g. 16:9) for the expanded canvas; the canvas only grows, never crops. Set only when the user names a target shape/orientation.",
@@ -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.35.0",
5
+ "version": "3.35.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.35.0",
3
+ "version": "3.35.2",
4
4
  "description": "Sogni Creative Agent Skill: agent skill and CLI for Sogni AI image, video, and music generation.",
5
5
  "type": "module",
6
6
  "main": "sogni-agent.mjs",
@@ -95,13 +95,13 @@
95
95
  "sogni-agent.mjs"
96
96
  ],
97
97
  "dependencies": {
98
- "@sogni-ai/sogni-intelligence-client": "3.24.0",
98
+ "@sogni-ai/sogni-intelligence-client": "3.24.5",
99
99
  "execa": "^9.6.1",
100
100
  "json5": "^2.2.3",
101
- "sharp": "^0.34.5"
101
+ "sharp": "0.35.4"
102
102
  },
103
103
  "overrides": {
104
- "@sogni-ai/sogni-client": "5.19.2"
104
+ "@sogni-ai/sogni-client": "5.21.2"
105
105
  },
106
106
  "openclaw": {
107
107
  "extensions": [
@@ -4,7 +4,7 @@ Use this guide only when the creator asks for prompt text as the deliverable. A
4
4
  prompt-only request does not authorize a render. Require both the exact target
5
5
  model/version and the operation (`generate` or `edit`). If either is missing,
6
6
  ask for it. If the exact pair is not registered, report that limitation; never
7
- substitute a generic image prompt or another model's format.
7
+ substitute another destination model's prompt contract.
8
8
 
9
9
  ## Output contracts by family
10
10
 
@@ -280,8 +280,8 @@ no negative prompt and no ControlNet.
280
280
  - **Audio-only reference**: unlike 2.0, Seedance 2.5 accepts standalone audio as
281
281
  its only loose reference.
282
282
 
283
- The pinned `@sogni-ai/sogni-intelligence-client` 3.23.2 runtime recognizes
284
- `seedance-2-5`, and the package override pins `@sogni-ai/sogni-client` 5.19.2
283
+ The pinned `@sogni-ai/sogni-intelligence-client` 3.24.1 runtime recognizes
284
+ `seedance-2-5`, and the package override pins `@sogni-ai/sogni-client` 5.20.0
285
285
  for typed task transport. The direct CLI applies Seedance's fixed 24 fps,
286
286
  4-30 s duration window, larger reference caps, reference-mode exclusivity, and
287
287
  HTTPS reference forwarding before dispatch.
@@ -350,12 +350,15 @@ IDs. It renders 2–30 second clips at fixed 30 fps with native audio (enabled b
350
350
  default, disable with `--no-generate-audio`) at 480P, 720P, or 1080P.
351
351
  Supported ratios are `adaptive`, `16:9`, `4:3`, `1:1`, `3:4`, and `9:16`.
352
352
  Use `--smart-duration` for provider-selected timing or `--duration 2..30` for
353
- an exact request. Provider prompt expansion defaults on; use
354
- `--no-expand-prompt` only when the submitted wording must remain exact.
353
+ an exact request. `--no-expand-prompt` bypasses local prompt guardrails and
354
+ sends literal wording; hosted agent paths run Sogni's exact-model shaper. The
355
+ configured Alibaba Model Studio WAN3 endpoint accepts no provider-side
356
+ `prompt_extend` behavior is coordinated with Sogni's own model-specific shaping
357
+ so a prompt is not rewritten twice.
355
358
 
356
359
  - **Frame mode:** `--ref` is the first frame; optional `--ref-end` is the last
357
360
  frame. A last frame requires a first frame.
358
- - **Loose-reference mode:** select `r2v`, `a2v`, `ia2v`, or `v2v`. In these
361
+ - **Loose-reference mode:** select `r2v`, `a2v`, or `ia2v`. In these
359
362
  modes `--ref` is a loose `Image 1`; `--ref-video` and `--ref-audio` are
360
363
  repeatable loose `Video N` / `Audio N` inputs. Give every reference one
361
364
  explicit job in the prompt.
@@ -370,15 +373,13 @@ an exact request. Provider prompt expansion defaults on; use
370
373
  - **Caps:** 10 images, 5 videos, and 5 audio clips. There is no additional
371
374
  aggregate media-count cap in the upstream contract.
372
375
  Each video/audio input is 1–15 seconds; total video input is at most 15
373
- seconds, and video-input duration plus requested output duration is at most
374
- 30 seconds.
376
+ seconds.
375
377
  - **Inputs:** a prompt or at least one media input is required; prompts allow up
376
378
  to 20,000 characters. Send no negative prompt, steps, guidance, sampler,
377
379
  scheduler, ControlNet, or mask. Seeds are integers from 0 through 2147483647.
378
- - **Edit/extend:** `--wan3-task-type edit` and `extend` require a source video.
379
- Extension also requires `--wan3-ratio adaptive` and a prompt that clearly
380
- asks to continue the supplied video. Input video plus output is at most 30
381
- seconds.
380
+ - **No edit/extend task:** video references are loose conditioning for a new
381
+ generation. Alibaba exposes no edit/extend task mode or task-type field; use
382
+ a dedicated video-to-video model when source-preserving editing is required.
382
383
  - **Cost (as of 2026-08):** platform artist pricing is $0.065/s at 480P,
383
384
  $0.13/s at 720P, and $0.26/s at 1080P; native audio does not change the rate.
384
385
 
@@ -17,6 +17,7 @@ const destination = join(
17
17
 
18
18
  const referenceFiles = [
19
19
  'hosted-api.md',
20
+ 'image-prompting.md',
20
21
  'krea2-loras.md',
21
22
  'loop-maker.md',
22
23
  'models.md',
@@ -3,9 +3,9 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@sogni-ai/sogni-intelligence-client": "3.24.0",
6
+ "@sogni-ai/sogni-intelligence-client": "3.24.5",
7
7
  "execa": "^9.6.1",
8
8
  "json5": "^2.2.3",
9
- "sharp": "^0.34.5"
9
+ "sharp": "0.35.4"
10
10
  }
11
11
  }
package/sogni-agent.mjs CHANGED
@@ -976,6 +976,10 @@ function applyVideoPromptGuardrails() {
976
976
 
977
977
  function applyCreativeBrainPreflight() {
978
978
  if (!options.video || !options.prompt) return;
979
+ if (options.apiExpandPrompt === false) {
980
+ options._literalPrompt = true;
981
+ return;
982
+ }
979
983
 
980
984
  const plan = planCliVideoBrain({
981
985
  video: options.video,
@@ -1627,10 +1631,9 @@ const WAN3_REFERENCE_LIMITS = Object.freeze({
1627
1631
  files: 1,
1628
1632
  links: 1,
1629
1633
  });
1630
- const WAN3_SUPPORTED_WORKFLOWS = new Set(['t2v', 'i2v', 'r2v', 'a2v', 'ia2v', 'v2v']);
1634
+ const WAN3_SUPPORTED_WORKFLOWS = new Set(['t2v', 'i2v', 'r2v', 'a2v', 'ia2v']);
1631
1635
  const WAN3_SUPPORTED_RESOLUTIONS = new Set([480, 720, 1080]);
1632
1636
  const WAN3_SUPPORTED_RATIOS = new Set(['adaptive', '16:9', '4:3', '1:1', '3:4', '9:16']);
1633
- const WAN3_TASK_TYPES = new Set(['create', 'edit', 'extend']);
1634
1637
  const WAN3_MAX_SEED = 0x7fffffff;
1635
1638
 
1636
1639
  function isWan3ModelSelectionLocal(modelId) {
@@ -2563,7 +2566,7 @@ const options = {
2563
2566
  video: false,
2564
2567
  videoWorkflow: null,
2565
2568
  seedanceTaskType: null,
2566
- wan3TaskType: null,
2569
+ legacyWan3TaskType: null,
2567
2570
  wan3Ratio: 'adaptive',
2568
2571
  wan3SmartDuration: false,
2569
2572
  wan3ReferenceFileUrl: null,
@@ -2749,7 +2752,6 @@ const cliSet = {
2749
2752
  video: false,
2750
2753
  workflow: false,
2751
2754
  seedanceTaskType: false,
2752
- wan3TaskType: false,
2753
2755
  wan3Ratio: false,
2754
2756
  wan3SmartDuration: false,
2755
2757
  wan3ReferenceFileUrl: false,
@@ -3046,8 +3048,7 @@ for (let i = 0; i < args.length; i++) {
3046
3048
  } else if (arg === '--wan3-task-type') {
3047
3049
  const raw = requireFlagValue(args, i, arg);
3048
3050
  i++;
3049
- options.wan3TaskType = raw.trim().toLowerCase();
3050
- cliSet.wan3TaskType = true;
3051
+ options.legacyWan3TaskType = raw.trim().toLowerCase();
3051
3052
  } else if (arg === '--wan3-ratio' || arg === '--video-ratio') {
3052
3053
  const raw = requireFlagValue(args, i, arg);
3053
3054
  i++;
@@ -3826,7 +3827,6 @@ Video Options:
3826
3827
  --video, -v Generate video instead of image
3827
3828
  --workflow <type> Video workflow: t2v|i2v|r2v|s2v|ia2v|a2v|v2v|animate-move|animate-replace
3828
3829
  --seedance-task-type <type> Seedance 2.5 loose-reference operation: reference|edit|extend
3829
- --wan3-task-type <type> Wan 3 operation: create|edit|extend (v2v defaults to edit)
3830
3830
  --wan3-ratio <ratio> Wan 3 ratio: adaptive|16:9|4:3|1:1|3:4|9:16
3831
3831
  --smart-duration, --no-smart-duration Let Wan 3 choose 2-30s, or use --duration
3832
3832
  --reference-file-url <url> Wan 3 public HTTPS document context (one, up to 100 MB; supported paged formats up to 50 pages)
@@ -3926,7 +3926,7 @@ Hosted API Modes:
3926
3926
  --video-prompt <text> Motion prompt for the generated-keyframe durable workflow
3927
3927
  --negative-prompt <text> Negative prompt for generated workflow steps
3928
3928
  --generate-audio, --no-generate-audio Toggle audio generation for generated video steps
3929
- --expand-prompt, --no-expand-prompt Toggle prompt expansion for Wan 3 direct video and generated video steps
3929
+ --expand-prompt, --no-expand-prompt Toggle local video prompt rewriting; --no-expand-prompt preserves literal wording
3930
3930
  --watch-workflow Stream workflow events after starting
3931
3931
  --list-workflows List recent durable creative workflows
3932
3932
  --get-workflow <id> Fetch a workflow snapshot
@@ -4650,7 +4650,7 @@ if (options.video) {
4650
4650
  const hasAudio = Boolean(options.refAudio || options.refAudios.length > 0);
4651
4651
  const hasVideo = Boolean(options.refVideo || options.refVideos.length > 0);
4652
4652
  if (hasVideo) {
4653
- options.videoWorkflow = 'v2v';
4653
+ options.videoWorkflow = 'r2v';
4654
4654
  } else if (hasAudio && (options.refImage || hasLooseImages)) {
4655
4655
  options.videoWorkflow = 'ia2v';
4656
4656
  } else if (hasAudio) {
@@ -5060,6 +5060,8 @@ if (!loraCatalogUtilityAction && (options.loraCatalogModel || options.loraCatalo
5060
5060
  if (typeof options.prompt === 'string' && options.prompt.trim() === '') {
5061
5061
  options.prompt = '';
5062
5062
  }
5063
+ const wan3ReferenceMediaCache = new Map();
5064
+ const wan3ReferencePreparationPlan = new Map();
5063
5065
  const wan3HasMediaInput = isWan3ModelLocal(options.model) && Boolean(
5064
5066
  options.refImage
5065
5067
  || options.refImageEnd
@@ -5068,6 +5070,8 @@ const wan3HasMediaInput = isWan3ModelLocal(options.model) && Boolean(
5068
5070
  || options.contextImages.length > 0
5069
5071
  || options.refAudios.length > 0
5070
5072
  || options.refVideos.length > 0
5073
+ || options.wan3ReferenceFileUrl
5074
+ || options.wan3ReferenceLinkUrl
5071
5075
  );
5072
5076
  if (!options.prompt && !wan3HasMediaInput && !options.upscaleImage && !options.apiChat && !apiWorkflowUtilityAction && !apiWorkflowStartAction && !apiModelUtilityAction && !liveModelUtilityAction && !loraCatalogUtilityAction && !apiReplayUtilityAction && !contractUtilityAction && !storyboardPlanUtilityAction && !options.estimateVideoCost && !options.multiAngle && !options.showBalance && !options.showVersion && !options.doctor && !options.extractLastFrame && !options.extractFirstFrame && !options.extractFrameAt && !options.verifyVideo && !options.concatVideos && !options.sourceReelDir && !options.remixAudio && !options.listMedia && !options.memoryAction && !options.personalityAction && !personaUtilityAction) {
5073
5077
  fatalCliError('No prompt provided. Use --help for usage.', { code: 'INVALID_ARGUMENT' });
@@ -5112,8 +5116,18 @@ if (!options.upscaleImage && (cliSet.upscaleScale || cliSet.upscaleTargetLongest
5112
5116
  });
5113
5117
  }
5114
5118
 
5115
- if (!options.video && !options.apiChat && !options.apiWorkflowAction && (options.refAudio || options.refVideo || options.refMask || options.referenceAudioIdentity || options.voicePersonaName || options.videoWorkflow || options.seedanceTaskType || options.wan3TaskType || options.wan3SmartDuration || options.wan3ReferenceFileUrl || options.wan3ReferenceLinkUrl || options.wan3Watermark || cliSet.wan3Ratio || options.frames || options.targetResolution || options.audioStart !== null || options.audioDuration !== null || options.videoStart !== null || options.outpaintPosition || options.outpaintAspectRatio)) {
5116
- fatalCliError('Video-only options (--workflow/--seedance-task-type/--wan3-task-type/--wan3-ratio/--smart-duration/--reference-file-url/--reference-link-url/--watermark/--frames/--target-resolution/--ref-audio/--ref-video/--mask/--outpaint-position/--reference-audio-identity/--voice-persona) require --video.', {
5119
+ if (options.legacyWan3TaskType !== null) {
5120
+ fatalCliError(
5121
+ '--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.',
5122
+ {
5123
+ code: 'INVALID_ARGUMENT',
5124
+ details: { wan3TaskType: options.legacyWan3TaskType }
5125
+ }
5126
+ );
5127
+ }
5128
+
5129
+ if (!options.video && !options.apiChat && !options.apiWorkflowAction && (options.refAudio || options.refVideo || options.refMask || options.referenceAudioIdentity || options.voicePersonaName || options.videoWorkflow || options.seedanceTaskType || options.wan3SmartDuration || options.wan3ReferenceFileUrl || options.wan3ReferenceLinkUrl || options.wan3Watermark || cliSet.wan3Ratio || options.frames || options.targetResolution || options.audioStart !== null || options.audioDuration !== null || options.videoStart !== null || options.outpaintPosition || options.outpaintAspectRatio)) {
5130
+ fatalCliError('Video-only options (--workflow/--seedance-task-type/--wan3-ratio/--smart-duration/--reference-file-url/--reference-link-url/--watermark/--frames/--target-resolution/--ref-audio/--ref-video/--mask/--outpaint-position/--reference-audio-identity/--voice-persona) require --video.', {
5117
5131
  code: 'INVALID_ARGUMENT'
5118
5132
  });
5119
5133
  }
@@ -5149,13 +5163,7 @@ if (options.video) {
5149
5163
  details: { model: options.model, seedanceTaskType: options.seedanceTaskType }
5150
5164
  });
5151
5165
  }
5152
- if (options.wan3TaskType && !WAN3_TASK_TYPES.has(options.wan3TaskType)) {
5153
- fatalCliError('--wan3-task-type must be one of: create, edit, extend.', {
5154
- code: 'INVALID_ARGUMENT',
5155
- details: { wan3TaskType: options.wan3TaskType }
5156
- });
5157
- }
5158
- if ((options.wan3TaskType || cliSet.wan3Ratio || options.wan3SmartDuration || options.wan3ReferenceFileUrl || options.wan3ReferenceLinkUrl || options.wan3Watermark) && !isWan3Video) {
5166
+ if ((cliSet.wan3Ratio || options.wan3SmartDuration || options.wan3ReferenceFileUrl || options.wan3ReferenceLinkUrl || options.wan3Watermark) && !isWan3Video) {
5159
5167
  fatalCliError('Wan 3 controls are supported only by wan3 / wan3.0-video.', {
5160
5168
  code: 'INVALID_ARGUMENT',
5161
5169
  details: { model: options.model }
@@ -5275,7 +5283,7 @@ if (options.video) {
5275
5283
  });
5276
5284
  }
5277
5285
  if (isWan3Video && !WAN3_SUPPORTED_WORKFLOWS.has(options.videoWorkflow)) {
5278
- fatalCliError('Wan 3 supports t2v, i2v/flf, r2v, a2v, ia2v, and v2v workflows.', {
5286
+ fatalCliError('Wan 3 supports t2v, i2v/flf, r2v, a2v, and ia2v workflows. Video inputs are loose r2v references, not source-video edit or extend tasks.', {
5279
5287
  code: 'INVALID_ARGUMENT',
5280
5288
  details: { workflow: options.videoWorkflow, model: options.model }
5281
5289
  });
@@ -5336,7 +5344,6 @@ if (options.video) {
5336
5344
  }
5337
5345
 
5338
5346
  if (isWan3Video) {
5339
- options.wan3TaskType ??= options.videoWorkflow === 'v2v' ? 'edit' : 'create';
5340
5347
  const looseImages = (options.refImage && options.videoWorkflow !== 'i2v' ? 1 : 0)
5341
5348
  + options.contextImages.length;
5342
5349
  const looseVideos = (options.refVideo ? 1 : 0) + options.refVideos.length;
@@ -5364,22 +5371,11 @@ if (options.video) {
5364
5371
  code: 'INVALID_ARGUMENT'
5365
5372
  });
5366
5373
  }
5367
- if ((options.wan3TaskType === 'edit' || options.wan3TaskType === 'extend') && looseVideos === 0) {
5368
- fatalCliError(`Wan 3 ${options.wan3TaskType} requires --ref-video.`, {
5369
- code: 'INVALID_ARGUMENT'
5370
- });
5371
- }
5372
- if (options.wan3TaskType === 'extend' && options.wan3Ratio !== 'adaptive') {
5373
- fatalCliError('Wan 3 extension requires --wan3-ratio adaptive.', {
5374
- code: 'INVALID_ARGUMENT'
5375
- });
5376
- }
5377
-
5378
5374
  if (options.refImageEnd && !options.refImage) {
5379
5375
  fatalCliError('Wan 3 last-frame generation requires --ref as the first-frame image.', { code: 'INVALID_ARGUMENT' });
5380
5376
  }
5381
5377
  if (options.videoWorkflow === 't2v' && (hasFrameInputs || looseTotal > 0 || options.refImageEnd)) {
5382
- fatalCliError('Wan 3 t2v does not accept reference media; choose i2v, r2v, a2v, ia2v, or v2v.', { code: 'INVALID_ARGUMENT' });
5378
+ fatalCliError('Wan 3 t2v does not accept reference media; choose i2v, r2v, a2v, or ia2v.', { code: 'INVALID_ARGUMENT' });
5383
5379
  }
5384
5380
  if (options.videoWorkflow === 'i2v') {
5385
5381
  if (!options.refImage) {
@@ -5413,14 +5409,6 @@ if (options.video) {
5413
5409
  fatalCliError('Wan 3 a2v accepts audio references only; use ia2v or r2v for multimodal input.', { code: 'INVALID_ARGUMENT' });
5414
5410
  }
5415
5411
  }
5416
- if (options.videoWorkflow === 'v2v') {
5417
- if (looseVideos === 0) {
5418
- fatalCliError('Wan 3 v2v requires --ref-video.', { code: 'INVALID_ARGUMENT' });
5419
- }
5420
- if (options.refImageEnd) {
5421
- fatalCliError('Wan 3 v2v uses loose references and does not accept --ref-end.', { code: 'INVALID_ARGUMENT' });
5422
- }
5423
- }
5424
5412
  enforceWan3ReferenceCaps({ images: looseImages, videos: looseVideos, audios: looseAudios });
5425
5413
  } else if (options.videoWorkflow === 't2v') {
5426
5414
  if (!isSeedanceVideo && (
@@ -5705,6 +5693,12 @@ if (options.video) {
5705
5693
  applyVideoPromptGuardrails();
5706
5694
 
5707
5695
  if (options.video && isWan3ModelLocal(options.model) && options.fps !== 30) {
5696
+ if (cliSet.fps) {
5697
+ fatalCliError('Wan 3 output is fixed at 30 fps; omit --fps or pass --fps 30.', {
5698
+ code: 'INVALID_ARGUMENT',
5699
+ details: { fps: options.fps }
5700
+ });
5701
+ }
5708
5702
  const originalFps = options.fps;
5709
5703
  options.fps = 30;
5710
5704
  if (!options.quiet) {
@@ -5728,6 +5722,15 @@ if (options.video && isWan3ModelLocal(options.model) && options.wan3SmartDuratio
5728
5722
  if (options.video && !options.frames) {
5729
5723
  const durationLimits = videoDurationLimitsLikeWrapper(options.model);
5730
5724
  const requestedDuration = options.duration;
5725
+ if (
5726
+ isWan3ModelLocal(options.model) &&
5727
+ (!Number.isInteger(options.duration) || options.duration < 2 || options.duration > 30)
5728
+ ) {
5729
+ fatalCliError('Wan 3 duration must be a whole number from 2 through 30 seconds.', {
5730
+ code: 'INVALID_ARGUMENT',
5731
+ details: { duration: options.duration }
5732
+ });
5733
+ }
5731
5734
  let clampedDuration = Math.max(durationLimits.min, Math.min(durationLimits.max, options.duration));
5732
5735
  if (isWan3ModelLocal(options.model)) {
5733
5736
  clampedDuration = Math.round(clampedDuration);
@@ -8912,6 +8915,114 @@ async function probeLocalMediaDurationSeconds(pathOrUrl) {
8912
8915
  return Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined;
8913
8916
  }
8914
8917
 
8918
+ async function probeMediaBufferDurationSeconds(buffer, filename) {
8919
+ const ffprobePath = getEnv('FFPROBE_PATH') || 'ffprobe';
8920
+ sanitizePath(ffprobePath, 'FFPROBE_PATH');
8921
+ const tempDir = createTrackedTempDir('sogni-wan3-probe-');
8922
+ const inputPath = mediaTempInputPath(tempDir, filename, '.media');
8923
+ try {
8924
+ writeFileSync(inputPath, Buffer.from(buffer));
8925
+ const result = await runCommand(ffprobePath, [
8926
+ '-v', 'error',
8927
+ '-show_entries', 'format=duration',
8928
+ '-of', 'default=noprint_wrappers=1:nokey=1',
8929
+ inputPath,
8930
+ ], { captureOutput: true });
8931
+ if (result.error || result.status !== 0) return undefined;
8932
+ const parsed = Number(String(result.stdout || '').trim());
8933
+ return Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined;
8934
+ } finally {
8935
+ try { if (existsSync(inputPath)) unlinkSync(inputPath); } catch {}
8936
+ try { rmdirSync(tempDir); } catch {}
8937
+ }
8938
+ }
8939
+
8940
+ function wan3ReferenceMediaKey(kind, source) {
8941
+ return `${kind}:${source}`;
8942
+ }
8943
+
8944
+ async function inspectWan3ReferenceMedia(source, kind) {
8945
+ const key = wan3ReferenceMediaKey(kind, source);
8946
+ const cached = wan3ReferenceMediaCache.get(key);
8947
+ if (cached) return cached;
8948
+ const buffer = await fetchMediaBuffer(source);
8949
+ const filename = mediaFilenameFromSource(source, `wan3-reference-${kind}`);
8950
+ const duration = await probeLocalMediaDurationSeconds(source)
8951
+ ?? await probeMediaBufferDurationSeconds(buffer, filename);
8952
+ if (!Number.isFinite(duration)) {
8953
+ const error = new Error(`Unable to read the duration of Wan 3 ${kind} reference "${source}".`);
8954
+ error.code = 'WAN3_REFERENCE_DURATION_UNAVAILABLE';
8955
+ error.hint = 'Install ffprobe and provide a playable local file or reachable URL; Wan 3 reference duration limits cannot be enforced safely without probing.';
8956
+ throw error;
8957
+ }
8958
+ const inspected = { buffer, filename, duration };
8959
+ wan3ReferenceMediaCache.set(key, inspected);
8960
+ return inspected;
8961
+ }
8962
+
8963
+ async function prepareWan3ReferenceMediaPlan() {
8964
+ const audioSources = [options.refAudio, ...options.refAudios].filter(Boolean);
8965
+ const videoSources = [options.refVideo, ...options.refVideos].filter(Boolean);
8966
+ const audioMedia = await Promise.all(audioSources.map(source => inspectWan3ReferenceMedia(source, 'audio')));
8967
+ const videoMedia = await Promise.all(videoSources.map(source => inspectWan3ReferenceMedia(source, 'video')));
8968
+ const audioDurations = audioMedia.map(media => media.duration);
8969
+ const videoDurations = videoMedia.map(media => media.duration);
8970
+ const fixedOutputDuration = options.frames ? (options.frames - 1) / 30 : options.duration;
8971
+
8972
+ if (audioMedia.length > 0 && (options.audioStart !== null || options.audioDuration !== null)) {
8973
+ const start = options.audioStart ?? 0;
8974
+ const available = audioMedia[0].duration - start;
8975
+ const duration = options.audioDuration ?? Math.min(15, available);
8976
+ if (start < 0 || available < 1 || duration < 1 || duration > 15 || duration > available + 0.05) {
8977
+ fatalCliError('Wan 3 selected audio window must be 1-15 seconds and fit inside the first reference clip.', {
8978
+ code: 'INVALID_ARGUMENT',
8979
+ details: { start, duration, sourceDuration: audioMedia[0].duration }
8980
+ });
8981
+ }
8982
+ audioDurations[0] = duration;
8983
+ wan3ReferencePreparationPlan.set(wan3ReferenceMediaKey('audio', audioSources[0]), { start, duration });
8984
+ }
8985
+
8986
+ const otherVideoDuration = videoDurations.slice(1).reduce((sum, duration) => sum + duration, 0);
8987
+ if (videoMedia.length > 0 && options.videoStart !== null) {
8988
+ const start = options.videoStart;
8989
+ const available = videoMedia[0].duration - start;
8990
+ const outputBudget = options.wan3SmartDuration ? 15 : 30 - fixedOutputDuration;
8991
+ const duration = Math.min(available, 15 - otherVideoDuration, outputBudget - otherVideoDuration);
8992
+ if (start < 0 || available < 1 || duration < 1) {
8993
+ fatalCliError('Wan 3 could not form a valid 1-15 second source window at --video-start within the reference and output-duration limits.', {
8994
+ code: 'INVALID_ARGUMENT',
8995
+ details: { start, sourceDuration: videoMedia[0].duration, outputDuration: options.wan3SmartDuration ? 'smart' : fixedOutputDuration }
8996
+ });
8997
+ }
8998
+ videoDurations[0] = duration;
8999
+ wan3ReferencePreparationPlan.set(wan3ReferenceMediaKey('video', videoSources[0]), { start, duration });
9000
+ }
9001
+
9002
+ const invalidAudio = audioDurations.find(duration => duration < 1 || duration > 15.05);
9003
+ const invalidVideo = videoDurations.find(duration => duration < 1 || duration > 15.05);
9004
+ const totalAudioDuration = audioDurations.reduce((sum, duration) => sum + duration, 0);
9005
+ const totalVideoDuration = videoDurations.reduce((sum, duration) => sum + duration, 0);
9006
+ if (invalidAudio !== undefined || totalAudioDuration > 15.05) {
9007
+ fatalCliError('Wan 3 audio references must each be 1-15 seconds and total no more than 15 seconds. No audio was trimmed automatically.', {
9008
+ code: 'INVALID_ARGUMENT',
9009
+ details: { durations: audioDurations, totalDuration: totalAudioDuration }
9010
+ });
9011
+ }
9012
+ if (invalidVideo !== undefined || totalVideoDuration > 15.05) {
9013
+ fatalCliError('Wan 3 video references must each be 1-15 seconds and total no more than 15 seconds. Use --video-start to select an explicit source window; no video was trimmed automatically.', {
9014
+ code: 'INVALID_ARGUMENT',
9015
+ details: { durations: videoDurations, totalDuration: totalVideoDuration }
9016
+ });
9017
+ }
9018
+ if (!options.wan3SmartDuration && totalVideoDuration + fixedOutputDuration > 30.05) {
9019
+ fatalCliError('Wan 3 reference-video duration plus output duration must not exceed 30 seconds. Use --video-start to select a source window or request a shorter output.', {
9020
+ code: 'INVALID_ARGUMENT',
9021
+ details: { referenceVideoDuration: totalVideoDuration, outputDuration: fixedOutputDuration }
9022
+ });
9023
+ }
9024
+ }
9025
+
8915
9026
  async function transcodeSeedanceReferenceAudioToMp3(request) {
8916
9027
  const ffmpegPath = await ensureFfmpegAvailable();
8917
9028
  const tempDir = createTrackedTempDir('sogni-seedance-audio-');
@@ -9104,42 +9215,62 @@ async function uploadSeedanceReferenceVideoUrl(pathOrUrl, apiKey, index = 0) {
9104
9215
  return uploaded.url;
9105
9216
  }
9106
9217
 
9107
- async function uploadWan3ReferenceAudioUrl(pathOrUrl, apiKey, index, maxDurationSeconds) {
9218
+ async function uploadWan3ReferenceAudioUrl(pathOrUrl, apiKey, index) {
9108
9219
  const ref = { flag: '--ref-audio', value: pathOrUrl, kind: 'audio' };
9109
- const buffer = await fetchMediaBuffer(pathOrUrl);
9110
- const filename = mediaFilenameFromSource(pathOrUrl, 'wan3-reference-audio');
9111
- const prepared = await trimSeedanceReferenceAudioToMp3({
9112
- data: buffer,
9113
- filename,
9114
- start: index === 0 ? options.audioStart ?? 0 : 0,
9115
- duration: maxDurationSeconds,
9116
- });
9220
+ const inspected = await inspectWan3ReferenceMedia(pathOrUrl, 'audio');
9221
+ const rawMimeType = mimeTypeForPath(pathOrUrl, 'application/octet-stream');
9222
+ const mimeType = normalizeReferenceAudioMimeType(rawMimeType) || rawMimeType;
9223
+ const sourceFormat = detectReferenceAudioFormat(inspected.buffer, mimeType);
9224
+ const plan = wan3ReferencePreparationPlan.get(wan3ReferenceMediaKey('audio', pathOrUrl));
9225
+ const prepared = plan
9226
+ ? await trimSeedanceReferenceAudioToMp3({
9227
+ data: inspected.buffer,
9228
+ filename: inspected.filename,
9229
+ inputMimeType: mimeType,
9230
+ sourceFormat,
9231
+ start: plan.start,
9232
+ duration: plan.duration,
9233
+ })
9234
+ : sourceFormat === 'mp3'
9235
+ ? { data: inspected.buffer, mimeType: 'audio/mpeg' }
9236
+ : await transcodeSeedanceReferenceAudioToMp3({
9237
+ data: inspected.buffer,
9238
+ filename: inspected.filename,
9239
+ inputMimeType: mimeType,
9240
+ sourceFormat,
9241
+ });
9117
9242
  const data = Buffer.from(prepared.data);
9118
9243
  const uploaded = await uploadPreparedApiMediaReferenceV2(ref, index, apiKey, {
9119
9244
  buffer: data,
9120
- filename: withMediaExtension(filename, 'mp3'),
9245
+ filename: withMediaExtension(inspected.filename, 'mp3'),
9121
9246
  byteLength: data.length,
9122
9247
  mimeType: 'audio/mpeg',
9123
9248
  });
9124
9249
  return uploaded.url;
9125
9250
  }
9126
9251
 
9127
- async function uploadWan3ReferenceVideoUrl(pathOrUrl, apiKey, index, maxDurationSeconds) {
9252
+ async function uploadWan3ReferenceVideoUrl(pathOrUrl, apiKey, index) {
9128
9253
  const ref = { flag: '--ref-video', value: pathOrUrl, kind: 'video' };
9129
- const buffer = await fetchMediaBuffer(pathOrUrl);
9130
- const filename = mediaFilenameFromSource(pathOrUrl, 'wan3-reference-video.mp4');
9131
- const prepared = await trimSeedanceV2VSourceVideo({
9132
- data: buffer,
9133
- filename,
9134
- start: index === 0 ? options.videoStart ?? 0 : 0,
9135
- duration: maxDurationSeconds,
9136
- });
9254
+ const inspected = await inspectWan3ReferenceMedia(pathOrUrl, 'video');
9255
+ const plan = wan3ReferencePreparationPlan.get(wan3ReferenceMediaKey('video', pathOrUrl));
9256
+ const prepared = plan
9257
+ ? await trimSeedanceV2VSourceVideo({
9258
+ data: inspected.buffer,
9259
+ filename: inspected.filename,
9260
+ start: plan.start,
9261
+ duration: plan.duration,
9262
+ })
9263
+ : { data: inspected.buffer, mimeType: mimeTypeForPath(pathOrUrl, 'video/mp4') };
9137
9264
  const data = Buffer.from(prepared.data);
9265
+ const outputMimeType = prepared.mimeType || 'video/mp4';
9138
9266
  const uploaded = await uploadPreparedApiMediaReferenceV2(ref, index, apiKey, {
9139
9267
  buffer: data,
9140
- filename: withMediaExtension(filename, 'mp4'),
9268
+ filename: withMediaExtension(
9269
+ inspected.filename,
9270
+ plan ? 'mp4' : extensionForApiMediaReference(outputMimeType, 'video'),
9271
+ ),
9141
9272
  byteLength: data.length,
9142
- mimeType: 'video/mp4',
9273
+ mimeType: outputMimeType,
9143
9274
  });
9144
9275
  return uploaded.url;
9145
9276
  }
@@ -11211,6 +11342,10 @@ async function main() {
11211
11342
  let client = null;
11212
11343
 
11213
11344
  try {
11345
+ if (options.video && isWan3ModelLocal(options.model)) {
11346
+ await prepareWan3ReferenceMediaPlan();
11347
+ }
11348
+
11214
11349
  if (options.showVersion) {
11215
11350
  if (options.json) {
11216
11351
  console.log(JSON.stringify({
@@ -11945,12 +12080,10 @@ async function main() {
11945
12080
  let projectVideoStart = options.videoStart;
11946
12081
  let useRefAudioUrl = false;
11947
12082
  if (isWan3Video && options.refAudio) {
11948
- const audioCount = 1 + options.refAudios.length;
11949
12083
  seedanceReferenceAudioUrls.push(await uploadWan3ReferenceAudioUrl(
11950
12084
  options.refAudio,
11951
12085
  creds.SOGNI_API_KEY,
11952
12086
  0,
11953
- 15 / audioCount,
11954
12087
  ));
11955
12088
  useRefAudioUrl = true;
11956
12089
  } else if (isSeedanceVideo && options.refAudio) {
@@ -11973,16 +12106,10 @@ async function main() {
11973
12106
  }
11974
12107
  let useRefVideoUrl = false;
11975
12108
  if (isWan3Video && options.refVideo) {
11976
- const videoCount = 1 + options.refVideos.length;
11977
- const wan3OutputDuration = options.wan3SmartDuration
11978
- ? 15
11979
- : options.frames ? (options.frames - 1) / 30 : options.duration;
11980
- const videoDurationBudget = Math.min(15, 30 - wan3OutputDuration) / videoCount;
11981
12109
  seedanceReferenceVideoUrls.push(await uploadWan3ReferenceVideoUrl(
11982
12110
  options.refVideo,
11983
12111
  creds.SOGNI_API_KEY,
11984
12112
  0,
11985
- videoDurationBudget,
11986
12113
  ));
11987
12114
  useRefVideoUrl = true;
11988
12115
  projectVideoStart = null;
@@ -12025,17 +12152,15 @@ async function main() {
12025
12152
  }
12026
12153
  }
12027
12154
  // Loose extras: Seedance forwards compatible HTTPS assets; Wan 3 uploads
12028
- // and bounds every asset so total vendor duration caps are respected.
12155
+ // the already-probed assets without silently dividing or trimming them.
12029
12156
  // HappyHorse takes no reference audio or video.
12030
12157
  if (isSeedanceVideo || isWan3Video) {
12031
12158
  for (const [extraAudioIndex, extraAudio] of options.refAudios.entries()) {
12032
12159
  if (isWan3Video) {
12033
- const audioCount = (options.refAudio ? 1 : 0) + options.refAudios.length;
12034
12160
  seedanceReferenceAudioUrls.push(await uploadWan3ReferenceAudioUrl(
12035
12161
  extraAudio,
12036
12162
  creds.SOGNI_API_KEY,
12037
12163
  extraAudioIndex + (options.refAudio ? 1 : 0),
12038
- 15 / audioCount,
12039
12164
  ));
12040
12165
  continue;
12041
12166
  }
@@ -12064,16 +12189,10 @@ async function main() {
12064
12189
  }
12065
12190
  for (const [extraVideoIndex, extraVideo] of options.refVideos.entries()) {
12066
12191
  if (isWan3Video) {
12067
- const videoCount = (options.refVideo ? 1 : 0) + options.refVideos.length;
12068
- const wan3OutputDuration = options.wan3SmartDuration
12069
- ? 15
12070
- : options.frames ? (options.frames - 1) / 30 : options.duration;
12071
- const videoDurationBudget = Math.min(15, 30 - wan3OutputDuration) / videoCount;
12072
12192
  seedanceReferenceVideoUrls.push(await uploadWan3ReferenceVideoUrl(
12073
12193
  extraVideo,
12074
12194
  creds.SOGNI_API_KEY,
12075
12195
  extraVideoIndex + (options.refVideo ? 1 : 0),
12076
- videoDurationBudget,
12077
12196
  ));
12078
12197
  continue;
12079
12198
  }
@@ -12299,8 +12418,7 @@ async function main() {
12299
12418
  projectConfig.seedanceTaskType = options.seedanceTaskType;
12300
12419
  }
12301
12420
  if (isWan3Video) {
12302
- projectConfig.ratio = options.wan3TaskType === 'extend' ? 'adaptive' : options.wan3Ratio;
12303
- projectConfig.wan3TaskType = options.wan3TaskType;
12421
+ projectConfig.ratio = options.wan3Ratio;
12304
12422
  projectConfig.generateAudio = options.apiGenerateAudio ?? true;
12305
12423
  projectConfig.promptExtend = options.apiExpandPrompt ?? true;
12306
12424
  projectConfig.watermark = options.wan3Watermark;
@@ -12312,10 +12430,16 @@ async function main() {
12312
12430
  if (options.outputFormat) {
12313
12431
  projectConfig.outputFormat = options.outputFormat;
12314
12432
  }
12315
- // Skip the wrapper's generic resize only for the proven no-op case: an
12316
- // implicit LTX canvas already equals the compatible local reference.
12317
- // Explicit canvases and incompatible references retain wrapper handling.
12318
- if (options.autoResizeVideoAssets !== null) {
12433
+ // Loose R2V references describe identity, style, motion, or other context;
12434
+ // they are never frame anchors and must not redefine the output canvas.
12435
+ // Older wrapper releases only misclassify the binary referenceImage path;
12436
+ // URL-array references are already ignored and must retain normal dimension
12437
+ // validation, so keep this compatibility guard as narrow as possible.
12438
+ const hasLooseBinaryReference = Boolean(projectConfig.referenceImage)
12439
+ && (options.videoWorkflow === 'r2v' || options.seedanceTaskType === 'reference');
12440
+ if (hasLooseBinaryReference) {
12441
+ projectConfig.autoResizeVideoAssets = false;
12442
+ } else if (options.autoResizeVideoAssets !== null) {
12319
12443
  projectConfig.autoResizeVideoAssets = options.autoResizeVideoAssets;
12320
12444
  } else if (options._ltxReferencePassthrough) {
12321
12445
  projectConfig.autoResizeVideoAssets = false;
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.35.0';
1
+ export const PACKAGE_VERSION = '3.35.2';