@sogni-ai/sogni-creative-agent-skill 3.42.0 → 3.46.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.42.0"
6
+ version: "3.46.0"
7
7
  author: Sogni AI
8
8
  hermes:
9
9
  category: creative
@@ -20,6 +20,9 @@ metadata:
20
20
 
21
21
  Generate images, video, and music through Sogni AI's decentralized GPU network.
22
22
 
23
+ For SAM 3 object masks, read [references/object-selection.md](references/object-selection.md).
24
+ Use `--segment` with an original still and normalized points or an object description.
25
+
23
26
  Invoke `sogni-agent-hermes` for every command in this skill. Fall back to
24
27
  `sogni-agent` only when the Hermes launcher is not on `PATH`. The two commands
25
28
  have identical flags and output; the Hermes launcher adds host attribution.
@@ -5,6 +5,24 @@ answering "which model should I use for X". For everyday generation prefer
5
5
  `-Q fast|hq|pro` and automatic workflow routing instead of memorizing IDs.
6
6
  `sogni-agent --help` is the canonical flag reference.
7
7
 
8
+ ## Contents
9
+
10
+ - Live model discovery
11
+ - Quality presets (images)
12
+ - Image models
13
+ - Utility and 3D models
14
+ - Music models
15
+ - Video models — current selectors
16
+ - Seedance 2.5
17
+ - HappyHorse 1.1 models
18
+ - Alibaba Wan 3
19
+ - Wan 3.0 Enhanced
20
+ - MiniMax H3 models
21
+ - LTX-2 / LTX-2.3 models
22
+ - Recommended model selectors by need
23
+ - Video sizing & aspect ratios
24
+ - GPT Image 2.5 controls (as of 2026-09)
25
+
8
26
  ## Live model discovery
9
27
 
10
28
  The static tables below are recommendations, not the complete changing
@@ -52,6 +70,8 @@ dimensions. "high quality" / "best quality" / "pro" → `-Q pro`; quick drafts
52
70
  |-------|-------|----------|
53
71
  | `z_image_turbo_bf16` | Fast (~5-10s) | General purpose, default |
54
72
  | `gpt-image-2` | Variable | OpenAI GPT Image 2 text-to-image and edit, strong prompt and text rendering |
73
+ | `gpt-image-2.5-sunburst` | Variable | GPT Image 2.5 Sunburst; explicit selection, edits, masks and transparency |
74
+ | `gpt-image-2.5-flare` | Variable | GPT Image 2.5 Flare; explicit selection, edits, masks and transparency |
55
75
  | `flux1-schnell-fp8` | Very fast | Quick iterations |
56
76
  | `qwen_image_2512_fp8` | Medium (~30s) | High quality |
57
77
  | `krea2_turbo_fp8_scaled` | Fast | Krea 2 Turbo text-to-image, fast high-quality generations with strong prompt adherence |
@@ -934,3 +954,23 @@ model recommendations.
934
954
  - Natural-language aspect requests like "portrait", "square", "16:9", or "9:16" are inferred when width/height aren't explicitly set. Combined requests like "720p 9:16" keep the requested short side while applying the requested shape.
935
955
  - For i2v (and any workflow using `--ref` / `--ref-end`), the client wrapper resizes the reference image with strict aspect-fit (`fit: inside`) and uses the *resized* dimensions as the final video size. Because that resize uses rounding, a "valid" requested size can still produce an invalid final size (example: `1024×1536` requested, but the ref becomes `1024×1535`). The CLI detects this for local refs and auto-adjusts to a nearby safe size.
936
956
  - Pass `--strict-size` to fail instead — the CLI prints a suggested size.
957
+
958
+ ## GPT Image 2.5 controls (as of 2026-09)
959
+
960
+ Use `-m gpt-image-2.5-sunburst` or `-m gpt-image-2.5-flare` explicitly.
961
+ `--image-quality low|medium|high|xhigh|max` preserves the exact quality;
962
+ default is medium. Sogni never uses provider-chosen (auto) quality.
963
+ `--image-background transparent` requires PNG or WebP. JPEG/WebP accept
964
+ `--image-output-compression 0..100`; omit compression for PNG.
965
+ For editing, repeat `--context` in source order (up to 16 total). `--image-mask`
966
+ accepts an original PNG alpha mask of the first context image; it must match
967
+ that image's dimensions (the image itself may be JPEG, PNG or WebP) and be
968
+ smaller than 50 MB. Transparent
969
+ mask regions identify edits; the model can also change pixels outside them.
970
+ The image mask flag is separate from video `--mask` semantics.
971
+
972
+ Dimensions default to 1024×1024: multiples of 16, at most 3840 per edge,
973
+ 3:1 maximum aspect ratio, 655,360–8,294,400 pixels. Above 3,686,400 pixels is
974
+ experimental. Transparency is integrated but clean cutout edges failed the
975
+ initial Flare canaries; inspect native output against a contrasting background.
976
+ These source changes still require the coordinated package release and server rollout.
@@ -0,0 +1,41 @@
1
+ # SAM 3 object selection
2
+
3
+ Use SAM 3 when a task needs an object mask from an existing still, for example
4
+ selecting a door before directing an edit. Coordinates refer to the original
5
+ image, normalized from 0 to 1, with the origin at the top left.
6
+ Use an upright original under 24 MB with each edge between 256 and 2560 pixels.
7
+
8
+ ```bash
9
+ sogni-agent --segment original.png --segment-point 0.45,0.6 --segment-exclude 0.1,0.1 -o mask.png
10
+ sogni-agent --segment original.png --segment-text "the red backpack" --segment-box 0.2,0.2,0.8,0.9 -o mask.png
11
+ ```
12
+
13
+ These commands submit one paid SAM 3 project using the configured account.
14
+ Include points identify the object; exclude points remove unwanted areas.
15
+ The result is one lossless binary PNG at the original dimensions. White selects
16
+ the object. Inspect the full-size mask before paying for a downstream edit.
17
+
18
+ The command selects `sam3_image_segment_bf16`, uses one inference step and no
19
+ previews, and keeps the content filter enabled. Do not supply output dimensions,
20
+ generation prompts, or another generation mode. It requires client 5.31.0 or later;
21
+ the package pins the compatible runtime. `--segment-box` accepts normalized
22
+ left,top,right,bottom bounds. A point may select only a flame, window, or other
23
+ subpart. To select a complete object, refine with a short text label and a box,
24
+ then inspect the actual SAM mask. Never use the box itself as a substitute mask.
25
+ Text and points cannot be combined. Limits: 240 text characters, 32 points,
26
+ 16 boxes; point prompts accept at most one box.
27
+
28
+ Keep the original still as the edit reference. When the edit model supports only
29
+ context images, a binary mask is a visual selection guide, not a strict inpainting
30
+ constraint. Review what changed outside the selection as well as inside it.
31
+ A registered character needs its saved reference images; an object label or
32
+ character name cannot preserve identity.
33
+
34
+ For a branching world, create a destination **still** from the original and
35
+ selection, then animate between the original parent and destination stills at
36
+ matching aspect ratios. Every subsequent node starts from that generated still.
37
+ Never promote an extracted video frame or a screenshot into the canonical scene.
38
+
39
+ The CLI capability is separate from hosted chat tool discovery. Do not invent a
40
+ hosted `segment_image` tool: inspect the connected tool catalog before dispatching
41
+ through chat. Use the CLI or SDK when segmentation is absent there.
@@ -202,6 +202,119 @@ supplies no words, author one concise line that realizes that request. If there
202
202
  is no vocal intent, do not invent speech. Use a compound ID such as `(S1,S2)`
203
203
  only when already-numbered speakers vocalize together.
204
204
 
