@sogni-ai/sogni-creative-agent-skill 3.50.0 → 3.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ name: sogni-creative-agent-skill
3
3
  description: "Generate and edit images, create Pixal3D 3D models, remove backgrounds with BiRefNet, synthesize Qwen3-TTS speech, upscale images, create video and music, animate image folders into seamless reels, and manage reusable personas with Sogni AI. Use when a Hermes user asks to draw, render, upscale, edit or restyle an image, animate an image, make a video, create music or lyrics, build a media workflow, apply a saved identity, or refine an earlier Sogni result."
4
4
  license: MIT
5
5
  metadata:
6
- version: "3.50.0"
6
+ version: "3.51.1"
7
7
  author: Sogni AI
8
8
  hermes:
9
9
  category: creative
@@ -160,3 +160,5 @@ and Music 3 section tags. Discover 3D with `--search-models pixal3d` or
160
160
  eligibility and prompting rules.
161
161
 
162
162
  Where a reference says `sogni-agent`, substitute `sogni-agent-hermes`.
163
+
164
+ Personal LoRA imports and library management: read [Personal LoRAs](./references/personal-loras.md) for account-bound discovery, asynchronous import status, consent, compatible models, and rendering with owned adapters.
@@ -321,3 +321,19 @@ Override the API origin with `--api-base-url`, `SOGNI_API_BASE_URL`, or
321
321
  hosted workflow + chat operations route through the SDK transport; the skill's
322
322
  `sogni-hosted-client.mjs` factory still validates `restEndpoint` /
323
323
  `socketEndpoint` against the SSRF guard before constructing the SDK client.
324
+
325
+
326
+ ## Original-image utilities and speech
327
+
328
+ Submit these media tools as durable workflow steps (`toolName` and `arguments`) to `POST /v1/creative-agent/workflows`, or use hosted chat. The synchronous `/tools/execute` endpoint supports text composition only:
329
+
330
+ | Tool | Inputs and controls | Output |
331
+ | --- | --- | --- |
332
+ | `remove_background` | `sourceImageIndex` or `source_image_url`, `applyMask` (default true) | Transparent PNG; false returns mask |
333
+ | `image_to_3d` | Front `sourceImageIndex`/`source_image_url`; optional `leftViewImageIndex`, `backViewImageIndex`, `rightViewImageIndex` or named `*_view_image_url` URLs; `meshTargetFaces`, `textureSize`, `normalMapSize`, `ambientOcclusionSize`, `shapeResolution` | Binary GLB with media type `model` |
334
+ | `segment_image` | Original source; `text`, `points`, or `boxes`; `threshold`, `multimask`, `maxInstances`, `applyMask` | PNG mask or original-pixel cutout |
335
+ | `generate_speech` | Literal `prompt`; `model=voice/clone/design`; `voice`, `voiceDescription`, `voiceSourceIndex`, `voiceTranscript`, `language`, `creativity`, `outputFormat`, `seed` | Spoken audio |
336
+
337
+ Negative indices address uploads (-1 first); non-negative indices address generated results. 3D views are from the subject's perspective: left means the subject's own left side faces camera (subject faces screen-left), right means screen-right. Supply original images of the same subject at consistent height and framing; any subset of the three orbit views enables multi-view reconstruction. Keep the GLB in the model artifact lane, never feed it into an image tool.
338
+
339
+ For two-stage Turbo H3, use explicit `minimax-h3-fasth3-*-turbo-2stage` selectors on the relevant video tool with `targetResolution`. Audio-guided IA2V/FLFA2V/A2V selectors belong on `sound_to_video` and require the uploaded audio plus their named endpoint images. They preserve the supplied audio and reject LoRAs. Other H3 modes discover personal LoRAs through the [authenticated catalog](personal-loras.md).
@@ -0,0 +1,33 @@
1
+ # Personal LoRAs
2
+
3
+ Read this when the user wants to import, inspect, remove, or render with their own LoRA. These commands use `SOGNI_API_KEY` for the same account as Sogni Web. Import and generation require Unlimited; list and removal remain available after it expires.
4
+
5
+ ```bash
6
+ sogni-agent --list-personal-loras
7
+ sogni-agent --import-lora https://huggingface.co/author/repository/resolve/main/style.safetensors --personal-lora-name "My style" --personal-lora-model krea2_turbo_fp8_scaled --confirm-lora-rights
8
+ sogni-agent --get-personal-lora personal-REPLACE-WITH-RETURNED-ID
9
+ sogni-agent --list-loras --include-personal-loras --lora-catalog-model krea2_turbo_fp8_scaled
10
+ ```
11
+
12
+ The import command starts asynchronous validation. Poll `--get-personal-lora` at a reasonable interval and show `reason`/`failureCode` on failure. Only `ready` entries can render; `queued`, `validating`, and `review` need more time. `rejected` and `revoked` cannot render. Do not re-import repeatedly to poll. `--list-personal-loras` returns supported import models and current limits; discover model IDs there.
13
+
14
+ Set `--confirm-lora-rights` only when the user has confirmed permission to use that file. Hugging Face safetensors links and Civitai model/version links are accepted. An import does not train a new adapter.
15
+
16
+ Once ready, use the actual returned ID:
17
+
18
+ ```bash
19
+ sogni-agent -m krea2_turbo_fp8_scaled --lora personal-REPLACE-WITH-RETURNED-ID --no-filter "a glass sculpture"
20
+ sogni-agent --video -m minimax-h3-fasth3-t2v-turbo-2stage --target-resolution 1080p --lora personal-REPLACE-WITH-RETURNED-ID --no-filter "the user's H3 prompt"
21
+ ```
22
+
23
+ First confirm the selected model occurs in the entry's `modelIds`. Preserve the user's selected model. The CLI discovers owned entries through the authenticated catalog and uses catalog defaults when strengths are omitted; repeat `--lora-strength` to set explicit ordered strengths. Follow the entry's prompt and workflow requirements. Personal imports require `--no-filter`; explain that setting when it was not already requested. H3 audio-guided modes do not support LoRAs.
24
+
25
+ `--list-loras` remains public and requires no account; add `--include-personal-loras` to merge owned ready imports. Catalog responses are account-specific. Do not share them between users.
26
+
27
+ Remove an entry only when requested:
28
+
29
+ ```bash
30
+ sogni-agent --remove-personal-lora personal-REPLACE-WITH-RETURNED-ID
31
+ ```
32
+
33
+ For speech, `--speech --speech-mode clone --voice-reference clip.wav` clones the supplied original recording for synthesis. It is reference conditioning, not a persistent training job; see the speech guidance in SKILL.md. Background removal, multi-view 3D, and two-stage H3 have their existing direct CLI controls; hosted equivalents are documented in [hosted-api.md](hosted-api.md).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.50.0",
3
+ "version": "3.51.1",
4
4
  "description": "Sogni Creative Agent: image, 3D, speech, video, and music generation via Sogni AI's decentralized GPU network. Supports personas, persistent memories, style transfer, and multi-step creative workflows.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sogni-creative-agent",
3
- "version": "3.50.0",
3
+ "version": "3.51.1",
4
4
  "description": "Create images, 3D models, speech, generative video, music, and image-folder loops with Sogni AI.",
