@sogni-ai/sogni-creative-agent-skill 3.62.0 → 3.63.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.
- package/.agents/skills/sogni-creative-agent-skill/SKILL.md +16 -11
- package/.agents/skills/sogni-creative-agent-skill/references/image-prompting.md +44 -5
- package/.agents/skills/sogni-creative-agent-skill/references/loop-maker.md +2 -2
- package/.agents/skills/sogni-creative-agent-skill/references/models.md +44 -24
- package/.agents/skills/sogni-creative-agent-skill/references/private-mature-video.md +21 -16
- package/.agents/skills/sogni-creative-agent-skill/references/video-editing.md +1 -2
- package/.agents/skills/sogni-creative-agent-skill/references/video-prompting.md +804 -64
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +27 -16
- package/SKILL.md +22 -19
- package/desktop-extension/manifest.json +1 -1
- package/desktop-extension/server/index.mjs +2 -1
- package/desktop-extension/server/tools.mjs +49 -5
- package/generated/creative-agent-runtime.mjs +9 -9
- package/llm.txt +7 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +7 -5
- package/plugin-skills/sogni-creative-agent/SKILL.md +16 -10
- package/references/image-prompting.md +44 -5
- package/references/loop-maker.md +2 -2
- package/references/models.md +44 -24
- package/references/private-mature-video.md +21 -16
- package/references/video-editing.md +1 -2
- package/references/video-prompting.md +804 -64
- package/skill-package.json +2 -2
- package/skills/image_generation.md +1 -1
- package/sogni-agent.mjs +330 -9
- package/version.mjs +1 -1
package/skill-package.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@sogni-ai/sogni-intelligence-client": "4.
|
|
6
|
+
"@sogni-ai/sogni-intelligence-client": "4.23.0",
|
|
7
7
|
"execa": "^10.0.1",
|
|
8
8
|
"json5": "^2.2.3",
|
|
9
9
|
"sharp": "0.35.5"
|
|
10
10
|
},
|
|
11
11
|
"overrides": {
|
|
12
|
-
"@sogni-ai/sogni-client": "5.
|
|
12
|
+
"@sogni-ai/sogni-client": "5.74.0"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -21,7 +21,7 @@ Text-to-image synthesis with the current Sogni image stack (Z-Image, Krea 2, Dar
|
|
|
21
21
|
- Use `-m dark_beast_krea2_fp8` when the user explicitly requests Dark Beast Krea 2 or the uncensored community Krea 2 fine-tune, or asks for a horror or sexy still: GPT Image's OpenAI safety system refuses gore on a real person's likeness and sexualized content.
|
|
22
22
|
- FLUX 3 Image Klein (`-m flux3_image_klein_sd_int8_convrot`; hosted selector `flux-3-klein`) works best with a full scene caption. Its guidance is fixed at 1, so a negative prompt has no effect.
|
|
23
23
|
- Seedream 5.0 Pro Uncensored (`-m seedream-5-0-pro-uncensored`, the same hosted selector) is used only when the user asks for it or for uncensored Seedream output. It renders 921,600-4,194,304 pixels up to 16:1 (default 1536x1536) and takes no seed, steps, guidance, LoRAs, or negative prompt. It shares the Seedance 2.5 Uncensored likeness agreement: on error 4103, tell the user to accept it in the Sogni app and do not retry.
|
|
24
|
-
-
|
|
24
|
+
- Hosted chat applies model-specific prompt shaping; the direct CLI applies none, so write the prompt in the model's own form (`references/image-prompting.md`). Either way, pass the user's intent faithfully and avoid empty quality-booster spam.
|
|
25
25
|
|
|
26
26
|
## Constraints
|
|
27
27
|
|
package/sogni-agent.mjs
CHANGED
|
@@ -91,6 +91,11 @@ import {
|
|
|
91
91
|
import {
|
|
92
92
|
extractToolCallProgressUpdate
|
|
93
93
|
} from '@sogni-ai/sogni-intelligence-client/chatRun';
|
|
94
|
+
import {
|
|
95
|
+
MODEL_PROMPT_GUIDES,
|
|
96
|
+
getModelPromptGuide,
|
|
97
|
+
renderModelPromptGuide
|
|
98
|
+
} from '@sogni-ai/sogni-intelligence-client/prompt-guides';
|
|
94
99
|
import {
|
|
95
100
|
buildImageEditExecutionControls,
|
|
96
101
|
normalizeGptImageModelAlias,
|
|
@@ -2042,6 +2047,19 @@ function imageOptionsFromCli() {
|
|
|
2042
2047
|
}
|
|
2043
2048
|
|
|
2044
2049
|
const SEEDANCE_TASK_TYPES = new Set(['reference', 'edit', 'extend']);
|
|
2050
|
+
|
|
2051
|
+
// Seedance 2.5 draft mode: a draft's job id is what --seedance-finalize takes,
|
|
2052
|
+
// and its expiry is the last moment it can be rendered at 1080p. Reported only
|
|
2053
|
+
// for draft-mode requests, from the completed SDK job.
|
|
2054
|
+
function seedanceDraftResultFields(job) {
|
|
2055
|
+
if (!options.seedanceDraft && options.seedanceFinalize === null) return {};
|
|
2056
|
+
return {
|
|
2057
|
+
jobId: job?.id ?? null,
|
|
2058
|
+
...(options.seedanceDraft
|
|
2059
|
+
? { seedanceDraft: job?.seedanceDraft === true, seedanceDraftExpiresAt: job?.seedanceDraftExpiresAt ?? null }
|
|
2060
|
+
: { seedanceDraftJobId: job?.seedanceDraftJobId ?? options.seedanceFinalize })
|
|
2061
|
+
};
|
|
2062
|
+
}
|
|
2045
2063
|
const QWEN_IMAGE_EDIT_2511_MODEL_IDS = new Set([
|
|
2046
2064
|
'qwen_image_edit_2511_fp8',
|
|
2047
2065
|
'qwen_image_edit_2511_fp8_lightning',
|
|
@@ -3539,6 +3557,181 @@ function loadOpenClawPluginConfig() {
|
|
|
3539
3557
|
}
|
|
3540
3558
|
}
|
|
3541
3559
|
|
|
3560
|
+
// ---------------------------------------------------------------------------
|
|
3561
|
+
// Prompt guides: `sogni-agent prompt-guide [model] [--mode <mode>] [--json]`
|
|
3562
|
+
// prints the prompt rules Sogni's own writers use for a model and mode
|
|
3563
|
+
// (@sogni-ai/sogni-intelligence-client/prompt-guides), so an agent can read
|
|
3564
|
+
// them before writing the prompt itself. The model is resolved the way -m is,
|
|
3565
|
+
// by model id only; nothing here reads prompt text. No API call, no credentials.
|
|
3566
|
+
// ---------------------------------------------------------------------------
|
|
3567
|
+
const PROMPT_GUIDE_USAGE = 'sogni-agent prompt-guide <model> [--mode <mode>] [--json]';
|
|
3568
|
+
|
|
3569
|
+
function promptGuideCatalog() {
|
|
3570
|
+
return Object.entries(MODEL_PROMPT_GUIDES).map(([family, modes]) => ({
|
|
3571
|
+
family,
|
|
3572
|
+
modes: Object.keys(modes),
|
|
3573
|
+
models: [...new Set(Object.values(modes).flatMap((guide) => guide.models))],
|
|
3574
|
+
}));
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
function formatPromptGuideCatalog() {
|
|
3578
|
+
const lines = [
|
|
3579
|
+
`Usage: ${PROMPT_GUIDE_USAGE}`,
|
|
3580
|
+
"Prints the prompt rules Sogni's own writers use for a model, to read before you write its prompt. Free and offline.",
|
|
3581
|
+
'',
|
|
3582
|
+
];
|
|
3583
|
+
for (const { family, modes, models } of promptGuideCatalog()) {
|
|
3584
|
+
lines.push(family, ` modes: ${modes.join(', ')}`, ` models: ${models.join(', ')}`);
|
|
3585
|
+
}
|
|
3586
|
+
return lines.join('\n');
|
|
3587
|
+
}
|
|
3588
|
+
|
|
3589
|
+
// The CLI resolves -m against the run's workflow and frames: with a workflow,
|
|
3590
|
+
// `wan22` t2v/i2v renders on LTX 2.5, and bare tier selectors such as
|
|
3591
|
+
// `minimax-h3-balanced` resolve only with one. A guide mode names both. With no
|
|
3592
|
+
// mode, a run with no media attached is t2v.
|
|
3593
|
+
const PROMPT_GUIDE_MODE_WORKFLOWS = Object.freeze({
|
|
3594
|
+
t2v: ['t2v', false, false],
|
|
3595
|
+
extend: ['t2v', false, false],
|
|
3596
|
+
i2v: ['i2v', true, false],
|
|
3597
|
+
'i2v-keyframes': ['i2v', true, false],
|
|
3598
|
+
l2v: ['i2v', false, true],
|
|
3599
|
+
flf: ['i2v', true, true],
|
|
3600
|
+
flf2v: ['i2v', true, true],
|
|
3601
|
+
r2v: ['r2v', false, false],
|
|
3602
|
+
v2v: ['v2v', false, false],
|
|
3603
|
+
a2v: ['a2v', false, false],
|
|
3604
|
+
'a2v-keyframes': ['a2v', false, false],
|
|
3605
|
+
ia2v: ['ia2v', true, false],
|
|
3606
|
+
flfa2v: ['ia2v', true, true],
|
|
3607
|
+
s2v: ['s2v', true, false],
|
|
3608
|
+
'animate-move': ['animate-move', true, false],
|
|
3609
|
+
'animate-replace': ['animate-replace', true, false],
|
|
3610
|
+
});
|
|
3611
|
+
|
|
3612
|
+
// Every guide mode, in registry order, for listing what one -m value supports.
|
|
3613
|
+
const PROMPT_GUIDE_MODES = [...new Set(Object.values(MODEL_PROMPT_GUIDES).flatMap((modes) => Object.keys(modes)))];
|
|
3614
|
+
|
|
3615
|
+
// The guide for a -m value and mode, resolved in the CLI's own order: its video
|
|
3616
|
+
// selectors for that workflow, then its image selector normalization. The model
|
|
3617
|
+
// id decides; nothing reads prompt text.
|
|
3618
|
+
function resolvePromptGuide(model, mode) {
|
|
3619
|
+
const [workflow, hasStartFrame, hasEndFrame] = mode
|
|
3620
|
+
? (PROMPT_GUIDE_MODE_WORKFLOWS[mode] || [])
|
|
3621
|
+
: PROMPT_GUIDE_MODE_WORKFLOWS.t2v;
|
|
3622
|
+
const video = resolveVideoModelAlias(
|
|
3623
|
+
resolveHappyHorseModelId(
|
|
3624
|
+
resolveSkillVideoModelAlias(model, workflow ?? null, Boolean(hasStartFrame), Boolean(hasEndFrame)),
|
|
3625
|
+
workflow ?? null
|
|
3626
|
+
),
|
|
3627
|
+
workflow
|
|
3628
|
+
);
|
|
3629
|
+
const image = normalizeSeedreamModelAlias(normalizeGptImageModelAlias(model));
|
|
3630
|
+
for (const resolvedModel of new Set([video, image])) {
|
|
3631
|
+
const guide = getModelPromptGuide(resolvedModel, mode || undefined);
|
|
3632
|
+
if (guide) return { guide, resolvedModel };
|
|
3633
|
+
}
|
|
3634
|
+
return null;
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
function runPromptGuideAction(argv) {
|
|
3638
|
+
let model = null;
|
|
3639
|
+
let mode = null;
|
|
3640
|
+
let showCatalog = false;
|
|
3641
|
+
for (let i = 0; i < argv.length; i++) {
|
|
3642
|
+
const arg = argv[i];
|
|
3643
|
+
if (arg === '--mode') {
|
|
3644
|
+
mode = requireFlagValue(argv, i, arg).trim().toLowerCase();
|
|
3645
|
+
i++;
|
|
3646
|
+
} else if (arg === '-m' || arg === '--model') {
|
|
3647
|
+
model = requireFlagValue(argv, i, arg).trim();
|
|
3648
|
+
i++;
|
|
3649
|
+
} else if (arg === '--json' || arg === '--no-update-check') {
|
|
3650
|
+
// --json is read from the raw argv (JSON_ERROR_MODE); the update check reads its own flag.
|
|
3651
|
+
} else if (arg === '--help') {
|
|
3652
|
+
showCatalog = true;
|
|
3653
|
+
} else if (arg.startsWith('-')) {
|
|
3654
|
+
fatalCliError(`Unknown prompt-guide option: ${arg}`, {
|
|
3655
|
+
code: 'INVALID_ARGUMENT',
|
|
3656
|
+
hint: `Usage: ${PROMPT_GUIDE_USAGE}`
|
|
3657
|
+
});
|
|
3658
|
+
} else if (model === null) {
|
|
3659
|
+
model = arg.trim();
|
|
3660
|
+
} else {
|
|
3661
|
+
fatalCliError(`prompt-guide takes one model; got "${model}" and "${arg}".`, {
|
|
3662
|
+
code: 'INVALID_ARGUMENT',
|
|
3663
|
+
hint: `Usage: ${PROMPT_GUIDE_USAGE}`
|
|
3664
|
+
});
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
const failWithCatalog = (message, details) => {
|
|
3669
|
+
if (!JSON_ERROR_MODE) console.error(formatPromptGuideCatalog());
|
|
3670
|
+
fatalCliError(message, {
|
|
3671
|
+
code: 'INVALID_ARGUMENT',
|
|
3672
|
+
details: { ...details, families: promptGuideCatalog() },
|
|
3673
|
+
hint: `Usage: ${PROMPT_GUIDE_USAGE}. Run sogni-agent prompt-guide with no model to list every guide.`
|
|
3674
|
+
});
|
|
3675
|
+
};
|
|
3676
|
+
|
|
3677
|
+
if (showCatalog || !model) {
|
|
3678
|
+
if (mode && !showCatalog) {
|
|
3679
|
+
failWithCatalog('prompt-guide --mode needs a model.', { mode });
|
|
3680
|
+
}
|
|
3681
|
+
if (JSON_ERROR_MODE) {
|
|
3682
|
+
console.log(JSON.stringify({ success: true, type: 'prompt-guide-list', usage: PROMPT_GUIDE_USAGE, families: promptGuideCatalog() }));
|
|
3683
|
+
} else {
|
|
3684
|
+
console.log(formatPromptGuideCatalog());
|
|
3685
|
+
}
|
|
3686
|
+
return;
|
|
3687
|
+
}
|
|
3688
|
+
|
|
3689
|
+
// Modes differ per selector (krea2-identity-edit only edits; wan22 s2v stays
|
|
3690
|
+
// on WAN 2.2 while its t2v renders on LTX 2.5), so list this -m value's own.
|
|
3691
|
+
const modes = PROMPT_GUIDE_MODES.filter((entry) => resolvePromptGuide(model, entry));
|
|
3692
|
+
const resolved = resolvePromptGuide(model, mode);
|
|
3693
|
+
if (!resolved) {
|
|
3694
|
+
if (mode && modes.length > 0) {
|
|
3695
|
+
fatalCliError(`No "${mode}" prompt guide for ${model}. Its modes: ${modes.join(', ')}.`, {
|
|
3696
|
+
code: 'INVALID_ARGUMENT',
|
|
3697
|
+
details: { model, mode, modes },
|
|
3698
|
+
hint: `Run sogni-agent prompt-guide ${model} --mode <${modes.join('|')}>.`
|
|
3699
|
+
});
|
|
3700
|
+
}
|
|
3701
|
+
failWithCatalog(`No prompt guide for model "${model}".`, { model, mode });
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
const { guide, resolvedModel } = resolved;
|
|
3705
|
+
if (JSON_ERROR_MODE) {
|
|
3706
|
+
console.log(JSON.stringify({
|
|
3707
|
+
success: true,
|
|
3708
|
+
type: 'prompt-guide',
|
|
3709
|
+
model,
|
|
3710
|
+
resolvedModel,
|
|
3711
|
+
family: guide.family,
|
|
3712
|
+
mode: guide.mode,
|
|
3713
|
+
modes,
|
|
3714
|
+
guide,
|
|
3715
|
+
}));
|
|
3716
|
+
return;
|
|
3717
|
+
}
|
|
3718
|
+
const otherModes = modes.filter((entry) => entry !== guide.mode);
|
|
3719
|
+
const footer = [
|
|
3720
|
+
`-m ${model} resolves to ${resolvedModel} in this mode.`,
|
|
3721
|
+
...(otherModes.length > 0
|
|
3722
|
+
? [`Other modes: ${otherModes.join(', ')}. Print one with: sogni-agent prompt-guide ${model} --mode <mode>`]
|
|
3723
|
+
: []),
|
|
3724
|
+
];
|
|
3725
|
+
console.log(`${renderModelPromptGuide(guide, { audience: 'agent' })}\n\n${footer.join('\n')}`);
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3728
|
+
// prompt-guide runs here: after the model alias tables it resolves with, and
|
|
3729
|
+
// before any config, credential or network work.
|
|
3730
|
+
if (RAW_ARGS[0] === 'prompt-guide') {
|
|
3731
|
+
runPromptGuideAction(RAW_ARGS.slice(1));
|
|
3732
|
+
process.exit(0);
|
|
3733
|
+
}
|
|
3734
|
+
|
|
3542
3735
|
const openclawConfig = loadOpenClawPluginConfig();
|
|
3543
3736
|
const CREDENTIALS_PATH = resolveConfiguredPath(
|
|
3544
3737
|
getEnv('SOGNI_CREDENTIALS_PATH') || openclawConfig?.credentialsPath,
|
|
@@ -3634,6 +3827,8 @@ const options = {
|
|
|
3634
3827
|
video: false,
|
|
3635
3828
|
videoWorkflow: null,
|
|
3636
3829
|
seedanceTaskType: null,
|
|
3830
|
+
seedanceDraft: false,
|
|
3831
|
+
seedanceFinalize: null,
|
|
3637
3832
|
legacyWan3TaskType: null,
|
|
3638
3833
|
wan3Ratio: 'adaptive',
|
|
3639
3834
|
wan3SmartDuration: false,
|
|
@@ -3837,6 +4032,8 @@ const cliSet = {
|
|
|
3837
4032
|
video: false,
|
|
3838
4033
|
workflow: false,
|
|
3839
4034
|
seedanceTaskType: false,
|
|
4035
|
+
seedanceDraft: false,
|
|
4036
|
+
seedanceFinalize: false,
|
|
3840
4037
|
wan3Ratio: false,
|
|
3841
4038
|
wan3SmartDuration: false,
|
|
3842
4039
|
wan3ReferenceFileUrl: false,
|
|
@@ -4150,6 +4347,14 @@ for (let i = 0; i < args.length; i++) {
|
|
|
4150
4347
|
i++;
|
|
4151
4348
|
options.seedanceTaskType = raw.trim().toLowerCase();
|
|
4152
4349
|
cliSet.seedanceTaskType = true;
|
|
4350
|
+
} else if (arg === '--seedance-draft') {
|
|
4351
|
+
options.seedanceDraft = true;
|
|
4352
|
+
cliSet.seedanceDraft = true;
|
|
4353
|
+
} else if (arg === '--seedance-finalize') {
|
|
4354
|
+
const raw = requireFlagValue(args, i, arg);
|
|
4355
|
+
i++;
|
|
4356
|
+
options.seedanceFinalize = raw.trim();
|
|
4357
|
+
cliSet.seedanceFinalize = true;
|
|
4153
4358
|
} else if (arg === '--wan3-task-type') {
|
|
4154
4359
|
const raw = requireFlagValue(args, i, arg);
|
|
4155
4360
|
i++;
|
|
@@ -5084,6 +5289,9 @@ Video Options:
|
|
|
5084
5289
|
--video, -v Generate video instead of image
|
|
5085
5290
|
--workflow <type> Video workflow: t2v|i2v|r2v|s2v|ia2v|a2v|v2v|animate-move|animate-replace
|
|
5086
5291
|
--seedance-task-type <type> Seedance 2.5 loose-reference operation: reference|edit|extend
|
|
5292
|
+
--seedance-draft Seedance 2.5: render a 480p draft that --seedance-finalize can render at 1080p
|
|
5293
|
+
--seedance-finalize <draft-job-id> Seedance 2.5: render that draft at 1080p with its own prompt, media,
|
|
5294
|
+
length, ratio, seed and audio (send none of them; the final is billed at 1080p)
|
|
5087
5295
|
--wan3-ratio <ratio> Wan 3 ratio: adaptive|16:9|4:3|1:1|3:4|9:16
|
|
5088
5296
|
--smart-duration, --no-smart-duration Let Wan 3 choose 2-30s, or use --duration
|
|
5089
5297
|
--reference-file-url <url> Wan 3 public HTTPS document context (one, up to 100 MB; supported paged formats up to 50 pages)
|
|
@@ -5250,6 +5458,11 @@ General:
|
|
|
5250
5458
|
--version, -V Show sogni-agent version and exit
|
|
5251
5459
|
--no-update-check Skip the once-daily npm update check for this run
|
|
5252
5460
|
self-update Upgrade sogni-agent in place (npm/pnpm/yarn/bun auto-detected)
|
|
5461
|
+
prompt-guide <model> [--mode <mode>] [--json]
|
|
5462
|
+
Print the prompt rules Sogni's own writers use for a model and mode
|
|
5463
|
+
(t2v|i2v|l2v|flf|r2v|v2v|a2v|ia2v|extend|generate|edit|...); read them
|
|
5464
|
+
before writing that model's prompt. Free and offline. With no model it
|
|
5465
|
+
lists every guide
|
|
5253
5466
|
--extract-last-frame <video> <image> Extract last frame from a video (safe ffmpeg wrapper)
|
|
5254
5467
|
--extract-first-frame <video> <image> Extract first frame from a video (safe ffmpeg wrapper)
|
|
5255
5468
|
--extract-frame-at <video> <sec> <image> Extract a timestamped frame (safe ffmpeg wrapper)
|
|
@@ -5461,7 +5674,8 @@ LTX-2 / LTX-2.3 rollback models:
|
|
|
5461
5674
|
|
|
5462
5675
|
Examples:
|
|
5463
5676
|
sogni-agent "a cat wearing a hat"
|
|
5464
|
-
sogni-agent -
|
|
5677
|
+
sogni-agent prompt-guide seedance2-5 --mode i2v
|
|
5678
|
+
sogni-agent -o cat.jpg "a cat"
|
|
5465
5679
|
sogni-agent --multi-angle -c subject.jpg --azimuth front-right --elevation eye-level --distance medium "studio portrait"
|
|
5466
5680
|
sogni-agent --angles-360 -c subject.jpg "studio portrait"
|
|
5467
5681
|
sogni-agent --video --ref cat.jpg -o cat.mp4 "cat walks around"
|
|
@@ -6451,6 +6665,13 @@ if (options.music) {
|
|
|
6451
6665
|
: 'Use -m minimax-h3-fasth3-turbo-2stage for 2K MiniMax H3 video, or pass the short side in pixels.'
|
|
6452
6666
|
});
|
|
6453
6667
|
}
|
|
6668
|
+
// Seedance 2.5 drafts render at 480p only, so a draft with no size asked for
|
|
6669
|
+
// gets the 480p canvas. A finalize sends no size: its final is the 1080p size
|
|
6670
|
+
// for the draft's ratio.
|
|
6671
|
+
if (options.seedanceDraft && !cliSet.targetResolution && !targetResolutionFromPrompt && !cliSet.width && !cliSet.height) {
|
|
6672
|
+
options.targetResolution = 480;
|
|
6673
|
+
cliSet.targetResolution = true;
|
|
6674
|
+
}
|
|
6454
6675
|
const hasExplicitVideoCanvas = cliSet.width || cliSet.height || widthFromConfig || heightFromConfig || widthFromPrompt || heightFromPrompt;
|
|
6455
6676
|
if (isTwoStageVideo) {
|
|
6456
6677
|
const requestedClass = (cliSet.targetResolution || targetResolutionFromPrompt) ? options.targetResolution : undefined;
|
|
@@ -6649,6 +6870,8 @@ const personaUtilityAction = Boolean(options.personaAction && options.personaAct
|
|
|
6649
6870
|
const contractUtilityAction = Boolean(options.contractAction);
|
|
6650
6871
|
const storyboardPlanUtilityAction = Boolean(options.storyboardPlanAction);
|
|
6651
6872
|
const commandUsesGenerationSeed = !options.apiChat &&
|
|
6873
|
+
// A Seedance 2.5 finalize renders its draft with the draft's own seed.
|
|
6874
|
+
!options.seedanceFinalize &&
|
|
6652
6875
|
!apiWorkflowUtilityAction &&
|
|
6653
6876
|
!apiModelUtilityAction &&
|
|
6654
6877
|
!liveModelUtilityAction &&
|
|
@@ -6719,7 +6942,7 @@ const wan3HasMediaInput = isWan3ModelLocal(options.model) && Boolean(
|
|
|
6719
6942
|
|| options.wan3ReferenceFileUrl
|
|
6720
6943
|
|| options.wan3ReferenceLinkUrl
|
|
6721
6944
|
);
|
|
6722
|
-
if (!options.prompt && !options.projectLookup && !wan3HasMediaInput && !options.segmentImage && !options.imageTo3d && !options.removeBackground && !options.upscaleImage && !options.upscaleVideo && !options.apiChat && !apiWorkflowUtilityAction && !apiWorkflowStartAction && !apiModelUtilityAction && !liveModelUtilityAction && !loraCatalogUtilityAction && !apiReplayUtilityAction && !contractUtilityAction && !storyboardPlanUtilityAction && !options.estimateVideoCost && !options.multiAngle && !options.showBalance && !options.showVersion && !options.doctor && !options.extractLastFrame && !options.extractFirstFrame && !options.extractFrameAt && !options.trimVideo && !options.verifyVideo && !options.concatVideos && !options.sourceReelDir && !options.remixAudio && !options.listMedia && !options.memoryAction && !options.personalityAction && !personaUtilityAction) {
|
|
6945
|
+
if (!options.prompt && !options.projectLookup && !options.seedanceFinalize && !wan3HasMediaInput && !options.segmentImage && !options.imageTo3d && !options.removeBackground && !options.upscaleImage && !options.upscaleVideo && !options.apiChat && !apiWorkflowUtilityAction && !apiWorkflowStartAction && !apiModelUtilityAction && !liveModelUtilityAction && !loraCatalogUtilityAction && !apiReplayUtilityAction && !contractUtilityAction && !storyboardPlanUtilityAction && !options.estimateVideoCost && !options.multiAngle && !options.showBalance && !options.showVersion && !options.doctor && !options.extractLastFrame && !options.extractFirstFrame && !options.extractFrameAt && !options.trimVideo && !options.verifyVideo && !options.concatVideos && !options.sourceReelDir && !options.remixAudio && !options.listMedia && !options.memoryAction && !options.personalityAction && !personaUtilityAction) {
|
|
6723
6946
|
fatalCliError('No prompt provided. Use --help for usage.', { code: 'INVALID_ARGUMENT' });
|
|
6724
6947
|
}
|
|
6725
6948
|
|
|
@@ -6841,8 +7064,8 @@ if (options.legacyWan3TaskType !== null) {
|
|
|
6841
7064
|
);
|
|
6842
7065
|
}
|
|
6843
7066
|
|
|
6844
|
-
if (!options.video && !options.apiChat && !options.apiWorkflowAction && (options.refAudio || options.refVideo || options.refMask || options.referenceAudioIdentity || options.voicePersonaName || options.videoWorkflow || options.seedanceTaskType || options.wan3SmartDuration || options.wan3ReferenceFileUrl || options.wan3ReferenceLinkUrl || options.wan3Watermark || cliSet.wan3Ratio || options.frames || options.targetResolution || options.audioStart !== null || options.audioDuration !== null || options.videoStart !== null || options.outpaintPosition || options.outpaintAspectRatio)) {
|
|
6845
|
-
fatalCliError('Video-only options (--workflow/--seedance-task-type/--wan3-ratio/--smart-duration/--reference-file-url/--reference-link-url/--watermark/--frames/--target-resolution/--ref-audio/--ref-video/--mask/--outpaint-position/--reference-audio-identity/--voice-persona) require --video.', {
|
|
7067
|
+
if (!options.video && !options.apiChat && !options.apiWorkflowAction && (options.refAudio || options.refVideo || options.refMask || options.referenceAudioIdentity || options.voicePersonaName || options.videoWorkflow || options.seedanceTaskType || options.seedanceDraft || options.seedanceFinalize || options.wan3SmartDuration || options.wan3ReferenceFileUrl || options.wan3ReferenceLinkUrl || options.wan3Watermark || cliSet.wan3Ratio || options.frames || options.targetResolution || options.audioStart !== null || options.audioDuration !== null || options.videoStart !== null || options.outpaintPosition || options.outpaintAspectRatio)) {
|
|
7068
|
+
fatalCliError('Video-only options (--workflow/--seedance-task-type/--seedance-draft/--seedance-finalize/--wan3-ratio/--smart-duration/--reference-file-url/--reference-link-url/--watermark/--frames/--target-resolution/--ref-audio/--ref-video/--mask/--outpaint-position/--reference-audio-identity/--voice-persona) require --video.', {
|
|
6846
7069
|
code: 'INVALID_ARGUMENT'
|
|
6847
7070
|
});
|
|
6848
7071
|
}
|
|
@@ -6879,6 +7102,61 @@ if (options.video) {
|
|
|
6879
7102
|
details: { model: options.model, seedanceTaskType: options.seedanceTaskType }
|
|
6880
7103
|
});
|
|
6881
7104
|
}
|
|
7105
|
+
// Seedance 2.5 draft mode: --seedance-draft renders a 480p draft, and
|
|
7106
|
+
// --seedance-finalize renders that draft at 1080p. The final reuses every
|
|
7107
|
+
// generation-defining input of its draft, and Sogni refuses any of them sent
|
|
7108
|
+
// again, so they are refused here in the CLI's own flag names.
|
|
7109
|
+
if ((options.seedanceDraft || options.seedanceFinalize !== null) && !isSeedance25Video) {
|
|
7110
|
+
fatalCliError('Seedance draft mode (--seedance-draft, --seedance-finalize) is supported only by Seedance 2.5.', {
|
|
7111
|
+
code: 'INVALID_ARGUMENT',
|
|
7112
|
+
details: { model: options.model },
|
|
7113
|
+
hint: 'Pass -m with the Seedance 2.5 model that made (or will make) the draft, such as -m seedance2-5.'
|
|
7114
|
+
});
|
|
7115
|
+
}
|
|
7116
|
+
if (options.seedanceDraft && options.seedanceFinalize !== null) {
|
|
7117
|
+
fatalCliError('--seedance-draft and --seedance-finalize cannot be combined: render a draft, or finalize one.', {
|
|
7118
|
+
code: 'INVALID_ARGUMENT'
|
|
7119
|
+
});
|
|
7120
|
+
}
|
|
7121
|
+
if (options.seedanceDraft && (cliSet.targetResolution || targetResolutionFromPrompt) && Number(options.targetResolution) !== 480) {
|
|
7122
|
+
fatalCliError(`Seedance 2.5 drafts render at 480p only, not ${options.targetResolution}p. Use --target-resolution 480 or leave it out.`, {
|
|
7123
|
+
code: 'INVALID_ARGUMENT',
|
|
7124
|
+
details: { targetResolution: options.targetResolution }
|
|
7125
|
+
});
|
|
7126
|
+
}
|
|
7127
|
+
if (options.seedanceFinalize !== null) {
|
|
7128
|
+
if (!options.seedanceFinalize) {
|
|
7129
|
+
fatalCliError('--seedance-finalize needs the job id of a Seedance 2.5 draft.', { code: 'INVALID_ARGUMENT' });
|
|
7130
|
+
}
|
|
7131
|
+
const inherited = [
|
|
7132
|
+
[options.prompt, 'a prompt'],
|
|
7133
|
+
[options.refImage, '--ref'],
|
|
7134
|
+
[options.refImageEnd, '--ref-end'],
|
|
7135
|
+
[options.contextImages.length > 0, '-c/--context'],
|
|
7136
|
+
[options.refAudio || options.refAudios.length > 0, '--ref-audio'],
|
|
7137
|
+
[options.refVideo || options.refVideos.length > 0, '--ref-video'],
|
|
7138
|
+
[options.referenceAudioIdentity || options.voicePersonaName, '--reference-audio-identity/--voice-persona'],
|
|
7139
|
+
[options.keyframes.length > 0, '--keyframe'],
|
|
7140
|
+
[cliSet.duration, '--duration'],
|
|
7141
|
+
[cliSet.frames, '--frames'],
|
|
7142
|
+
[cliSet.seed || options.lastSeed, '--seed/--last-seed'],
|
|
7143
|
+
[options.apiGenerateAudio !== null, '--generate-audio/--no-generate-audio'],
|
|
7144
|
+
[cliSet.seedanceTaskType || cliSet.workflow, '--seedance-task-type/--workflow'],
|
|
7145
|
+
[cliSet.width || cliSet.height || cliSet.targetResolution, '-w/-h/--target-resolution'],
|
|
7146
|
+
[cliSet.count && options.count !== 1, '-n']
|
|
7147
|
+
].filter(([present]) => present).map(([, flag]) => flag);
|
|
7148
|
+
if (inherited.length > 0) {
|
|
7149
|
+
fatalCliError(
|
|
7150
|
+
`A Seedance 2.5 finalize renders its draft at 1080p with the draft's own prompt, media, length, ratio, seed and audio; remove ${inherited.join(', ')}.`,
|
|
7151
|
+
{
|
|
7152
|
+
code: 'INVALID_ARGUMENT',
|
|
7153
|
+
details: { seedanceFinalize: options.seedanceFinalize, inherited },
|
|
7154
|
+
hint: `sogni-agent --video -m ${options.model} --seedance-finalize ${options.seedanceFinalize} -o final.mp4`
|
|
7155
|
+
}
|
|
7156
|
+
);
|
|
7157
|
+
}
|
|
7158
|
+
options.count = 1;
|
|
7159
|
+
}
|
|
6882
7160
|
if ((cliSet.wan3Ratio || options.wan3SmartDuration || options.wan3ReferenceFileUrl || options.wan3ReferenceLinkUrl || options.wan3Watermark) && !isWan3Video) {
|
|
6883
7161
|
fatalCliError('Wan 3 controls are supported only by Wan 3 or Wan 3.0 Enhanced.', {
|
|
6884
7162
|
code: 'INVALID_ARGUMENT',
|
|
@@ -7394,7 +7672,8 @@ if (options.video) {
|
|
|
7394
7672
|
fatalCliError(
|
|
7395
7673
|
'Seedance reference modes are mutually exclusive: native --ref/--ref-end frame anchors cannot be combined with loose image, video, or audio references. '
|
|
7396
7674
|
+ 'Pick one: use --ref/--ref-end alone for first-class frame anchoring, or use -c/--context with optional --ref-video/--ref-audio and @ImageN/@VideoN/@AudioN prompt language. '
|
|
7397
|
-
+ 'For image-plus-audio generation, select --workflow ia2v; there --ref is mapped to a loose @Image reference instead of first_frame.'
|
|
7675
|
+
+ 'For image-plus-audio generation, select --workflow ia2v; there --ref is mapped to a loose @Image reference instead of first_frame. '
|
|
7676
|
+
+ 'To open on a picture while using references, pass it with -c and state it in the prompt as the first frame ("@ImageN is the first frame of this video").',
|
|
7398
7677
|
{ code: 'INVALID_ARGUMENT', details: {
|
|
7399
7678
|
dedicatedFrames: seedanceFrameInputs,
|
|
7400
7679
|
looseReferences: seedanceLooseInputs,
|
|
@@ -13064,7 +13343,10 @@ function projectLookupSummary(result) {
|
|
|
13064
13343
|
...(job.reason ? { reason: job.reason } : {}),
|
|
13065
13344
|
...(job.kind ? { kind: job.kind } : {}),
|
|
13066
13345
|
...(job.url ? { url: job.url } : {}),
|
|
13067
|
-
...(job.urlUnavailable ? { urlUnavailable: job.urlUnavailable } : {})
|
|
13346
|
+
...(job.urlUnavailable ? { urlUnavailable: job.urlUnavailable } : {}),
|
|
13347
|
+
// Seedance 2.5 draft mode: render a draft at 1080p with --seedance-finalize <id> before it expires.
|
|
13348
|
+
...(job.seedanceDraft === true ? { seedanceDraft: true, seedanceDraftExpiresAt: job.seedanceDraftExpiresAt ?? null } : {}),
|
|
13349
|
+
...(job.seedanceDraftJobId ? { seedanceDraftJobId: job.seedanceDraftJobId } : {})
|
|
13068
13350
|
}))
|
|
13069
13351
|
};
|
|
13070
13352
|
}
|
|
@@ -13924,7 +14206,11 @@ async function buildVideoEstimateParams({ tokenType, steps }) {
|
|
|
13924
14206
|
...(options.frames ? { frames: options.frames } : { duration: options.duration }),
|
|
13925
14207
|
...(referenceImageCount !== undefined ? { referenceImageCount } : {}),
|
|
13926
14208
|
// MiniMax H3 keyframes: two are included, each extra one adds output time.
|
|
13927
|
-
...(options.keyframes.length > 0 ? { keyframeCount: options.keyframes.length } : {})
|
|
14209
|
+
...(options.keyframes.length > 0 ? { keyframeCount: options.keyframes.length } : {}),
|
|
14210
|
+
// Seedance 2.5 draft mode: a draft is quoted as its 480p job, a finalize
|
|
14211
|
+
// from its draft (the server ignores this request's size and length).
|
|
14212
|
+
...(options.seedanceDraft ? { seedanceDraft: true } : {}),
|
|
14213
|
+
...(options.seedanceFinalize !== null ? { seedanceDraftJobId: options.seedanceFinalize } : {})
|
|
13928
14214
|
};
|
|
13929
14215
|
|
|
13930
14216
|
if ((isSeedanceVideo || isWan3Video || isMiniMaxH3R2v) && videoSources.length > 0) {
|
|
@@ -14821,6 +15107,12 @@ async function main() {
|
|
|
14821
15107
|
count: options.count,
|
|
14822
15108
|
...(delivered ? { deliveredWidth: delivered.width, deliveredHeight: delivered.height } : {}),
|
|
14823
15109
|
...(options.keyframes.length > 0 ? { keyframeCount: options.keyframes.length } : {}),
|
|
15110
|
+
// A finalize is quoted from its draft: 1080p in the draft's ratio, for
|
|
15111
|
+
// the draft's length, not this request's defaults.
|
|
15112
|
+
...(options.seedanceFinalize !== null
|
|
15113
|
+
? { width: null, height: null, frames: null, duration: null, seedanceDraftJobId: options.seedanceFinalize }
|
|
15114
|
+
: {}),
|
|
15115
|
+
...(options.seedanceDraft ? { seedanceDraft: true } : {}),
|
|
14824
15116
|
estimate
|
|
14825
15117
|
}));
|
|
14826
15118
|
} else {
|
|
@@ -14865,6 +15157,7 @@ async function main() {
|
|
|
14865
15157
|
seed: jobData.seed,
|
|
14866
15158
|
jobIndex: data.jobIndex,
|
|
14867
15159
|
projectId: data.projectId,
|
|
15160
|
+
...seedanceDraftResultFields(data.job),
|
|
14868
15161
|
nsfwDetected: data.job?.nsfwDetected ?? jobData.nsfwDetected ?? false,
|
|
14869
15162
|
nsfwSources: data.job?.nsfwSources ?? jobData.nsfwSources ?? [],
|
|
14870
15163
|
...(withheld ? { urlUnavailable: 'sensitiveContent' } : {})
|
|
@@ -15398,6 +15691,7 @@ async function main() {
|
|
|
15398
15691
|
if (options.seedanceTaskType) {
|
|
15399
15692
|
projectConfig.seedanceTaskType = options.seedanceTaskType;
|
|
15400
15693
|
}
|
|
15694
|
+
if (options.seedanceDraft) projectConfig.seedanceDraft = true;
|
|
15401
15695
|
if (options.returnLastFrame) projectConfig.returnLastFrame = true;
|
|
15402
15696
|
if (isWan3Video) {
|
|
15403
15697
|
projectConfig.ratio = options.wan3Ratio;
|
|
@@ -15560,6 +15854,16 @@ async function main() {
|
|
|
15560
15854
|
projectConfig.loraStrengths = options.loraStrengths;
|
|
15561
15855
|
}
|
|
15562
15856
|
|
|
15857
|
+
if (options.seedanceFinalize !== null) {
|
|
15858
|
+
// The final is its draft at 1080p: Sogni takes the prompt, media, length,
|
|
15859
|
+
// ratio, seed and audio from the draft and refuses them sent again. The
|
|
15860
|
+
// flags that set them are refused up front; the default length is not.
|
|
15861
|
+
delete projectConfig.duration;
|
|
15862
|
+
projectConfig.positivePrompt = '';
|
|
15863
|
+
projectConfig.seedanceDraftJobId = options.seedanceFinalize;
|
|
15864
|
+
log(`Rendering Seedance draft ${options.seedanceFinalize} at 1080p...`);
|
|
15865
|
+
}
|
|
15866
|
+
|
|
15563
15867
|
await warnAboutInFlightProjects(client, log);
|
|
15564
15868
|
const videoResult = trackProjectResult(
|
|
15565
15869
|
await client.createVideoProject(withBillingMode(projectConfig))
|
|
@@ -16031,8 +16335,11 @@ async function main() {
|
|
|
16031
16335
|
seeds,
|
|
16032
16336
|
projectId: firstResult.projectId,
|
|
16033
16337
|
urls: urls,
|
|
16034
|
-
results: results.map(({ resultUrl, seed, jobIndex, nsfwDetected, nsfwSources, urlUnavailable }) => ({
|
|
16035
|
-
url: resultUrl, seed, jobIndex, nsfwDetected, nsfwSources, ...(urlUnavailable ? { urlUnavailable } : {})
|
|
16338
|
+
results: results.map(({ resultUrl, seed, jobIndex, nsfwDetected, nsfwSources, urlUnavailable, jobId, seedanceDraft, seedanceDraftExpiresAt, seedanceDraftJobId }) => ({
|
|
16339
|
+
url: resultUrl, seed, jobIndex, nsfwDetected, nsfwSources, ...(urlUnavailable ? { urlUnavailable } : {}),
|
|
16340
|
+
...(jobId ? { jobId } : {}),
|
|
16341
|
+
...(seedanceDraft !== undefined ? { seedanceDraft, seedanceDraftExpiresAt } : {}),
|
|
16342
|
+
...(seedanceDraftJobId ? { seedanceDraftJobId } : {})
|
|
16036
16343
|
})),
|
|
16037
16344
|
localPath: options.output || null,
|
|
16038
16345
|
tokenType: options.tokenType || 'spark',
|
|
@@ -16431,6 +16738,13 @@ async function main() {
|
|
|
16431
16738
|
guidanceEnd: options.cnGuidanceEnd ?? 0.6,
|
|
16432
16739
|
};
|
|
16433
16740
|
}
|
|
16741
|
+
if (options.seedanceFinalize !== null) {
|
|
16742
|
+
// The final's size and length are its draft's, at 1080p, not this
|
|
16743
|
+
// request's defaults.
|
|
16744
|
+
output.width = null;
|
|
16745
|
+
output.height = null;
|
|
16746
|
+
output.duration = null;
|
|
16747
|
+
}
|
|
16434
16748
|
console.log(JSON.stringify(output));
|
|
16435
16749
|
} else {
|
|
16436
16750
|
urls.forEach(url => console.log(url));
|
|
@@ -16438,6 +16752,13 @@ async function main() {
|
|
|
16438
16752
|
if (options.returnLastFrame) {
|
|
16439
16753
|
results.forEach(result => { if (result.lastFrameUrl) console.log(`Last frame: ${result.lastFrameUrl}`); });
|
|
16440
16754
|
}
|
|
16755
|
+
if (options.seedanceDraft) {
|
|
16756
|
+
results.forEach(result => {
|
|
16757
|
+
if (!result.jobId) return;
|
|
16758
|
+
const until = result.seedanceDraftExpiresAt ? ` until ${result.seedanceDraftExpiresAt}` : '';
|
|
16759
|
+
console.log(`Seedance draft ${result.jobId}. Render it at 1080p${until} with: sogni-agent --video -m ${options.model} --seedance-finalize ${result.jobId} -o final.mp4`);
|
|
16760
|
+
});
|
|
16761
|
+
}
|
|
16441
16762
|
}
|
|
16442
16763
|
} else {
|
|
16443
16764
|
throw new Error('No output generated - may have been filtered');
|
package/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '3.
|
|
1
|
+
export const PACKAGE_VERSION = '3.63.0';
|