205
+ ### Writing the body the way the Base model reads it
206
+
207
+ Audited 2026-09-10 against MiniMax's `VIDEO_PROMPT_WRITING_GUIDE_base_en.md`
208
+ (the guide the h3-prompt-writing skill wraps) and the LightX2V rewriter that
209
+ was trained on the same rewrite policy. The open-weights H3-Base checkpoint
210
+ reads the prompt directly with no hosted Context-IR rewrite in front of it, so
211
+ every sentence is model input. Everything below is what the official examples
212
+ do and never deviate from:
213
+
214
+ - **Open `[Shot 1]` with the medium and look as concrete facts** (`Live-action,
215
+ cinematic`, `2D-animated`, `3D CG`, `claymation`, `watercolor`, `vintage
216
+ film`) plus the initial composition. In frame-anchored modes derive the look
217
+ from the picture. Genre, mood, audience, and intent labels (`horror`, `eerie`,
218
+ `adult`, `tense`, `jump scare`) are not visible and never appear in an
219
+ official example; write the light, surfaces, distances, movements, and sounds
220
+ that produce them.
221
+ - **Every sentence is a depiction.** The guide's rule is that every detail must
222
+ correspond to something visible or audible. Never write notes to the model
223
+ (`preserve believable anatomy`, `keep the foley prominent`, `hard cut, no
224
+ morph or dissolve`, `hold six frames only`, `this anchor is excluded from the
225
+ presentation`) and never shout in capitals.
226
+ - **State exclusions as positive facts.** There is no negative field and the
227
+ contract has no negation grammar, so `no people, faces or words` names the
228
+ things it tries to remove. Write `the hall is empty and still`, `the walls are
229
+ bare`, `the air is clear and sharply lit`. Keep a user-supplied exclusion only
230
+ when it cannot be stated positively, phrased once. `non_diegetic_music: N/A`
231
+ is the reliable way to keep score out even when the rest of the structure is
232
+ loose.
233
+ - **Clock times exist only on cut markers.** `[Shot 2] At 00:03.500, the camera
234
+ cuts to …` is the only place a time appears. Inside a shot, order events with
235
+ words (`early in the shot`, `as the doors part`, `toward the end`). In-shot
236
+ ranges such as `From 00:02.000 to 00:04.000` are not H3 syntax; the shaper now
237
+ flags them.
238
+ - **Camera moves use the official vocabulary** as natural prose: `Zoom In/Out`,
239
+ `Push In/Pull Out`, `Pan Left/Right`, `Truck Left/Right`, `Tilt Up/Down`,
240
+ `Pedestal Up/Down`, `Arc Shot`, `Tracking Shot`, `Static Shot`, `Shake
241
+ Slightly/Strongly`, `POV`, `Roll Clockwise/Counterclockwise`, with `with
242
+ small/large amplitude` and `at slow/fast speed` only when they matter. One
243
+ primary move per shot. First-person coverage is a `POV shot`; `handheld` reads
244
+ as camera shake, so write it only when shake is wanted.
245
+ - **Frame-anchored modes describe the path, not the pictures.** The model sees
246
+ every attached picture; describing one back at length, or adding objects,
247
+ text, fluids, or figures that are not in it, produces crossfades and invented
248
+ props. I2VA: first-frame anchor → action onset → continuous development →
249
+ result or reaction. FL2VA: first-frame state → observable intermediate
250
+ changes → progressively narrowing differences → last-frame state, in **one
251
+ continuous shot** unless the user explicitly asks for cuts; begin `in the
252
+ position and framing established by Picture 1`, carry the identity anchors
253
+ that must stay fixed into the motion sentences, and end by settling `into the
254
+ pose, spacing, and composition established by Picture 2 at the end of the
255
+ shot`. L2VA: plausible preceding state → explicit action and transition path →
256
+ gradual convergence in the final shot → last-frame landing on `<Picture 1>`.
257
+ Exact composition matching applies only at a picture's assigned timestamp.
258
+ - **Bind every vocal line to its speaker in the same sentence:**
259
+ `The young woman with a quiet, breathy voice (S1) says: <d>[English] I get
260
+ off at the next station.</d>` and `The two children (S1,S2) shout together,
261
+ <d>[English] Wait for us!</d>`.
262
+ - **Length.** Official bodies run roughly 150–450 words; Ref2VA
263
+ `detailed_description` targets 350–500. Long is fine when every sentence is a
264
+ visible or audible event.
265
+
266
+ ### Beats and voices (2026-09-11 review lessons)
267
+
268
+ Tested on a branching horror route the same day, on top of the rules above:
269
+
270
+ - **One continuous shot is still the default.** In most cases it is preferred
271
+ and the shot count stays as low as the content allows. What made the slow
272
+ takes boring was emptiness, not the lack of cuts: something new should
273
+ happen every 1.5–2.5 seconds inside the shot (an action, a reaction, a
274
+ reveal, a line), never walking or waiting.
275
+ - **Beats and multi-shot are tools for when the context calls for them.** A
276
+ chase, a reveal that needs a new viewpoint, an exchange of lines, a jump in
277
+ space or time: then cut (`[Shot 2] At 00:01.500, the camera cuts to …`),
278
+ keep continuous motion inside each shot, and let the final shot cut to the
279
+ Picture 2 composition and hold with a live action, which lands cleanly where
280
+ a long interpolation would crossfade. Never cut a simple movement into
281
+ pieces, and if both pictures share one camera position the camera does not
282
+ move at all (a curtain dropping needs a static shot, not a tracking shot
283
+ away).
284
+ - **Write physical acts as acts.** A fall is the rail giving, the wall of
285
+ windows streaking upward, the ground rushing in. A bite is the jaws snapping
286
+ shut over the picture. A shove is two palms filling the frame. "His lips
287
+ part as he bends closer" produced no bite; "You brought it back" followed by
288
+ a cut to an aftermath still produced no fall.
289
+ - **Describe the voice, not just the mood.** At a speaker's first line give
290
+ accent, pitch, timbre and speaking rate: `The woman (S1), speaking in a
291
+ plain American accent with a light, mid-pitched voice at a quick, breathless
292
+ pace, says: <d>[English] …</d>`. "A bright, breathless voice" alone drifted
293
+ to a British accent between takes.
294
+ - **Dialogue after the action that motivates it.** She says "That's my dad"
295
+ after she has picked the photograph up, in the shot where she holds it.
296
+ - **Whose hands.** In first-person coverage say whose hands are in frame
297
+ ("both his palms fill the frame as he shoves"); "hands seizing the front of
298
+ the cardigan" was rendered as the attacker's own point of view.
299
+
300
+ ### Worked example — first frame → last frame
301
+
302
+ ```text
303
+ User ask (two uploaded stills): "the elevator doors open onto the laundry and we walk in"
304
+
305
+ sogni-agent -q --video -m minimax-h3-flf2v-balanced --ref ./elevator.png --ref-end ./laundry.png --duration 8 -w 1344 -h 768 -o ./press-b.mp4 "<prompt below>"
306
+ ```
307
+
308
+ ```text
309
+ How the reference pictures align with the target video — Picture 1 (from Shot 1) aligns with the 0.00-second mark of the target video; Picture 2 (from Shot 1) aligns with the 8.00-second mark of the target video.
310
+
311
+ integrated_multimodal_description: [Shot 1] Live-action, cinematic, a POV shot at standing eye level begins in the position and framing established by Picture 1, facing the closed brass elevator doors from inside the small wood-panelled vestibule with its dark red velvet panels, marble floor and crystal ceiling lamp. Early in the shot the lamp flickers twice and the floor shudders as the car settles. The brass doors slide apart with a slow steady motion, and bright white fluorescent light from beyond spills across the marble floor and the brass door frame. Through the widening gap the long white-tiled laundry hall comes into view: the raised tiled walkway with steel rails, the row of round steel washing-machine doors along the left wall, and the open steel service door with its amber wall lamp at the far right. The camera pushes in with large amplitude at slow speed through the open doorway, the brass frame sliding out of the picture on both sides as the tiled floor takes over the foreground and the red brake lever comes into view at the near left. Toward the end the differences narrow as the camera glides forward and settles into the composition, spacing and lighting established by Picture 2 at the end of the shot, with the machines still, the grey curtains hanging straight and the hall empty and quiet.
312
+
313
+ overall_soundscape: A low electrical hum from the crystal lamp, a muffled cable groan and a soft mechanical shudder as the car settles, then the smooth metallic slide of the brass doors parting. Beyond the doors an even ventilation hum and the buzz of fluorescent tubes grow louder over slow footsteps that move from marble onto tile.
314
+
315
+ non_diegetic_music: N/A
316
+ ```
317
+
205
318
  ### Worked example — text-to-video
206
319
 
207
320
  ```text
@@ -358,8 +471,9 @@ How the reference pictures align with the target video — Picture 1 (from Shot
358
471
  ```
359
472
 
360
473
  `N` is the index of the actual final shot (`Shot 1` for the usual single-shot
361
- transition), and `S.SS` is the effective duration to exactly two decimal places
362
- — `10.13` for 243 frames at 24 fps (243 ÷ 24 = 10.125, rounded up).
474
+ transition; FL2VA favours one continuous shot and cuts only when the user asks),
475
+ and `S.SS` is the effective duration to exactly two decimal places — `10.13` for
476
+ 243 frames at 24 fps (243 ÷ 24 = 10.125, rounded up).
363
477
 
364
478
  ### MiniMax H3 reference-to-video (r2v)
