@sogni-ai/sogni-creative-agent-skill 3.32.0 → 3.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.32.0"
6
+ version: "3.33.0"
7
7
  author: Sogni AI
8
8
  hermes:
9
9
  category: creative
@@ -93,6 +93,9 @@ sogni-agent-hermes --help
93
93
  one render: read [krea2-loras.md](references/krea2-loras.md).
94
94
  - Video prompts, reference roles, LTX, WAN, MiniMax, Seedance, and HappyHorse:
95
95
  read [video-prompting.md](references/video-prompting.md).
96
+ - Prompt-only image deliverables for SD/SDXL, FLUX/Chroma, Krea 2, Qwen,
97
+ Z-Image, GPT Image, and model-specific editing: read
98
+ [image-prompting.md](references/image-prompting.md).
96
99
  - Local video cutting, stitching, overlays, subtitles, audio remixing, and
97
100
  verification: read [video-editing.md](references/video-editing.md).
98
101
  - Saved identities, reusable assets, memory, and personality: read
@@ -178,7 +178,7 @@ When `--video -m seedance2`, `-m seedance2-mini`, `-m seedance2-fast`, or
178
178
  just to attach a local loose-reference image. The 2.0 family supports up to
179
179
  9 image refs, 3 video refs, 3 audio refs, and 12 total reference assets per
180
180
  request; `seedance2-5` raises the caps to 30 image / 10 video / 10 audio /
