@sogni-ai/sogni-creative-agent-skill 3.46.0 → 3.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,131 @@
1
+ import {
2
+ SpeechModel, getSpeechMode, validateSpeechRequest, DEFAULT_SPEECH_VOICE,
3
+ SPEECH_CREATIVITY, SPEECH_REFERENCE_SECONDS, MUSIC_MODELS, MusicModel
4
+ } from '@sogni-ai/sogni-intelligence-client/media';
5
+
6
+ export const PIXAL3D_MODEL_ID = 'pixal3d_int8_i23d';
7
+ export const BIREFNET_MODEL_ID = 'birefnet_image_background_removal_fp16';
8
+ export const MUSIC3_MODEL_ID = MusicModel.best;
9
+ export const MUSIC3_DEFAULTS = MUSIC_MODELS.best;
10
+ export { SPEECH_REFERENCE_SECONDS };
11
+
12
+ export const SPEECH_VALUE_FLAGS = {
13
+ '--speech-mode': 'speechMode', '--speech-voice': 'speechVoice', '--voice-description': 'voiceDescription',
14
+ '--voice-reference': 'voiceReference', '--voice-transcript': 'voiceTranscript'
15
+ };
16
+
17
+ export const MESH_FLAGS = {
18
+ '--mesh-faces': ['meshTargetFaces', 5000, 700000],
19
+ '--texture-size': ['textureSize', 1024, 4096],
20
+ '--normal-map-size': ['normalMapSize', 512, 2048],
21
+ '--ao-map-size': ['ambientOcclusionSize', 256, 1024],
22
+ '--shape-resolution': ['shapeResolution', 1024, 1536]
23
+ };
24
+
25
+ // Validate explicit controls before image/video inference can reinterpret them.
26
+ export function prepareMediaUtilityOptions(options, explicit) {
27
+ const fail = message => { throw new Error(message); };
28
+ const selectedSpeechMode = getSpeechMode(options.model);
29
+ if (selectedSpeechMode) {
30
+ if (options.speechMode && options.speechMode !== selectedSpeechMode) fail('--speech-mode conflicts with --model.');
31
+ options.speech = true;
32
+ options.speechMode = selectedSpeechMode;
33
+ }
34
+ if (options.model === PIXAL3D_MODEL_ID && !options.imageTo3d) fail('Pixal3D requires --image-to-3d <original-image>.');
35
+ if (options.model === BIREFNET_MODEL_ID && !options.removeBackground) fail('BiRefNet requires --remove-background <original-image>.');
36
+ if (Object.keys(options.meshSettings).length && !options.imageTo3d) fail('Mesh settings require --image-to-3d.');
37
+ if (options.matte && !options.removeBackground) fail('--matte requires --remove-background.');
38
+ if (!options.speech && (options.speechMode || options.speechVoice || options.voiceDescription || options.voiceReference || options.voiceTranscript || options.speechCreativity !== null)) {
39
+ fail('Speech controls require --speech.');
40
+ }
41
+ const active = options.speech || options.imageTo3d || options.removeBackground;
42
+ if (!active) return;
43
+ if ([options.speech, options.imageTo3d, options.removeBackground, options.music, options.video,
44
+ options.segmentImage, options.upscaleImage, options.upscaleVideo, options.apiChat, options.apiWorkflowAction].filter(Boolean).length !== 1) {
45
+ fail('Choose one generation mode: speech, image-to-3d, remove-background, music, video, segmentation, or upscale.');
46
+ }
47
+ const unsupported = ['quality', 'width', 'height', 'strictSize', 'duration', 'fps', 'frames', 'steps', 'guidance',
48
+ 'sampler', 'scheduler', 'context', 'refImage', 'refImageEnd', 'refAudio', 'refVideo', 'targetResolution',
49
+ 'musicLyrics', 'musicBpm', 'musicKeyscale', 'musicTimesig', 'musicComposerMode', 'musicPromptStrength',
50
+ 'musicCreativity', 'musicShift', 'returnLastFrame'];
51
+ if (unsupported.some(key => explicit[key]) || options.contextImages.length || options.loras.length ||
52
+ options.multiAngle || options.photobooth || options.looping || options.personaName || options.referenceAudioIdentity || options.voicePersonaName) {
53
+ fail('This mode does not accept image/video references, sizing, diffusion, or music controls. Use its dedicated input flags.');
54
+ }
55
+ if (options.speech) {
56
+ options.speechMode ||= 'voice';
57
+ const model = SpeechModel[options.speechMode];
58
+ if (!model) fail('Speech mode must be voice, clone, or design.');
59
+ if (explicit.model && options.model !== model) fail('--model conflicts with the selected speech mode.');
60
+ options.model = model;
61
+ options.musicLanguage = (options.musicLanguage || 'auto').toLowerCase();
62
+ const error = validateSpeechRequest({ mode: options.speechMode, script: options.prompt,
63
+ language: options.musicLanguage, voice: options.speechVoice || undefined,
64
+ instruct: options.voiceDescription || undefined, referenceText: options.voiceTranscript || undefined,
65
+ hasReferenceAudio: Boolean(options.voiceReference) });
66
+ if (error) fail(error);
67
+ if (options.speechMode === 'voice') options.speechVoice ||= DEFAULT_SPEECH_VOICE;
68
+ if (options.speechCreativity !== null && (!Number.isFinite(options.speechCreativity) ||
69
+ options.speechCreativity < SPEECH_CREATIVITY.min || options.speechCreativity > SPEECH_CREATIVITY.max)) {
70
+ fail(`--speech-creativity must be between ${SPEECH_CREATIVITY.min} and ${SPEECH_CREATIVITY.max}.`);
71
+ }
72
+ options.outputFormat = (options.outputFormat || 'wav').toLowerCase();
73
+ } else {
74
+ if (options.prompt) fail('Pixal3D and BiRefNet are promptless; supply only the original image.');
75
+ if (options.count !== 1) fail('Image utilities accept one image and produce one result; --count must be 1.');
76
+ if (explicit.musicLanguage || explicit.seed || options.lastSeed) fail('Image utilities do not accept language or seed controls.');
77
+ const model = options.imageTo3d ? PIXAL3D_MODEL_ID : BIREFNET_MODEL_ID;
78
+ if (explicit.model && options.model !== model) fail('--model conflicts with the selected image utility.');
79
+ options.model = model;
80
+ const format = options.imageTo3d ? 'glb' : 'png';
81
+ if (options.outputFormat && options.outputFormat.toLowerCase() !== format) fail(`This mode produces ${format.toUpperCase()} only.`);
82
+ options.outputFormat = format;
83
+ if (options.imageTo3d && options.meshSettings.shapeResolution !== undefined && ![1024, 1536].includes(options.meshSettings.shapeResolution)) {
84
+ fail('--shape-resolution must be 1024 or 1536.');
85
+ }
86
+ }
87
+ if (options.output) {
88
+ const extension = options.output.match(/\.([^./\\]+)$/)?.[1]?.toLowerCase();
89
+ if (extension && extension !== options.outputFormat) fail(`Output filename must use .${options.outputFormat}, matching --output-format.`);
90
+ }
91
+ }
92
+
93
+ export function imageUtilityConfig(options, bytes) {
94
+ return {
95
+ modelId: options.model, positivePrompt: '', startingImage: bytes,
96
+ numberOfMedia: 1, tokenType: options.tokenType || 'spark', waitForCompletion: false,
97
+ ...(options.imageTo3d ? { ...options.meshSettings } : { applyMask: !options.matte, outputFormat: 'png' })
98
+ };
99
+ }
100
+
101
+ export function speechConfig(options, referenceAudio) {
102
+ return {
103
+ modelId: options.model, positivePrompt: options.prompt, numberOfMedia: options.count,
104
+ tokenType: options.tokenType || 'spark', waitForCompletion: false,
105
+ language: options.musicLanguage, outputFormat: options.outputFormat,
106
+ ...(options.speechVoice ? { speaker: options.speechVoice } : {}),
107
+ ...(options.voiceDescription ? { instruct: options.voiceDescription } : {}),
108
+ ...(referenceAudio ? { referenceAudio } : {}),
109
+ ...(options.voiceTranscript ? { referenceText: options.voiceTranscript } : {}),
110
+ ...(options.speechCreativity !== null ? { creativity: options.speechCreativity } : {}),
111
+ ...(options.seed !== null ? { seed: options.seed } : {})
112
+ };
113
+ }
114
+
115
+ export function utilityResultMetadata(options) {
116
+ if (options.speech) return { speechMode: options.speechMode, speaker: options.speechVoice,
117
+ language: options.musicLanguage,
118
+ ...(options.voiceDescription ? { voiceDescription: options.voiceDescription } : {}),
119
+ ...(options.voiceReference ? { voiceReference: options.voiceReference } : {}),
120
+ ...(options.voiceTranscript ? { voiceTranscript: options.voiceTranscript } : {}),
121
+ ...(options.speechCreativity !== null ? { creativity: options.speechCreativity } : {}) };
122
+ if (options.imageTo3d) return { sourceImage: options.imageTo3d, meshSettings: { shapeResolution: 1024, ...options.meshSettings } };
123
+ if (options.removeBackground) return { sourceImage: options.removeBackground, applyMask: !options.matte };
124
+ return {};
125
+ }
126
+
127
+ export function validateGlb(bytes) {
128
+ if (bytes.length < 20 || bytes.toString('ascii', 0, 4) !== 'glTF' || bytes.readUInt32LE(4) !== 2 || bytes.readUInt32LE(8) !== bytes.length) {
129
+ throw new Error('Pixal3D returned an invalid GLB file; the result was not saved.');
130
+ }
131
+ }
@@ -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.46.0",
5
+ "version": "3.49.0",
6
6
  "skills": [
7
7
  "."
8
8
  ],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sogni-ai/sogni-creative-agent-skill",