5
5
  "author": {
6
6
  "name": "Sogni AI",
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [3.51.1] - 2026-09-16
2
+
3
+ Includes the integration prepared as 3.51.0 (unpublished) and the shared Ref2VA prompt repair.
4
+
5
+ ### Features
6
+
7
+ * Manage the same Personal LoRA library as Sogni Web: list imports and supported models, import with confirmed rights, inspect asynchronous status, remove owned entries, and include ready personal adapters in model-filtered discovery. Generations preserve ordered strengths and use catalog defaults when no strength was selected.
8
+ * Expose hosted background removal, object segmentation, and single/multi-view Pixal3D reconstruction alongside the existing direct CLI modes. Document speech cloning, output controls, and FastH3 Two-Stage selectors.
9
+ * Use GPT Image 2.5 Sunburst and Seedance 2.5 at 1080p for new storyboard workflows; explicit existing model selections remain supported.
10
+
11
+ ### Bug Fixes
12
+
13
+ * Keep GLB outputs typed as models through durable workflow and chat records. Update the bundled runtime and exact dependencies to SDK 5.51.0, intelligence client 4.2.1, and creative agent 2.3.2.
14
+
1
15
  ## [3.50.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.49.1...v3.50.0) (2026-09-14)
2
16
 
3
17
  ### Features
package/README.md CHANGED
@@ -587,7 +587,7 @@ sogni-agent --api-workflow --ref https://cdn.example.com/sketch.png \
587
587
  # Exact durable workflow input
588
588
  sogni-agent --api-workflow --workflow-input @workflow.json
589
589
 
590
- # Storyline -> GPT Image 2 storyboard sheet -> Seedance video sequence
590
+ # Storyline -> GPT Image 2.5 Sunburst storyboard sheet -> Seedance 2.5 1080p video
591
591
  sogni-agent --api-workflow storyboard-video --storyboard-frames 6 --duration 12 -Q hq \
592
592
  "Create a 9:16 bakery launch video with a neon street-window reveal"
593
593
 
@@ -884,7 +884,7 @@ Hosted API modes require `SOGNI_API_KEY`.
884
884
  - **`--durable-chat`** starts a hosted `/v1/chat/runs` record through the SDK transport. Set `SOGNI_SKILL_USE_SDK_TRANSPORT=1` before using it. The CLI streams assistant deltas and de-duplicated per-job progress / ETA / result lines from hosted run events.
885
885
  - **`--api-workflow`** targets `/v1/creative-agent/workflows` for durable, async workflow records with event streaming and cancellation. Requests carry `input.steps` plus snake_case controls such as `token_type`, `media_references`, `max_estimated_capacity_units`, and `confirm_cost`.
886
886
  - **`--workflow-input`** forwards exact durable workflow JSON (`{ title?, steps: [...] }`). Use this when you need exact multi-step behavior such as repeated `replace_video_segment` steps with `replacementStartSeconds` / `replacementEndSeconds` for interleaved video slices.
887
- - **`--api-workflow storyboard-video`** generates a storyline, creates a single GPT Image 2 storyboard sheet, then passes that artifact into Seedance as the video reference. The `-Q fast|hq|pro` preset maps to GPT Image 2 low/medium/high quality for that storyboard sheet.
887
+ - **`--api-workflow storyboard-video`** generates a storyline, creates a single storyboard sheet with GPT Image 2.5 Sunburst, then passes that artifact into Seedance 2.5 for 1080p video generation. The `-Q fast|hq|pro` preset maps to GPT Image low/medium/high quality for that storyboard sheet; explicit model and resolution choices still win.
888
888
  - **Media references** from `-c`, `--ref`, `--ref-end`, `--ref-audio`, `--reference-audio-identity`, and `--ref-video` are forwarded as `media_references` metadata in hosted API requests. API chat also attaches image refs as vision inputs. Local file references are uploaded to Sogni media storage first, then forwarded as retrievable URLs so durable executors do not depend on `data:` URI support. Durable workflow JSON can bind those references into step arguments with `sourceStepId: "$input_media"`. Use direct CLI mode for private media that must not leave the local machine.
889
889
  - **Cost controls** use `--workflow-max-cost <n>` to reject workflow starts above a capacity-unit ceiling, and `--confirm-cost` / `--no-confirm-cost` to forward explicit billing confirmation.
890
890
  - Manage runs with `--watch-workflow`, `--workflow-events`, `--stream-workflow`, `--list-workflows`, `--get-workflow`, `--cancel-workflow`, and `--resume-workflow`. Use `--workflow-input` to provide exact durable workflow JSON.
@@ -955,7 +955,7 @@ Plan pricing, included features and models, usage allowances, fair-use controls,
955
955
  ### What the subscription covers
956
956
 
957
957
  - **Covered:** Sogni-hosted models on the Supernet — image, video, and music generation, including worker-hosted premium models. Covered renders bill to the subscription and do not spend Spark or SOGNI.
958
- - **Not subscription-covered:** external-vendor models — **GPT Image 2** (`gpt-image-2`), **Seedance 2.0 / Seedance 2.0 Mini / Seedance 2.0 Fast / Seedance 2.5** (`seedance-2-0`, `seedance-2-0-mini`, `seedance-2-0-fast`, `seedance-2-5`), **HappyHorse 1.1** (`happyhorse-1.1-t2v`, `happyhorse-1.1-i2v`, `happyhorse-1.1-r2v`), **Wan 3** (`wan3.0-video`), and **Wan 3.0 Enhanced** (`wan3.0-spicy-video`). They never fall back to SOGNI. Wan 3.0 Enhanced may use its separate launch-credit ledger before PAYG; that credit does not make the model subscription-covered.
958
+ - **Not subscription-covered:** external-vendor models — **GPT Image 2 / GPT Image 2.5 Sunburst / GPT Image 2.5 Flare** (`gpt-image-2`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`), **Seedance 2.0 / Seedance 2.0 Mini / Seedance 2.0 Fast / Seedance 2.5** (`seedance-2-0`, `seedance-2-0-mini`, `seedance-2-0-fast`, `seedance-2-5`), **HappyHorse 1.1** (`happyhorse-1.1-t2v`, `happyhorse-1.1-i2v`, `happyhorse-1.1-r2v`), **Wan 3** (`wan3.0-video`), and **Wan 3.0 Enhanced** (`wan3.0-spicy-video`). They never fall back to SOGNI. Wan 3.0 Enhanced may use its separate launch-credit ledger before PAYG; that credit does not make the model subscription-covered.
959
959
  - **Token choice stays yours:** selecting SOGNI (`--token-type sogni`) opts a job out of subscription coverage and spends SOGNI instead. Coverage applies when the active token is Spark.
960
960
 
961
961
  By default the CLI sends no `billingMode`/coverage hint; the server decides coverage from the account's verified entitlement and the resolved model, and a subscription claim is never honored without a server-verified entitlement. `--billing-mode` makes the choice explicit when you need it: `subscription` requires Unlimited coverage (the job fails instead of spending tokens), `tokens` opts out of coverage and bills Spark/SOGNI, and `auto` states the default server behavior explicitly.
@@ -1057,3 +1057,5 @@ Issues and feature requests: [github.com/Sogni-AI/sogni-creative-agent-skill/iss
1057
1057
  ## License
1058
1058
 
1059
1059
  [MIT](./LICENSE) © Sogni AI
1060
+
1061
+ Personal LoRA imports and library management: read [Personal LoRAs](./references/personal-loras.md) for account-bound discovery, asynchronous import status, consent, compatible models, and rendering with owned adapters.
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 Pixal3D single- and multi-view image-to-GLB, BiRefNet background removal, Qwen3-TTS speech/voice cloning/design, MiniMax Music 3, SAM 3 object selection, promptless RTX VSR image upscaling through 16K, promptless FlashVSR video upscaling to 1080p/1440p, one-click image-folder loop reels, personas (named people with saved reference photos and voice clips), persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/H3 Balanced/LightX2V Turbo/FastH3 Turbo (including audio-to-video from an uploaded track)/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"upscale an image\", \"upscale a video\", \"make a video/animate\", \"turn this image folder into a loop\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
3
+ description: "CLI and agent skill for personal LoRAs, image, video, and music generation using Sogni AI's decentralized GPU network. Supports Pixal3D single- and multi-view image-to-GLB, BiRefNet background removal, Qwen3-TTS speech/voice cloning/design, MiniMax Music 3, SAM 3 object selection, promptless RTX VSR image upscaling through 16K, promptless FlashVSR video upscaling to 1080p/1440p, one-click image-folder loop reels, personas (named people with saved reference photos and voice clips), persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/H3 Balanced/LightX2V Turbo/FastH3 Turbo (including audio-to-video from an uploaded track)/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"upscale an image\", \"upscale a video\", \"make a video/animate\", \"turn this image folder into a loop\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
4
4
  metadata:
5
- version: "3.50.0"
5
+ version: "3.51.1"
6
6
  homepage: https://sogni.ai
7
7
  openclaw:
8
8
  emoji: "🎨"
@@ -367,7 +367,7 @@ H3 r2v accepts up to **9 images** (`--ref` then repeatable `-c`), **3 videos** (
367
367
 
368
368
  **Music-locked video is immutable.** When the user asks for the same/specific/original/trending song or choreography tied to it, never invent, imitate, recompose, remix, replace, or add a copyright-avoidance mutation. For H3 Ref2VA use `audio reuse`, `<Audio N>: fully_copy`, and explicit source action times; then stream-copy/remux the original soundtrack into the final deliverable. `audio reference` means a newly generated signal and is allowed only when explicitly requested. Ref2VA is loose conditioning: if edit-level choreography timing is mandatory, use a pose/edit-controlled workflow or stop before spending compute rather than promise exact sync.
369
369
 
370
- **MiniMax H3 is the only video family that loads LoRAs** (not its FastH3 audio-to-video modes). Attach them with the same repeatable `--lora <id> --lora-strength <n>` arguments the image models take, and name the explicit H3 mode in the same command — availability differs per mode, and bare `-m minimax-h3` cannot be validated. Video LoRAs are positive-only: a negative value is not an inverse effect and `0` is off, unlike the bipolar Krea 2 image sliders. Omit `--lora-strengths` to apply each adapter's catalog default rather than the worker's 1.0 fallback. `h3-realism-people` needs its trigger word `r34l1sm` near the FRONT of the prompt or it renders as ordinary H3 with no error. The CLI validates every id against the live catalog for the model you selected, so a wrong id fails before it costs a render instead of being dropped silently. LTX, WAN, Seedance, and HappyHorse load none. Read [`references/h3-video-loras.md`](./references/h3-video-loras.md) for per-mode availability and ranges.
370
+ [Personal LoRA library management](./references/personal-loras.md) covers imports, consent, status and compatible models. **MiniMax H3 is the only video family that loads LoRAs** (not its FastH3 audio-to-video modes). Attach them with the same repeatable `--lora <id> --lora-strength <n>` arguments the image models take, and name the explicit H3 mode in the same command — availability differs per mode, and bare `-m minimax-h3` cannot be validated. Video LoRAs are positive-only: a negative value is not an inverse effect and `0` is off, unlike the bipolar Krea 2 image sliders. Omit `--lora-strengths` to apply each adapter's catalog default rather than the worker's 1.0 fallback. `h3-realism-people` needs its trigger word `r34l1sm` near the FRONT of the prompt or it renders as ordinary H3 with no error. The CLI validates every id against the live catalog for the model you selected, so a wrong id fails before it costs a render instead of being dropped silently. LTX, WAN, Seedance, and HappyHorse load none. Read [`references/h3-video-loras.md`](./references/h3-video-loras.md) for per-mode availability and ranges.
371
371
 
372
372
  **H3 requires MiniMax's official ordered-field prompt contract.** Standard, Balanced, LightX2V Turbo, and FastH3 T2V/I2V/L2V/FLF2V (and the FastH3 audio modes, with the I2V or FLF2V preamble when frames are supplied) use `integrated_multimodal_description`, `overall_soundscape`, then `non_diegetic_music`, with the mode-specific alignment preamble for endpoint-conditioned modes. Use `[Shot N]` notation, stable `(S1)` speaker IDs, and dialogue as `<d>[Language] words</d>`. Preserve supplied dialogue exactly; author one concise line only when the user explicitly asks for speech/dialogue/lyrics without supplying words, and otherwise invent no speech. Use `<scenetrans>` at both connecting points when one line crosses a cut and `<cutoff>` only when the video ending truncates speech. Do not substitute quoted prose, bracketed timecode lists, or tokenizer-internal `<|...|>` markers. Ref2VA uses its separate six-field contract and exact task/retention vocabulary; loose video references do not promise editing or continuation. 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.
373
373
 
@@ -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.50.0",
5
+ "version": "3.51.1",
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",
@@ -27,6 +27,9 @@ const GATING_POLICIES = [
27
27
  "edit_image",
28
28
  "restore_photo",
29
29
  "upscale_image",
30
+ "image_to_3d",
31
+ "remove_background",
32
+ "segment_image",
30
33
  "apply_style",
31
34
  "refine_result",
32
35
  "animate_photo",
@@ -63,6 +66,9 @@ const GATING_POLICIES = [
63
66
  "edit_image",
64
67
  "restore_photo",
65
68
  "upscale_image",
69
+ "image_to_3d",
70
+ "remove_background",
71
+ "segment_image",
66
72
  "apply_style",
67
73
  "refine_result",
68
74
  "animate_photo",
@@ -98,6 +104,9 @@ const GATING_POLICIES = [
98
104
  "edit_image",
99
105
  "restore_photo",
100
106
  "upscale_image",
107
+ "image_to_3d",
108
+ "remove_background",
109
+ "segment_image",
101
110
  "apply_style",
102
111
  "refine_result",
103
112
  "animate_photo",
@@ -134,6 +143,9 @@ const GATING_POLICIES = [
134
143
  "edit_image",
135
144
  "restore_photo",
136
145
  "upscale_image",
146
+ "image_to_3d",
147
+ "remove_background",
148
+ "segment_image",
137
149
  "apply_style",
138
150
  "refine_result",
139
151
  "animate_photo",
@@ -460,6 +472,33 @@ const REPAIR_RECIPES = [
460
472
  "maxRetries": 0,
461
473
  "repairNoteTemplate": "I need more details before I can run {{toolName}}. {{missingDetail}}"
462
474
  },
475
+ {
476
+ "recipeId": "image_to_3d.user_input_incomplete",
477
+ "version": "1.0.0",
478
+ "toolName": "image_to_3d",
479
+ "errorCode": "USER_INPUT_INCOMPLETE",
480
+ "mode": "stopAndAsk",
481
+ "maxRetries": 0,
482
+ "repairNoteTemplate": "I need more details before I can run {{toolName}}. {{missingDetail}}"
483
+ },
484
+ {
485
+ "recipeId": "remove_background.user_input_incomplete",
486
+ "version": "1.0.0",
487
+ "toolName": "remove_background",
488
+ "errorCode": "USER_INPUT_INCOMPLETE",
489
+ "mode": "stopAndAsk",
490
+ "maxRetries": 0,
491
+ "repairNoteTemplate": "I need more details before I can run {{toolName}}. {{missingDetail}}"
492
+ },
493
+ {
494
+ "recipeId": "segment_image.user_input_incomplete",
495
+ "version": "1.0.0",
496
+ "toolName": "segment_image",
497
+ "errorCode": "USER_INPUT_INCOMPLETE",
498
+ "mode": "stopAndAsk",
499
+ "maxRetries": 0,
500
+ "repairNoteTemplate": "I need more details before I can run {{toolName}}. {{missingDetail}}"
501
+ },
463
502
  {
464
503
  "recipeId": "apply_style.user_input_incomplete",
465
504
  "version": "1.0.0",
@@ -649,6 +688,33 @@ const REPAIR_RECIPES = [
649
688
  "maxRetries": 0,
650
689
  "repairNoteTemplate": "You have hit the credit limit for this turn. Buy Spark Packs to continue: https://docs.sogni.ai/pricing/#spark-packs"
651
690
  },
691
+ {
692
+ "recipeId": "image_to_3d.cost_limit_exceeded",
693
+ "version": "1.0.0",
694
+ "toolName": "image_to_3d",
695
+ "errorCode": "COST_LIMIT_EXCEEDED",
696
+ "mode": "stopAndAsk",
697
+ "maxRetries": 0,
698
+ "repairNoteTemplate": "You have hit the credit limit for this turn. Buy Spark Packs to continue: https://docs.sogni.ai/pricing/#spark-packs"
699
+ },
700
+ {
701
+ "recipeId": "remove_background.cost_limit_exceeded",
702
+ "version": "1.0.0",
703
+ "toolName": "remove_background",
704
+ "errorCode": "COST_LIMIT_EXCEEDED",
705
+ "mode": "stopAndAsk",
706
+ "maxRetries": 0,
707
+ "repairNoteTemplate": "You have hit the credit limit for this turn. Buy Spark Packs to continue: https://docs.sogni.ai/pricing/#spark-packs"
708
+ },
709
+ {
710
+ "recipeId": "segment_image.cost_limit_exceeded",
711
+ "version": "1.0.0",
712
+ "toolName": "segment_image",
713
+ "errorCode": "COST_LIMIT_EXCEEDED",
714
+ "mode": "stopAndAsk",
715
+ "maxRetries": 0,
716
+ "repairNoteTemplate": "You have hit the credit limit for this turn. Buy Spark Packs to continue: https://docs.sogni.ai/pricing/#spark-packs"
717
+ },
652
718
  {
653
719
  "recipeId": "apply_style.cost_limit_exceeded",
654
720
  "version": "1.0.0",
@@ -838,6 +904,33 @@ const REPAIR_RECIPES = [
838
904
  "maxRetries": 0,
839
905
  "repairNoteTemplate": "I cannot find the asset that {{toolName}} needs. {{message}} Which uploaded or generated asset did you want?"
840
906
  },
907
+ {
908
+ "recipeId": "image_to_3d.asset_not_found",
909
+ "version": "1.0.0",
910
+ "toolName": "image_to_3d",
911
+ "errorCode": "ASSET_NOT_FOUND",
912
+ "mode": "stopAndAsk",
913
+ "maxRetries": 0,
914
+ "repairNoteTemplate": "I cannot find the asset that {{toolName}} needs. {{message}} Which uploaded or generated asset did you want?"
915
+ },
916
+ {
917
+ "recipeId": "remove_background.asset_not_found",
918
+ "version": "1.0.0",
919
+ "toolName": "remove_background",
920
+ "errorCode": "ASSET_NOT_FOUND",
921
+ "mode": "stopAndAsk",
922
+ "maxRetries": 0,
923
+ "repairNoteTemplate": "I cannot find the asset that {{toolName}} needs. {{message}} Which uploaded or generated asset did you want?"
924
+ },
925
+ {
926
+ "recipeId": "segment_image.asset_not_found",
927
+ "version": "1.0.0",
928
+ "toolName": "segment_image",
929
+ "errorCode": "ASSET_NOT_FOUND",
930
+ "mode": "stopAndAsk",
931
+ "maxRetries": 0,
932
+ "repairNoteTemplate": "I cannot find the asset that {{toolName}} needs. {{message}} Which uploaded or generated asset did you want?"
933
+ },
841
934
  {
842
935
  "recipeId": "apply_style.asset_not_found",
843
936
  "version": "1.0.0",
@@ -1054,6 +1147,33 @@ const REPAIR_RECIPES = [
1054
1147
  "maxRetries": 0,
1055
1148
  "repairNoteTemplate": "{{toolName}} could not run: {{message}}"
1056
1149
  },
1150
+ {
1151
+ "recipeId": "image_to_3d.workflow_validation_failed",
1152
+ "version": "1.0.0",
1153
+ "toolName": "image_to_3d",
1154
+ "errorCode": "WORKFLOW_VALIDATION_FAILED",
1155
+ "mode": "stopAndAsk",
1156
+ "maxRetries": 0,
1157
+ "repairNoteTemplate": "{{toolName}} could not run: {{message}}"
1158
+ },
1159
+ {
1160
+ "recipeId": "remove_background.workflow_validation_failed",
1161
+ "version": "1.0.0",
1162
+ "toolName": "remove_background",
1163
+ "errorCode": "WORKFLOW_VALIDATION_FAILED",
1164
+ "mode": "stopAndAsk",
1165
+ "maxRetries": 0,
1166
+ "repairNoteTemplate": "{{toolName}} could not run: {{message}}"
1167
+ },
1168
+ {
1169
+ "recipeId": "segment_image.workflow_validation_failed",
1170
+ "version": "1.0.0",
1171
+ "toolName": "segment_image",
1172
+ "errorCode": "WORKFLOW_VALIDATION_FAILED",
1173
+ "mode": "stopAndAsk",
1174
+ "maxRetries": 0,
1175
+ "repairNoteTemplate": "{{toolName}} could not run: {{message}}"
1176
+ },
1057
1177
  {
1058
1178
  "recipeId": "apply_style.workflow_validation_failed",
1059
1179
  "version": "1.0.0",
@@ -1243,6 +1363,33 @@ const REPAIR_RECIPES = [
1243
1363
  "maxRetries": 0,
1244
1364
  "repairNoteTemplate": "{{toolName}} rejected the arguments: {{message}}"
1245
1365
  },
1366
+ {
1367
+ "recipeId": "image_to_3d.parameter_invalid",
1368
+ "version": "1.0.0",
1369
+ "toolName": "image_to_3d",
1370
+ "errorCode": "PARAMETER_INVALID",
1371
+ "mode": "stopAndAsk",
1372
+ "maxRetries": 0,
1373
+ "repairNoteTemplate": "{{toolName}} rejected the arguments: {{message}}"
1374
+ },
1375
+ {
1376
+ "recipeId": "remove_background.parameter_invalid",
1377
+ "version": "1.0.0",
1378
+ "toolName": "remove_background",
1379
+ "errorCode": "PARAMETER_INVALID",
1380
+ "mode": "stopAndAsk",
1381
+ "maxRetries": 0,
1382
+ "repairNoteTemplate": "{{toolName}} rejected the arguments: {{message}}"
1383
+ },
1384
+ {
1385
+ "recipeId": "segment_image.parameter_invalid",
1386
+ "version": "1.0.0",
1387
+ "toolName": "segment_image",
1388
+ "errorCode": "PARAMETER_INVALID",
1389
+ "mode": "stopAndAsk",
1390
+ "maxRetries": 0,
1391
+ "repairNoteTemplate": "{{toolName}} rejected the arguments: {{message}}"
1392
+ },
1246
1393
  {
1247
1394
  "recipeId": "apply_style.parameter_invalid",
1248
1395
  "version": "1.0.0",
@@ -1414,6 +1561,33 @@ const REPAIR_RECIPES = [
1414
1561
  "maxRetries": 0,
1415
1562
  "repairNoteTemplate": "The {{toolName}} worker failed. {{message}} Want me to try again or change the request?"
1416
1563
  },
1564
+ {
1565
+ "recipeId": "image_to_3d.gpu_worker_failed",
1566
+ "version": "1.0.0",
1567
+ "toolName": "image_to_3d",
1568
+ "errorCode": "GPU_WORKER_FAILED",
1569
+ "mode": "stopAndAsk",
1570
+ "maxRetries": 0,
1571
+ "repairNoteTemplate": "The {{toolName}} worker failed. {{message}} Want me to try again or change the request?"
1572
+ },
1573
+ {
1574
+ "recipeId": "remove_background.gpu_worker_failed",
1575
+ "version": "1.0.0",
1576
+ "toolName": "remove_background",
1577
+ "errorCode": "GPU_WORKER_FAILED",
1578
+ "mode": "stopAndAsk",
1579
+ "maxRetries": 0,
1580
+ "repairNoteTemplate": "The {{toolName}} worker failed. {{message}} Want me to try again or change the request?"
1581
+ },
1582
+ {
1583
+ "recipeId": "segment_image.gpu_worker_failed",
1584
+ "version": "1.0.0",
1585
+ "toolName": "segment_image",
1586
+ "errorCode": "GPU_WORKER_FAILED",
1587
+ "mode": "stopAndAsk",
1588
+ "maxRetries": 0,
1589
+ "repairNoteTemplate": "The {{toolName}} worker failed. {{message}} Want me to try again or change the request?"
1590
+ },
1417
1591
  {
1418
1592
  "recipeId": "apply_style.gpu_worker_failed",
1419
1593
  "version": "1.0.0",
@@ -1594,6 +1768,33 @@ const REPAIR_RECIPES = [
1594
1768
  "maxRetries": 0,
1595
1769
  "repairNoteTemplate": "The model {{toolName}} wanted is offline. {{message}} Pick a different model or try again later."
1596
1770
  },
1771
+ {
1772
+ "recipeId": "image_to_3d.model_unavailable",
1773
+ "version": "1.0.0",
1774
+ "toolName": "image_to_3d",
1775
+ "errorCode": "MODEL_UNAVAILABLE",
1776
+ "mode": "stopAndAsk",
1777
+ "maxRetries": 0,
1778
+ "repairNoteTemplate": "The model {{toolName}} wanted is offline. {{message}} Pick a different model or try again later."
1779
+ },
1780
+ {
1781
+ "recipeId": "remove_background.model_unavailable",
1782
+ "version": "1.0.0",
1783
+ "toolName": "remove_background",
1784
+ "errorCode": "MODEL_UNAVAILABLE",
1785
+ "mode": "stopAndAsk",
1786
+ "maxRetries": 0,
1787
+ "repairNoteTemplate": "The model {{toolName}} wanted is offline. {{message}} Pick a different model or try again later."
1788
+ },
1789
+ {
1790
+ "recipeId": "segment_image.model_unavailable",
1791
+ "version": "1.0.0",
1792
+ "toolName": "segment_image",
1793
+ "errorCode": "MODEL_UNAVAILABLE",
1794
+ "mode": "stopAndAsk",
1795
+ "maxRetries": 0,
1796
+ "repairNoteTemplate": "The model {{toolName}} wanted is offline. {{message}} Pick a different model or try again later."
1797
+ },
1597
1798
  {
1598
1799
  "recipeId": "apply_style.model_unavailable",
1599
1800
  "version": "1.0.0",
@@ -1783,6 +1984,33 @@ const REPAIR_RECIPES = [
1783
1984
  "maxRetries": 0,
1784
1985
  "repairNoteTemplate": "{{toolName}} needs permission you have not granted yet. {{message}}"
1785
1986
  },
1987
+ {
1988
+ "recipeId": "image_to_3d.permission_required",
1989
+ "version": "1.0.0",
1990
+ "toolName": "image_to_3d",
1991
+ "errorCode": "PERMISSION_REQUIRED",
1992
+ "mode": "stopAndAsk",
1993
+ "maxRetries": 0,
1994
+ "repairNoteTemplate": "{{toolName}} needs permission you have not granted yet. {{message}}"
1995
+ },
1996
+ {
1997
+ "recipeId": "remove_background.permission_required",
1998
+ "version": "1.0.0",
1999
+ "toolName": "remove_background",
2000
+ "errorCode": "PERMISSION_REQUIRED",
2001
+ "mode": "stopAndAsk",
2002
+ "maxRetries": 0,
2003
+ "repairNoteTemplate": "{{toolName}} needs permission you have not granted yet. {{message}}"
2004
+ },
2005
+ {
2006
+ "recipeId": "segment_image.permission_required",
2007
+ "version": "1.0.0",
2008
+ "toolName": "segment_image",
2009
+ "errorCode": "PERMISSION_REQUIRED",
2010
+ "mode": "stopAndAsk",
2011
+ "maxRetries": 0,
2012
+ "repairNoteTemplate": "{{toolName}} needs permission you have not granted yet. {{message}}"
2013
+ },
1786
2014
  {
1787
2015
  "recipeId": "apply_style.permission_required",
1788
2016
  "version": "1.0.0",
@@ -2082,6 +2310,33 @@ const REPAIR_RECIPES = [
2082
2310
  "maxRetries": 0,
2083
2311
  "repairNoteTemplate": "{{toolName}} timed out. {{message}} Want me to retry, or simplify the request?"
2084
2312
  },
2313
+ {
2314
+ "recipeId": "image_to_3d.provider_timeout",
2315
+ "version": "1.0.0",
2316
+ "toolName": "image_to_3d",
2317
+ "errorCode": "PROVIDER_TIMEOUT",
2318
+ "mode": "stopAndAsk",
2319
+ "maxRetries": 0,
2320
+ "repairNoteTemplate": "{{toolName}} timed out. {{message}} Want me to retry, or simplify the request?"
2321
+ },
2322
+ {
2323
+ "recipeId": "remove_background.provider_timeout",
2324
+ "version": "1.0.0",
2325
+ "toolName": "remove_background",
2326
+ "errorCode": "PROVIDER_TIMEOUT",
2327
+ "mode": "stopAndAsk",
2328
+ "maxRetries": 0,
2329
+ "repairNoteTemplate": "{{toolName}} timed out. {{message}} Want me to retry, or simplify the request?"
2330
+ },
2331
+ {
2332
+ "recipeId": "segment_image.provider_timeout",
2333
+ "version": "1.0.0",
2334
+ "toolName": "segment_image",
2335
+ "errorCode": "PROVIDER_TIMEOUT",
2336
+ "mode": "stopAndAsk",
2337
+ "maxRetries": 0,
2338
+ "repairNoteTemplate": "{{toolName}} timed out. {{message}} Want me to retry, or simplify the request?"
2339
+ },
2085
2340
  {
2086
2341
  "recipeId": "apply_style.provider_timeout",
2087
2342
  "version": "1.0.0",
@@ -2271,6 +2526,33 @@ const REPAIR_RECIPES = [
2271
2526
  "maxRetries": 0,
2272
2527
  "repairNoteTemplate": "The {{toolName}} run was cancelled by the user. I will stop here unless you ask me to try again."
2273
2528
  },
2529
+ {
2530
+ "recipeId": "image_to_3d.user_cancelled",
2531
+ "version": "1.0.0",
2532
+ "toolName": "image_to_3d",
2533
+ "errorCode": "USER_CANCELLED",
2534
+ "mode": "stopAndAsk",
2535
+ "maxRetries": 0,
2536
+ "repairNoteTemplate": "The {{toolName}} run was cancelled by the user. I will stop here unless you ask me to try again."
2537
+ },
2538
+ {
2539
+ "recipeId": "remove_background.user_cancelled",
2540
+ "version": "1.0.0",
2541
+ "toolName": "remove_background",
2542
+ "errorCode": "USER_CANCELLED",
2543
+ "mode": "stopAndAsk",
2544
+ "maxRetries": 0,
2545
+ "repairNoteTemplate": "The {{toolName}} run was cancelled by the user. I will stop here unless you ask me to try again."
2546
+ },
2547
+ {
2548
+ "recipeId": "segment_image.user_cancelled",
2549
+ "version": "1.0.0",
2550
+ "toolName": "segment_image",
2551
+ "errorCode": "USER_CANCELLED",
2552
+ "mode": "stopAndAsk",
2553
+ "maxRetries": 0,
2554
+ "repairNoteTemplate": "The {{toolName}} run was cancelled by the user. I will stop here unless you ask me to try again."
2555
+ },
2274
2556
  {
2275
2557
  "recipeId": "apply_style.user_cancelled",
2276
2558
  "version": "1.0.0",
@@ -2426,6 +2708,39 @@ const REPAIR_RECIPES = [
2426
2708
  }
2427
2709
  ];
2428
2710
  const PROMPT_CONTRACTS = [
2711
+ {
2712
+ "contractId": "image_to_3d_v1",
2713
+ "version": "1.0.0",
2714
+ "toolName": "image_to_3d",
2715
+ "baseDescription": "Reconstruct a downloadable GLB from an original front image, optionally with left, back and right views of the same subject at consistent height and framing. Pass each view in its named slot; never invent views or substitute screenshots. Choose mesh and texture budgets for the intended use. The output is a 3D model, so do not send it to image or video tools.",
2716
+ "parameterDocs": {
2717
+ "sourceImageIndex": "Front view; negative indices select uploads.",
2718
+ "leftViewImageIndex": "Subject own left side toward camera (subject faces screen-left).",
2719
+ "backViewImageIndex": "Subject seen from behind.",
2720
+ "rightViewImageIndex": "Subject own right side toward camera (subject faces screen-right)."
2721
+ }
2722
+ },
2723
+ {
2724
+ "contractId": "remove_background_v1",
2725
+ "version": "1.0.0",
2726
+ "toolName": "remove_background",
2727
+ "baseDescription": "Use BiRefNet to remove an existing image background while preserving the original foreground. No prompt is needed. Return a transparent PNG by default, or an alpha mask when applyMask=false.",
2728
+ "parameterDocs": {
2729
+ "sourceImageIndex": "Original image to isolate.",
2730
+ "applyMask": "Default true: transparent cutout; false: mask."
2731
+ }
2732
+ },
2733
+ {
2734
+ "contractId": "segment_image_v1",
2735
+ "version": "1.0.0",
2736
+ "toolName": "segment_image",
2737
+ "baseDescription": "Select objects with SAM 3 using an object description, normalized original-image points, or boxes. Text can combine with boxes. Points can combine with at most one positive box and never with text. Output a binary mask by default or an original-pixel cutout with applyMask=true; do not repaint the source.",
2738
+ "parameterDocs": {
2739
+ "sourceImageIndex": "Original image to select from.",
2740
+ "maxInstances": "Keep the strongest N selections (1–16).",
2741
+ "applyMask": "True returns a cutout; false returns a mask."
2742
+ }
2743
+ },
2429
2744
  {
2430
2745
  "contractId": "restore_photo_v1",
2431
2746
  "version": "1.0.0",
@@ -2535,7 +2850,7 @@ const PROMPT_CONTRACTS = [
2535
2850
  "contractId": "edit_image_v1",
2536
2851
  "version": "1.0.0",
2537
2852
  "toolName": "edit_image",
2538
- "baseDescription": "edit_image applies instruction-based edits to uploaded or generated images. Use when\nuploaded or reference images must guide identity or likeness.\n\nImage-to-Image prompt order: [IDENTITY LOCK] → [REQUESTED EDIT] → [REFERENCE ROLE\nMAPPING] → [POSE/COMPOSITION] → [STYLE] → [LIGHTING/REALISM] → [PRESERVE ALL\nUNMENTIONED DETAILS]. GOLDEN RULE: When editing a person, state which image owns\nidentity so it is not ambiguous. Describe only the DELTA — what changes. Don't\nrewrite the entire image; the base image already contains most of the truth. Default to minimal\nchange. For multi-image edits, assign one primary role per reference image (identity, pose,\noutfit, style, environment). Do not let a style/pose/clothing reference silently override the face.\nUse positive constraints — \"preserve exact facial likeness, face structure, eye shape, nose\nshape, mouth shape, jawline, skin tone, hairline, apparent age, and overall recognizability\"\n— not vague negatives like \"don't mess up the face\".\n\nKREA IDENTITY EDIT: Use model=\"krea-identity-edit\" whenever an edit of a referenced\nperson or character must keep likeness or character identity while changing clothing,\nhair or makeup, pose or position, face/head/body, background, lighting, or visual style.\nInfer that semantic intent in any language; never route from keyword or regex matching.\nAlso use it for a non-Pro single-character sheet. An explicitly requested model always\nwins. Use model=\"dark-beast-krea2-identity-edit\" only when the user explicitly requests\nthat model, its uncensored/community variant, or dark_beast_krea2_identity_edit_v1_2.\nThese models require one reference image, accept up to two context images, and work best\nat 512-2048 px. Let the model tier and worker choose current execution defaults, and do\nnot use negative prompts. Put the primary scene/base image first and an optional\nperson/detail reference second; reference them with context_image_0 and context_image_1\nwhen model_ref tokens are needed.\n\nKREA 2 IDENTITY EDIT PROMPTING: Use a concise 1-4 sentence delta instruction instead of\nthe generic 50-200 word expansion. Name the requested change and only the details that\nmust remain fixed; do not restate the whole image or dump a facial-feature inventory.\nWith two references, assign their roles compactly: base scene/image first, then the\nperson/detail/outfit/pose/style reference. Longer structured prompts remain appropriate\nfor character sheets, grids, editorial layouts, or exact visible text.\n\nUPLOADED IMAGE VARIANT SETS: When the user supplies a photo/portrait/reference image and\nasks for N distinct generated images deriving from that source while changing paired\nper-output details, prefer one edit_image call with sourceImageIndex=-1,\nnumberOfVariations=N, and ONE Dynamic Prompt branch with N complete options. Each option\nmust be a full concrete image prompt for one output, including the uploaded subject/reference\nanchor, requested pose or placement preservation, the specific changed appearance/style/role,\nclothing or surface details when relevant, setting/background, and any requested label text or\nvisual symbol. If one option is a remade original/preserved source and the rest are themed\nvariants, the original option should explicitly say to preserve the original clothing/wardrobe/outfit\nand background/setting, plus any requested added label, flag, logo, symbol, or prop.\nDo not call generate_image, analyze_image, or multiple serial edit_image calls first.\n\nSELECTION-GATED IMAGE STAGES: If the user asks for N image options and says they will pick\none before a later dance/video/animation, prefer one edit_image call with numberOfVariations=N\nand one Dynamic Prompt branch. After images are created, stop and ask the user to choose\nunless the user explicitly asked to run the later stage immediately.\n\nMULTI-PERSONA (COMBINED): When multiple personas must appear in the SAME scene, make\none edit_image call with all persona faces in one prompt and omit personaName.\nPer-persona splits (one call each with personaName set) are RARE — only when the user\nexplicitly asks for solo images of each person individually.\n\nSTORYBOARD IMAGE BATCH RULE: When rendering scene keyframes from a screenplay/storyboard,\nnumberOfVariations is only the count; the prompt should be one Dynamic Prompt branch with one\nfull keyframe prompt per scene:\n{scene 1 full keyframe prompt|scene 2 full keyframe prompt|...|scene N full keyframe prompt}.\nDo not set numberOfVariations=N with only the first scene prompt — that creates N versions of\nscene 1. For full project requests, one edit_image batch for all scene keyframes, then one\nanimate_photo batch for all video clips in parallel.\nException: if the storyboard/shot sheet is already uploaded and the user asks to make a\ntrailer/video/movie/clip from that uploaded board, do not extract panels or redraw keyframes.\nUse generate_video with Seedance references for one continuous clip unless the user explicitly\nasks for separate image keyframes or a storyboard sheet output.\n\nDIRECT UPLOADED GPT IMAGE 2 STORYBOARD SHEETS: If the user uploaded reference images and\nasks for one finished GPT Image 2 storyboard/keyframe sheet now, call edit_image directly\nwith sourceImageIndex=-1, model=\"gpt-image-2\", numberOfVariations=1, and the requested\ncanvas/aspect settings. If the user did not explicitly specify a storyboard page/canvas/sheet\nshape, default the GPT Image 2 storyboard sheet pixel dimensions to a balanced grid that hosts\nthe target cell aspect ratio natively (e.g., 12 cells with 9:16 portrait video target -> ~3:4\nportrait sheet around 1728x2304; 12 cells with 16:9 landscape video target -> ~4:3 landscape\nsheet around 2304x1728; 6 cells with 9:16 target -> ~27:32 portrait sheet around 1840x2176). Do\nNOT default the sheet to 2560x1440 landscape when cells are portrait — a landscape sheet with\na portrait-cell grid physically forces cells to ~4:3 landscape and the model will not render\n9:16 portrait rectangles inside it. Keep individual scene-cell/frame areas at the target video\naspect ratio. Do not call map_assets_for_model, analyze_image, generate_image, or a separate\nplanning tool first. The uploaded files are already available as references; describe their\nroles plainly in the edit_image prompt and generate the sheet in that call.\n\nDO NOT USE edit_image FOR UPLOADED REFERENCE LOOPED VIDEO SEGMENTS: If the user says the\nsame uploaded image/reference should be reused as the first frame and last frame of each\nscripted segment/scene/clip before stitching, they are explicitly asking to animate the\nuploaded image, not to generate new storyboard keyframes. Do not call edit_image for that\nrequest. Call animate_photo once with repeated uploaded source indices and per-scene prompts.",
2853
+ "baseDescription": "edit_image applies instruction-based edits to uploaded or generated images. Use when\nuploaded or reference images must guide identity or likeness.\n\nImage-to-Image prompt order: [IDENTITY LOCK] → [REQUESTED EDIT] → [REFERENCE ROLE\nMAPPING] → [POSE/COMPOSITION] → [STYLE] → [LIGHTING/REALISM] → [PRESERVE ALL\nUNMENTIONED DETAILS]. GOLDEN RULE: When editing a person, state which image owns\nidentity so it is not ambiguous. Describe only the DELTA — what changes. Don't\nrewrite the entire image; the base image already contains most of the truth. Default to minimal\nchange. For multi-image edits, assign one primary role per reference image (identity, pose,\noutfit, style, environment). Do not let a style/pose/clothing reference silently override the face.\nUse positive constraints — \"preserve exact facial likeness, face structure, eye shape, nose\nshape, mouth shape, jawline, skin tone, hairline, apparent age, and overall recognizability\"\n— not vague negatives like \"don't mess up the face\".\n\nKREA IDENTITY EDIT: Use model=\"krea-identity-edit\" whenever an edit of a referenced\nperson or character must keep likeness or character identity while changing clothing,\nhair or makeup, pose or position, face/head/body, background, lighting, or visual style.\nInfer that semantic intent in any language; never route from keyword or regex matching.\nAlso use it for a non-Pro single-character sheet. An explicitly requested model always\nwins. Use model=\"dark-beast-krea2-identity-edit\" only when the user explicitly requests\nthat model, its uncensored/community variant, or dark_beast_krea2_identity_edit_v1_2.\nThese models require one reference image, accept up to two context images, and work best\nat 512-2048 px. Let the model tier and worker choose current execution defaults, and do\nnot use negative prompts. Put the primary scene/base image first and an optional\nperson/detail reference second; reference them with context_image_0 and context_image_1\nwhen model_ref tokens are needed.\n\nKREA 2 IDENTITY EDIT PROMPTING: Use a concise 1-4 sentence delta instruction instead of\nthe generic 50-200 word expansion. Name the requested change and only the details that\nmust remain fixed; do not restate the whole image or dump a facial-feature inventory.\nWith two references, assign their roles compactly: base scene/image first, then the\nperson/detail/outfit/pose/style reference. Longer structured prompts remain appropriate\nfor character sheets, grids, editorial layouts, or exact visible text.\n\nUPLOADED IMAGE VARIANT SETS: When the user supplies a photo/portrait/reference image and\nasks for N distinct generated images deriving from that source while changing paired\nper-output details, prefer one edit_image call with sourceImageIndex=-1,\nnumberOfVariations=N, and ONE Dynamic Prompt branch with N complete options. Each option\nmust be a full concrete image prompt for one output, including the uploaded subject/reference\nanchor, requested pose or placement preservation, the specific changed appearance/style/role,\nclothing or surface details when relevant, setting/background, and any requested label text or\nvisual symbol. If one option is a remade original/preserved source and the rest are themed\nvariants, the original option should explicitly say to preserve the original clothing/wardrobe/outfit\nand background/setting, plus any requested added label, flag, logo, symbol, or prop.\nDo not call generate_image, analyze_image, or multiple serial edit_image calls first.\n\nSELECTION-GATED IMAGE STAGES: If the user asks for N image options and says they will pick\none before a later dance/video/animation, prefer one edit_image call with numberOfVariations=N\nand one Dynamic Prompt branch. After images are created, stop and ask the user to choose\nunless the user explicitly asked to run the later stage immediately.\n\nMULTI-PERSONA (COMBINED): When multiple personas must appear in the SAME scene, make\none edit_image call with all persona faces in one prompt and omit personaName.\nPer-persona splits (one call each with personaName set) are RARE — only when the user\nexplicitly asks for solo images of each person individually.\n\nSTORYBOARD IMAGE BATCH RULE: When rendering scene keyframes from a screenplay/storyboard,\nnumberOfVariations is only the count; the prompt should be one Dynamic Prompt branch with one\nfull keyframe prompt per scene:\n{scene 1 full keyframe prompt|scene 2 full keyframe prompt|...|scene N full keyframe prompt}.\nDo not set numberOfVariations=N with only the first scene prompt — that creates N versions of\nscene 1. For full project requests, one edit_image batch for all scene keyframes, then one\nanimate_photo batch for all video clips in parallel.\nException: if the storyboard/shot sheet is already uploaded and the user asks to make a\ntrailer/video/movie/clip from that uploaded board, do not extract panels or redraw keyframes.\nUse generate_video with Seedance references for one continuous clip unless the user explicitly\nasks for separate image keyframes or a storyboard sheet output.\n\nDIRECT UPLOADED GPT IMAGE STORYBOARD SHEETS: If the user uploaded reference images and\nasks for one finished GPT Image storyboard/keyframe sheet now, call edit_image directly\nwith sourceImageIndex=-1, model=\"gpt-image-2.5-sunburst\", numberOfVariations=1, and the requested\ncanvas/aspect settings. Preserve another explicit GPT Image model named by the user.\nIf the user did not explicitly specify a storyboard page/canvas/sheet\nshape, default the GPT Image 2.5 storyboard sheet pixel dimensions to a balanced grid that hosts\nthe target cell aspect ratio natively (e.g., 12 cells with 9:16 portrait video target -> ~3:4\nportrait sheet around 1728x2304; 12 cells with 16:9 landscape video target -> ~4:3 landscape\nsheet around 2304x1728; 6 cells with 9:16 target -> ~27:32 portrait sheet around 1840x2176). Do\nNOT default the sheet to 2560x1440 landscape when cells are portrait — a landscape sheet with\na portrait-cell grid physically forces cells to ~4:3 landscape and the model will not render\n9:16 portrait rectangles inside it. Keep individual scene-cell/frame areas at the target video\naspect ratio. Do not call map_assets_for_model, analyze_image, generate_image, or a separate\nplanning tool first. The uploaded files are already available as references; describe their\nroles plainly in the edit_image prompt and generate the sheet in that call.\n\nDO NOT USE edit_image FOR UPLOADED REFERENCE LOOPED VIDEO SEGMENTS: If the user says the\nsame uploaded image/reference should be reused as the first frame and last frame of each\nscripted segment/scene/clip before stitching, they are explicitly asking to animate the\nuploaded image, not to generate new storyboard keyframes. Do not call edit_image for that\nrequest. Call animate_photo once with repeated uploaded source indices and per-scene prompts.",
2539
2854
  "parameterDocs": {
2540
2855
  "sourceImageIndex": "Index of uploaded/generated image. Use -1 for the first uploaded image.",
2541
2856
  "numberOfVariations": "Number of output variants. When > 1, use a Dynamic Prompt branch with one complete prompt per output.",
@@ -2546,7 +2861,7 @@ const PROMPT_CONTRACTS = [
2546
2861
  "contractId": "generate_image_v1",
2547
2862
  "version": "1.1.0",
2548
2863
  "toolName": "generate_image",
2549
- "baseDescription": "generate_image creates images from text descriptions. Use for text-only image generation;\nuse edit_image when uploaded or reference images must guide identity/likeness.\nException: Z-image, Z-image Turbo, and Krea 2 Turbo image-to-image/enhancement requests\nuse generate_image with model=\"z-turbo\", model=\"z-image\", or model=\"krea-2-turbo\",\nsourceImageIndex=-1, and starting_image_strength; do not route explicit base-model\nZ-image Turbo or Krea 2 Turbo uploaded-image enhancement to edit_image because edit_image\ndoes not expose those base image-to-image models.\n\nMODEL CHOICE: If the user asks for Krea 2 Turbo, choose model=\"krea-2-turbo\". If they ask\nfor Dark Beast Krea 2, choose model=\"dark-beast-krea2\". If they ask for Dark Beast Z-Image\nTurbo, choose model=\"dark-beast-z-turbo\". If they ask for Chroma 1 HD, choose model=\"chroma1-hd\".\nIf they ask for anime or anime-style output without naming a model, choose model=\"one-obsession-v22\".\nBase Z-image and Krea 2 Turbo image-to-image/enhancement requests stay on generate_image with\nsourceImageIndex and starting_image_strength; identity-preserving Krea edits with reference\nphotos use edit_image instead.\n\nBATCH FAN-OUT DEFAULT (READ BEFORE ANYTHING ELSE BELOW):\nWhen the user explicitly asks for N images in the CURRENT turn, set numberOfVariations=N\nin one call. Avoid multiple serial generate_image calls unless the user explicitly wants\nindependent projects, isolated approvals, or per-output settings that cannot share one project.\nDo not omit numberOfVariations and try to \"generate the next one after this finishes\".\nTrigger phrasings:\n\"draw N\", \"make N\", \"give me N\", \"show me N\", \"render N\", \"create N\", \"generate N\",\n\"N more\", \"another N\", \"N as separate\", \"N separate images\", \"N different images\",\n\"N options\", \"N takes\", \"N versions\", \"N variations\", \"N pictures of\",\n\"all at the same time\", \"in parallel\", \"side by side as separate\".\n\nTHE PRIOR TURN DOES NOT ANCHOR THE CURRENT TURN. If the prior assistant turn used\nnumberOfVariations=1 with a composite \"N subjects in one image\" prompt, and the user\nnow says \"draw N more as separate images\" / \"as separate\" / \"separately\", DO NOT carry\nover numberOfVariations=1 from the prior call. The user is correcting that interpretation;\nset numberOfVariations=N for THIS call with one self-contained prompt per image via {|}\nDynamic Prompt branches. The new turn's count + separation language always wins over the\nprevious turn's pattern.\n\nWHEN BATCH FAN-OUT DOES NOT APPLY: numberOfVariations=1 with multiple subjects packed into\nONE prompt is correct only when the user clearly wants a SINGLE composite image (e.g.\n\"draw 2 goats in a meadow\" with no separation language, or explicit \"in one image\" / \"one\npicture of N\" / \"single image\" / \"composite\" / \"sheet\" / \"side-by-side composition\").\n\nIMAGE PROMPT ORDER: [SUBJECT] → [ATTRIBUTES] → [ACTION/POSE] → [CAMERA/FRAMING]\n→ [ENVIRONMENT] → [LIGHTING] → [STYLE/MEDIUM] → [MATERIALS/TEXTURES] →\n[SECONDARY DETAILS]. By default, start with the main subject and concrete observable\nattributes; use mood or atmosphere first only when the user explicitly asks for that shape.\nUse concrete nouns and observable adjectives — \"soft overcast daylight\" not \"nice lighting\".\nGood defaults when user is underspecified: medium shot for portraits, wide shot for\nenvironments, eye-level angle, soft natural light for realism.\n\nDYNAMIC PROMPTS: When numberOfVariations > 1, use Dynamic Prompt syntax to make each\nvariation meaningfully different — not just seed-different. Syntax: {a|b|c} cycles\nsequentially, {@a|b|c} picks randomly, {~a|b} paired cycling across groups. Rules: (1) Vary\nONLY what the user left unspecified — lock in everything they specified. (2) Match option\ncount to numberOfVariations so every result is unique. (3) Briefly tell the user what you're\nvarying without exposing raw {|} syntax unless the user asks to inspect the prompt.\n(4) Skip when: user wants consistency, prompt is fully\nspecified, user typed their own {|} syntax, or iterating on a specific result. (5) Do not put\nthe count or the word \"versions\"/\"variations\" inside the prompt — the prompt always describes\na single image. The multiplicity comes ONLY from numberOfVariations + the {|} syntax.\nLINKED VARIANTS: when multiple attributes must stay paired per result, use ONE top-level\nDynamic Prompt branch with one complete self-contained prompt per output. Do NOT split\nlinked fields into separate Dynamic Prompt groups. Treat every batch-wide requirement\nquantified as \"each\", \"every\", or \"all\" as a hard per-option invariant: repeat it inside\nEVERY option, including identity/pose continuity, clothing/style, the concrete setting, and\nliteral visible names, labels, captions, flags, logos, or symbols. A shared prefix or another\noption is never a substitute for a complete standalone option.\nEach option must name its actual styling, setting, accessories, and requested literal text or\nsymbol. Never emit meta-placeholders such as \"variant-specific background\", \"requested\nsymbol\", \"humorous alternate name\", or \"bake the name and symbol into the image\".\nWhen one option remakes/preserves an original and the others are themed variants, make the\noriginal option equally concrete: specify the original clothing and setting plus every\nrequested label, flag, logo, symbol, or prop; do not write only \"the original\".\n\nSELECTION-GATED IMAGE STAGES: If the user asks for N image options and says they will pick\none before a later dance/video/animation, call generate_image once with numberOfVariations=N.\nAfter images are created, stop and ask the user to choose unless the user explicitly asked\nto run the later stage immediately.\n\nIMAGE→VIDEO DIMENSION RULE: When generating an image that will feed into a video tool\n(animate_photo, sound_to_video, etc.), the image MUST be generated at the SAME aspect\nratio and dimensions as the target video. Default video aspect ratio is 16:9 landscape —\npass aspectRatio=\"16:9\" (or the user's specified/reference ratio) so the source image\nmatches the video output. Do not generate a square image for a widescreen video. Exception:\na composite GPT Image 2 storyboard/keyframe sheet for a later Seedance video is a board,\nnot a single source frame; unless the user explicitly specifies a storyboard page/canvas/sheet\nshape, default the sheet image dimensions to a balanced grid that hosts the target\nscene-cell/frame aspect natively (portrait video target -> portrait or square sheet whose\ncolumns x rows grid produces ~9:16 cells; landscape video target -> landscape sheet whose\nrows x columns grid produces ~16:9 cells). Each scene-cell/frame area preserves the target\nvideo aspect ratio.\n\nSTORYBOARD IMAGE BATCH RULE: When rendering scene keyframes from a screenplay/storyboard,\nnumberOfVariations is only the count; the prompt should be one Dynamic Prompt branch with one\nfull keyframe prompt per scene:\n{scene 1 full keyframe prompt|scene 2 full keyframe prompt|...|scene N full keyframe prompt}.\nDo not set numberOfVariations=N with only the first scene prompt — that creates N versions of\nscene 1. For full project requests, one generate_image batch for all scene keyframes, then\none animate_photo batch for all video clips in parallel.\n\nSTORYTELLING / BRAND / SOCIAL IMAGE PROMPTS: If generating a storyboard, ad concept,\ntrailer sheet, meme, creator post, or provocative social concept, make the first frame or\npanel immediately legible. Preserve the user's requested tone and audience. Use concrete\ncomposition, persona, product/brand role, caption placement, readable required text, and a\nclear visual transformation or punchline. For provocative adult social content, keep subjects\nclearly adult and consensual, PG-13/non-explicit, and avoid minor-coded styling or school-coded\nsettings while still optimizing visual magnet, persona, caption bait, and replay/comment value.\n\nGPT IMAGE 2 STORYBOARD SHEET → SEEDANCE AUTO-PROCEED: If the user asks to run the whole\nGPT Image 2 storyboard/keyframe sheet plus Seedance workflow without approval, the FIRST\ngenerate_image call must create ONE composite storyboard/keyframe sheet, not loose concept\nart and not separate keyframes. Use model=\"gpt-image-2\", numberOfVariations=1, and a\ncompiled storyboard prompt that literally includes: \"Create exactly N sequential video\nstoryboard frames as one composite storyboard image\", \"Target final video aspect ratio: X\",\na `SCENES:` section, and exactly N concrete scene entries named `SCENE_01`, `SCENE_02`,\netc. Each scene entry must include `Visual/Action:`, `Camera/Motion:`, `Dialogue/VO:`\n(use `[no dialogue]` when silent), `Audio/SFX:`, and any reference/visible-text notes\nneeded for that scene. Do not send only a source brief, storyboard concept, or generic\nlayout instructions as the prompt; malformed compiled storyboard prompts are blocked by\nquality audit instead of being repaired at runtime. If the user does not explicitly specify\na frame count, choose N with the shared storyboard density default: at least one key visual\nbeat about every 2 seconds, rounded up and clamped to 6-16 total storyboard frames\n(for example, a 60 second commercial defaults to N=16). Unless the user explicitly specifies another\nstoryboard page/canvas/sheet shape, default the GPT Image 2 storyboard sheet pixel dimensions\nto a balanced grid that hosts the target cell aspect natively: for a 9:16 portrait video,\npick a portrait-leaning sheet whose columns x rows grid produces ~9:16 cells (e.g., 12 cells\n-> ~3:4 sheet around 1728x2304, 6 cells -> ~27:32 around 1840x2176, 9 cells -> ~9:16 around\n1504x2672); for a 16:9 landscape video, pick a landscape sheet whose rows x columns grid\nproduces ~16:9 cells (e.g., 12 cells -> ~4:3 sheet around 2304x1728). Do not force landscape\n2560x1440 when cells are portrait — a landscape sheet with a portrait-cell grid cannot host\n9:16 cells without crushing them. Preserve the requested final video aspect ratio for every\nframe area. After\nthat image completes, call generate_video once using the generated storyboard board as\n@Image1/referenceImageIndices=[0], with skipPromptProcessing=false only when the user\nexplicitly wants the storyboard text rewritten; otherwise preserve the compiled shot guide\nand use skipPromptProcessing=true, expandPrompt=false.\n\nDO NOT USE generate_image FOR UPLOADED REFERENCE LOOPED VIDEO SEGMENTS: If the user says\nthe same uploaded image/reference should be reused as the first frame and last frame of each\nscripted segment/scene/clip before stitching, they are explicitly asking to animate the\nuploaded image, not to generate new storyboard keyframes. Do not call generate_image for\nthat request. Call animate_photo once with repeated uploaded source indices and per-scene\nprompts.\n\nREUSING RESULTS: When the user asks to redo, retry, or revise (e.g., \"try a new version\",\n\"redo the video with X\"), reuse the existing source images — do NOT regenerate them unless\nthe user explicitly asks for new images or describes changes to the images themselves.\nReference the existing result indices from the prior generation. If unsure whether the user\nwants new images, ask — don't regenerate by default.",
2864
+ "baseDescription": "generate_image creates images from text descriptions. Use for text-only image generation;\nuse edit_image when uploaded or reference images must guide identity/likeness.\nException: Z-image, Z-image Turbo, and Krea 2 Turbo image-to-image/enhancement requests\nuse generate_image with model=\"z-turbo\", model=\"z-image\", or model=\"krea-2-turbo\",\nsourceImageIndex=-1, and starting_image_strength; do not route explicit base-model\nZ-image Turbo or Krea 2 Turbo uploaded-image enhancement to edit_image because edit_image\ndoes not expose those base image-to-image models.\n\nMODEL CHOICE: If the user asks for Krea 2 Turbo, choose model=\"krea-2-turbo\". If they ask\nfor Dark Beast Krea 2, choose model=\"dark-beast-krea2\". If they ask for Dark Beast Z-Image\nTurbo, choose model=\"dark-beast-z-turbo\". If they ask for Chroma 1 HD, choose model=\"chroma1-hd\".\nIf they ask for anime or anime-style output without naming a model, choose model=\"one-obsession-v22\".\nBase Z-image and Krea 2 Turbo image-to-image/enhancement requests stay on generate_image with\nsourceImageIndex and starting_image_strength; identity-preserving Krea edits with reference\nphotos use edit_image instead.\n\nBATCH FAN-OUT DEFAULT (READ BEFORE ANYTHING ELSE BELOW):\nWhen the user explicitly asks for N images in the CURRENT turn, set numberOfVariations=N\nin one call. Avoid multiple serial generate_image calls unless the user explicitly wants\nindependent projects, isolated approvals, or per-output settings that cannot share one project.\nDo not omit numberOfVariations and try to \"generate the next one after this finishes\".\nTrigger phrasings:\n\"draw N\", \"make N\", \"give me N\", \"show me N\", \"render N\", \"create N\", \"generate N\",\n\"N more\", \"another N\", \"N as separate\", \"N separate images\", \"N different images\",\n\"N options\", \"N takes\", \"N versions\", \"N variations\", \"N pictures of\",\n\"all at the same time\", \"in parallel\", \"side by side as separate\".\n\nTHE PRIOR TURN DOES NOT ANCHOR THE CURRENT TURN. If the prior assistant turn used\nnumberOfVariations=1 with a composite \"N subjects in one image\" prompt, and the user\nnow says \"draw N more as separate images\" / \"as separate\" / \"separately\", DO NOT carry\nover numberOfVariations=1 from the prior call. The user is correcting that interpretation;\nset numberOfVariations=N for THIS call with one self-contained prompt per image via {|}\nDynamic Prompt branches. The new turn's count + separation language always wins over the\nprevious turn's pattern.\n\nWHEN BATCH FAN-OUT DOES NOT APPLY: numberOfVariations=1 with multiple subjects packed into\nONE prompt is correct only when the user clearly wants a SINGLE composite image (e.g.\n\"draw 2 goats in a meadow\" with no separation language, or explicit \"in one image\" / \"one\npicture of N\" / \"single image\" / \"composite\" / \"sheet\" / \"side-by-side composition\").\n\nIMAGE PROMPT ORDER: [SUBJECT] → [ATTRIBUTES] → [ACTION/POSE] → [CAMERA/FRAMING]\n→ [ENVIRONMENT] → [LIGHTING] → [STYLE/MEDIUM] → [MATERIALS/TEXTURES] →\n[SECONDARY DETAILS]. By default, start with the main subject and concrete observable\nattributes; use mood or atmosphere first only when the user explicitly asks for that shape.\nUse concrete nouns and observable adjectives — \"soft overcast daylight\" not \"nice lighting\".\nGood defaults when user is underspecified: medium shot for portraits, wide shot for\nenvironments, eye-level angle, soft natural light for realism.\n\nDYNAMIC PROMPTS: When numberOfVariations > 1, use Dynamic Prompt syntax to make each\nvariation meaningfully different — not just seed-different. Syntax: {a|b|c} cycles\nsequentially, {@a|b|c} picks randomly, {~a|b} paired cycling across groups. Rules: (1) Vary\nONLY what the user left unspecified — lock in everything they specified. (2) Match option\ncount to numberOfVariations so every result is unique. (3) Briefly tell the user what you're\nvarying without exposing raw {|} syntax unless the user asks to inspect the prompt.\n(4) Skip when: user wants consistency, prompt is fully\nspecified, user typed their own {|} syntax, or iterating on a specific result. (5) Do not put\nthe count or the word \"versions\"/\"variations\" inside the prompt — the prompt always describes\na single image. The multiplicity comes ONLY from numberOfVariations + the {|} syntax.\nLINKED VARIANTS: when multiple attributes must stay paired per result, use ONE top-level\nDynamic Prompt branch with one complete self-contained prompt per output. Do NOT split\nlinked fields into separate Dynamic Prompt groups. Treat every batch-wide requirement\nquantified as \"each\", \"every\", or \"all\" as a hard per-option invariant: repeat it inside\nEVERY option, including identity/pose continuity, clothing/style, the concrete setting, and\nliteral visible names, labels, captions, flags, logos, or symbols. A shared prefix or another\noption is never a substitute for a complete standalone option.\nEach option must name its actual styling, setting, accessories, and requested literal text or\nsymbol. Never emit meta-placeholders such as \"variant-specific background\", \"requested\nsymbol\", \"humorous alternate name\", or \"bake the name and symbol into the image\".\nWhen one option remakes/preserves an original and the others are themed variants, make the\noriginal option equally concrete: specify the original clothing and setting plus every\nrequested label, flag, logo, symbol, or prop; do not write only \"the original\".\n\nSELECTION-GATED IMAGE STAGES: If the user asks for N image options and says they will pick\none before a later dance/video/animation, call generate_image once with numberOfVariations=N.\nAfter images are created, stop and ask the user to choose unless the user explicitly asked\nto run the later stage immediately.\n\nIMAGE→VIDEO DIMENSION RULE: When generating an image that will feed into a video tool\n(animate_photo, sound_to_video, etc.), the image MUST be generated at the SAME aspect\nratio and dimensions as the target video. Default video aspect ratio is 16:9 landscape —\npass aspectRatio=\"16:9\" (or the user's specified/reference ratio) so the source image\nmatches the video output. Do not generate a square image for a widescreen video. Exception:\na composite GPT Image 2 storyboard/keyframe sheet for a later Seedance video is a board,\nnot a single source frame; unless the user explicitly specifies a storyboard page/canvas/sheet\nshape, default the sheet image dimensions to a balanced grid that hosts the target\nscene-cell/frame aspect natively (portrait video target -> portrait or square sheet whose\ncolumns x rows grid produces ~9:16 cells; landscape video target -> landscape sheet whose\nrows x columns grid produces ~16:9 cells). Each scene-cell/frame area preserves the target\nvideo aspect ratio.\n\nSTORYBOARD IMAGE BATCH RULE: When rendering scene keyframes from a screenplay/storyboard,\nnumberOfVariations is only the count; the prompt should be one Dynamic Prompt branch with one\nfull keyframe prompt per scene:\n{scene 1 full keyframe prompt|scene 2 full keyframe prompt|...|scene N full keyframe prompt}.\nDo not set numberOfVariations=N with only the first scene prompt — that creates N versions of\nscene 1. For full project requests, one generate_image batch for all scene keyframes, then\none animate_photo batch for all video clips in parallel.\n\nSTORYTELLING / BRAND / SOCIAL IMAGE PROMPTS: If generating a storyboard, ad concept,\ntrailer sheet, meme, creator post, or provocative social concept, make the first frame or\npanel immediately legible. Preserve the user's requested tone and audience. Use concrete\ncomposition, persona, product/brand role, caption placement, readable required text, and a\nclear visual transformation or punchline. For provocative adult social content, keep subjects\nclearly adult and consensual, PG-13/non-explicit, and avoid minor-coded styling or school-coded\nsettings while still optimizing visual magnet, persona, caption bait, and replay/comment value.\n\nGPT IMAGE STORYBOARD SHEET → SEEDANCE AUTO-PROCEED: If the user asks to run the whole\nGPT Image storyboard/keyframe sheet plus Seedance workflow without approval, the FIRST\ngenerate_image call must create ONE composite storyboard/keyframe sheet, not loose concept\nart and not separate keyframes. Default to model=\"gpt-image-2.5-sunburst\" and preserve another\nexplicit GPT Image model named by the user. Use numberOfVariations=1 and a\ncompiled storyboard prompt that literally includes: \"Create exactly N sequential video\nstoryboard frames as one composite storyboard image\", \"Target final video aspect ratio: X\",\na `SCENES:` section, and exactly N concrete scene entries named `SCENE_01`, `SCENE_02`,\netc. Each scene entry must include `Visual/Action:`, `Camera/Motion:`, `Dialogue/VO:`\n(use `[no dialogue]` when silent), `Audio/SFX:`, and any reference/visible-text notes\nneeded for that scene. Do not send only a source brief, storyboard concept, or generic\nlayout instructions as the prompt; malformed compiled storyboard prompts are blocked by\nquality audit instead of being repaired at runtime. If the user does not explicitly specify\na frame count, choose N with the shared storyboard density default: at least one key visual\nbeat about every 2 seconds, rounded up and clamped to 6-16 total storyboard frames\n(for example, a 60 second commercial defaults to N=16). Unless the user explicitly specifies another\nstoryboard page/canvas/sheet shape, default the GPT Image 2 storyboard sheet pixel dimensions\nto a balanced grid that hosts the target cell aspect natively: for a 9:16 portrait video,\npick a portrait-leaning sheet whose columns x rows grid produces ~9:16 cells (e.g., 12 cells\n-> ~3:4 sheet around 1728x2304, 6 cells -> ~27:32 around 1840x2176, 9 cells -> ~9:16 around\n1504x2672); for a 16:9 landscape video, pick a landscape sheet whose rows x columns grid\nproduces ~16:9 cells (e.g., 12 cells -> ~4:3 sheet around 2304x1728). Do not force landscape\n2560x1440 when cells are portrait — a landscape sheet with a portrait-cell grid cannot host\n9:16 cells without crushing them. Preserve the requested final video aspect ratio for every\nframe area. After\nthat image completes, call generate_video once using the generated storyboard board as\n@Image1/referenceImageIndices=[0], with skipPromptProcessing=false only when the user\nexplicitly wants the storyboard text rewritten; otherwise preserve the compiled shot guide\nand use skipPromptProcessing=true, expandPrompt=false.\n\nDO NOT USE generate_image FOR UPLOADED REFERENCE LOOPED VIDEO SEGMENTS: If the user says\nthe same uploaded image/reference should be reused as the first frame and last frame of each\nscripted segment/scene/clip before stitching, they are explicitly asking to animate the\nuploaded image, not to generate new storyboard keyframes. Do not call generate_image for\nthat request. Call animate_photo once with repeated uploaded source indices and per-scene\nprompts.\n\nREUSING RESULTS: When the user asks to redo, retry, or revise (e.g., \"try a new version\",\n\"redo the video with X\"), reuse the existing source images — do NOT regenerate them unless\nthe user explicitly asks for new images or describes changes to the images themselves.\nReference the existing result indices from the prior generation. If unsure whether the user\nwants new images, ask — don't regenerate by default.",
2550
2865
  "parameterDocs": {
2551
2866
  "prompt": "Text description. Put the subject first. Use Dynamic Prompt syntax when numberOfVariations > 1.",
2552
2867
  "numberOfVariations": "Number of distinct outputs. Use Dynamic Prompt {|} syntax to vary one attribute per image. Never put the count in the prompt itself.",
@@ -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.50.0",
5
+ "version": "3.51.1",
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.50.0",
3
+ "version": "3.51.1",
4
4
  "description": "Sogni Creative Agent Skill: agent skill and CLI for Sogni AI image, 3D, speech, video, and music generation.",
5
5
  "type": "module",
6
6
  "main": "sogni-agent.mjs",
@@ -100,13 +100,13 @@
100
100
  "media-utilities.mjs"
101
101
  ],
102
102
  "dependencies": {
103
- "@sogni-ai/sogni-intelligence-client": "4.1.0",
103
+ "@sogni-ai/sogni-intelligence-client": "4.2.1",
104
104
  "execa": "^10.0.1",
105
105
  "json5": "^2.2.3",
106
106
  "sharp": "0.35.4"
107
107
  },
108
108
  "overrides": {
109
- "@sogni-ai/sogni-client": "5.50.0"
109
+ "@sogni-ai/sogni-client": "5.51.0"
110
110
  },
111
111
  "openclaw": {
112
112
  "extensions": [
@@ -85,3 +85,5 @@ recordings, and Music 3 section tags before generating. Discover 3D with
85
85
  read `../../references/interactive-worlds.md`.
86
86
 
87
87
  The complete skill spec — every workflow, model default, persona schema, memory schema, and prompt-engineering note — lives at `../../SKILL.md` relative to this file, with deep-dive guides under `../../references/`. Resolve those paths from this installed `SKILL.md`, not from the user's working directory. Read them when the user's request needs detail beyond the quick examples above (e.g. choosing between video workflows, configuring persona references, planning a multi-step composition).
88
+
89
+ Personal LoRA imports and library management: read [Personal LoRAs](../../references/personal-loras.md) for account-bound discovery, asynchronous import status, consent, compatible models, and rendering with owned adapters.
@@ -321,3 +321,19 @@ Override the API origin with `--api-base-url`, `SOGNI_API_BASE_URL`, or
321
321
  hosted workflow + chat operations route through the SDK transport; the skill's
322
322
  `sogni-hosted-client.mjs` factory still validates `restEndpoint` /
323
323
  `socketEndpoint` against the SSRF guard before constructing the SDK client.
324
+
325
+
326
+ ## Original-image utilities and speech
327
+
328
+ Submit these media tools as durable workflow steps (`toolName` and `arguments`) to `POST /v1/creative-agent/workflows`, or use hosted chat. The synchronous `/tools/execute` endpoint supports text composition only:
329
+
330
+ | Tool | Inputs and controls | Output |
331
+ | --- | --- | --- |
332
+ | `remove_background` | `sourceImageIndex` or `source_image_url`, `applyMask` (default true) | Transparent PNG; false returns mask |
333
+ | `image_to_3d` | Front `sourceImageIndex`/`source_image_url`; optional `leftViewImageIndex`, `backViewImageIndex`, `rightViewImageIndex` or named `*_view_image_url` URLs; `meshTargetFaces`, `textureSize`, `normalMapSize`, `ambientOcclusionSize`, `shapeResolution` | Binary GLB with media type `model` |
334
+ | `segment_image` | Original source; `text`, `points`, or `boxes`; `threshold`, `multimask`, `maxInstances`, `applyMask` | PNG mask or original-pixel cutout |
335
+ | `generate_speech` | Literal `prompt`; `model=voice/clone/design`; `voice`, `voiceDescription`, `voiceSourceIndex`, `voiceTranscript`, `language`, `creativity`, `outputFormat`, `seed` | Spoken audio |
336
+
337
+ Negative indices address uploads (-1 first); non-negative indices address generated results. 3D views are from the subject's perspective: left means the subject's own left side faces camera (subject faces screen-left), right means screen-right. Supply original images of the same subject at consistent height and framing; any subset of the three orbit views enables multi-view reconstruction. Keep the GLB in the model artifact lane, never feed it into an image tool.
338
+
339
+ For two-stage Turbo H3, use explicit `minimax-h3-fasth3-*-turbo-2stage` selectors on the relevant video tool with `targetResolution`. Audio-guided IA2V/FLFA2V/A2V selectors belong on `sound_to_video` and require the uploaded audio plus their named endpoint images. They preserve the supplied audio and reject LoRAs. Other H3 modes discover personal LoRAs through the [authenticated catalog](personal-loras.md).
@@ -0,0 +1,33 @@
1
+ # Personal LoRAs
2
+
3
+ Read this when the user wants to import, inspect, remove, or render with their own LoRA. These commands use `SOGNI_API_KEY` for the same account as Sogni Web. Import and generation require Unlimited; list and removal remain available after it expires.
4
+
5
+ ```bash
6
+ sogni-agent --list-personal-loras
7
+ sogni-agent --import-lora https://huggingface.co/author/repository/resolve/main/style.safetensors --personal-lora-name "My style" --personal-lora-model krea2_turbo_fp8_scaled --confirm-lora-rights
8
+ sogni-agent --get-personal-lora personal-REPLACE-WITH-RETURNED-ID
9
+ sogni-agent --list-loras --include-personal-loras --lora-catalog-model krea2_turbo_fp8_scaled
10
+ ```
11
+
12
+ The import command starts asynchronous validation. Poll `--get-personal-lora` at a reasonable interval and show `reason`/`failureCode` on failure. Only `ready` entries can render; `queued`, `validating`, and `review` need more time. `rejected` and `revoked` cannot render. Do not re-import repeatedly to poll. `--list-personal-loras` returns supported import models and current limits; discover model IDs there.
13
+
14
+ Set `--confirm-lora-rights` only when the user has confirmed permission to use that file. Hugging Face safetensors links and Civitai model/version links are accepted. An import does not train a new adapter.
15
+
16
+ Once ready, use the actual returned ID:
17
+
18
+ ```bash
19
+ sogni-agent -m krea2_turbo_fp8_scaled --lora personal-REPLACE-WITH-RETURNED-ID --no-filter "a glass sculpture"
20
+ sogni-agent --video -m minimax-h3-fasth3-t2v-turbo-2stage --target-resolution 1080p --lora personal-REPLACE-WITH-RETURNED-ID --no-filter "the user's H3 prompt"
21
+ ```
22
+
23
+ First confirm the selected model occurs in the entry's `modelIds`. Preserve the user's selected model. The CLI discovers owned entries through the authenticated catalog and uses catalog defaults when strengths are omitted; repeat `--lora-strength` to set explicit ordered strengths. Follow the entry's prompt and workflow requirements. Personal imports require `--no-filter`; explain that setting when it was not already requested. H3 audio-guided modes do not support LoRAs.
24
+
25
+ `--list-loras` remains public and requires no account; add `--include-personal-loras` to merge owned ready imports. Catalog responses are account-specific. Do not share them between users.
26
+
27
+ Remove an entry only when requested:
28
+
29
+ ```bash
30
+ sogni-agent --remove-personal-lora personal-REPLACE-WITH-RETURNED-ID
31
+ ```
32
+
33
+ For speech, `--speech --speech-mode clone --voice-reference clip.wav` clones the supplied original recording for synthesis. It is reference conditioning, not a persistent training job; see the speech guidance in SKILL.md. Background removal, multi-view 3D, and two-stage H3 have their existing direct CLI controls; hosted equivalents are documented in [hosted-api.md](hosted-api.md).
@@ -25,6 +25,7 @@ const referenceFiles = [
25
25
  'models.md',
26
26
  'object-selection.md',
27
27
  'personas-memory.md',
28
+ 'personal-loras.md',
28
29
  'private-mature-video.md',
29
30
  'seamless-tiling.md',
30
31
  'video-editing.md',
@@ -3,12 +3,12 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@sogni-ai/sogni-intelligence-client": "4.1.0",
6
+ "@sogni-ai/sogni-intelligence-client": "4.2.1",
7
7
  "execa": "^10.0.1",
8
8
  "json5": "^2.2.3",
9
9
  "sharp": "0.35.4"
10
10
  },
11
11
  "overrides": {
12
- "@sogni-ai/sogni-client": "5.50.0"
12
+ "@sogni-ai/sogni-client": "5.51.0"
13
13
  }
14
14
  }
package/sogni-agent.mjs CHANGED
@@ -3219,6 +3219,12 @@ const options = {
3219
3219
  loraCatalogQuery: null,
3220
3220
  loraCatalogModel: null, // restrict to LoRAs compatible with this model id
3221
3221
  loraCatalogCategory: null, // restrict to one catalog category
3222
+ includePersonalLoras: false,
3223
+ personalLoraAction: null,
3224
+ personalLoraValue: null,
3225
+ personalLoraName: null,
3226
+ personalLoraModel: null,
3227
+ personalLoraRightsConfirmed: false,
3222
3228
  apiReplayAction: null, // list|get|ingest
3223
3229
  apiReplayId: null,
3224
3230
  apiReplayInput: null,
@@ -4051,6 +4057,21 @@ for (let i = 0; i < args.length; i++) {
4051
4057
  const raw = requireFlagValue(args, i, arg);
4052
4058
  i++;
4053
4059
  options.liveModelTags.push(raw);
4060
+ } else if (arg === '--list-personal-loras') {
4061
+ if (options.personalLoraAction) fatalCliError('Choose one personal LoRA action.', { code: 'INVALID_ARGUMENT' });
4062
+ options.personalLoraAction = 'list';
4063
+ } else if ((arg === '--get-personal-lora' || arg === '--import-lora' || arg === '--remove-personal-lora')) {
4064
+ if (options.personalLoraAction) fatalCliError('Choose one personal LoRA action.', { code: 'INVALID_ARGUMENT' });
4065
+ options.personalLoraAction = { '--get-personal-lora': 'get', '--import-lora': 'import', '--remove-personal-lora': 'remove' }[arg];
4066
+ options.personalLoraValue = requireFlagValue(args, i, arg);
4067
+ i++;
4068
+ } else if (arg === '--personal-lora-name' || arg === '--personal-lora-model') {
4069
+ options[arg === '--personal-lora-name' ? 'personalLoraName' : 'personalLoraModel'] = requireFlagValue(args, i, arg);
4070
+ i++;
4071
+ } else if (arg === '--confirm-lora-rights') {
4072
+ options.personalLoraRightsConfirmed = true;
4073
+ } else if (arg === '--include-personal-loras') {
4074
+ options.includePersonalLoras = true;
4054
4075
  } else if (arg === '--list-loras' || arg === '--loras-catalog') {
4055
4076
  options.loraCatalogAction = 'list';
4056
4077
  const next = args[i + 1];
@@ -4608,6 +4629,14 @@ General:
4608
4629
  --search-loras <q> Search LoRAs by ID, name, category, or description
4609
4630
  --lora-catalog-model <id> Only LoRAs compatible with that model id
4610
4631
  --lora-category <c> Filter by catalog category, e.g. character or lighting
4632
+ --include-personal-loras Include your ready imports in --list-loras / --search-loras
4633
+ --list-personal-loras List all your imports, statuses, supported models and limits
4634
+ --get-personal-lora <id> Read one import's current status and requirements
4635
+ --import-lora <url> Import a public Hugging Face or Civitai LoRA
4636
+ --personal-lora-name <name> Name for --import-lora
4637
+ --personal-lora-model <id> Base model for --import-lora (see --list-personal-loras)
4638
+ --confirm-lora-rights Confirm permission to use the imported file on Sogni
4639
+ --remove-personal-lora <id> Remove an entry from your library
4611
4640
  --doctor Health check: Node, credentials, ffmpeg, auth, plan, config, version
4612
4641
  --snooze-update Snooze the pending update reminder (1 day → 2 days → 1 week)
4613
4642
  --whats-new [version] Show bundled CHANGELOG entries (everything after <version> if given)
@@ -4713,7 +4742,7 @@ Seedance Video Model Selectors:
4713
4742
  seedance2-v2v Video-to-video without ControlNet
4714
4743
  seedance2-5 Seedance 2.5 text-to-video (alias seedance2-5-t2v): 4-30s single clips,
4715
4744
  480p/720p/1080p (no 4K), MP4/MOV and last-frame export, native audio, first/last frame via
4716
- --ref/--ref-end, up to 30 image / 10 video / 10 audio refs (30 total)
4745
+ --ref/--ref-end, up to 30 image / 10 video / 10 audio refs (50 total)
4717
4746
  seedance2-5-ia2v Seedance 2.5 image+audio-to-video
4718
4747
  seedance2-5-v2v Seedance 2.5 video-to-video, editing, and extension, no ControlNet
4719
4748
 
@@ -4816,7 +4845,7 @@ Examples:
4816
4845
  sogni-agent --api-chat "Create a 4-shot product video concept for a red sneaker"
4817
4846
  sogni-agent --api-workflow --video-prompt "slow push-in as it comes alive" "a graphite robot sketch"
4818
4847
  sogni-agent --api-workflow --workflow-input @workflow.json
4819
- sogni-agent --api-workflow storyboard-video --storyboard-frames 6 "Create a 12s 9:16 bakery launch video with GPT Image 2 and Seedance"
4848
+ sogni-agent --api-workflow storyboard-video --storyboard-frames 6 "Create a 12s 9:16 bakery launch video with GPT Image 2.5 Sunburst and Seedance 2.5 at 1080p"
4820
4849
  sogni-agent --video -m ltx25 --duration 20 "A wide cinematic aerial shot opens over steep tropical cliffs at golden hour, warm sunlight grazing the rock faces while sea mist drifts above the water below. Palm trees bend gently along the ridge as waves roll against the shoreline, leaving bright bands of foam across the dark stone. The camera glides forward in one continuous pass, revealing more of the coastline as sunlight flickers across wet surfaces and distant birds wheel through the haze. The scene holds a calm, upscale travel-film mood with smooth stabilized motion and crisp environmental detail."
4821
4850
  sogni-agent --video --ref subject.jpg --ref-video motion.mp4 --workflow animate-move "transfer motion"
4822
4851
  sogni-agent --video --last-image "gentle camera pan"
@@ -5299,7 +5328,7 @@ if (options.video && options.loras.length > 0) {
5299
5328
  // dropped server-side and rendering as if no LoRA had been asked for.
5300
5329
  let videoLoraCatalog;
5301
5330
  try {
5302
- videoLoraCatalog = await fetchLoraCatalog(options.model);
5331
+ videoLoraCatalog = await fetchLoraCatalog(options.model, options.loras.some(id => id.startsWith('personal-')));
5303
5332
  } catch (cause) {
5304
5333
  fatalCliError(
5305
5334
  `Could not read the LoRA catalog for "${options.model}": ${cause?.message || cause}`,
@@ -5323,7 +5352,7 @@ if (options.video && options.loras.length > 0) {
5323
5352
  : isUnresolvedH3Alias
5324
5353
  ? 'Name an explicit H3 mode (for example -m minimax-h3-i2v); LoRA availability differs per mode.'
5325
5354
  : 'That model loads no LoRAs.') +
5326
- ' Run --list-loras --lora-model <id> for the live catalog.',
5355
+ ' Run --list-loras --include-personal-loras --lora-catalog-model <id> for the live catalog.',
5327
5356
  { code: 'INVALID_ARGUMENT' }
5328
5357
  );
5329
5358
  }
@@ -5349,6 +5378,20 @@ if (options.video && options.loras.length > 0) {
5349
5378
  }
5350
5379
  }
5351
5380
 
5381
+ if (!options.video && options.loras.some(id => id.startsWith('personal-'))) {
5382
+ try {
5383
+ const catalog = await fetchLoraCatalog(options.model, true);
5384
+ const entries = new Map(catalog.loras.map(loraCatalogEntryFromPayload).map(entry => [entry.loraId, entry]));
5385
+ for (const id of options.loras.filter(id => id.startsWith('personal-'))) {
5386
+ if (!entries.has(id)) fatalCliError(`Personal LoRA "${id}" is not ready or compatible with model "${options.model}". Run --list-personal-loras and --list-loras --include-personal-loras.`, { code: 'INVALID_ARGUMENT' });
5387
+ if (entries.get(id).nsfw && !options.noFilter) fatalCliError(`Personal LoRA "${id}" requires --no-filter.`, { code: 'INVALID_ARGUMENT' });
5388
+ }
5389
+ if (options.loraStrengths.length === 0) options.loraStrengths = options.loras.map(id => entries.get(id)?.default ?? 1);
5390
+ } catch (cause) {
5391
+ fatalCliError(`Could not read your personal LoRA catalog: ${cause?.message || cause}`, { code: cause?.code || 'LORA_CATALOG_UNAVAILABLE' });
5392
+ }
5393
+ }
5394
+
5352
5395
  if (options.video && options.scheduler) {
5353
5396
  fatalCliError('--scheduler is an image-only option.', { code: 'INVALID_ARGUMENT' });
5354
5397
  }
@@ -5920,7 +5963,7 @@ const apiWorkflowStartHasExternalInput = options.apiWorkflowAction === 'start' &
5920
5963
  const apiWorkflowTemplate = options.apiWorkflowTemplate || 'generated_keyframe_video';
5921
5964
  const apiModelUtilityAction = Boolean(options.apiModelAction);
5922
5965
  const liveModelUtilityAction = Boolean(options.liveModelAction);
5923
- const loraCatalogUtilityAction = Boolean(options.loraCatalogAction);
5966
+ const loraCatalogUtilityAction = Boolean(options.loraCatalogAction || options.personalLoraAction);
5924
5967
  const apiReplayUtilityAction = Boolean(options.apiReplayAction);
5925
5968
  const personaUtilityAction = Boolean(options.personaAction && options.personaAction !== 'generate');
5926
5969
  const contractUtilityAction = Boolean(options.contractAction);
@@ -5963,11 +6006,20 @@ if (!liveModelUtilityAction && (options.liveModelMedia !== 'all' || options.live
5963
6006
  code: 'INVALID_ARGUMENT'
5964
6007
  });
5965
6008
  }
5966
- if (!loraCatalogUtilityAction && (options.loraCatalogModel || options.loraCatalogCategory)) {
6009
+ if (!options.loraCatalogAction && (options.loraCatalogModel || options.loraCatalogCategory || options.includePersonalLoras)) {
5967
6010
  fatalCliError('--lora-catalog-model and --lora-category require --list-loras or --search-loras.', {
5968
6011
  code: 'INVALID_ARGUMENT'
5969
6012
  });
5970
6013
  }
6014
+ if (options.personalLoraAction && (options.prompt || options.video || options.music || options.speech || options.imageTo3d || options.removeBackground || options.apiChat || options.apiWorkflowAction || options.loraCatalogAction || options.loras.length)) {
6015
+ fatalCliError('Run personal LoRA management separately from generation or catalog discovery.', { code: 'INVALID_ARGUMENT' });
6016
+ }
6017
+ if (options.personalLoraAction === 'import' && (!options.personalLoraName || !options.personalLoraModel || !options.personalLoraRightsConfirmed)) {
6018
+ fatalCliError('--import-lora requires --personal-lora-name, --personal-lora-model and --confirm-lora-rights.', { code: 'INVALID_ARGUMENT' });
6019
+ }
6020
+ if (options.personalLoraAction !== 'import' && (options.personalLoraName || options.personalLoraModel || options.personalLoraRightsConfirmed)) {
6021
+ fatalCliError('Personal LoRA import options require --import-lora.', { code: 'INVALID_ARGUMENT' });
6022
+ }
5971
6023
  // Normalize a whitespace-only prompt to empty so the guard below treats it as
5972
6024
  // "no prompt" rather than silently sending blank text to the server.
5973
6025
  if (typeof options.prompt === 'string' && options.prompt.trim() === '') {
@@ -8504,6 +8556,31 @@ function storyboardWorkflowImageQualityFromCli() {
8504
8556
  return 'medium';
8505
8557
  }
8506
8558
 
8559
+ function normalizeSeedance25StoryboardPlanDimensions(plan, targetResolution) {
8560
+ if (!plan?.video || plan.video.model !== 'seedance2-5') return plan;
8561
+ const videoStep = plan.input?.steps?.find((step) => step?.toolName === 'generate_video');
8562
+ const ratioParts = String(plan.storyboardProject?.targetVideoAspectRatio || '')
8563
+ .split(':')
8564
+ .map(Number);
8565
+ if (!Number.isFinite(targetResolution) || targetResolution <= 0 || ratioParts.length !== 2) return plan;
8566
+ const [ratioWidth, ratioHeight] = ratioParts;
8567
+ if (!Number.isFinite(ratioWidth) || !Number.isFinite(ratioHeight) || ratioWidth <= 0 || ratioHeight <= 0) return plan;
8568
+ if (videoStep?.arguments) {
8569
+ videoStep.arguments.targetResolution = targetResolution;
8570
+ delete videoStep.arguments.width;
8571
+ delete videoStep.arguments.height;
8572
+ }
8573
+ const roundEven = (value) => Math.round(value / 2) * 2;
8574
+ if (ratioWidth >= ratioHeight) {
8575
+ plan.video.width = roundEven(targetResolution * ratioWidth / ratioHeight);
8576
+ plan.video.height = targetResolution;
8577
+ } else {
8578
+ plan.video.width = targetResolution;
8579
+ plan.video.height = roundEven(targetResolution * ratioHeight / ratioWidth);
8580
+ }
8581
+ return plan;
8582
+ }
8583
+
8507
8584
  function storyboardWorkflowInputFromParsedValue(parsed) {
8508
8585
  if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return null;
8509
8586
  if (Array.isArray(parsed.steps)) return parsed;
@@ -8519,8 +8596,13 @@ function storyboardWorkflowInputFromParsedValue(parsed) {
8519
8596
  const explicitCliVideoModel = options.videoModel
8520
8597
  || (cliSet.model && isSeedanceModelSelection(options.model) ? options.model : undefined);
8521
8598
  const explicitCliImageModel = cliSet.model && !isSeedanceModelSelection(options.model) ? options.model : undefined;
8599
+ const storyboardVideoTargetResolution = Number.isFinite(parsed.videoTargetResolution)
8600
+ ? parsed.videoTargetResolution
8601
+ : cliSet.targetResolution && Number.isFinite(options.targetResolution)
8602
+ ? options.targetResolution
8603
+ : 1080;
8522
8604
 
8523
- return buildStoryboardVideoHostedToolSequenceInput({
8605
+ return normalizeSeedance25StoryboardPlanDimensions(buildStoryboardVideoHostedToolSequenceInput({
8524
8606
  storyline,
8525
8607
  userIntentText: typeof parsed.userIntentText === 'string'
8526
8608
  ? parsed.userIntentText
@@ -8538,12 +8620,10 @@ function storyboardWorkflowInputFromParsedValue(parsed) {
8538
8620
  : cliSet.duration && Number.isFinite(options.duration)
8539
8621
  ? options.duration
8540
8622
  : undefined,
8541
- videoTargetResolution: Number.isFinite(parsed.videoTargetResolution)
8542
- ? parsed.videoTargetResolution
8543
- : cliSet.targetResolution && Number.isFinite(options.targetResolution)
8544
- ? options.targetResolution
8545
- : undefined,
8546
- imageModel: typeof parsed.imageModel === 'string' ? parsed.imageModel : explicitCliImageModel,
8623
+ videoTargetResolution: storyboardVideoTargetResolution,
8624
+ imageModel: typeof parsed.imageModel === 'string'
8625
+ ? parsed.imageModel
8626
+ : explicitCliImageModel ?? 'gpt-image-2.5-sunburst',
8547
8627
  imageQuality: typeof parsed.imageQuality === 'string'
8548
8628
  ? parsed.imageQuality
8549
8629
  : typeof parsed.gptImageQuality === 'string'
@@ -8556,15 +8636,17 @@ function storyboardWorkflowInputFromParsedValue(parsed) {
8556
8636
  : cliSet.outputFormat
8557
8637
  ? options.outputFormat
8558
8638
  : undefined,
8559
- videoModel: typeof parsed.videoModel === 'string' ? parsed.videoModel : explicitCliVideoModel,
8639
+ videoModel: typeof parsed.videoModel === 'string'
8640
+ ? parsed.videoModel
8641
+ : explicitCliVideoModel ?? 'seedance2-5',
8560
8642
  generateAudio: typeof parsed.generateAudio === 'boolean' ? parsed.generateAudio : options.apiGenerateAudio ?? undefined,
8561
- });
8643
+ }), storyboardVideoTargetResolution);
8562
8644
  }
8563
8645
 
8564
8646
  function buildStoryboardStorylineMessages() {
8565
8647
  const durationLine = cliSet.duration && Number.isFinite(options.duration)
8566
8648
  ? `Target duration: ${options.duration} seconds.`
8567
- : 'Target duration: infer a Seedance-safe duration between 4 and 15 seconds from the request.';
8649
+ : 'Target duration: infer a Seedance 2.5-safe duration between 4 and 30 seconds from the request.';
8568
8650
  const frameLine = Number.isFinite(options.storyboardFrames)
8569
8651
  ? `Storyboard beat count: exactly ${options.storyboardFrames}.`
8570
8652
  : 'Storyboard beat count: infer a compact 4-8 beat plan unless the user asks otherwise.';
@@ -8572,13 +8654,13 @@ function buildStoryboardStorylineMessages() {
8572
8654
  ? `Video target short-side resolution: ${options.targetResolution}p.`
8573
8655
  : '';
8574
8656
  const system = [
8575
- 'You write production-ready video storyboard storylines for a GPT Image 2 storyboard sheet that will be rendered into a Seedance 2.0 video.',
8657
+ 'You write production-ready video storyboard storylines for a GPT Image 2.5 Sunburst storyboard sheet that will be rendered into a Seedance 2.5 video at 1080p.',
8576
8658
  'Return only the storyline/script. Do not call tools, do not ask follow-up questions, and do not include markdown fences.',
8577
8659
  'Use this exact plain-text structure so downstream compilers can parse it: Project Title, Total Duration, then one SCENE NN - Title block per beat.',
8578
8660
  'Each scene block must put each field on its own line: TIME, PURPOSE, VISUAL, ACTION, CAMERA, LIGHTING/STYLE, TRANSITION, DIALOGUE/VO, AUDIO/SFX, MUSIC, VISIBLE TEXT.',
8579
8661
  'When there is no spoken dialogue or voiceover, write DIALOGUE/VO: [no dialogue]. Do not write None, N/A, or leave it blank.',
8580
8662
  'If the user requires exact visible text, repeat that exact text only in the relevant VISIBLE TEXT field and preserve spelling exactly.',
8581
- 'Keep it concise enough for one GPT Image 2 storyboard image and one Seedance video prompt, while preserving cause-and-effect story progression.',
8663
+ 'Keep it concise enough for one GPT Image 2.5 Sunburst storyboard image and one Seedance 2.5 video prompt, while preserving cause-and-effect story progression.',
8582
8664
  ].join(' ');
8583
8665
  const user = [
8584
8666
  'Original user request:',
@@ -8646,19 +8728,22 @@ async function buildStoryboardVideoWorkflowInput(apiKey) {
8646
8728
  const explicitCliVideoModel = options.videoModel
8647
8729
  || (cliSet.model && isSeedanceModelSelection(options.model) ? options.model : undefined);
8648
8730
  const explicitCliImageModel = cliSet.model && !isSeedanceModelSelection(options.model) ? options.model : undefined;
8649
- const plan = buildStoryboardVideoHostedToolSequenceInput({
8731
+ const storyboardVideoTargetResolution = cliSet.targetResolution && Number.isFinite(options.targetResolution)
8732
+ ? options.targetResolution
8733
+ : 1080;
8734
+ const plan = normalizeSeedance25StoryboardPlanDimensions(buildStoryboardVideoHostedToolSequenceInput({
8650
8735
  storyline,
8651
8736
  userIntentText: options.prompt,
8652
8737
  title: options.apiWorkflowTitle,
8653
8738
  frameCount: options.storyboardFrames ?? undefined,
8654
8739
  videoDurationSec: cliSet.duration && Number.isFinite(options.duration) ? options.duration : undefined,
8655
- videoTargetResolution: cliSet.targetResolution && Number.isFinite(options.targetResolution) ? options.targetResolution : undefined,
8656
- imageModel: explicitCliImageModel,
8740
+ videoTargetResolution: storyboardVideoTargetResolution,
8741
+ imageModel: explicitCliImageModel ?? 'gpt-image-2.5-sunburst',
8657
8742
  imageQuality: storyboardWorkflowImageQualityFromCli(),
8658
8743
  imageOutputFormat: cliSet.outputFormat ? options.outputFormat : undefined,
8659
- videoModel: explicitCliVideoModel,
8744
+ videoModel: explicitCliVideoModel ?? 'seedance2-5',
8660
8745
  generateAudio: options.apiGenerateAudio ?? undefined,
8661
- });
8746
+ }), storyboardVideoTargetResolution);
8662
8747
  return { plan, planningRaw: raw };
8663
8748
  }
8664
8749
 
@@ -8911,7 +8996,7 @@ async function runLiveModels() {
8911
8996
  //
8912
8997
  // This path is deliberately socket-free and credential-free: the catalog is
8913
8998
  // public, so `--list-loras` answers without connecting a worker session.
8914
- async function fetchLoraCatalog(modelId) {
8999
+ async function fetchPublicLoraCatalog(modelId) {
8915
9000
  const fixtureJson = getEnv('SOGNI_AGENT_TEST_LORA_CATALOG_JSON');
8916
9001
  if (fixtureJson) {
8917
9002
  const payload = JSON.parse(fixtureJson);
@@ -8975,6 +9060,43 @@ async function fetchLoraCatalog(modelId) {
8975
9060
  }
8976
9061
  }
8977
9062
 
9063
+ async function personalLoraRequest(path = '', init = {}) {
9064
+ const apiKey = requireApiKeyCredentials(loadCredentials(), 'Personal LoRAs');
9065
+ // Video preflight can run before the module's default timeout is initialized.
9066
+ const payload = await fetchApiJson(`/v1/loras/personal${path}`, { ...init, apiKey, timeoutMs: 30000 });
9067
+ if (payload?.status !== 'success' || !payload.data) throw new Error('Invalid personal LoRA response.');
9068
+ return payload.data;
9069
+ }
9070
+
9071
+ async function fetchLoraCatalog(modelId, includePersonal = false) {
9072
+ const catalog = await fetchPublicLoraCatalog(modelId);
9073
+ if (!includePersonal) return catalog;
9074
+ const personal = await personalLoraRequest('/catalog');
9075
+ if (!Array.isArray(personal.loras)) throw new Error('Invalid personal LoRA catalog.');
9076
+ return {
9077
+ ...catalog,
9078
+ loras: [...catalog.loras, ...personal.loras.filter(row => !modelId || row.modelIds?.includes(modelId))],
9079
+ models: [...new Set([...(catalog.models || []), ...personal.loras.flatMap(row => row.modelIds || [])])].sort()
9080
+ };
9081
+ }
9082
+
9083
+ async function runPersonalLoras() {
9084
+ const action = options.personalLoraAction;
9085
+ const id = options.personalLoraValue;
9086
+ let data;
9087
+ if (action === 'import') {
9088
+ data = await personalLoraRequest('', { method: 'POST', body: {
9089
+ url: id, name: options.personalLoraName, modelId: options.personalLoraModel,
9090
+ rightsConfirmed: options.personalLoraRightsConfirmed
9091
+ } });
9092
+ } else if (action === 'remove') {
9093
+ data = await personalLoraRequest(`/${encodeURIComponent(id)}`, { method: 'DELETE' });
9094
+ } else {
9095
+ data = await personalLoraRequest(action === 'get' ? `/${encodeURIComponent(id)}` : '');
9096
+ }
9097
+ console.log(JSON.stringify({ success: true, type: 'personal-loras', action, data }, null, options.json ? undefined : 2));
9098
+ }
9099
+
8978
9100
  function loraCatalogEntryFromPayload(entry) {
8979
9101
  const ui = entry?.ui || {};
8980
9102
  return {
@@ -9020,7 +9142,7 @@ async function runLoraCatalog() {
9020
9142
 
9021
9143
  // The model filter is applied server-side by the catalog endpoint; category
9022
9144
  // and free-text search are presentation-layer narrowing over what it returns.
9023
- const catalog = await fetchLoraCatalog(modelFilter || undefined);
9145
+ const catalog = await fetchLoraCatalog(modelFilter || undefined, options.includePersonalLoras);
9024
9146
  let loras = catalog.loras.map(loraCatalogEntryFromPayload).filter(entry => entry.loraId);
9025
9147
  if (categoryFilter) loras = loras.filter(entry => normalizeLiveModelTag(entry.category) === categoryFilter);
9026
9148
  if (normalizedQuery) {
@@ -12730,6 +12852,11 @@ async function main() {
12730
12852
  return;
12731
12853
  }
12732
12854
 
12855
+ if (options.personalLoraAction) {
12856
+ await runPersonalLoras();
12857
+ return;
12858
+ }
12859
+
12733
12860
  if (options.loraCatalogAction) {
12734
12861
  await runLoraCatalog();
12735
12862
  return;
package/version.mjs CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '3.50.0';
1
+ export const PACKAGE_VERSION = '3.51.1';