181
- 30 total (canonical per-model caps come from `SEEDANCE_REFERENCE_LIMITS` /
181
+ 50 total (canonical per-model caps come from `SEEDANCE_REFERENCE_LIMITS` /
182
182
  `validateSeedanceReferenceCounts()` in
183
183
  `@sogni-ai/sogni-intelligence-client/tools`).
184
184
 
@@ -0,0 +1,61 @@
1
+ # Image Prompt Authoring Guide
2
+
3
+ Use this guide only when the creator asks for prompt text as the deliverable. A
4
+ prompt-only request does not authorize a render. Require both the exact target
5
+ model/version and the operation (`generate` or `edit`). If either is missing,
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.
8
+
9
+ ## Output contracts by family
10
+
11
+ | Target family | Native prompt shape | Output envelope |
12
+ | --- | --- | --- |
13
+ | SD 1.5 | Weighted or comma-separated tags; quality/medium, subject, environment, lighting/camera | `positive_prompt:` plus `negative_prompt:` |
14
+ | SDXL | Hybrid natural language plus selective comma-separated style/quality terms; Pony variants start with their score tags | `positive_prompt:` plus `negative_prompt:` |
15
+ | FLUX / Chroma | One coherent natural-language visual description; exact visible text in quotes; no SD score/tag soup | Prompt text only; FLUX.2 has no negative-prompt field |
16
+ | Krea 2 / Krea 2 Turbo | Dense, fluent rich caption emphasizing observable composition, palette, light, texture, and atmosphere; no SD weighting syntax | Prompt text only |
17
+ | Qwen Image 2512 | Detailed natural-language description with explicit spatial relationships and exact quoted typography | `positive_prompt:` plus `negative_prompt:` |
18
+ | Z-Image | Compact instruction-aware natural-language caption | Foundation model: positive plus negative; Turbo: prompt text only |
19
+ | GPT Image 2 | Direct natural-language creative direction with explicit layout, hierarchy, and exact quoted copy | Prompt text only |
20
+ | Qwen / Krea / FLUX / GPT edits | A direct delta instruction: what changes, what remains fixed, and the ordered role of each reference | Prompt text only |
21
+
22
+ The two-field envelope is exact: return two non-empty single lines in this
23
+ order and nothing else:
24
+
25
+ ```text
26
+ positive_prompt: <model-ready positive prompt>
27
+ negative_prompt: <model-native exclusions and relevant failure modes>
28
+ ```
29
+
30
+ Prompt-only families return the directly runnable prompt with no label,
31
+ Markdown fence, preamble, explanation, or render offer.
32
+
33
+ ## Selector and operation discipline
34
+
35
+ - Treat a model selector as an exact capability declaration, not a name to
36
+ fuzzy-match into a convenient family. Every selector exposed by
37
+ `generate_image` and `edit_image` must resolve in the shared registry.
38
+ - A family can have different operation profiles. `flux2` and
39
+ `gpt-image-2` support registered generation and edit contracts. A
40
+ generation-only selector such as `flux1-krea` or `krea-2-turbo` must not
41
+ silently accept an edit request.
42
+ - Use `qwen` / `qwen-lightning` as edit selectors and
43
+ `qwen-2512` / `qwen-2512-lightning` as generation selectors.
44
+ - Use `krea-identity-edit` or
45
+ `dark-beast-krea2-identity-edit` for Krea identity edits. Assign
46
+ `context_image_0` as the base and `context_image_1` as the secondary
47
+ identity/outfit/pose/style reference when two inputs are requested.
48
+ - Preserve the creator's subjects, actions, spatial relationships, exact
49
+ visible copy, proper nouns, style, and constraints. Add supporting visual
50
+ detail without inventing extra objects, labels, slogans, characters, or
51
+ story events.
52
+ - Model capability selection comes from typed model and operation metadata.
53
+ Never infer it from sentence-shape regexes or a list of creative keywords.
54
+
55
+ Primary references: [FLUX prompting](https://docs.bfl.ai/guides/prompting_unified_basics),
56
+ [Krea 2 technical report](https://www.krea.ai/blog/krea-2-technical-report),
57
+ [Qwen Image 2512](https://huggingface.co/Qwen/Qwen-Image-2512),
58
+ [Qwen Image Edit 2511](https://huggingface.co/Qwen/Qwen-Image-Edit-2511),
59
+ [Z-Image Turbo](https://huggingface.co/Tongyi-MAI/Z-Image-Turbo), and
60
+ [Stability API](https://platform.stability.ai/docs/api-reference).
61
+
@@ -260,7 +260,8 @@ no negative prompt and no ControlNet.
260
260
  (`seedance2-5-ia2v`), and multimodal reference / video-to-video including
261
261
  video editing and extension (`seedance2-5-v2v`).
262
262
  - **Reference budget**: up to 30 image / 10 video / 10 standalone audio refs,
263
- 30 reference files total — much larger than the 2.0 family's 9 / 3 / 3 / 12.
263
+ 50 reference files total across those per-modality caps — much larger than
264
+ the 2.0 family's 9 / 3 / 3 / 12.
264
265
  Per-model caps come from `@sogni-ai/sogni-protocol`'s
265
266
  `seedance-reference-limits` catalog.
266
267
  - **Prompting**: the same `@Image1` / `@Video1` / `@Audio1` loose-reference
@@ -12,6 +12,16 @@ tags, and mode-specific alignment preamble. Do not carry LTX's
12
12
  single-paragraph, positive-only, no-markup rule into an H3 prompt. Pick the
13
13
  section that matches the model you are about to invoke.
14
14
 
15
+ If the creator asks only for a prompt, the requested text is the final
16
+ deliverable: author it in the selected model's native shape without invoking
17
+ the CLI or hosted API. A request to generate/write a prompt does not authorize
18
+ media generation. A compound request that also asks to render or make the
19
+ video now does authorize execution after the prompt is shaped. This applies to
20
+ every video model and workflow, not only the families documented below. The
21
+ target model and mode are required. If either is omitted, ask for it. If that
22
+ exact model/mode has no validated native contract, say so and request the exact
23
+ specification; never substitute a generic prompt or another model's syntax.
24
+
15
25
  ## LTX-2.x Prompt Rule
16
26
 
17
27
  Whenever the chosen video model is LTX-2.5 (or an LTX-2.3 rollback model), do
@@ -86,6 +96,12 @@ not substitute an unstructured prompt for the required fields. The field names,
86
96
  order, shot notation, alignment preamble, reference labels, and dialogue markup
87
97
  are part of the model contract.
88
98
 
99
+ For prompt-only authoring, return only the applicable ordered-field document.
100
+ Do not wrap it in Markdown, add a title or preamble, append generic prompting
101
+ tips, explain the format, offer to generate the video, or ask a follow-up
102
+ question after the contract. Those additions make the text invalid as direct
103
+ H3 input.
104
+
89
105
  Applies to standard `minimax-h3` / `minimax-h3-t2v`, `minimax-h3-i2v`, and
90
106
  `minimax-h3-flf2v`; their 4-step `minimax-h3-turbo`,
91
107
  `minimax-h3-i2v-turbo`, and `minimax-h3-flf2v-turbo` variants; and—with its own
@@ -418,6 +434,14 @@ sogni-agent -q --video -m minimax-h3-flf2v-turbo --ref ./first.png --ref-end ./l
418
434
  sogni-agent -q --video -m minimax-h3-r2v --ref ./identity.png -c ./wardrobe.png --ref-video ./motion.mp4 --ref-audio ./voice.m4a --duration 8 -w 1344 -h 768 -o ./video.mp4 "<six-field Ref2VA prompt>"
419
435
  ```
420
436
 
437
+ When local primary `--ref-audio` is combined with `--audio-start` and/or
438
+ `--audio-duration` on MiniMax H3 R2V, the CLI prepares and physically trims the
439
+ audio window before upload. The worker receives only that window, and the CLI
440
+ does not forward redundant `audioStart` / `audioDuration` project fields. This
441
+ avoids worker failures on long source files and makes the attached `<Audio 1>`
442
+ the exact waveform-conditioned lip-sync input. Remote audio URLs and additional
443
+ audio references keep their existing handling.
444
+
421
445
  ## High-Res Video Routing
422
446
 
423
447
  When the user asks for video in **"hd"**, **"1080p"**, **"4k"**, **"uhd"**, or **"high-res"**, do not use the default WAN video models.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.32.0",
3
+ "version": "3.33.0",
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.32.0",
3
+ "version": "3.33.0",
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,18 @@
1
+ # [3.33.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.32.0...v3.33.0) (2026-08-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** align model-native prompt runtime packages ([a013381](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/a013381c62e87158070d0a238d4908ceabc60f05))
7
+ * **video:** keep H3 references on the valid grid ([cd5c0f1](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/cd5c0f187fd175291de8e2a2bee7559fdf35dd94))
8
+ * **video:** pretrim H3 R2V audio windows ([#31](https://github.com/Sogni-AI/sogni-creative-agent-skill/issues/31)) ([1447ef5](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/1447ef5f7314c5f11d9f2ae8648dddccfef3a90d))
9
+ * **video:** quote H3 R2V reference images ([d9f20e9](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/d9f20e958f1147fe3f58ca4093ad4c84aa9844c3))
10
+
11
+
12
+ ### Features
13
+
14
+ * **prompts:** document model-native authoring ([9cab39c](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/9cab39cc05f62e1788f807e656fed99d75913977))
15
+
1
16
  # [3.32.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.31.0...v3.32.0) (2026-08-19)
2
17
 
3
18
 
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.32.0"
5
+ version: "3.33.0"
6
6
  homepage: https://sogni.ai
7
7
  openclaw:
8
8
  emoji: "🎨"
@@ -272,6 +272,12 @@ sogni-agent -c photo.jpg -m qwen_image_edit_2511_fp8 "turn this into anime style
272
272
  - For Krea 2 style/control LoRAs, use the base text-to-image model `-m krea2_turbo_fp8_scaled` with repeatable ordered `--lora <id> --lora-strength <n>` arguments (or comma-separated `--loras` / `--lora-strengths`). Up to 8 LoRAs may be stacked. Order matters, strengths are positional, omitted strengths default to 1, and many Krea 2 LoRAs are bipolar sliders whose negative values apply the inverse effect. Do not clamp them to 0-2. The first use of an uncached LoRA may pause while the worker downloads it. All 25 published Krea 2 LoRAs work on every Krea 2 based model, including the identity-edit and Dark Beast variants, so a context edit with `-m krea2_identity_edit_v1_2 -c` can stack LoRAs to shift age, build, skin, or lighting while the identity LoRA holds the likeness. Never combine a negative `krea2-age` with `krea2-mystic-x` or `krea2-realism-engine`; the platform rejects that outright. Read [`references/krea2-loras.md`](./references/krea2-loras.md) for the IDs and per-LoRA ranges, and run `--list-loras` / `--search-loras` for the live catalog before relying on an exact range.
273
273
  - Do not route to `--photobooth` merely because the user asks to preserve a face in a style edit — face-preserving full-image edits use `-c` with Krea 2 Identity Edit by the semantic rule above. The bare CLI still defaults context edits without `-m` to `qwen_image_edit_2511_fp8_lightning`, so agents must pass the Krea model explicitly for identity-sensitive edits. Select `-m gpt-image-2` for up to 16 reference images and OpenAI-backed editing (Qwen supports up to 3; Krea identity edit supports up to 2).
274
274
 
275
+ ### Prompt-only model authoring
276
+
277
+ When the creator asks only to write, draft, return, or generate a prompt for **any image or video model/workflow**, the prompt text is the final deliverable. Require the named model/version and operation, apply its registered model-native contract, and return only the directly runnable prompt. Do not invoke the CLI, hosted API, or any media-generation tool; do not add a Markdown fence, preamble, generic tips, explanation, render offer, or follow-up question after a completed prompt. If the target is omitted, ask which model to tune for. If the model/version/operation has no validated contract, say so and ask for the exact target; never substitute a generic prompt or another model's format. If the same request also asks to render the media now, that execution request wins and the shaped prompt becomes the generation input.
278
+
279
+ For image prompt-only requests, **read [`references/image-prompting.md`](./references/image-prompting.md)** before writing. SD 1.5, SDXL/Pony, FLUX/Chroma, Krea 2, Qwen Image, Z-Image, GPT Image, and their edit operations do not share one prompt syntax or output envelope.
280
+
275
281
  ### LTX video prompts
276
282
 
277
283
  Whenever the chosen video model is in the LTX family (including the default t2v), **do not pass the user's short request through unchanged**. Rewrite it into one unbroken paragraph of 4-8 flowing present-tense sentences describing a single continuous shot — concrete subjects, named light sources, one action thread, dialogue embedded in double quotes with the speaker identified, positive phrasing only, no headers/bullets/negative-prompts. **Read [`references/video-prompting.md`](./references/video-prompting.md) for the full rule, duration pacing, orientation mapping, and camera-language normalization before writing the prompt.**
@@ -290,6 +296,8 @@ H3 r2v accepts up to **9 images** (`--ref` then repeatable `-c`), **3 videos** (
290
296
 
291
297
  **H3 requires MiniMax's official ordered-field prompt contract.** Base and Turbo T2V/I2V/FLF2V use `integrated_multimodal_description`, `overall_soundscape`, then `non_diegetic_music`, with the mode-specific alignment preamble for I2V or FLF2V. Use `[Shot N]` notation, stable `(S1)` speaker IDs, and exact dialogue as `<d>[Language] words</d>`; do not substitute quoted prose or bracketed timecode lists. Ref2VA uses its separate six-field contract. Negative direction belongs inside the structured prompt because there is no negative-prompt field. Read [`references/video-prompting.md`](./references/video-prompting.md) § MiniMax H3 Prompting before writing any H3 prompt.
292
298
 
299
+ For an H3 prompt-only request, the general prompt-authoring rule above requires returning only the applicable ordered-field contract. The fields themselves are the directly runnable deliverable; do not wrap them in commentary.
300
+
293
301
  For "4k" / "uhd" requests where the user accepts the Premium Spark vendor path or asks for Seedance/native audio/multimodal references, use full Seedance: `-m seedance2 --target-resolution 2160`. Do not use `seedance2-mini`, `seedance2-fast`, or `seedance2-5` for 4K; Mini and Fast remain capped to the 720p lower-resolution path, and Seedance 2.5 renders 480p/720p only. For "hd" / "1080p" requests, or when avoiding vendor models, use `-m ltx25` (text) or `-m ltx25-i2v` (image), prefer `-w 1920 -h 1088` (or the orientation mapping in the reference), and rewrite the prompt per the LTX rule. For bare "720p" without orientation, prefer `--target-resolution 768`.
294
302
 
295
303
  ### Video editing, stitching, 360 turnarounds
@@ -400,6 +408,7 @@ Eligible Sogni-hosted renders use Unlimited coverage when active; otherwise rend
400
408
 
401
409
  | Read this | When the task involves |
402
410
  |-----------|------------------------|
411
+ | [`references/image-prompting.md`](./references/image-prompting.md) | Writing prompt-only image deliverables for SD/SDXL/Pony, FLUX/Chroma, Krea 2, Qwen, Z-Image, GPT Image, or model-specific edit operations |
403
412
  | [`references/video-prompting.md`](./references/video-prompting.md) | Writing LTX video prompts; writing MiniMax H3 official ordered-field prompts, mode preambles, shot notation, speaker IDs, and dialogue tags; high-res/4K routing; orientation/aspect mapping; camera language |
404
413
  | [`references/private-mature-video.md`](./references/private-mature-video.md) | Mature-theme video model, LoRA, frame modes, and prompt tokens |
405
414
  | [`references/video-editing.md`](./references/video-editing.md) | Animate between images, continue/bridge videos, 360 turnarounds, concat, audio remix/layering, v2v ControlNet |
@@ -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.32.0",
5
+ "version": "3.33.0",
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,7 +2321,7 @@ 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 V2V transforms.\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 Seedance-fast 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.\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.",
@@ -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.32.0",
5
+ "version": "3.33.0",
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.32.0",
3
+ "version": "3.33.0",
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.19.0",
98
+ "@sogni-ai/sogni-intelligence-client": "3.22.0",
99
99
  "execa": "^9.6.1",
100
100
  "json5": "^2.2.3",
101
101
  "sharp": "^0.34.5"
102
102
  },
103
103
  "overrides": {
104
- "@sogni-ai/sogni-client": "5.17.0"
104
+ "@sogni-ai/sogni-client": "5.18.2"
105
105
  },
106
106
  "openclaw": {
107
107
  "extensions": [
@@ -178,7 +178,7 @@ When `--video -m seedance2`, `-m seedance2-mini`, `-m seedance2-fast`, or
178
178
  just to attach a local loose-reference image. The 2.0 family supports up to
179
179
  9 image refs, 3 video refs, 3 audio refs, and 12 total reference assets per
180
180
  request; `seedance2-5` raises the caps to 30 image / 10 video / 10 audio /
181
- 30 total (canonical per-model caps come from `SEEDANCE_REFERENCE_LIMITS` /
181
+ 50 total (canonical per-model caps come from `SEEDANCE_REFERENCE_LIMITS` /
182
182
  `validateSeedanceReferenceCounts()` in
183
183
  `@sogni-ai/sogni-intelligence-client/tools`).
184
184
 
@@ -0,0 +1,61 @@
1
+ # Image Prompt Authoring Guide
2
+
3
+ Use this guide only when the creator asks for prompt text as the deliverable. A
4
+ prompt-only request does not authorize a render. Require both the exact target
5
+ model/version and the operation (`generate` or `edit`). If either is missing,
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.
8
+
9
+ ## Output contracts by family
10
+
11
+ | Target family | Native prompt shape | Output envelope |
12
+ | --- | --- | --- |
13
+ | SD 1.5 | Weighted or comma-separated tags; quality/medium, subject, environment, lighting/camera | `positive_prompt:` plus `negative_prompt:` |
14
+ | SDXL | Hybrid natural language plus selective comma-separated style/quality terms; Pony variants start with their score tags | `positive_prompt:` plus `negative_prompt:` |
15
+ | FLUX / Chroma | One coherent natural-language visual description; exact visible text in quotes; no SD score/tag soup | Prompt text only; FLUX.2 has no negative-prompt field |
16
+ | Krea 2 / Krea 2 Turbo | Dense, fluent rich caption emphasizing observable composition, palette, light, texture, and atmosphere; no SD weighting syntax | Prompt text only |
17
+ | Qwen Image 2512 | Detailed natural-language description with explicit spatial relationships and exact quoted typography | `positive_prompt:` plus `negative_prompt:` |
18
+ | Z-Image | Compact instruction-aware natural-language caption | Foundation model: positive plus negative; Turbo: prompt text only |
19
+ | GPT Image 2 | Direct natural-language creative direction with explicit layout, hierarchy, and exact quoted copy | Prompt text only |
20
+ | Qwen / Krea / FLUX / GPT edits | A direct delta instruction: what changes, what remains fixed, and the ordered role of each reference | Prompt text only |
21
+
22
+ The two-field envelope is exact: return two non-empty single lines in this
23
+ order and nothing else:
24
+
25
+ ```text
26
+ positive_prompt: <model-ready positive prompt>
27
+ negative_prompt: <model-native exclusions and relevant failure modes>
28
+ ```
29
+
30
+ Prompt-only families return the directly runnable prompt with no label,
31
+ Markdown fence, preamble, explanation, or render offer.
32
+
33
+ ## Selector and operation discipline
34
+
35
+ - Treat a model selector as an exact capability declaration, not a name to
36
+ fuzzy-match into a convenient family. Every selector exposed by
37
+ `generate_image` and `edit_image` must resolve in the shared registry.
38
+ - A family can have different operation profiles. `flux2` and
39
+ `gpt-image-2` support registered generation and edit contracts. A
40
+ generation-only selector such as `flux1-krea` or `krea-2-turbo` must not
41
+ silently accept an edit request.
42
+ - Use `qwen` / `qwen-lightning` as edit selectors and
43
+ `qwen-2512` / `qwen-2512-lightning` as generation selectors.
44
+ - Use `krea-identity-edit` or
45
+ `dark-beast-krea2-identity-edit` for Krea identity edits. Assign
46
+ `context_image_0` as the base and `context_image_1` as the secondary
47
+ identity/outfit/pose/style reference when two inputs are requested.
48
+ - Preserve the creator's subjects, actions, spatial relationships, exact
49
+ visible copy, proper nouns, style, and constraints. Add supporting visual
50
+ detail without inventing extra objects, labels, slogans, characters, or
51
+ story events.
52
+ - Model capability selection comes from typed model and operation metadata.
53
+ Never infer it from sentence-shape regexes or a list of creative keywords.
54
+
55
+ Primary references: [FLUX prompting](https://docs.bfl.ai/guides/prompting_unified_basics),
56
+ [Krea 2 technical report](https://www.krea.ai/blog/krea-2-technical-report),
57
+ [Qwen Image 2512](https://huggingface.co/Qwen/Qwen-Image-2512),
58
+ [Qwen Image Edit 2511](https://huggingface.co/Qwen/Qwen-Image-Edit-2511),
59
+ [Z-Image Turbo](https://huggingface.co/Tongyi-MAI/Z-Image-Turbo), and
60
+ [Stability API](https://platform.stability.ai/docs/api-reference).
61
+
@@ -260,7 +260,8 @@ no negative prompt and no ControlNet.
260
260
  (`seedance2-5-ia2v`), and multimodal reference / video-to-video including
261
261
  video editing and extension (`seedance2-5-v2v`).
262
262
  - **Reference budget**: up to 30 image / 10 video / 10 standalone audio refs,
263
- 30 reference files total — much larger than the 2.0 family's 9 / 3 / 3 / 12.
263
+ 50 reference files total across those per-modality caps — much larger than
264
+ the 2.0 family's 9 / 3 / 3 / 12.
264
265
  Per-model caps come from `@sogni-ai/sogni-protocol`'s
265
266
  `seedance-reference-limits` catalog.
266
267
  - **Prompting**: the same `@Image1` / `@Video1` / `@Audio1` loose-reference
@@ -12,6 +12,16 @@ tags, and mode-specific alignment preamble. Do not carry LTX's
12
12
  single-paragraph, positive-only, no-markup rule into an H3 prompt. Pick the
13
13
  section that matches the model you are about to invoke.
14
14
 
15
+ If the creator asks only for a prompt, the requested text is the final
16
+ deliverable: author it in the selected model's native shape without invoking
17
+ the CLI or hosted API. A request to generate/write a prompt does not authorize
18
+ media generation. A compound request that also asks to render or make the
19
+ video now does authorize execution after the prompt is shaped. This applies to
20
+ every video model and workflow, not only the families documented below. The
21
+ target model and mode are required. If either is omitted, ask for it. If that
22
+ exact model/mode has no validated native contract, say so and request the exact
23
+ specification; never substitute a generic prompt or another model's syntax.
24
+
15
25
  ## LTX-2.x Prompt Rule
16
26
 
17
27
  Whenever the chosen video model is LTX-2.5 (or an LTX-2.3 rollback model), do
@@ -86,6 +96,12 @@ not substitute an unstructured prompt for the required fields. The field names,
86
96
  order, shot notation, alignment preamble, reference labels, and dialogue markup
87
97
  are part of the model contract.
88
98
 
99
+ For prompt-only authoring, return only the applicable ordered-field document.
100
+ Do not wrap it in Markdown, add a title or preamble, append generic prompting
101
+ tips, explain the format, offer to generate the video, or ask a follow-up
102
+ question after the contract. Those additions make the text invalid as direct
103
+ H3 input.
104
+
89
105
  Applies to standard `minimax-h3` / `minimax-h3-t2v`, `minimax-h3-i2v`, and
90
106
  `minimax-h3-flf2v`; their 4-step `minimax-h3-turbo`,
91
107
  `minimax-h3-i2v-turbo`, and `minimax-h3-flf2v-turbo` variants; and—with its own
@@ -418,6 +434,14 @@ sogni-agent -q --video -m minimax-h3-flf2v-turbo --ref ./first.png --ref-end ./l
418
434
  sogni-agent -q --video -m minimax-h3-r2v --ref ./identity.png -c ./wardrobe.png --ref-video ./motion.mp4 --ref-audio ./voice.m4a --duration 8 -w 1344 -h 768 -o ./video.mp4 "<six-field Ref2VA prompt>"
419
435
  ```
420
436
 
437
+ When local primary `--ref-audio` is combined with `--audio-start` and/or
438
+ `--audio-duration` on MiniMax H3 R2V, the CLI prepares and physically trims the
439
+ audio window before upload. The worker receives only that window, and the CLI
440
+ does not forward redundant `audioStart` / `audioDuration` project fields. This
441
+ avoids worker failures on long source files and makes the attached `<Audio 1>`
442
+ the exact waveform-conditioned lip-sync input. Remote audio URLs and additional
443
+ audio references keep their existing handling.
444
+
421
445
  ## High-Res Video Routing
422
446
 
423
447
  When the user asks for video in **"hd"**, **"1080p"**, **"4k"**, **"uhd"**, or **"high-res"**, do not use the default WAN video models.
@@ -3,7 +3,7 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@sogni-ai/sogni-intelligence-client": "3.19.0",
6
+ "@sogni-ai/sogni-intelligence-client": "3.22.0",
7
7
  "execa": "^9.6.1",
8
8
  "json5": "^2.2.3",
9
9
  "sharp": "^0.34.5"
package/sogni-agent.mjs CHANGED
@@ -1530,6 +1530,20 @@ function getImageDimensionsFromBuffer(buffer) {
1530
1530
  return getPngDimensions(buffer) || getJpegDimensions(buffer);
1531
1531
  }
1532
1532
 
1533
+ async function getVideoImageDimensionsFromBuffer(buffer) {
1534
+ const parsed = getImageDimensionsFromBuffer(buffer);
1535
+ if (parsed) return parsed;
1536
+ try {
1537
+ const metadata = await sharp(buffer).metadata();
1538
+ if (metadata.width && metadata.height) {
1539
+ return { width: metadata.width, height: metadata.height, type: metadata.format || 'image' };
1540
+ }
1541
+ } catch {
1542
+ // The caller will preserve the wrapper's normal media-validation path.
1543
+ }
1544
+ return null;
1545
+ }
1546
+
1533
1547
  const DEFAULT_VIDEO_DIMENSION_RULES = {
1534
1548
  minDimension: 480,
1535
1549
  maxDimension: 1536,
@@ -1554,6 +1568,7 @@ const VIDEO_DIMENSION_MULTIPLE = DEFAULT_VIDEO_DIMENSION_RULES.dimensionMultiple
1554
1568
  // the swap invisible — a 25:14 source becoming 16:9 drifts 0.44%, far under the limit.
1555
1569
  const VIDEO_REF_PRERESIZE_MIN_AREA_GAIN = 1.1;
1556
1570
  const VIDEO_REF_PRERESIZE_MAX_ASPECT_DRIFT = 0.02;
1571
+ const MINIMAX_H3_MAX_VIDEO_PIXELS = 1_032_192;
1557
1572
 
1558
1573
  function isWanVideoModelId(modelId) {
1559
1574
  return typeof modelId === 'string' && modelId.startsWith('wan_');
@@ -1694,10 +1709,24 @@ function videoDurationLimitsLikeWrapper(modelId) {
1694
1709
  // still win (see the video preflight defaults block).
1695
1710
  function videoModelDimensionDefaultsLikeWrapper(modelId) {
1696
1711
  if (String(modelId || '').trim().toLowerCase() === MINIMAX_H3_R2V_TURBO_MODEL_ID) {
1697
- return { defaultWidth: 960, defaultHeight: 544, maxDimension: 1344, dimensionMultiple: 32 };
1712
+ return {
1713
+ defaultWidth: 960,
1714
+ defaultHeight: 544,
1715
+ minDimension: 32,
1716
+ maxDimension: 1344,
1717
+ dimensionMultiple: 32,
1718
+ maxPixels: MINIMAX_H3_MAX_VIDEO_PIXELS
1719
+ };
1698
1720
  }
1699
1721
  if (isMiniMaxH3Model(modelId)) {
1700
- return { defaultWidth: 1344, defaultHeight: 768, maxDimension: 1344, dimensionMultiple: 32 };
1722
+ return {
1723
+ defaultWidth: 1344,
1724
+ defaultHeight: 768,
1725
+ minDimension: 32,
1726
+ maxDimension: 1344,
1727
+ dimensionMultiple: 32,
1728
+ maxPixels: MINIMAX_H3_MAX_VIDEO_PIXELS
1729
+ };
1701
1730
  }
1702
1731
  if (isHappyHorseModel(modelId) || isHappyHorseModelSelectionLocal(modelId)) {
1703
1732
  return { defaultWidth: 1920, defaultHeight: 1080, maxDimension: 1920, dimensionMultiple: 1 };
@@ -1730,15 +1759,19 @@ function wrapperRefVideoDimensionCeiling(modelId) {
1730
1759
 
1731
1760
  function videoDimensionRulesFromDefaults(modelDefaults, modelId) {
1732
1761
  const wrapperMax = wrapperMaxVideoDimension(modelId);
1762
+ const wrapperRules = typeof getWrapperVideoDimensionRules === 'function'
1763
+ ? getWrapperVideoDimensionRules(modelId)
1764
+ : null;
1733
1765
  // Fall back to skill-local dimension rules for models the intel registry does
1734
1766
  // not carry (e.g. HappyHorse), so their model-specific maxDimension and
1735
1767
  // dimensionMultiple are applied instead of the generic 1536 / 16 defaults.
1736
1768
  const localFallback = videoModelDimensionDefaultsLikeWrapper(modelId);
1737
1769
  const configuredMax = modelDefaults?.maxDimension || localFallback?.maxDimension || DEFAULT_VIDEO_DIMENSION_RULES.maxDimension;
1738
1770
  return {
1739
- minDimension: modelDefaults?.minDimension || DEFAULT_VIDEO_DIMENSION_RULES.minDimension,
1771
+ minDimension: modelDefaults?.minDimension || localFallback?.minDimension || wrapperRules?.minDimension || DEFAULT_VIDEO_DIMENSION_RULES.minDimension,
1740
1772
  maxDimension: Math.min(configuredMax, wrapperMax),
1741
- dimensionMultiple: modelDefaults?.dimensionMultiple || localFallback?.dimensionMultiple || DEFAULT_VIDEO_DIMENSION_RULES.dimensionMultiple
1773
+ dimensionMultiple: modelDefaults?.dimensionMultiple || localFallback?.dimensionMultiple || DEFAULT_VIDEO_DIMENSION_RULES.dimensionMultiple,
1774
+ maxPixels: modelDefaults?.maxPixels || localFallback?.maxPixels || wrapperRules?.maxPixels || null
1742
1775
  };
1743
1776
  }
1744
1777
 
@@ -1771,7 +1804,15 @@ function predictVideoRefPreResizeDims(refWidth, refHeight, rules = DEFAULT_VIDEO
1771
1804
  const fitted = predictSharpInsideResizeDims(rw, rh, boxWidth, boxHeight);
1772
1805
  if (!fitted) return null;
1773
1806
 
1774
- return { width: clamp(fitted.width), height: clamp(fitted.height) };
1807
+ let width = clamp(fitted.width);
1808
+ let height = clamp(fitted.height);
1809
+ if (Number.isFinite(rules.maxPixels) && rules.maxPixels > 0 && width * height > rules.maxPixels) {
1810
+ const pixelScale = Math.sqrt(rules.maxPixels / (width * height));
1811
+ width = Math.max(ceilMultiple, Math.floor((width * pixelScale) / multiple) * multiple);
1812
+ height = Math.max(ceilMultiple, Math.floor((height * pixelScale) / multiple) * multiple);
1813
+ }
1814
+
1815
+ return { width, height };
1775
1816
  }
1776
1817
 
1777
1818
  /**
@@ -1795,6 +1836,9 @@ function normalizeVideoDimensionsLikeWrapper(width, height, rules = DEFAULT_VIDE
1795
1836
  const effectiveMin = rules.minDimension || DEFAULT_VIDEO_DIMENSION_RULES.minDimension;
1796
1837
  const effectiveMax = rules.maxDimension || DEFAULT_VIDEO_DIMENSION_RULES.maxDimension;
1797
1838
  const effectiveMultiple = rules.dimensionMultiple || DEFAULT_VIDEO_DIMENSION_RULES.dimensionMultiple;
1839
+ const effectiveMaxPixels = Number.isFinite(rules.maxPixels) && rules.maxPixels > 0
1840
+ ? rules.maxPixels
1841
+ : null;
1798
1842
 
1799
1843
  if (!Number.isFinite(targetWidth) || !Number.isFinite(targetHeight)) {
1800
1844
  return { width: targetWidth, height: targetHeight, adjusted: false };
@@ -1819,6 +1863,13 @@ function normalizeVideoDimensionsLikeWrapper(width, height, rules = DEFAULT_VIDE
1819
1863
  }
1820
1864
  }
1821
1865
 
1866
+ if (effectiveMaxPixels && targetWidth * targetHeight > effectiveMaxPixels) {
1867
+ const scaleFactor = Math.sqrt(effectiveMaxPixels / (targetWidth * targetHeight));
1868
+ targetWidth = Math.floor(targetWidth * scaleFactor);
1869
+ targetHeight = Math.floor(targetHeight * scaleFactor);
1870
+ adjusted = true;
1871
+ }
1872
+
1822
1873
  const roundedWidth = Math.floor(targetWidth / effectiveMultiple) * effectiveMultiple;
1823
1874
  const roundedHeight = Math.floor(targetHeight / effectiveMultiple) * effectiveMultiple;
1824
1875
  if (roundedWidth !== targetWidth || roundedHeight !== targetHeight) {
@@ -1839,6 +1890,20 @@ function normalizeVideoDimensionsLikeWrapper(width, height, rules = DEFAULT_VIDE
1839
1890
  return { width: targetWidth, height: targetHeight, adjusted };
1840
1891
  }
1841
1892
 
1893
+ function videoDimensionsAreIncompatible(dimensions, rules = DEFAULT_VIDEO_DIMENSION_RULES) {
1894
+ if (!dimensions || !Number.isFinite(dimensions.width) || !Number.isFinite(dimensions.height)) return false;
1895
+ const multiple = rules.dimensionMultiple || DEFAULT_VIDEO_DIMENSION_RULES.dimensionMultiple;
1896
+ const minDimension = rules.minDimension || DEFAULT_VIDEO_DIMENSION_RULES.minDimension;
1897
+ const maxDimension = rules.maxDimension || DEFAULT_VIDEO_DIMENSION_RULES.maxDimension;
1898
+ return dimensions.width % multiple !== 0 ||
1899
+ dimensions.height % multiple !== 0 ||
1900
+ dimensions.width < minDimension ||
1901
+ dimensions.height < minDimension ||
1902
+ dimensions.width > maxDimension ||
1903
+ dimensions.height > maxDimension ||
1904
+ (Number.isFinite(rules.maxPixels) && rules.maxPixels > 0 && dimensions.width * dimensions.height > rules.maxPixels);
1905
+ }
1906
+
1842
1907
  function predictSharpInsideResizeDims(refWidth, refHeight, targetWidth, targetHeight) {
1843
1908
  const rw = Number(refWidth);
1844
1909
  const rh = Number(refHeight);
@@ -5345,12 +5410,7 @@ if (options.video) {
5345
5410
  ];
5346
5411
  const localRefDims = new Map();
5347
5412
 
5348
- const isIncompatible = (predicted) => Boolean(predicted) && (
5349
- predicted.width % videoDimensionRules.dimensionMultiple !== 0 ||
5350
- predicted.height % videoDimensionRules.dimensionMultiple !== 0 ||
5351
- predicted.width < videoDimensionRules.minDimension ||
5352
- predicted.height < videoDimensionRules.minDimension
5353
- );
5413
+ const isIncompatible = (predicted) => videoDimensionsAreIncompatible(predicted, videoDimensionRules);
5354
5414
 
5355
5415
  for (const ref of references) {
5356
5416
  if (!ref.path || isHttpUrl(ref.path) || !existsSync(ref.path)) continue;
@@ -8302,6 +8362,43 @@ async function prepareReferenceAudioForVideoBuffer(buffer, sourceLabel) {
8302
8362
  return prepared;
8303
8363
  }
8304
8364
 
8365
+ async function trimPreparedReferenceAudioWindowBuffer(buffer, {
8366
+ startSeconds = 0,
8367
+ durationSeconds = null,
8368
+ } = {}) {
8369
+ const ffmpegPath = await ensureFfmpegAvailable();
8370
+ const tempDir = createTrackedTempDir('sogni-h3-audio-window-');
8371
+ const inputPath = join(tempDir, 'reference-audio-input.m4a');
8372
+ const outputPath = join(tempDir, 'reference-audio-window.m4a');
8373
+ try {
8374
+ writeFileSync(inputPath, buffer);
8375
+ const args = ['-hide_banner', '-loglevel', 'error', '-y'];
8376
+ if (Number.isFinite(startSeconds) && startSeconds > 0) {
8377
+ args.push('-ss', String(startSeconds));
8378
+ }
8379
+ args.push('-i', inputPath);
8380
+ if (Number.isFinite(durationSeconds) && durationSeconds > 0) {
8381
+ args.push('-t', String(durationSeconds));
8382
+ }
8383
+ args.push('-vn', '-c:a', 'aac', '-b:a', '192k', '-movflags', '+faststart', outputPath);
8384
+ const result = await runCommand(ffmpegPath, args, { captureOutput: true });
8385
+ if (result.error || result.status !== 0 || !isNonEmptyFile(outputPath)) {
8386
+ const err = new Error('Failed to prepare the MiniMax H3 reference-audio window.');
8387
+ err.code = 'FFMPEG_H3_AUDIO_WINDOW_FAILED';
8388
+ err.details = { stderr: result.stderr || '', stdout: result.stdout || '', status: result.status };
8389
+ throw err;
8390
+ }
8391
+ if (!options.quiet) {
8392
+ console.error(`Prepared MiniMax H3 reference-audio window (${startSeconds}s start, ${durationSeconds ?? 'remaining'}s duration).`);
8393
+ }
8394
+ return readFileSync(outputPath);
8395
+ } finally {
8396
+ try { if (existsSync(inputPath)) unlinkSync(inputPath); } catch {}
8397
+ try { if (existsSync(outputPath)) unlinkSync(outputPath); } catch {}
8398
+ try { rmdirSync(tempDir); } catch {}
8399
+ }
8400
+ }
8401
+
8305
8402
  function mediaFilenameFromSource(sourceLabel, fallbackName) {
8306
8403
  const raw = String(sourceLabel || '');
8307
8404
  try {
@@ -10289,8 +10386,15 @@ async function runMultiAngleFlow(client, log) {
10289
10386
  }
10290
10387
  }
10291
10388
 
10389
+ function miniMaxH3R2vReferenceImageCount() {
10390
+ if (!isMiniMaxH3R2vModel(options.model)) return undefined;
10391
+ return (options.refImage ? 1 : 0)
10392
+ + (Array.isArray(options.contextImages) ? options.contextImages.length : 0);
10393
+ }
10394
+
10292
10395
  function buildVideoEstimateParams({ tokenType, steps }) {
10293
10396
  const isSeedanceVideo = isSeedanceModel(options.model);
10397
+ const referenceImageCount = miniMaxH3R2vReferenceImageCount();
10294
10398
  const params = {
10295
10399
  modelId: options.model,
10296
10400
  width: options.width,
@@ -10299,7 +10403,8 @@ function buildVideoEstimateParams({ tokenType, steps }) {
10299
10403
  numberOfMedia: options.count,
10300
10404
  tokenType,
10301
10405
  ...(Number.isFinite(steps) && steps > 0 ? { steps } : {}),
10302
- ...(options.frames ? { frames: options.frames } : { duration: options.duration })
10406
+ ...(options.frames ? { frames: options.frames } : { duration: options.duration }),
10407
+ ...(referenceImageCount !== undefined ? { referenceImageCount } : {})
10303
10408
  };
10304
10409
 
10305
10410
  if (isSeedanceVideo && options.refVideo) {
@@ -11364,8 +11469,22 @@ async function main() {
11364
11469
  const additionalVideoBuffers = isMiniMaxH3R2v
11365
11470
  ? await Promise.all(options.refVideos.map((reference) => fetchMediaBuffer(reference)))
11366
11471
  : [];
11472
+ let pretrimmedMiniMaxH3ReferenceAudio = false;
11367
11473
  if (audioBuffer) {
11368
11474
  audioBuffer = await prepareReferenceAudioForVideoBuffer(audioBuffer, options.refAudio);
11475
+ if (
11476
+ isMiniMaxH3R2v
11477
+ && (
11478
+ (Number.isFinite(options.audioStart) && options.audioStart > 0)
11479
+ || (Number.isFinite(options.audioDuration) && options.audioDuration > 0)
11480
+ )
11481
+ ) {
11482
+ audioBuffer = await trimPreparedReferenceAudioWindowBuffer(audioBuffer, {
11483
+ startSeconds: options.audioStart ?? 0,
11484
+ durationSeconds: options.audioDuration,
11485
+ });
11486
+ pretrimmedMiniMaxH3ReferenceAudio = true;
11487
+ }
11369
11488
  }
11370
11489
  if (additionalAudioBuffers.length > 0) {
11371
11490
  additionalAudioBuffers = await Promise.all(
@@ -11458,18 +11577,46 @@ async function main() {
11458
11577
  }
11459
11578
 
11460
11579
  // Pre-resize reference images to model-compatible dimensions if needed for i2v workflow.
11461
- if (options.videoWorkflow === 'i2v' && imageBuffer && options._needsRefResize) {
11462
- const dims = getImageDimensionsFromBuffer(imageBuffer);
11580
+ // The earlier preflight can inspect local files, but HTTPS references are downloaded only
11581
+ // here. Re-check the actual buffer so remote and local inputs follow the same grid rules.
11582
+ if (options.videoWorkflow === 'i2v' && imageBuffer) {
11583
+ const dims = await getVideoImageDimensionsFromBuffer(imageBuffer);
11463
11584
  if (dims?.width && dims?.height) {
11464
- const resizedBuffer = await resizeImageBufferForVideo(imageBuffer, dims.width, dims.height, videoDimensionRules);
11465
- const resizedDims = getImageDimensionsFromBuffer(resizedBuffer);
11466
- if (!options.quiet) {
11467
- console.error(
11468
- `Pre-resized reference image from ${dims.width}x${dims.height} to ${resizedDims.width}x${resizedDims.height} ` +
11469
- `(divisible by ${videoDimensionRules.dimensionMultiple}) to ensure i2v compatibility.`
11470
- );
11585
+ const predicted = predictSharpInsideResizeDims(dims.width, dims.height, options.width, options.height);
11586
+ if (options._needsRefResize || videoDimensionsAreIncompatible(predicted, videoDimensionRules)) {
11587
+ const requested = { width: options.width, height: options.height };
11588
+ const resizedBuffer = await resizeImageBufferForVideo(imageBuffer, dims.width, dims.height, videoDimensionRules);
11589
+ const resizedDims = await getVideoImageDimensionsFromBuffer(resizedBuffer);
11590
+ if (resizedDims?.width && resizedDims?.height) {
11591
+ options.width = resizedDims.width;
11592
+ options.height = resizedDims.height;
11593
+ options._needsRefResize = true;
11594
+ options._effectiveVideoDims = {
11595
+ width: resizedDims.width,
11596
+ height: resizedDims.height,
11597
+ refWidth: dims.width,
11598
+ refHeight: dims.height,
11599
+ requestedWidth: requested.width,
11600
+ requestedHeight: requested.height
11601
+ };
11602
+ if (!options._adjustedVideoDims) {
11603
+ options._adjustedVideoDims = {
11604
+ reason: 'i2v-ref-pre-resize',
11605
+ referenceType: 'refImage',
11606
+ requested,
11607
+ resizedFrom: predicted,
11608
+ resizedTo: { width: resizedDims.width, height: resizedDims.height }
11609
+ };
11610
+ }
11611
+ }
11612
+ if (!options.quiet && resizedDims?.width && resizedDims?.height) {
11613
+ console.error(
11614
+ `Pre-resized reference image from ${dims.width}x${dims.height} to ${resizedDims.width}x${resizedDims.height} ` +
11615
+ `(divisible by ${videoDimensionRules.dimensionMultiple}) to ensure i2v compatibility.`
11616
+ );
11617
+ }
11618
+ imageBuffer = resizedBuffer;
11471
11619
  }
11472
- imageBuffer = resizedBuffer;
11473
11620
  }
11474
11621
  }
11475
11622
  if (options.videoWorkflow === 'i2v' && endImageBuffer && options._needsRefEndResize) {
@@ -11544,10 +11691,10 @@ async function main() {
11544
11691
  if (additionalAudioBuffers.length > 0) {
11545
11692
  projectConfig.referenceAudios = additionalAudioBuffers;
11546
11693
  }
11547
- if (options.audioStart !== null && !useRefAudioUrl) {
11694
+ if (options.audioStart !== null && !useRefAudioUrl && !pretrimmedMiniMaxH3ReferenceAudio) {
11548
11695
  projectConfig.audioStart = options.audioStart;
11549
11696
  }
11550
- if (options.audioDuration !== null && !useRefAudioUrl) {
11697
+ if (options.audioDuration !== null && !useRefAudioUrl && !pretrimmedMiniMaxH3ReferenceAudio) {
11551
11698
  projectConfig.audioDuration = options.audioDuration;
11552
11699
  }
11553
11700
  if (audioIdentityMedia) {
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.32.0';
1
+ export const PACKAGE_VERSION = '3.33.0';