365
479
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.42.0",
3
+ "version": "3.46.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.42.0",
3
+ "version": "3.46.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,50 @@
1
+ ## [3.46.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.43.0...v3.46.0) (2026-09-11)
2
+
3
+ 3.44.0 and 3.45.0 were prepared but never published to npm; this release carries their changes too, so 3.43.0 is the last version npm actually shipped.
4
+
5
+ ### Features
6
+
7
+ * Add `--segment` with `--segment-point`, `--segment-exclude`, `--segment-box` and `--segment-text`, returning a SAM 3 mask for an original still. Text and point prompts never combine, point prompts take at most one box, and the limits are 32 points, 16 boxes and 240 text characters.
8
+
9
+ ### Bug Fixes
10
+
11
+ * Align the public runtime with Intelligence Client 3.31.1 and Sogni Client 5.44.1, moving the exact pin, `skill-package.json` and the sogni-client override together.
12
+ * The bundled creative-agent runtime (1.63.1) adds `detailPreference`, `processingSpeed` and `seed` to `upscale_video`; none of them changes the price.
13
+
14
+ ## [3.45.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.43.0...v3.45.0) (2026-09-11)
15
+
16
+ 3.44.0 was prepared but never published to npm; this release carries its changes too.
17
+
18
+ ### Features
19
+
20
+ * Add GPT Image 2.5 Sunburst and Flare (`-m gpt-image-2.5-sunburst`, `-m gpt-image-2.5-flare`) for text-to-image and edits with up to 16 ordered `--context` references.
21
+ * Add `--image-quality low|medium|high` for every GPT Image model, plus `xhigh|max` on 2.5. Auto quality is rejected: Sogni never lets the provider choose the quality.
22
+ * Add `--image-background` (transparent on 2.5, PNG or WebP), `--image-output-compression 0-100` (JPEG or WebP) and `--image-mask`, a PNG alpha mask of the first `--context` image for edits.
23
+ * GPT Image defaults to 1024x1024 and a 10-minute timeout, and rejects sizes outside the provider's bounds before submitting.
24
+ * The MiniMax H3 reference keeps one continuous shot as the default, with beats and multi-shot sequences for when the context calls for them.
25
+
26
+ ### Bug Fixes
27
+
28
+ * Align the public runtime with Intelligence Client 3.30.1 and Sogni Client 5.42.0.
29
+
30
+ ## [3.44.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.43.0...v3.44.0) (2026-09-11)
31
+
32
+ ### Features
33
+
34
+ * Add the beats-and-voices lessons to the MiniMax H3 reference: pace dramatic requests by beats with a final shot that may cut to the closing frame's composition, keep continuous motion for continuous action, write a fall or a bite as the physical act, describe each voice with accent, pitch, timbre and speaking rate, place dialogue after the action that motivates it, and say whose hands are in a first-person frame.
35
+
36
+ ## [3.43.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.42.0...v3.43.0) (2026-09-10)
37
+
38
+ ### Features
39
+
40
+ * Teach MiniMax H3 prompt writing from MiniMax's official Base guide: `[Shot 1]` opens with the picture's own look rather than a genre label, every sentence depicts something seen or heard, exclusions are positive facts, clock times live only on cut markers, first-to-last-frame prompts describe the path between the pictures in one continuous shot, and each vocal line binds to its speaker. Adds a first-to-last-frame worked example.
41
+ * The bundled creative-agent runtime (1.60.0) applies the same rules and flags in-shot clock times when it writes MiniMax H3 prompts.
42
+
43
+ ### Bug Fixes
44
+
45
+ * `--upscale-video` relays the server's own refusal when a source is too long, with a hint to trim or split the clip, for direct and wrapped SDK errors.
46
+ * Align the public runtime with Intelligence Client 3.29.2 and Sogni Client 5.40.0.
47
+
1
48
  ## [3.42.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.41.0...v3.42.0) (2026-09-10)
2
49
 
3
50
  ### Features
package/README.md CHANGED
@@ -27,6 +27,7 @@ It ships four ways:
27
27
  With this skill, an agent can:
28
28
 
29
29
  - generate images from prompts and edit/restyle existing images
30
+ - select an object in an original image and return its SAM 3 mask (`--segment`; see the [object selection guide](references/object-selection.md))
30
31
  - create videos from text, images, first/last frames, audio, or source video (LTX-2.5), with LTX-2.3 retained for voice ID, transition, and 10Eros workflows
31
32
  - turn an image folder into a visually deduplicated, music-backed seamless loop with one plugin skill invocation
32
33
  - generate instrumental music or full songs with lyrics
@@ -670,6 +671,7 @@ Prefer `-Q fast|hq|pro` for images and automatic workflow routing for video. Pas
670
671
  | Image editing | `qwen_image_edit_2511_fp8_lightning` |
671
672
  | Deterministic image upscaling through 16K | `rtx_vsr_pro` via `--upscale` |
672
673
  | Promptless video upscaling to 1080p/1440p | `flashvsr_v1.1_tiny_long_bf16` via `--upscale-video` |
674
+ | Object masks from points, boxes, or a description | `sam3_image_segment_bf16` via `--segment` |
673
675
  | Dark Beast Krea 2 images | `dark_beast_krea2_fp8` |
674
676
  | Identity-preserving Krea image edits | `krea2_identity_edit_v1_2` |
675
677
  | Uncensored identity-preserving Krea edits | `dark_beast_krea2_identity_edit_v1_2` |
package/SKILL.md CHANGED
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: sogni-creative-agent-skill
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, promptless FlashVSR video upscaling to 1080p/1440p, one-click image-folder loop reels, personas (named people with saved reference photos and voice clips), persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/H3 Balanced/LightX2V Turbo/FastH3 Turbo/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"upscale an image\", \"upscale a video\", \"make a video/animate\", \"turn this image folder into a loop\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
3
+ description: "Sogni Creative Agent Skill: agent skill and CLI for image, video, and music generation using Sogni AI's decentralized GPU network. Supports SAM 3 object selection, promptless RTX VSR image upscaling through 16K, promptless FlashVSR video upscaling to 1080p/1440p, one-click image-folder loop reels, personas (named people with saved reference photos and voice clips), persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/H3 Balanced/LightX2V Turbo/FastH3 Turbo/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"upscale an image\", \"upscale a video\", \"make a video/animate\", \"turn this image folder into a loop\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
4
4
  metadata:
5
- version: "3.42.0"
5
+ version: "3.46.0"
6
6
  homepage: https://sogni.ai
7
7
  openclaw:
8
8
  emoji: "🎨"
@@ -323,8 +323,8 @@ sogni-agent doctor --json
323
323
 
324
324
  ### Segmentation and 3D reconstruction
325
325
 
326
- - To isolate an object in an image — a mask, or the subject cut out on transparency — use `sam3_image_segment_bf16` with a `sam3Prompt`. It is promptless in the ordinary sense: the selection comes from `text`, click `points`, or `boxes`, never from `positivePrompt`. Never route a "remove the background" or "select the X" request through `edit_image` or `refine_result`, which regenerate pixels instead of selecting them.
327
- - Set `applyMask: true` when the result feeds a composite; leave it off when you need the black-and-white mask itself. If a text prompt matches more instances than intended, the result's `maskSelections` reports each one's score and bounds — re-run with `maxInstances: 1` or a box around the intended one rather than accepting a merged shape.
326
+ - To isolate an object in an image — a mask, or the subject cut out on transparency — use `sam3_image_segment_bf16` with a `sam3Prompt`. In direct CLI mode that is `--segment <original> --segment-point x,y` (repeat; `--segment-exclude` refines) or `--segment-text "<object>"` with optional `--segment-box x0,y0,x1,y1`, returning one binary PNG mask — read [`references/object-selection.md`](./references/object-selection.md) first. It is promptless in the ordinary sense: the selection comes from `text`, click `points`, or `boxes`, never from `positivePrompt`. Never route a "remove the background" or "select the X" request through `edit_image` or `refine_result`, which regenerate pixels instead of selecting them.
327
+ - SDK callers: set `applyMask: true` when the result feeds a composite; leave it off when you need the black-and-white mask itself. If a text prompt matches more instances than intended, the result's `maskSelections` reports each one's score and bounds — re-run with `maxInstances: 1` or a box around the intended one rather than accepting a merged shape.
328
328
  - To turn one image into a textured 3D model, use `pixal3d_int8_i23d` with a `startingImage` and **no prompt** — the default graph isolates the subject on its own. Only the `templateVariant: 'i23d'` variant takes a `positivePrompt`, and there the prompt names which object to pull out of a busy scene. The artifact is a binary GLB, not a picture; never display or post-process it as an image. Set `meshTargetFaces` well below the 700000 default for anything headed into a real-time engine.
329
329
  - `birefnet_image_background_removal_fp16` (prompt-free background removal) is **not yet routable** — it still needs a Comfy Worker release, so do not offer it. Remove backgrounds with SAM 3 and `applyMask: true` in the meantime.
330
330
  - All are flat-priced per request, so resolution and step count change neither cost nor result. Details and full option ranges in [`references/models.md`](./references/models.md).
@@ -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.42.0",
5
+ "version": "3.46.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",
@@ -2451,12 +2451,15 @@ const PROMPT_CONTRACTS = [
2451
2451
  },