3
- "version": "3.46.0",
4
- "description": "Sogni Creative Agent Skill: agent skill and CLI for Sogni AI image, video, and music generation.",
3
+ "version": "3.49.0",
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",
7
7
  "bin": {
@@ -96,16 +96,17 @@
96
96
  "node-version-check.mjs",
97
97
  "generated/creative-agent-runtime.mjs",
98
98
  "sogni-agent.mjs",
99
- "sam-segmentation.mjs"
99
+ "sam-segmentation.mjs",
100
+ "media-utilities.mjs"
100
101
  ],
101
102
  "dependencies": {
102
- "@sogni-ai/sogni-intelligence-client": "3.31.1",
103
+ "@sogni-ai/sogni-intelligence-client": "4.0.0",
103
104
  "execa": "^10.0.1",
104
105
  "json5": "^2.2.3",
105
106
  "sharp": "0.35.4"
106
107
  },
107
108
  "overrides": {
108
- "@sogni-ai/sogni-client": "5.44.1"
109
+ "@sogni-ai/sogni-client": "5.48.0"
109
110
  },
110
111
  "openclaw": {
111
112
  "extensions": [
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sogni-creative-agent
3
- description: "Sogni Creative Agent: image, video, and music generation using Sogni AI's decentralized GPU network. Supports personas, persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Invoke when the user asks to \"draw\", \"generate\", \"create an image\", \"make a video\", \"animate\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
3
+ description: "Sogni Creative Agent: image, 3D, speech, video, and music generation using Sogni AI's decentralized GPU network. Supports personas, persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Invoke when the user asks to \"draw\", \"generate\", \"create an image\", \"make a video\", \"animate\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
4
4
  ---
5
5
 
6
6
  # Sogni Creative Agent
@@ -38,6 +38,8 @@ Honor requests to wait for user input; model-specific policies still apply.
38
38
  - Object mask: `sogni-agent --segment <path> --segment-point 0.5,0.5 -o mask.png` (SAM 3; see `../../references/object-selection.md`)
39
39
  - Video (image-to-video): `sogni-agent --video --ref <path> "gentle camera pan"` (defaults to `wan_v2.2-14b-fp8_i2v_lightx2v`)
40
40
  - Animate two images (first frame → last frame): `sogni-agent --video --ref <first> --ref-end <last> "smooth morph into the final frame"` (defaults to `ltx25-22b-int8_i2v_distilled` and the standard FLF template; no transition LoRA is attached)
41
+ - Seedance 2.5 at 1080p: `sogni-agent --video -m seedance2-5 --target-resolution 1080 --duration 8 -o ./seedance-1080p.mp4 "A quiet bookshop, slow camera push-in, soft room ambience"` (4–30s; 480p/720p/1080p, native audio; optional `--output-format mov` and `--return-last-frame`)
42
+ - Upscale a finished video: `sogni-agent --upscale-video ./clip.mp4 --upscale-resolution 1080 -o ./clip-1080p.mp4` (promptless FlashVSR; also supports 1440p)
41
43
  - MiniMax H3 reference-to-video: `sogni-agent --video -m minimax-h3-r2v --ref <identity> -c <wardrobe> --ref-video <motion> --ref-audio <voice> "<Picture 1> controls identity; <Picture 2> controls wardrobe; <Video 1> controls motion; <Audio 1> controls voice."`
42
44
  - Alibaba Wan 3 unified video: `sogni-agent --video -m wan3 --target-resolution 1080 --duration 8 "a presenter says 'Welcome' in a detailed studio"`
43
45
  - Wan 3.0 Enhanced through MuleRouter: `sogni-agent --video -m wan3-enhanced --target-resolution 1080 --smart-duration --wan3-ratio adaptive "a presenter says 'Welcome' in a detailed studio"`
@@ -61,4 +63,20 @@ The user asks to:
61
63
 
62
64
  ## Full skill manifest
63
65
 
66
+ For capability questions and model selection, read `../../references/models.md`.
67
+ It covers Seedance 2.5 1080p (including edit/extend), FastH3 Two-Stage delivered
68
+ 720p/1080p/2K, GPT Image 2.5 Sunburst/Flare edits and masks, and current video
69
+ and image upscale limits. Honor an explicitly selected model and resolution.
70
+ For FastH3, read `../../references/video-prompting.md` before writing its
71
+ ordered-field prompt; select the Two-Stage model for higher delivered sizes.
72
+
73
+ Pixal3D: `--image-to-3d original.png --mesh-faces 30000 -o object.glb`.
74
+ BiRefNet: `--remove-background original.png -o cutout.png`; add `--matte`
75
+ for a soft mask. Both are promptless and preserve the original input bytes.
76
+ Music 3: `--music -m music3`; speech: `--speech --speech-mode voice|clone|design`.
77
+ Read `../../references/models.md` for exact controls, studio voices, clone
78
+ recordings, and Music 3 section tags before generating. Discover 3D with
79
+ `--search-models pixal3d` or `--model-media model`. For explorable worlds,
80
+ read `../../references/interactive-worlds.md`.
81
+
64
82
  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).
@@ -13,10 +13,16 @@ are not obvious and each one cost a day.
13
13
 
14
14
  ## The stack, in the order it runs
15
15
 
16
+ The direct CLI now covers this stack, including `--image-to-3d` for Pixal3D,
17
+ `--remove-background` for BiRefNet, `--music -m music3` for scores, and
18
+ `--speech --speech-mode clone` for character voices. Hosted tools and SDK
19
+ projects remain available. Read [models.md](./models.md) for the required
20
+ inputs and controls before converting a stage into commands.
21
+
16
22
  | Step | Model | What it gives you |
17
23
  |---|---|---|
18
24
  | 1. Places | `krea2_turbo_fp8_scaled` | A scene as one wide still |
19
- | 2. The same character, somewhere new | `krea2_identity_edit_sogni_v0_3_alpha` | A new place with a recognisable character in it, from two context references |
25
+ | 2. The same character, somewhere new | `krea2_identity_edit_v1_2` | A new place with a recognisable character in it, from two context references |
20
26
  | 3. Clickable objects | `sam3_image_segment_bf16` | A pixel mask of a named object, to trace into a hit area |
21
27
  | 4. Clean cut-outs | `birefnet_image_background_removal_fp16` | A soft matte with real edges, for anything going into 3D or a composite |
22
28
  | 5. Travel and dialogue | `minimax-h3-fastvideo-int8_flf2v_turbo`, `minimax-h3-fl2va-fp8_flf2v_turbo` | First/last-frame video with generated audio in one pass |
@@ -81,8 +87,8 @@ loosening the identity to get variety costs the thing the world is built on.
81
87
 
82
88
  ### Keeping a character
83
89
 
84
- A name is not an identity lock. `krea2_identity_edit_sogni_v0_3_alpha` takes
85
- exactly two context images: give it the world in one and the character in the
90
+ A name is not an identity lock. `krea2_identity_edit_v1_2` accepts one or two
91
+ context images; for this workflow give it the world in one and the character in the
86
92
  other, and say in the prompt which reference is for which. Everything a
87
93
  character's identity depends on has to be in a saved reference image you can
88
94
  hand back to the model.