2452
2452
  {
2453
2453
  "contractId": "upscale_video_v1",
2454
- "version": "1.0.0",
2454
+ "version": "1.1.0",
2455
2455
  "toolName": "upscale_video",
2456
- "baseDescription": "upscale_video performs promptless, deterministic FlashVSR super-resolution of exactly one\nuploaded or generated video. Use it when the user asks to upscale, enlarge, sharpen, or increase\nthe resolution of an existing video, or wants a 1080p, 1440p, 2K, or HD copy of it. The output\nkeeps every source frame, the exact frame rate, the full aspect ratio, and the original audio.\n\nDo not invent a prompt and do not route a pure video upscale through video_to_video,\ngenerate_video, extend_video, or replace_video_segment; those tools re-render or edit content.\nUse video_to_video only when the user explicitly names a generative model such as Seedance for\nthe re-render. Do not use upscale_image for videos.\n\nOmit sourceVideoIndex to use the latest generated video, falling back to the most recent upload.\nUse zero-based non-negative indices for generated videos; -1 selects the first uploaded video\nand -2 the second. targetResolution is the output short edge: omit it for 1440p (or 1080p when\nthe source is too small for 1440p), and set 1080 when the user asks for 1080p or Full HD.\nThe output is at most twice the source size, so 1440p needs a source short edge of 720-768px\nand 1080p needs 540-768px. Sources must also be at most about 1344x768 pixels (768x1344 in\nportrait), 1-60 fps, and 100 MB. The server sets the maximum clip length and rejects a source\nthat is too long; never quote a length limit yourself. If the tool reports that the source is too\nlong or outside these limits, relay that error to the user instead of switching to a generative\nvideo tool. It cannot produce 4K or any size above 1440p: when the user asks for one, say so and\noffer 1440p instead of silently delivering less.",
2456
+ "baseDescription": "upscale_video performs promptless, deterministic FlashVSR super-resolution of exactly one\nuploaded or generated video. Use it when the user asks to upscale, enlarge, sharpen, or increase\nthe resolution of an existing video, or wants a 1080p, 1440p, 2K, or HD copy of it. The output\nkeeps every source frame, the exact frame rate, the full aspect ratio, and the original audio.\n\nDo not invent a prompt and do not route a pure video upscale through video_to_video,\ngenerate_video, extend_video, or replace_video_segment; those tools re-render or edit content.\nUse video_to_video only when the user explicitly names a generative model such as Seedance for\nthe re-render. Do not use upscale_image for videos.\n\nOmit sourceVideoIndex to use the latest generated video, falling back to the most recent upload.\nUse zero-based non-negative indices for generated videos; -1 selects the first uploaded video\nand -2 the second. targetResolution is the output short edge: omit it for 1440p (or 1080p when\nthe source is too small for 1440p), and set 1080 when the user asks for 1080p or Full HD.\nThe output is at most twice the source size, so 1440p needs a source short edge of 720-768px\nand 1080p needs 540-768px. Sources must also be at most about 1344x768 pixels (768x1344 in\nportrait), 1-60 fps, and 100 MB. The server sets the maximum clip length and rejects a source\nthat is too long; never quote a length limit yourself. If the tool reports that the source is too\nlong or outside these limits, relay that error to the user instead of switching to a generative\nvideo tool. It cannot produce 4K or any size above 1440p: when the user asks for one, say so and\noffer 1440p instead of silently delivering less.\n\nThe defaults give the most stable result. Set detailPreference to sharper only when the user\nasks for a sharper, crisper, or more detailed upscale, and processingSpeed to faster only when\nthey ask for a quicker one. Leave seed out unless the user gives a seed or asks for a different\nor random variation (-1 is random). None of these options changes the price.",
2457
2457
  "parameterDocs": {
2458
2458
  "sourceVideoIndex": "Omit for the latest generated video, then the most recent upload. Generated videos are zero-based; -1/-2 select uploaded videos.",
2459
- "targetResolution": "Output short edge in pixels: 1440 or 1080. Omit for the default (1440, or 1080 for sources under 720px); set 1080 when the user asks for 1080p or Full HD."
2459
+ "targetResolution": "Output short edge in pixels: 1440 or 1080. Omit for the default (1440, or 1080 for sources under 720px); set 1080 when the user asks for 1080p or Full HD.",
2460
+ "detailPreference": "stable (default) or sharper. Set sharper only when the user asks for a sharper, crisper, or more detailed result.",
2461
+ "processingSpeed": "stable (default) or faster. Set faster only when the user asks for a quicker upscale.",
2462
+ "seed": "Omit for the repeatable default 0. -1 is random; otherwise an integer 0-4294967295 the user gave."
2460
2463
  }
2461
2464
  },
2462
2465
  {
@@ -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.42.0",
5
+ "version": "3.46.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.42.0",
3
+ "version": "3.46.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,16 +95,17 @@
95
95
  "update-check.mjs",
96
96
  "node-version-check.mjs",
97
97
  "generated/creative-agent-runtime.mjs",
98
- "sogni-agent.mjs"
98
+ "sogni-agent.mjs",
99
+ "sam-segmentation.mjs"
99
100
  ],
100
101
  "dependencies": {
101
- "@sogni-ai/sogni-intelligence-client": "3.29.1",
102
+ "@sogni-ai/sogni-intelligence-client": "3.31.1",
102
103
  "execa": "^10.0.1",
103
104
  "json5": "^2.2.3",
104
105
  "sharp": "0.35.4"
105
106
  },
106
107
  "overrides": {
107
- "@sogni-ai/sogni-client": "5.39.1"
108
+ "@sogni-ai/sogni-client": "5.44.1"
108
109
  },
109
110
  "openclaw": {
110
111
  "extensions": [
@@ -35,6 +35,7 @@ Honor requests to wait for user input; model-specific policies still apply.
35
35
 
36
36
  - Image: `sogni-agent "a cat on the moon, cinematic"`
37
37
  - Image edit: `sogni-agent -c <path> "make it night, add fireflies"`
38
+ - Object mask: `sogni-agent --segment <path> --segment-point 0.5,0.5 -o mask.png` (SAM 3; see `../../references/object-selection.md`)
38
39
  - Video (image-to-video): `sogni-agent --video --ref <path> "gentle camera pan"` (defaults to `wan_v2.2-14b-fp8_i2v_lightx2v`)
39
40
  - Animate two images (first frame → last frame): `sogni-agent --video --ref <first> --ref-end <last> "smooth morph into the final frame"` (defaults to `ltx25-22b-int8_i2v_distilled` and the standard FLF template; no transition LoRA is attached)
40
41
  - MiniMax H3 reference-to-video: `sogni-agent --video -m minimax-h3-r2v --ref <identity> -c <wardrobe> --ref-video <motion> --ref-audio <voice> "<Picture 1> controls identity; <Picture 2> controls wardrobe; <Video 1> controls motion; <Audio 1> controls voice."`
@@ -5,6 +5,24 @@ answering "which model should I use for X". For everyday generation prefer
5
5
  `-Q fast|hq|pro` and automatic workflow routing instead of memorizing IDs.
6
6
  `sogni-agent --help` is the canonical flag reference.
7
7
 
8
+ ## Contents
9
+
10
+ - Live model discovery
11
+ - Quality presets (images)
12
+ - Image models
13
+ - Utility and 3D models
14
+ - Music models
15
+ - Video models — current selectors
16
+ - Seedance 2.5
17
+ - HappyHorse 1.1 models
18
+ - Alibaba Wan 3
19
+ - Wan 3.0 Enhanced
20
+ - MiniMax H3 models
21
+ - LTX-2 / LTX-2.3 models
22
+ - Recommended model selectors by need
23
+ - Video sizing & aspect ratios
24
+ - GPT Image 2.5 controls (as of 2026-09)
25
+
8
26
  ## Live model discovery
9
27
 
10
28
  The static tables below are recommendations, not the complete changing
@@ -52,6 +70,8 @@ dimensions. "high quality" / "best quality" / "pro" → `-Q pro`; quick drafts
52
70
  |-------|-------|----------|
53
71
  | `z_image_turbo_bf16` | Fast (~5-10s) | General purpose, default |
54
72
  | `gpt-image-2` | Variable | OpenAI GPT Image 2 text-to-image and edit, strong prompt and text rendering |
73
+ | `gpt-image-2.5-sunburst` | Variable | GPT Image 2.5 Sunburst; explicit selection, edits, masks and transparency |
74
+ | `gpt-image-2.5-flare` | Variable | GPT Image 2.5 Flare; explicit selection, edits, masks and transparency |
55
75
  | `flux1-schnell-fp8` | Very fast | Quick iterations |
56
76
  | `qwen_image_2512_fp8` | Medium (~30s) | High quality |
57
77
  | `krea2_turbo_fp8_scaled` | Fast | Krea 2 Turbo text-to-image, fast high-quality generations with strong prompt adherence |
@@ -934,3 +954,23 @@ model recommendations.
934
954
  - Natural-language aspect requests like "portrait", "square", "16:9", or "9:16" are inferred when width/height aren't explicitly set. Combined requests like "720p 9:16" keep the requested short side while applying the requested shape.
935
955
  - For i2v (and any workflow using `--ref` / `--ref-end`), the client wrapper resizes the reference image with strict aspect-fit (`fit: inside`) and uses the *resized* dimensions as the final video size. Because that resize uses rounding, a "valid" requested size can still produce an invalid final size (example: `1024×1536` requested, but the ref becomes `1024×1535`). The CLI detects this for local refs and auto-adjusts to a nearby safe size.
936
956
  - Pass `--strict-size` to fail instead — the CLI prints a suggested size.
957
+
958
+ ## GPT Image 2.5 controls (as of 2026-09)
959
+
960
+ Use `-m gpt-image-2.5-sunburst` or `-m gpt-image-2.5-flare` explicitly.
961
+ `--image-quality low|medium|high|xhigh|max` preserves the exact quality;
962
+ default is medium. Sogni never uses provider-chosen (auto) quality.
963
+ `--image-background transparent` requires PNG or WebP. JPEG/WebP accept
964
+ `--image-output-compression 0..100`; omit compression for PNG.
965
+ For editing, repeat `--context` in source order (up to 16 total). `--image-mask`
966
+ accepts an original PNG alpha mask of the first context image; it must match
967
+ that image's dimensions (the image itself may be JPEG, PNG or WebP) and be
968
+ smaller than 50 MB. Transparent
969
+ mask regions identify edits; the model can also change pixels outside them.
970
+ The image mask flag is separate from video `--mask` semantics.
971
+
972
+ Dimensions default to 1024×1024: multiples of 16, at most 3840 per edge,
973
+ 3:1 maximum aspect ratio, 655,360–8,294,400 pixels. Above 3,686,400 pixels is
974
+ experimental. Transparency is integrated but clean cutout edges failed the
975
+ initial Flare canaries; inspect native output against a contrasting background.
976
+ These source changes still require the coordinated package release and server rollout.
@@ -0,0 +1,41 @@
1
+ # SAM 3 object selection
2
+
3
+ Use SAM 3 when a task needs an object mask from an existing still, for example
4
+ selecting a door before directing an edit. Coordinates refer to the original
5
+ image, normalized from 0 to 1, with the origin at the top left.
6
+ Use an upright original under 24 MB with each edge between 256 and 2560 pixels.
7
+
8
+ ```bash
9
+ sogni-agent --segment original.png --segment-point 0.45,0.6 --segment-exclude 0.1,0.1 -o mask.png
10
+ sogni-agent --segment original.png --segment-text "the red backpack" --segment-box 0.2,0.2,0.8,0.9 -o mask.png
11
+ ```
12
+
13
+ These commands submit one paid SAM 3 project using the configured account.
14
+ Include points identify the object; exclude points remove unwanted areas.
15
+ The result is one lossless binary PNG at the original dimensions. White selects
16
+ the object. Inspect the full-size mask before paying for a downstream edit.
17
+
18
+ The command selects `sam3_image_segment_bf16`, uses one inference step and no
19
+ previews, and keeps the content filter enabled. Do not supply output dimensions,
20
+ generation prompts, or another generation mode. It requires client 5.31.0 or later;
21
+ the package pins the compatible runtime. `--segment-box` accepts normalized
22
+ left,top,right,bottom bounds. A point may select only a flame, window, or other
23
+ subpart. To select a complete object, refine with a short text label and a box,
24
+ then inspect the actual SAM mask. Never use the box itself as a substitute mask.
25
+ Text and points cannot be combined. Limits: 240 text characters, 32 points,
26
+ 16 boxes; point prompts accept at most one box.
27
+
28
+ Keep the original still as the edit reference. When the edit model supports only
29
+ context images, a binary mask is a visual selection guide, not a strict inpainting
30
+ constraint. Review what changed outside the selection as well as inside it.
31
+ A registered character needs its saved reference images; an object label or
32
+ character name cannot preserve identity.
33
+
34
+ For a branching world, create a destination **still** from the original and
35
+ selection, then animate between the original parent and destination stills at
36
+ matching aspect ratios. Every subsequent node starts from that generated still.
37
+ Never promote an extracted video frame or a screenshot into the canonical scene.
38
+
39
+ The CLI capability is separate from hosted chat tool discovery. Do not invent a
40
+ hosted `segment_image` tool: inspect the connected tool catalog before dispatching
41
+ through chat. Use the CLI or SDK when segmentation is absent there.
@@ -202,6 +202,119 @@ supplies no words, author one concise line that realizes that request. If there
202
202
  is no vocal intent, do not invent speech. Use a compound ID such as `(S1,S2)`
203
203
  only when already-numbered speakers vocalize together.
204
204
 
205
+ ### Writing the body the way the Base model reads it
206
+
207
+ Audited 2026-09-10 against MiniMax's `VIDEO_PROMPT_WRITING_GUIDE_base_en.md`
208
+ (the guide the h3-prompt-writing skill wraps) and the LightX2V rewriter that
209
+ was trained on the same rewrite policy. The open-weights H3-Base checkpoint
210
+ reads the prompt directly with no hosted Context-IR rewrite in front of it, so
211
+ every sentence is model input. Everything below is what the official examples
212
+ do and never deviate from:
213
+
214
+ - **Open `[Shot 1]` with the medium and look as concrete facts** (`Live-action,
215
+ cinematic`, `2D-animated`, `3D CG`, `claymation`, `watercolor`, `vintage
216
+ film`) plus the initial composition. In frame-anchored modes derive the look
217
+ from the picture. Genre, mood, audience, and intent labels (`horror`, `eerie`,
218
+ `adult`, `tense`, `jump scare`) are not visible and never appear in an
219
+ official example; write the light, surfaces, distances, movements, and sounds
220
+ that produce them.
221
+ - **Every sentence is a depiction.** The guide's rule is that every detail must
222
+ correspond to something visible or audible. Never write notes to the model
223
+ (`preserve believable anatomy`, `keep the foley prominent`, `hard cut, no
224
+ morph or dissolve`, `hold six frames only`, `this anchor is excluded from the
225
+ presentation`) and never shout in capitals.
226
+ - **State exclusions as positive facts.** There is no negative field and the
227
+ contract has no negation grammar, so `no people, faces or words` names the
228
+ things it tries to remove. Write `the hall is empty and still`, `the walls are
229
+ bare`, `the air is clear and sharply lit`. Keep a user-supplied exclusion only
230
+ when it cannot be stated positively, phrased once. `non_diegetic_music: N/A`
231
+ is the reliable way to keep score out even when the rest of the structure is
232
+ loose.
233
+ - **Clock times exist only on cut markers.** `[Shot 2] At 00:03.500, the camera
234
+ cuts to …` is the only place a time appears. Inside a shot, order events with
235
+ words (`early in the shot`, `as the doors part`, `toward the end`). In-shot
236
+ ranges such as `From 00:02.000 to 00:04.000` are not H3 syntax; the shaper now
237
+ flags them.
238
+ - **Camera moves use the official vocabulary** as natural prose: `Zoom In/Out`,
239
+ `Push In/Pull Out`, `Pan Left/Right`, `Truck Left/Right`, `Tilt Up/Down`,
240
+ `Pedestal Up/Down`, `Arc Shot`, `Tracking Shot`, `Static Shot`, `Shake
241
+ Slightly/Strongly`, `POV`, `Roll Clockwise/Counterclockwise`, with `with
242
+ small/large amplitude` and `at slow/fast speed` only when they matter. One
243
+ primary move per shot. First-person coverage is a `POV shot`; `handheld` reads
244
+ as camera shake, so write it only when shake is wanted.
245
+ - **Frame-anchored modes describe the path, not the pictures.** The model sees
246
+ every attached picture; describing one back at length, or adding objects,
247
+ text, fluids, or figures that are not in it, produces crossfades and invented
248
+ props. I2VA: first-frame anchor → action onset → continuous development →
249
+ result or reaction. FL2VA: first-frame state → observable intermediate
250
+ changes → progressively narrowing differences → last-frame state, in **one
251
+ continuous shot** unless the user explicitly asks for cuts; begin `in the
252
+ position and framing established by Picture 1`, carry the identity anchors
253
+ that must stay fixed into the motion sentences, and end by settling `into the
254
+ pose, spacing, and composition established by Picture 2 at the end of the
255
+ shot`. L2VA: plausible preceding state → explicit action and transition path →
256
+ gradual convergence in the final shot → last-frame landing on `<Picture 1>`.
257
+ Exact composition matching applies only at a picture's assigned timestamp.
258
+ - **Bind every vocal line to its speaker in the same sentence:**
259
+ `The young woman with a quiet, breathy voice (S1) says: <d>[English] I get
260
+ off at the next station.</d>` and `The two children (S1,S2) shout together,
261
+ <d>[English] Wait for us!</d>`.
262
+ - **Length.** Official bodies run roughly 150–450 words; Ref2VA
263
+ `detailed_description` targets 350–500. Long is fine when every sentence is a
264
+ visible or audible event.
265
+
266
+ ### Beats and voices (2026-09-11 review lessons)
267
+
268
+ Tested on a branching horror route the same day, on top of the rules above:
269
+
270
+ - **One continuous shot is still the default.** In most cases it is preferred
271
+ and the shot count stays as low as the content allows. What made the slow
272
+ takes boring was emptiness, not the lack of cuts: something new should
273
+ happen every 1.5–2.5 seconds inside the shot (an action, a reaction, a
274
+ reveal, a line), never walking or waiting.
275
+ - **Beats and multi-shot are tools for when the context calls for them.** A
276
+ chase, a reveal that needs a new viewpoint, an exchange of lines, a jump in
277
+ space or time: then cut (`[Shot 2] At 00:01.500, the camera cuts to …`),
278
+ keep continuous motion inside each shot, and let the final shot cut to the
279
+ Picture 2 composition and hold with a live action, which lands cleanly where
280
+ a long interpolation would crossfade. Never cut a simple movement into
281
+ pieces, and if both pictures share one camera position the camera does not
282
+ move at all (a curtain dropping needs a static shot, not a tracking shot
283
+ away).
284
+ - **Write physical acts as acts.** A fall is the rail giving, the wall of
285
+ windows streaking upward, the ground rushing in. A bite is the jaws snapping
286
+ shut over the picture. A shove is two palms filling the frame. "His lips
287
+ part as he bends closer" produced no bite; "You brought it back" followed by
288
+ a cut to an aftermath still produced no fall.
289
+ - **Describe the voice, not just the mood.** At a speaker's first line give
290
+ accent, pitch, timbre and speaking rate: `The woman (S1), speaking in a
291
+ plain American accent with a light, mid-pitched voice at a quick, breathless
292
+ pace, says: <d>[English] …</d>`. "A bright, breathless voice" alone drifted
293
+ to a British accent between takes.
294
+ - **Dialogue after the action that motivates it.** She says "That's my dad"
295
+ after she has picked the photograph up, in the shot where she holds it.
296
+ - **Whose hands.** In first-person coverage say whose hands are in frame
297
+ ("both his palms fill the frame as he shoves"); "hands seizing the front of
298
+ the cardigan" was rendered as the attacker's own point of view.
299
+
300
+ ### Worked example — first frame → last frame
301
+
302
+ ```text
303
+ User ask (two uploaded stills): "the elevator doors open onto the laundry and we walk in"
304
+
305
+ sogni-agent -q --video -m minimax-h3-flf2v-balanced --ref ./elevator.png --ref-end ./laundry.png --duration 8 -w 1344 -h 768 -o ./press-b.mp4 "<prompt below>"
306
+ ```
307
+
308
+ ```text
309
+ How the reference pictures align with the target video — Picture 1 (from Shot 1) aligns with the 0.00-second mark of the target video; Picture 2 (from Shot 1) aligns with the 8.00-second mark of the target video.
310
+
311
+ integrated_multimodal_description: [Shot 1] Live-action, cinematic, a POV shot at standing eye level begins in the position and framing established by Picture 1, facing the closed brass elevator doors from inside the small wood-panelled vestibule with its dark red velvet panels, marble floor and crystal ceiling lamp. Early in the shot the lamp flickers twice and the floor shudders as the car settles. The brass doors slide apart with a slow steady motion, and bright white fluorescent light from beyond spills across the marble floor and the brass door frame. Through the widening gap the long white-tiled laundry hall comes into view: the raised tiled walkway with steel rails, the row of round steel washing-machine doors along the left wall, and the open steel service door with its amber wall lamp at the far right. The camera pushes in with large amplitude at slow speed through the open doorway, the brass frame sliding out of the picture on both sides as the tiled floor takes over the foreground and the red brake lever comes into view at the near left. Toward the end the differences narrow as the camera glides forward and settles into the composition, spacing and lighting established by Picture 2 at the end of the shot, with the machines still, the grey curtains hanging straight and the hall empty and quiet.
312
+
313
+ overall_soundscape: A low electrical hum from the crystal lamp, a muffled cable groan and a soft mechanical shudder as the car settles, then the smooth metallic slide of the brass doors parting. Beyond the doors an even ventilation hum and the buzz of fluorescent tubes grow louder over slow footsteps that move from marble onto tile.
314
+
315
+ non_diegetic_music: N/A
316
+ ```
317
+
205
318
  ### Worked example — text-to-video
206
319
 
207
320
  ```text
@@ -358,8 +471,9 @@ How the reference pictures align with the target video — Picture 1 (from Shot
358
471
  ```
359
472
 
360
473
  `N` is the index of the actual final shot (`Shot 1` for the usual single-shot
361
- transition), and `S.SS` is the effective duration to exactly two decimal places
362
- — `10.13` for 243 frames at 24 fps (243 ÷ 24 = 10.125, rounded up).
474
+ transition; FL2VA favours one continuous shot and cuts only when the user asks),
475
+ and `S.SS` is the effective duration to exactly two decimal places — `10.13` for
476
+ 243 frames at 24 fps (243 ÷ 24 = 10.125, rounded up).
363
477
 
364
478
  ### MiniMax H3 reference-to-video (r2v)
365
479
 
@@ -0,0 +1,40 @@
1
+ export const SAM3_MODEL_ID = 'sam3_image_segment_bf16';
2
+
3
+ export function segmentPoint(value, label) {
4
+ const parts = value.split(',');
5
+ const coordinates = parts.map(Number);
6
+ if (parts.length !== 2 || parts.some(part => !part.trim()) || coordinates.some(n => !Number.isFinite(n) || n < 0 || n > 1)) {
7
+ throw new Error('Selection points use normalized x,y coordinates between 0 and 1.');
8
+ }
9
+ return { x: coordinates[0], y: coordinates[1], label };
10
+ }
11
+
12
+ export function segmentBox(value) {
13
+ const parts = value.split(','); const [x0, y0, x1, y1] = parts.map(Number);
14
+ if (parts.length !== 4 || parts.some(part => !part.trim()) || [x0, y0, x1, y1].some(n => !Number.isFinite(n) || n < 0 || n > 1) || x0 >= x1 || y0 >= y1) {
15
+ throw new Error('Selection boxes use normalized x0,y0,x1,y1 coordinates, with x0 < x1 and y0 < y1.');
16
+ }
17
+ return { x0, y0, x1, y1 };
18
+ }
19
+
20
+ export function validateSegmentationPrompts(points, text, boxes = []) {
21
+ const label = text?.trim();
22
+ if (points.length > 32 || boxes.length > 16 || (label?.length ?? 0) > 240 || (!points.some(point => point.label === 'positive') && !label && !boxes.length)) {
23
+ throw new Error('Supply a positive point, box or object description; use at most 32 points, 16 boxes and 240 text characters.');
24
+ }
25
+ if (label && points.length) throw new Error('Text and point prompts cannot be combined; use text with optional boxes, or points with at most one box.');
26
+ if (points.length && boxes.length > 1) throw new Error('Point prompts support at most one box.');
27
+ }
28
+
29
+ export function segmentationConfig(bytes, dimensions, points, text, tokenType = 'spark', boxes = []) {
30
+ if (!dimensions || !Number.isSafeInteger(dimensions.width) || !Number.isSafeInteger(dimensions.height)
31
+ || dimensions.width < 256 || dimensions.height < 256 || dimensions.width > 2560 || dimensions.height > 2560
32
+ || bytes.length > 24 * 1024 * 1024) throw new Error('Choose an original still under 24 MB, with each edge between 256 and 2560 pixels.');
33
+ validateSegmentationPrompts(points, text, boxes);
34
+ return {
35
+ modelId: SAM3_MODEL_ID, positivePrompt: 'Select the indicated object.', negativePrompt: '',
36
+ startingImage: bytes, sam3Prompt: { ...(points.length ? { points } : {}), ...(boxes.length ? { boxes } : {}), ...(text?.trim() ? { text: text.trim() } : {}), threshold: 0.5, multimask: points.length > 0 },
37
+ ...dimensions, sizePreset: 'custom', numberOfMedia: 1, numberOfPreviews: 0, steps: 1, guidance: 1,
38
+ outputFormat: 'png', disableNSFWFilter: false, tokenType, waitForCompletion: false,
39
+ };
40
+ }
@@ -22,6 +22,7 @@ const referenceFiles = [
22
22
  'krea2-loras.md',
23
23
  'loop-maker.md',
24
24
  'models.md',
25
+ 'object-selection.md',
25
26
  'personas-memory.md',
26
27
  'private-mature-video.md',
27
28
  'seamless-tiling.md',
@@ -3,7 +3,7 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@sogni-ai/sogni-intelligence-client": "3.29.1",
6
+ "@sogni-ai/sogni-intelligence-client": "3.31.1",
7
7
  "execa": "^10.0.1",
8
8
  "json5": "^2.2.3",
9
9
  "sharp": "0.35.4"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sogni-creative-agent
3
- description: Generate and edit images, video, and music using Sogni AI's decentralized GPU network. Use for image generation or editing, first-frame/last-frame animation, video generation, music and soundtrack creation, personas, style transfer, and other Sogni Creative Agent workflows.
3
+ description: Generate and edit images, video, and music using Sogni AI's decentralized GPU network. Use for image generation or editing, SAM 3 object masks, first-frame/last-frame animation, video generation, music and soundtrack creation, personas, style transfer, and other Sogni Creative Agent workflows.
4
4
  ---
5
5
 
6
6
  # Sogni Creative Agent
package/sogni-agent.mjs CHANGED
@@ -28,6 +28,7 @@ import {
28
28
  semanticWorkloadAttribution,
29
29
  } from './attribution.mjs';
30
30
  import { assertSafeUrl, fetchSafeUrl } from './ssrf-guard.mjs';
31
+ import { SAM3_MODEL_ID, segmentPoint, segmentBox, validateSegmentationPrompts, segmentationConfig } from './sam-segmentation.mjs';
31
32
  import {
32
33
  INTERNAL_FLAG as UPDATE_CHECK_INTERNAL_FLAG,
33
34
  runForegroundCheck as runUpdateCheckForeground,
@@ -89,6 +90,10 @@ import {
89
90
  } from '@sogni-ai/sogni-intelligence-client/chatRun';
90
91
  import {
91
92
  buildImageEditExecutionControls,
93
+ normalizeGptImageModelAlias,
94
+ normalizeGptImageQuality,
95
+ getGptImageRequestOptions,
96
+ isGptImageModel,
92
97
  isKreaIdentityEditModel,
93
98
  SEEDANCE_R2V_REFERENCE_AUDIO_MAX_DURATION_SECONDS,
94
99
  prepareSeedanceV2VSourceVideo as prepareSharedSeedanceV2VSourceVideo
@@ -1369,8 +1374,11 @@ function resolveRtxVsrDimensions(sourceWidth, sourceHeight, { scale = 2, targetL
1369
1374
  }
1370
1375
 
1371
1376
  // Promptless FlashVSR video upscaling (--upscale-video). The server probes the
1372
- // uploaded source and stays authoritative; these public limits let the CLI
1373
- // explain an unsupported clip before any upload.
1377
+ // uploaded source and stays authoritative; these public geometry, frame-rate
1378
+ // and file-size limits let the CLI explain an unsupported clip before any
1379
+ // upload. There is deliberately no frame-count or duration limit here: the
1380
+ // server's admission check alone sets the maximum clip length and refuses a
1381
+ // source that is too long (see annotateVideoUpscaleError).
1374
1382
  const FLASHVSR_MODEL_ID = 'flashvsr_v1.1_tiny_long_bf16';
1375
1383
  const VIDEO_UPSCALE_RESOLUTIONS = [1080, 1440];
1376
1384
  const VIDEO_UPSCALE_DEFAULT_RESOLUTION = 1440;
@@ -1517,12 +1525,25 @@ async function probeVideoUpscaleSource(buffer, sourceLabel) {
1517
1525
  return { width, height, frames, fps, sizeBytes: buffer.length };
1518
1526
  }
1519
1527
 
1528
+ // The server's own refusal of a source longer than it accepts. Only the server
1529
+ // knows the current maximum, so the CLI relays its sentence rather than
1530
+ // restating a limit.
1531
+ const VIDEO_UPSCALE_TOO_LONG_PATTERN = /This video is too long to upscale\b.*$/s;
1532
+
1520
1533
  function annotateVideoUpscaleError(error) {
1521
1534
  const message = String(error?.message || error?.originalError?.message || '');
1522
1535
  if (error && typeof error === 'object' && message.includes(FLASHVSR_UNAVAILABLE_MESSAGE)) {
1523
1536
  if (!error.code || error.code === 'PROJECT_ERROR') error.code = 'MODEL_UNAVAILABLE';
1524
1537
  error.hint = 'FlashVSR upscaling workers are not online yet, so nothing was charged. Try again later.';
1525
1538
  }
1539
+ const tooLong = [error?.message, error?.originalError?.message]
1540
+ .map((text) => String(text || '').match(VIDEO_UPSCALE_TOO_LONG_PATTERN)?.[0].trim())
1541
+ .find(Boolean);
1542
+ if (error && typeof error === 'object' && tooLong) {
1543
+ error.message = tooLong;
1544
+ if (!error.code || error.code === 'PROJECT_ERROR') error.code = 'INVALID_UPSCALE_SOURCE';
1545
+ error.hint = 'Trim the video, or split it into shorter clips and upscale each one.';
1546
+ }
1526
1547
  return error;
1527
1548
  }
1528
1549
 
@@ -1750,8 +1771,20 @@ function isWanAnimateVideoModelId(modelId) {
1750
1771
  }
1751
1772
 
1752
1773
  function isGptImage2ModelSelection(modelId) {
1753
- const normalized = String(modelId || '').trim().toLowerCase();
1754
- return ['gpt-image-2', 'gptimage2', 'gpt-image', 'gpt_image_2'].includes(normalized);
1774
+ return isGptImageModel(normalizeGptImageModelAlias(modelId));
1775
+ }
1776
+
1777
+ function imageOptionsFromCli() {
1778
+ if (!isGptImage2ModelSelection(options.model)) return {};
1779
+ return {
1780
+ ...getGptImageRequestOptions({
1781
+ gptImageBackground: options.imageBackground ?? undefined,
1782
+ gptImageOutputCompression: options.imageOutputCompression ?? undefined,
1783
+ outputFormat: options.outputFormat ?? 'png'
1784
+ }, options.model),
1785
+ gptImageQuality: normalizeGptImageQuality(options.imageQuality ??
1786
+ (options.quality === 'pro' ? 'high' : options.quality === 'fast' ? 'low' : 'medium'), options.model)
1787
+ };
1755
1788
  }
1756
1789
 
1757
1790
  const SEEDANCE_TASK_TYPES = new Set(['reference', 'edit', 'extend']);
@@ -2818,6 +2851,10 @@ const options = {
2818
2851
  steps: null,
2819
2852
  guidance: null,
2820
2853
  outputFormat: null,
2854
+ imageQuality: null,
2855
+ imageBackground: null,
2856
+ imageOutputCompression: null,
2857
+ imageMask: null,
2821
2858
  sampler: null,
2822
2859
  scheduler: null,
2823
2860
  loras: [],
@@ -2877,6 +2914,10 @@ const options = {
2877
2914
  outpaintAspectRatio: null, // Optional target aspect ratio for outpaint canvas growth
2878
2915
  contextImages: [], // Context images for image editing
2879
2916
  upscaleImage: null, // Source image for promptless RTX VSR upscaling
2917
+ segmentImage: null,
2918
+ segmentPoints: [],
2919
+ segmentBoxes: [],
2920
+ segmentText: null,
2880
2921
  upscaleScale: 2,
2881
2922
  upscaleTargetLongestEdge: null,
2882
2923
  upscaleVideo: null, // Source video for promptless FlashVSR upscaling
@@ -3170,6 +3211,14 @@ for (let i = 0; i < args.length; i++) {
3170
3211
  i++;
3171
3212
  options.outputFormat = raw;
3172
3213
  cliSet.outputFormat = true;
3214
+ } else if (arg === '--image-quality') {
3215
+ options.imageQuality = requireFlagValue(args, i++, arg);
3216
+ } else if (arg === '--image-background') {
3217
+ options.imageBackground = requireFlagValue(args, i++, arg);
3218
+ } else if (arg === '--image-output-compression') {
3219
+ options.imageOutputCompression = parseNumberValue(requireFlagValue(args, i++, arg), arg);
3220
+ } else if (arg === '--image-mask') {
3221
+ options.imageMask = requireFlagValue(args, i++, arg);
3173
3222
  } else if (arg === '--sampler') {
3174
3223
  const raw = requireFlagValue(args, i, arg);
3175
3224
  i++;
@@ -3450,6 +3499,16 @@ for (let i = 0; i < args.length; i++) {
3450
3499
  i++;
3451
3500
  options.contextImages.push(raw);
3452
3501
  cliSet.context = true;
3502
+ } else if (arg === '--segment') {
3503
+ options.segmentImage = expandHomePath(requireFlagValue(args, i++, arg));
3504
+ } else if (arg === '--segment-point' || arg === '--segment-exclude') {
3505
+ try { options.segmentPoints.push(segmentPoint(requireFlagValue(args, i++, arg), arg === '--segment-point' ? 'positive' : 'negative')); }
3506
+ catch (error) { fatalCliError(error.message, { code: 'INVALID_ARGUMENT' }); }
3507
+ } else if (arg === '--segment-box') {
3508
+ try { options.segmentBoxes.push(segmentBox(requireFlagValue(args, i++, arg))); }
3509
+ catch (error) { fatalCliError(error.message, { code: 'INVALID_ARGUMENT' }); }
3510
+ } else if (arg === '--segment-text') {
3511
+ options.segmentText = requireFlagValue(args, i++, arg);
3453
3512
  } else if (arg === '--upscale') {
3454
3513
  const raw = expandHomePath(requireFlagValue(args, i, arg));
3455
3514
  i++;
@@ -4103,7 +4162,11 @@ Image Options:
4103
4162
  --distance <key> close-up|medium|wide
4104
4163
  --angle-strength <n> LoRA strength for multiple_angles (default: 0.9)
4105
4164
  --angle-description <text> Optional subject description
4106
- --output-format <f> Image output format: png|jpg (webp for gpt-image-2)
4165
+ --output-format <f> Image output format: png|jpg (webp for GPT Image)
4166
+ --image-quality <q> GPT Image: low|medium|high; 2.5 also xhigh|max
4167
+ --image-background <b> auto|opaque; 2.5 also transparent (PNG/WebP)
4168
+ --image-output-compression <n> JPEG/WebP compression, integer 0–100
4169
+ --image-mask <path|url> PNG alpha mask of first --context image, same size
4107
4170
  --sampler <name> Sampler (images/music; H3 LightX2V Turbo: euler|er_sde|sa_solver; FastH3: euler)
4108
4171
  --scheduler <name> Scheduler (model-dependent)
4109
4172
  --lora <id> Image LoRA id (repeatable; order is significant)
@@ -4112,6 +4175,11 @@ Image Options:
4112
4175
  --lora-strengths <n> Comma-separated LoRA strengths
4113
4176
  -c, --context <path> Context image for editing (can use multiple)
4114
4177
  --last-image Use last generated image as context
4178
+ --segment <path|url> SAM 3 object selection; returns one original-size PNG mask
4179
+ --segment-point <x,y> Include point, normalized 0–1; repeat to refine
4180
+ --segment-exclude <x,y> Exclude point, normalized 0–1; repeat to refine
4181
+ --segment-box <x0,y0,x1,y1> Object bounds, normalized 0–1
4182
+ --segment-text <text> Object description; combine with boxes, never points
4115
4183
  --upscale <path|url> Promptless NVIDIA RTX VSR upscale, up to 16K (one source image)
4116
4184
  --upscale-scale <n> Enlarge longest edge by 2, 3, or 4 (default: 2)
4117
4185
  --target-longest-edge <px> Explicit output longest edge, up to 15360 (overrides scale)
@@ -4330,6 +4398,8 @@ Personas (named people with reference photos):
4330
4398
  Image Models:
4331
4399
  z_image_turbo_bf16 Fast, general purpose (default)
4332
4400
  gpt-image-2 OpenAI GPT Image 2 text-to-image and edit (up to 16 context images)
4401
+ gpt-image-2.5-sunburst GPT Image 2.5 Sunburst: edits, masks, 16 references, transparency
4402
+ gpt-image-2.5-flare GPT Image 2.5 Flare: edits, masks, 16 references, transparency
4333
4403
  krea2_turbo_fp8_scaled Krea 2 Turbo text-to-image
4334
4404
  dark_beast_krea2_fp8 Dark Beast Krea 2 text-to-image
4335
4405
  krea2_identity_edit_v1_2 Krea 2 Identity Edit LoRA (up to 2 context images)
@@ -4802,6 +4872,9 @@ if (options.multiAngle) {
4802
4872
  }
4803
4873
  }
4804
4874
 
4875
+ if (!options.video && !options.music && options.model) {
4876
+ options.model = normalizeGptImageModelAlias(options.model);
4877
+ }
4805
4878
  if (options.outputFormat) {
4806
4879
  const normalized = options.outputFormat.toLowerCase();
4807
4880
  options.outputFormat = normalized === 'jpeg' ? 'jpg' : normalized;
@@ -4827,6 +4900,24 @@ if (options.outputFormat) {
4827
4900
  }
4828
4901
  }
4829
4902
 
4903
+ if (options.imageQuality !== null || options.imageBackground !== null || options.imageOutputCompression !== null || options.imageMask !== null) {
4904
+ try {
4905
+ if (options.video || options.music || !isGptImage2ModelSelection(options.model)) {
4906
+ throw new Error('Image quality, background, compression and mask options require a GPT Image model.');
4907
+ }
4908
+ // Provider-chosen (auto) quality is never used.
4909
+ if (options.imageQuality !== null && !['low', 'medium', 'high', 'xhigh', 'max'].includes(options.imageQuality)) {
4910
+ throw new Error('--image-quality must be low, medium, high, xhigh, or max.');
4911
+ }
4912
+ imageOptionsFromCli();
4913
+ if (options.imageMask && options.contextImages.length === 0) {
4914
+ throw new Error('--image-mask requires a first --context source image.');
4915
+ }
4916
+ } catch (error) {
4917
+ fatalCliError(error.message, { code: 'INVALID_ARGUMENT' });
4918
+ }
4919
+ }
4920
+
4830
4921
  if (options.video) {
4831
4922
  options.model = resolveSkillVideoModelAlias(options.model);
4832
4923
  if (options.model === LTX23_10EROS_MODEL_ID && !options.noFilter) {
@@ -5332,6 +5423,10 @@ if (options.music) {
5332
5423
  if (!cliSet.timeout && !timeoutFromConfig && options.timeout === 30000) {
5333
5424
  options.timeout = 1800000; // 30 min for queued video work
5334
5425
  }
5426
+ } else if (options.segmentImage) {
5427
+ if (options.model && options.model !== SAM3_MODEL_ID) fatalCliError(`--segment requires model ${SAM3_MODEL_ID}.`, { code: 'INVALID_ARGUMENT' });
5428
+ options.model = SAM3_MODEL_ID;
5429
+ if (!cliSet.timeout && !timeoutFromConfig) options.timeout = 180000;
5335
5430
  } else if (options.upscaleImage) {
5336
5431
  if (options.model && options.model !== RTX_VSR_MODEL_ID) {
5337
5432
  fatalCliError(`--upscale requires model ${RTX_VSR_MODEL_ID}.`, {
@@ -5361,6 +5456,17 @@ if (options.music) {
5361
5456
  options.model = options.model || openclawConfig?.defaultImageModel || 'z_image_turbo_bf16';
5362
5457
  }
5363
5458
 
5459
+ if (!options.video && !options.music && isGptImage2ModelSelection(options.model)) {
5460
+ options.model = normalizeGptImageModelAlias(options.model);
5461
+ if (!cliSet.width && !widthFromConfig && !widthFromPrompt) options.width = 1024;
5462
+ if (!cliSet.height && !heightFromConfig && !heightFromPrompt) options.height = 1024;
5463
+ const { width, height } = options;
5464
+ if (width % 16 || height % 16 || Math.max(width, height) > 3840 || Math.max(width, height) / Math.min(width, height) > 3 || width * height < 655360 || width * height > 8294400) {
5465
+ fatalCliError('GPT Image dimensions must be multiples of 16, at most 3840 per edge, within 3:1 and 655360–8294400 pixels.', { code: 'INVALID_ARGUMENT' });
5466
+ }
5467
+ if (!cliSet.timeout && !timeoutFromConfig) options.timeout = 600000;
5468
+ }
5469
+
5364
5470
  if (options.music) {
5365
5471
  const musicDefaults = getMusicModelDefaults(options.model);
5366
5472
  if (options.duration < MUSIC_DURATION_LIMITS.min || options.duration > MUSIC_DURATION_LIMITS.max) {
@@ -5457,6 +5563,7 @@ const commandUsesGenerationSeed = !options.apiChat &&
5457
5563
  !options.remixAudio &&
5458
5564
  !options.upscaleImage &&
5459
5565
  !options.upscaleVideo &&
5566
+ !options.segmentImage &&
5460
5567
  !options.listMedia &&
5461
5568
  !options.memoryAction &&
5462
5569
  !options.personalityAction &&
@@ -5495,7 +5602,7 @@ const wan3HasMediaInput = isWan3ModelLocal(options.model) && Boolean(
5495
5602
  || options.wan3ReferenceFileUrl
5496
5603
  || options.wan3ReferenceLinkUrl
5497
5604
  );
5498
- if (!options.prompt && !wan3HasMediaInput && !options.upscaleImage && !options.upscaleVideo && !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.trimVideo && !options.verifyVideo && !options.concatVideos && !options.sourceReelDir && !options.remixAudio && !options.listMedia && !options.memoryAction && !options.personalityAction && !personaUtilityAction) {
5605
+ if (!options.prompt && !wan3HasMediaInput && !options.segmentImage && !options.upscaleImage && !options.upscaleVideo && !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.trimVideo && !options.verifyVideo && !options.concatVideos && !options.sourceReelDir && !options.remixAudio && !options.listMedia && !options.memoryAction && !options.personalityAction && !personaUtilityAction) {
5499
5606
  fatalCliError('No prompt provided. Use --help for usage.', { code: 'INVALID_ARGUMENT' });
5500
5607
  }
5501
5608
 
@@ -5510,6 +5617,17 @@ if (options.apiChat && !options.prompt && getApiModeMediaReferences().length ===
5510
5617
  fatalCliError('--api-chat requires a prompt or media reference for planning.', { code: 'INVALID_ARGUMENT' });
5511
5618
  }
5512
5619
 
5620
+ if (options.segmentImage) {
5621
+ if (options.prompt || options.video || options.music || options.upscaleImage || options.upscaleVideo || options.photobooth || options.contextImages.length || options.refImage || options.refImageEnd
5622
+ || options.apiChat || options.apiWorkflowAction || options.multiAngle || options.noFilter || options.count !== 1 || cliSet.width || cliSet.height) {
5623
+ fatalCliError('--segment requires one original image with selection points or --segment-text; omit generation prompts, resize, other generation modes and --no-filter.', { code: 'INVALID_ARGUMENT' });
5624
+ }
5625
+ try { validateSegmentationPrompts(options.segmentPoints, options.segmentText, options.segmentBoxes); }
5626
+ catch (error) { fatalCliError(error.message, { code: 'INVALID_ARGUMENT' }); }
5627
+ } else if (options.segmentPoints.length || options.segmentBoxes.length || options.segmentText !== null) {
5628
+ fatalCliError('Selection prompts require --segment <path|url>.', { code: 'INVALID_ARGUMENT' });
5629
+ }
5630
+
5513
5631
  if (options.upscaleImage) {
5514
5632
  if (options.prompt) {
5515
5633
  fatalCliError('--upscale is promptless and does not accept a prompt.', { code: 'INVALID_ARGUMENT' });
@@ -7919,6 +8037,7 @@ function buildGeneratedKeyframeVideoWorkflowInput() {
7919
8037
  }
7920
8038
 
7921
8039
  function storyboardWorkflowImageQualityFromCli() {
8040
+ if (options.imageQuality) return options.imageQuality;
7922
8041
  if (!cliSet.quality || !options.quality) return undefined;
7923
8042
  if (options.quality === 'pro') return 'high';
7924
8043
  if (options.quality === 'fast') return 'low';
@@ -13345,6 +13464,14 @@ async function main() {
13345
13464
  if (upscaleVideoResult?.error || upscaleVideoResult?.message) {
13346
13465
  throw annotateVideoUpscaleError(buildProjectResultError(upscaleVideoResult));
13347
13466
  }
13467
+ } else if (options.segmentImage) {
13468
+ log('Selecting the object with SAM 3...');
13469
+ const bytes = await fetchMediaBuffer(options.segmentImage);
13470
+ const dimensions = getImageDimensionsFromBuffer(bytes);
13471
+ const config = segmentationConfig(bytes, dimensions, options.segmentPoints, options.segmentText, options.tokenType || 'spark', options.segmentBoxes);
13472
+ options.width = config.width; options.height = config.height; options.outputFormat = 'png';
13473
+ const result = trackProjectResult(await client.createImageProject(withBillingMode(config)));
13474
+ if (result?.error || result?.message) throw buildProjectResultError(result);
13348
13475
  } else if (options.upscaleImage) {
13349
13476
  log(`Upscaling with ${RTX_VSR_MODEL_ID}...`);
13350
13477
  const sourceBuffer = await fetchMediaBuffer(options.upscaleImage);
@@ -13443,6 +13570,8 @@ async function main() {
13443
13570
  if (gptImageQuality) {
13444
13571
  editConfig.gptImageQuality = gptImageQuality;
13445
13572
  }
13573
+ Object.assign(editConfig, imageOptionsFromCli());
13574
+ if (options.imageMask) editConfig.gptImageMask = await fetchMediaBuffer(options.imageMask);
13446
13575
  if (options.loras.length > 0) {
13447
13576
  editConfig.loras = options.loras;
13448
13577
  }
@@ -13558,6 +13687,7 @@ async function main() {
13558
13687
  if (gptImageQuality) {
13559
13688
  projectConfig.gptImageQuality = gptImageQuality;
13560
13689
  }
13690
+ Object.assign(projectConfig, imageOptionsFromCli());
13561
13691
  if (options.sampler) {
13562
13692
  projectConfig.sampler = options.sampler;
13563
13693
  }
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.42.0';
1
+ export const PACKAGE_VERSION = '3.46.0';