@sogni-ai/sogni-creative-agent-skill 3.35.3 → 3.36.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 +1 -1
- package/.agents/skills/sogni-creative-agent-skill/references/h3-video-loras.md +82 -0
- package/.agents/skills/sogni-creative-agent-skill/references/hosted-api.md +12 -0
- package/.agents/skills/sogni-creative-agent-skill/references/video-editing.md +11 -0
- package/.agents/skills/sogni-creative-agent-skill/references/video-prompting.md +22 -3
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +26 -0
- package/SKILL.md +7 -2
- package/desktop-extension/manifest.json +1 -1
- package/generated/creative-agent-runtime.mjs +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -3
- package/references/h3-video-loras.md +82 -0
- package/references/hosted-api.md +12 -0
- package/references/video-editing.md +11 -0
- package/references/video-prompting.md +22 -3
- package/scripts/sync-hermes-skill.mjs +1 -0
- package/skill-package.json +1 -1
- package/sogni-agent.mjs +280 -30
- package/version.mjs +1 -1
|
@@ -3,7 +3,7 @@ name: sogni-creative-agent-skill
|
|
|
3
3
|
description: "Generate and edit images, upscale images, create video and music, animate image folders into seamless reels, and manage reusable personas with Sogni AI. Use when a Hermes user asks to draw, render, upscale, edit or restyle an image, animate an image, make a video, create music or lyrics, build a media workflow, apply a saved identity, or refine an earlier Sogni result."
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "3.
|
|
6
|
+
version: "3.36.0"
|
|
7
7
|
author: Sogni AI
|
|
8
8
|
hermes:
|
|
9
9
|
category: creative
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# MiniMax H3 video LoRA catalog
|
|
2
|
+
|
|
3
|
+
The adapters Sogni publishes for MiniMax H3 — the only video family that loads
|
|
4
|
+
LoRAs. Everything else (LTX, WAN, Seedance, HappyHorse) ignores `--lora`, and
|
|
5
|
+
the CLI refuses the combination rather than rendering as if you had not asked.
|
|
6
|
+
|
|
7
|
+
Video LoRAs are a different shape from the Krea 2 image sliders:
|
|
8
|
+
|
|
9
|
+
- **Positive-only.** A negative strength is not an inverse effect, and `0` is
|
|
10
|
+
off. The bipolar convention belongs to the Krea 2 image sliders alone.
|
|
11
|
+
- **One file per family**, not one per effect.
|
|
12
|
+
- **Availability differs by H3 mode.** Read the live catalog for the exact mode
|
|
13
|
+
you are rendering; the mode's canonical model id is the filter.
|
|
14
|
+
|
|
15
|
+
## Selecting a compatible model
|
|
16
|
+
|
|
17
|
+
LoRAs attach to the resolved H3 model, so name the mode in the same command:
|
|
18
|
+
|
|
19
|
+
| Mode | Selector | Canonical model id |
|
|
20
|
+
|------|----------|--------------------|
|
|
21
|
+
| Text-to-video | `-m minimax-h3-t2v` (`-turbo`) | `minimax-h3-fl2va-fp8_t2v` |
|
|
22
|
+
| Image-to-video | `-m minimax-h3-i2v` (`-turbo`) | `minimax-h3-fl2va-fp8_i2v` |
|
|
23
|
+
| First+last frame | `-m minimax-h3-flf2v` (`-turbo`) | `minimax-h3-fl2va-fp8_flf2v` |
|
|
24
|
+
| Reference-to-video | `-m minimax-h3-r2v` (`-turbo`) | `minimax-h3-ref2va-fp8_r2v` |
|
|
25
|
+
|
|
26
|
+
Bare `-m minimax-h3` is not enough to validate a LoRA request: it resolves by
|
|
27
|
+
frame arguments, and availability differs per mode. Name the explicit mode.
|
|
28
|
+
|
|
29
|
+
## Published adapters
|
|
30
|
+
|
|
31
|
+
`h3-realism-people` (fal) — a realism pass trained on live-action footage of
|
|
32
|
+
people. Restores skin texture and pores, stray hairs, fabric weave, and a fine
|
|
33
|
+
sensor grain the base model smooths away; holds up in close-up. Range `0-2`,
|
|
34
|
+
catalog default `0.8`, usable band `0.6-1`. **It needs its trigger word**: put
|
|
35
|
+
`r34l1sm` near the FRONT of the prompt, or the render comes back as ordinary H3
|
|
36
|
+
with no error. It also pulls the camera in as it climbs — at `1.5` and above the
|
|
37
|
+
shot reliably recomposes and the grade darkens, which on an image-conditioned
|
|
38
|
+
mode can crop the subject out of the frame you supplied. Prefer the default when
|
|
39
|
+
you supplied a first or last frame.
|
|
40
|
+
|
|
41
|
+
`h3-vbvr-video-reasoning` — a prompt-adherence pass that holds the model to what
|
|
42
|
+
was asked instead of improvising. Range `0-1`, default `1`, usable band
|
|
43
|
+
`0.7-1`. No trigger word. Opt-in mature-capable; requires `--no-filter`.
|
|
44
|
+
|
|
45
|
+
`h3-mystic-xxx-v4` — an uncensored all-round adult adapter that keeps motion,
|
|
46
|
+
temporal consistency, and fine detail. Range `0-1`, default `1`, usable band
|
|
47
|
+
`0.2-1`. No trigger word. Requires `--no-filter`.
|
|
48
|
+
|
|
49
|
+
Only `h3-realism-people` is published on every mode. Ref2VA carries it alone.
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Single adapter at its catalog default strength
|
|
55
|
+
sogni-agent --video --ref shot.png -m minimax-h3-i2v \
|
|
56
|
+
--lora h3-realism-people "r34l1sm, a slow push-in as she looks up"
|
|
57
|
+
|
|
58
|
+
# Explicit strength, and a stack (order matters — adapters do not commute)
|
|
59
|
+
sogni-agent --video -m minimax-h3-t2v --no-filter \
|
|
60
|
+
--loras h3-realism-people,h3-vbvr-video-reasoning \
|
|
61
|
+
--lora-strengths 0.8,0.9 "r34l1sm, a welder lowers her mask"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Omitting `--lora-strengths` applies each adapter's **catalog default**. Sending
|
|
65
|
+
a LoRA to the worker with no strength at all falls back to `1.0`, which for
|
|
66
|
+
`h3-realism-people` is already the top of its band — so the CLI fills the
|
|
67
|
+
catalog default in for you rather than letting that happen. Stack up to 8.
|
|
68
|
+
|
|
69
|
+
## Live catalog is the source of truth
|
|
70
|
+
|
|
71
|
+
This page is a snapshot. Sogni publishes and retires adapters without a skill
|
|
72
|
+
release, so read the catalog before relying on an exact range:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
sogni-agent --list-loras --lora-catalog-model minimax-h3-fl2va-fp8_i2v
|
|
76
|
+
sogni-agent --json --list-loras --lora-catalog-model minimax-h3-ref2va-fp8_r2v
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The CLI validates `--lora` against exactly this catalog for the model you
|
|
80
|
+
selected, so an id it accepts is an id the render will actually load, and a
|
|
81
|
+
wrong id fails before it costs a render. A LoRA the model cannot load is dropped
|
|
82
|
+
silently server-side — that check is what stops it reaching that point.
|
|
@@ -124,6 +124,18 @@ submit inline `input.steps`; `--workflow-input <json|@path>` supplies the
|
|
|
124
124
|
`replacementEndSeconds` when interleaving existing video slices. Workflow
|
|
125
125
|
JSON can bind request media into step arguments with
|
|
126
126
|
`sourceStepId: "$input_media"`.
|
|
127
|
+
- LoRA steps: `generate_image`, `edit_image`, `generate_video`, and
|
|
128
|
+
`animate_photo` take an ordered `loras` array plus a positionally aligned
|
|
129
|
+
`loraStrengths` (order matters, adapters do not commute). Step arguments are
|
|
130
|
+
schema-validated before dispatch, so 1-8 entries with matching lengths or the
|
|
131
|
+
step fails with a `400` — omit `loraStrengths` entirely to apply every adapter
|
|
132
|
+
at `1.0`. LoRAs are also model-gated, and there the mismatch is silent: ids
|
|
133
|
+
the chosen model cannot load are dropped without an error, so set the
|
|
134
|
+
model in the same step — `model: krea-2-turbo` or `dark-beast-krea2` for
|
|
135
|
+
`generate_image`, `model: krea-identity-edit` or
|
|
136
|
+
`dark-beast-krea2-identity-edit` for `edit_image`, and a `minimax-h3-*`
|
|
137
|
+
`videoModel` for `generate_video` / `animate_photo`. Published ids and ranges
|
|
138
|
+
come from `GET /v1/loras/comfy?modelId=<canonical-model-id>`.
|
|
127
139
|
- `--api-workflow storyboard-video` generates a storyline, creates one GPT
|
|
128
140
|
Image 2 storyboard sheet, then feeds that artifact into Seedance as the
|
|
129
141
|
video reference. `-Q fast|hq|pro` maps to GPT Image 2 low|medium|high
|
|
@@ -66,6 +66,17 @@ This ensures visual continuity — the new clip picks up exactly where the previ
|
|
|
66
66
|
|
|
67
67
|
When the final stitched output needs a single external soundtrack, add `--concat-audio /path/to/audio.mp3` and optional `--concat-audio-start <sec>` to the same `--concat-videos` command. This is the local-agent advantage over browser-only workflows: generate clips with Sogni, then stitch and mux audio locally.
|
|
68
68
|
|
|
69
|
+
## Preserve a Specific Song or Trending Soundtrack
|
|
70
|
+
|
|
71
|
+
Treat a user-specified original/specific/trending song and its timeline as
|
|
72
|
+
immutable. Never ask a generative video model to imitate, recompose, remix, or
|
|
73
|
+
replace it, including for copyright-avoidance. For MiniMax H3 Ref2VA, author
|
|
74
|
+
`audio reuse` plus `<Audio N>: fully_copy` and explicit choreography times, then
|
|
75
|
+
stream-copy/remux the original soundtrack into the final video. `audio
|
|
76
|
+
reference` explicitly permits a newly generated signal and is not equivalent.
|
|
77
|
+
If exact dance timing is mandatory, loose R2V conditioning is insufficient;
|
|
78
|
+
use a pose/edit-controlled workflow or stop before rendering.
|
|
79
|
+
|
|
69
80
|
## Transition Between Two Videos (Bridge Clip)
|
|
70
81
|
|
|
71
82
|
This recipe transitions between two **finished videos**. To morph between two
|
|
@@ -359,6 +359,9 @@ transition), and `S.SS` is the effective duration to exactly two decimal places
|
|
|
359
359
|
locked frames: up to **9 reference images**,
|
|
360
360
|
**3 reference videos** (24 fps, 2–15 s, each with an optional soundtrack) and
|
|
361
361
|
**3 standalone audio clips** (2–15 s each), **12 files maximum in total**.
|
|
362
|
+
The 24 fps requirement applies to the reference files themselves: normalize any
|
|
363
|
+
other frame rate without changing duration before submission, or H3 will
|
|
364
|
+
time-distort the visual reference relative to its soundtrack.
|
|
362
365
|
Reference-video duration totals may not exceed 15 seconds, and standalone
|
|
363
366
|
reference-audio duration totals may not exceed 15 seconds. It runs a separate
|
|
364
367
|
ref2va checkpoint, so it is never inferred — it must be chosen by name with
|
|
@@ -402,6 +405,21 @@ content and `fully_copy`, `partially_copy`, `reference`, or `weak_reference` for
|
|
|
402
405
|
audio. `detailed_description` is the shot-by-shot target-video timeline and
|
|
403
406
|
uses the same `[Shot N]`, `(Sx)`, and `<d>[Language] ...</d>` rules as Base H3.
|
|
404
407
|
|
|
408
|
+
**Immutable soundtrack rule.** If the user asks for the same, specific,
|
|
409
|
+
original, or trending song/soundtrack—or choreography tied to that audio—the
|
|
410
|
+
source signal and timeline are locked. Never generate a substitute, loose
|
|
411
|
+
imitation, remix, recomposition, or copyright-avoidance melody/lyric change.
|
|
412
|
+
Use `audio reuse` in `summary`, assign every locked `<Audio N>` `fully_copy` in
|
|
413
|
+
`retention_analysis`, name it directly in `non_diegetic_music`, and put the
|
|
414
|
+
source action onset/beat times in `detailed_description`. `audio reference`
|
|
415
|
+
means H3 may generate a new signal and is valid only when the user explicitly
|
|
416
|
+
wants style, timbre, rhythm, or delivery guidance rather than the original
|
|
417
|
+
track. A generative request cannot guarantee waveform identity, so the final
|
|
418
|
+
exact-song deliverable must stream-copy/remux the original audio after render.
|
|
419
|
+
Soundtrack identity and choreography timing are separate: Ref2VA is loose
|
|
420
|
+
conditioning, not an edit-level timing guarantee. If exact movement timing is
|
|
421
|
+
mandatory, use a pose/edit-controlled workflow or stop before paid generation.
|
|
422
|
+
|
|
405
423
|
**Reference grammar.** Reference assets are numbered from 1 independently per
|
|
406
424
|
type. Use the exact angle-bracket labels:
|
|
407
425
|
|
|
@@ -413,9 +431,10 @@ Visible people, objects, scenes, or effects reused from an image or video become
|
|
|
413
431
|
`<Subject N>` entries whose definitions cite their source asset. Reserve
|
|
414
432
|
`<Picture N>` for a concrete frame or storyboard relationship, `<Video N>` for
|
|
415
433
|
a whole-video edit, continuation, camera, cut, rhythm, or temporal relationship,
|
|
416
|
-
and `<Audio N>` for a standalone audio asset or
|
|
417
|
-
|
|
418
|
-
|
|
434
|
+
and `<Audio N>` for a standalone audio asset or a reference-video soundtrack.
|
|
435
|
+
Every soundtracked reference video contributes an `<Audio N>` ordinal before
|
|
436
|
+
standalone audio clips; probe the files and use the runtime's reported order so
|
|
437
|
+
the soundtrack cannot bind to the wrong label.
|
|
419
438
|
|
|
420
439
|
Rewrite aliases such as "image 2", `@Image2`, or `[Image 2]` to the correct H3
|
|
421
440
|
label. Seedance's `@Image1` / `@Video1` / `@Audio1` grammar must not leak into an
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sogni-creative-agent",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.36.0",
|
|
4
4
|
"description": "Sogni Creative Agent: image, video, and music generation via Sogni AI's decentralized GPU network. Supports personas, persistent memories, style transfer, and multi-step creative workflows.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Sogni AI",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [3.36.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.35.4...v3.36.0) (2026-08-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** consume intelligence client 3.25.0 ([b495645](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/b4956451ec39cc44406d7115f91dc8156fe1a850))
|
|
7
|
+
* forward H3 video durations ([986f373](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/986f373d085400add22aceda2d4d2fb5cde48ea6))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **video:** harden local reference workflows ([eb3c19c](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/eb3c19c66f215a8322a864e0d7175939851f8bda))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Documentation
|
|
16
|
+
|
|
17
|
+
* **hosted-api:** document workflow LoRA steps ([5bdf28f](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/5bdf28f3ae7a5d788b3f0fb95379c2b3c73ffb5c))
|
|
18
|
+
* **loras:** document the MiniMax H3 video adapters ([92d2524](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/92d2524f52346bebde33fc288421a490109d49a1))
|
|
19
|
+
|
|
20
|
+
## [3.35.4](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.35.3...v3.35.4) (2026-08-26)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **deps:** consume storyboard compiler correction ([ed60ec8](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/ed60ec85fdfa11e8c2a10dd7bbd283ae9a1087cf))
|
|
26
|
+
|
|
1
27
|
## [3.35.3](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.35.2...v3.35.3) (2026-08-26)
|
|
2
28
|
|
|
3
29
|
|
package/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: sogni-creative-agent-skill
|
|
3
3
|
description: "Sogni Creative Agent Skill: agent skill and CLI for image, video, and music generation using Sogni AI's decentralized GPU network. Supports promptless RTX VSR image upscaling through 16K, one-click image-folder loop reels, personas (named people with saved reference photos and voice clips), persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/H3 Turbo/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"upscale an image\", \"make a video/animate\", \"turn this image folder into a loop\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
|
|
4
4
|
metadata:
|
|
5
|
-
version: "3.
|
|
5
|
+
version: "3.36.0"
|
|
6
6
|
homepage: https://sogni.ai
|
|
7
7
|
openclaw:
|
|
8
8
|
emoji: "🎨"
|
|
@@ -315,7 +315,11 @@ tokens in that scoped reference rather than ordinary model recommendations.
|
|
|
315
315
|
|
|
316
316
|
MiniMax H3 is an explicit model choice, not a universal default. Eight hosted selectors expose **ten prompt/input shapes**: T2VA, I2VA, L2VA, FL2VA, and Ref2VA in standard and Turbo form. L2VA deliberately reuses the I2V selector: `-m minimax-h3-i2v --ref-end B` (or `minimax-h3-i2v-turbo`) supplies only the closing frame; never invent an `minimax-h3-l2v` model key. Use `-m minimax-h3-i2v --ref A` for a first frame, `-m minimax-h3-flf2v --ref A --ref-end B` for both endpoints, and explicitly select `-m minimax-h3-r2v` for loose references. `-m minimax-h3` and `-m minimax-h3-turbo` infer the three endpoint shapes from `--ref`/`--ref-end`. Turbo is the fixed 4-step execution path; standard H3 uses 20 steps. Do not claim a quality or speed multiple without current production-parity measurements and manual output review.
|
|
317
317
|
|
|
318
|
-
H3 r2v accepts up to **9 images** (`--ref` then repeatable `-c`), **3 videos** (repeat `--ref-video`), and **3 audio clips** (repeat `--ref-audio`), with **12 files total** and at least one visual reference (image or video); it is never inferred. A video can be the only visual input, while audio alone is invalid. Address references as `<Picture 1>`, `<Video 1>`, and `<Audio 1>` in per-type submission order, give every reference one job, and never use `--ref-end` for r2v. H3 generates picture and **native 32 kHz stereo audio jointly** at fixed 24 fps, so dialogue, foley, and score must be described in the prompt. `--no-generate-audio` strips that generated track from the delivered file; it does not skip audio generation. Frames snap to the `124 + n×17` grid (5.17-15.08 s). Standard and FL2VA Turbo default to `1344x768`; Ref2VA Turbo defaults to `960x544`, with other supported 32 px-grid shapes allowed. Send no steps, guidance, scheduler, or negative prompt. Standard H3 accepts no sampler override. FL2VA H3 Turbo defaults to `er_sde` on Socket, and the CLI omits the sampler unless `--sampler` is passed; direct FL2VA A/B tests may use `euler`, `er_sde`, or `sa_solver`. Ref2VA Turbo follows its exact upstream Euler/simple recipe and accepts only `--sampler euler`. It is the 768p-class open-weights release — do not claim 2K. FL2VA/Turbo and image-only R2V require 32 GB-class workers; video-conditioned R2V is reserved for workers above 40 GB.
|
|
318
|
+
H3 r2v accepts up to **9 images** (`--ref` then repeatable `-c`), **3 videos** (repeat `--ref-video`), and **3 audio clips** (repeat `--ref-audio`), with **12 files total** and at least one visual reference (image or video); it is never inferred. A video can be the only visual input, while audio alone is invalid. Address references as `<Picture 1>`, `<Video 1>`, and `<Audio 1>` in per-type submission order, give every reference one job, and never use `--ref-end` for r2v. Reference videos must themselves be exactly 24 fps; normalize other rates without changing duration or audio timing before submission. H3 generates picture and **native 32 kHz stereo audio jointly** at fixed 24 fps, so dialogue, foley, and score must be described in the prompt. `--no-generate-audio` strips that generated track from the delivered file; it does not skip audio generation. Frames snap to the `124 + n×17` grid (5.17-15.08 s). Standard and FL2VA Turbo default to `1344x768`; Ref2VA Turbo defaults to `960x544`, with other supported 32 px-grid shapes allowed. Send no steps, guidance, scheduler, or negative prompt. Standard H3 accepts no sampler override. FL2VA H3 Turbo defaults to `er_sde` on Socket, and the CLI omits the sampler unless `--sampler` is passed; direct FL2VA A/B tests may use `euler`, `er_sde`, or `sa_solver`. Ref2VA Turbo follows its exact upstream Euler/simple recipe and accepts only `--sampler euler`. It is the 768p-class open-weights release — do not claim 2K. FL2VA/Turbo and image-only R2V require 32 GB-class workers; video-conditioned R2V is reserved for workers above 40 GB.
|
|
319
|
+
|
|
320
|
+
**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.
|
|
321
|
+
|
|
322
|
+
**MiniMax H3 is the only video family that loads LoRAs.** 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.
|
|
319
323
|
|
|
320
324
|
**H3 requires MiniMax's official ordered-field prompt contract.** Base and Turbo T2V/I2V/L2V/FLF2V 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.
|
|
321
325
|
|
|
@@ -440,6 +444,7 @@ Eligible Sogni-hosted renders use Unlimited coverage when active; otherwise rend
|
|
|
440
444
|
| [`references/seamless-tiling.md`](./references/seamless-tiling.md) | Seamless repeating patterns, wallpapers, tiling textures, Escher tessellations |
|
|
441
445
|
| [`references/models.md`](./references/models.md) | Choosing models, sizing/divisibility rules, image edit reference limits, music model options |
|
|
442
446
|
| [`references/krea2-loras.md`](./references/krea2-loras.md) | The 25 Krea 2 LoRAs: IDs, strength ranges, bipolar directions, community fine-tunes, live `--list-loras` discovery |
|
|
447
|
+
| [`references/h3-video-loras.md`](./references/h3-video-loras.md) | MiniMax H3 video LoRAs: per-mode availability, trigger words, positive-only strength bands, live catalog discovery |
|
|
443
448
|
| [`references/personas-memory.md`](./references/personas-memory.md) | Persona CRUD/voice cloning, multi-persona scenes, memories, personality, style transfer, photo restoration |
|
|
444
449
|
| [`references/openclaw-config.md`](./references/openclaw-config.md) | OpenClaw plugin config defaults and overrides |
|
|
445
450
|
| [`skills/README.md`](./skills/README.md) | Hosted per-skill tool surface (for hosts that load focused capability subsets) |
|
|
@@ -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.
|
|
5
|
+
"version": "3.36.0",
|
|
6
6
|
"description": "Generate images, video, and music on Sogni AI's decentralized GPU network — with personas, memories, and safe video editing tools.",
|
|
7
7
|
"author": { "name": "Sogni AI", "url": "https://sogni.ai" },
|
|
8
8
|
"homepage": "https://sogni.ai",
|
|
@@ -2287,9 +2287,9 @@ const PROMPT_CONTRACTS = [
|
|
|
2287
2287
|
},
|
|
2288
2288
|
{
|
|
2289
2289
|
"contractId": "generate_video_v1",
|
|
2290
|
-
"version": "1.
|
|
2290
|
+
"version": "1.2.0",
|
|
2291
2291
|
"toolName": "generate_video",
|
|
2292
|
-
"baseDescription": "generate_video produces text-to-video clips and multimodal reference videos.\nUse for text-only video generation with no source image input. For Seedance and Wan 3, also\nuse this tool when uploaded/generated images, videos, or audio are loose references. Use\nanimate_photo when a source image must become the first frame of an LTX/WAN animation.\n\nWAN 3: Use videoModel=\"wan3.0-video\" for explicit Wan 3 requests. The same canonical model\nsupports text, up to 10 reference images, 5 reference videos, and 5 reference audios. Refer\nto loose assets in English prompts as Image 1, Video 1, and Audio 1, numbered independently\nby type. Do not bracket or @-prefix these identifiers. Wan 3 renders 2-30 seconds at fixed\n30 fps, offers 480P/720P/1080P and 16:9/4:3/1:1/3:4/9:16, and can toggle native audio.\n\nSEEDANCE UPLOADED STORYBOARD DEFAULT: When the user uploads a storyboard, shot sheet,\nmood board, or trailer concept image and asks to make a movie trailer/video/clip from it,\ndefault to one Seedance generate_video call with referenceImageIndices=[-1]. Do not first\nextract panels with edit_image, do not generate replacement keyframes, and do not make four\nseparate LTX animate_photo clips unless the user explicitly asks for separate clips or LTX.\nUse seedance2 when premium Spark access is available; if premium access is unavailable,\nexplain the limitation or use the best non-Seedance fallback the user accepts.\n\nEXACT / INCLUDED VIDEO PROMPTS: If the user asks for a Seedance video using uploaded or\ngenerated references and says to use a prompt exactly, pass only that literal quoted prompt\nto generate_video and set skipPromptProcessing=true plus expandPrompt=false. Do not treat\nwords inside the literal prompt, such as storyboard, script, thumbnails, or panels, as a\nrequest to create a storyboard image. If the user includes a timecoded script inside a\nvideo request, keep it in the generate_video prompt. Explicit constraints like no storyboard\npanels, no subtitles, or no captions are constraints on the video render, not instructions\nto call edit_image or generate_image.\n\nSTORYTELLING / COMMERCIAL / TRAILER PROMPTS: For creative video requests, turn the brief\ninto timed, causally connected visual beats before writing the final prompt. Default social\nvideo is 15s 9:16 with a strong first 1-2s, visible escalation, payoff, and brand/CTA/final\nimage. Commercials should show audience desire/problem, transformation, proof/benefit, and\nCTA. Trailers should follow hook → world → disruption → escalation → reveal → title/CTA.\nEvery beat must be generatable: subject, setting, action, camera, lighting, audio, and text\nrole where relevant. Avoid vague \"cinematic\" filler, feature dumps, and beautiful images with\nno visible change.\n\nVIDEO PROMPT QUOTING: ONLY use double quotes for spoken dialogue in video prompts. Never\nquote on-screen text, titles, captions, or visual text elements — describe them without\nquotes. Quotes signal speech to the model and confuse audio generation.\n\nSTORYBOARD TEXT: Structural headings, section numbers, slide titles, panel titles, and\ncaptions in storyboard references may become short audio-only narration/VO or\nkey-message beats, but they are not subtitles, title cards, lower thirds, or visible\noverlays unless the user explicitly asks for visible text, on-screen text, a title\ncard, subtitle, lower third, signage, or CTA. Keep narration as separate brief phrases\nwith pauses; do not concatenate storyboard labels into run-on voiceover.\n\nDIALOGUE DURATION: Spoken dialogue must fit the clip. Estimate 3 words per second\nnatural delivery plus ~1s per acting beat. Hard maximum 3.75 words/second.\nCheck: dialogue words ÷ 3 + beats ≤ duration. Do not submit oversized dialogue.\n\nLATEST USER DURATION WINS: In follow-up turns, use the newest duration the user states,\neven if a previous assistant message mentioned a longer script/runtime. For example, if\nhistory says \"the full script is 66 seconds\" but the user now says \"do a 30 second version\",\ngenerate the 30 second version. Do not ask a clarification question just because history\ncontains another duration; treat the latest user request as the override.\n\nSEEDANCE SHORT-DURATION LIMIT: Seedance supports 4-15s clips. If the user explicitly asks\nfor Seedance below 4s, do not silently round up. Ask whether they prefer a 4s Seedance clip\nor an exact-duration LTX clip. If the user did not explicitly ask for Seedance, choose the\nmodel/tool that can satisfy the requested duration exactly.",
|
|
2292
|
+
"baseDescription": "generate_video produces text-to-video clips and multimodal reference videos.\nUse for text-only video generation with no source image input. For Seedance and Wan 3, also\nuse this tool when uploaded/generated images, videos, or audio are loose references. Use\nanimate_photo when a source image must become the first frame of an LTX/WAN animation.\n\nWAN 3: Use videoModel=\"wan3.0-video\" for explicit Wan 3 requests. The same canonical model\nsupports text, up to 10 reference images, 5 reference videos, and 5 reference audios. Refer\nto loose assets in English prompts as Image 1, Video 1, and Audio 1, numbered independently\nby type. Do not bracket or @-prefix these identifiers. Wan 3 renders 2-30 seconds at fixed\n30 fps, offers 480P/720P/1080P and 16:9/4:3/1:1/3:4/9:16, and can toggle native audio.\n\nMINIMAX H3 SOURCE AUDIO: Every H3 R2V call with a reference video or audio must set\nsourceAudioPolicy. A specific/original/trending song is immutable: use reuse_exact, author\nthe official audio reuse task plus fully_copy, keep choreography on explicit source times,\nand stream-copy/remux the original soundtrack after rendering. Never substitute, recompose,\nremix, or add a copyright-avoidance mutation. H3 reference videos must themselves be exactly\n24 fps; normalize other rates without changing duration/audio timing before submission.\nRef2VA cannot guarantee edit-level beat sync.\n\nSEEDANCE UPLOADED STORYBOARD DEFAULT: When the user uploads a storyboard, shot sheet,\nmood board, or trailer concept image and asks to make a movie trailer/video/clip from it,\ndefault to one Seedance generate_video call with referenceImageIndices=[-1]. Do not first\nextract panels with edit_image, do not generate replacement keyframes, and do not make four\nseparate LTX animate_photo clips unless the user explicitly asks for separate clips or LTX.\nUse seedance2 when premium Spark access is available; if premium access is unavailable,\nexplain the limitation or use the best non-Seedance fallback the user accepts.\n\nEXACT / INCLUDED VIDEO PROMPTS: If the user asks for a Seedance video using uploaded or\ngenerated references and says to use a prompt exactly, pass only that literal quoted prompt\nto generate_video and set skipPromptProcessing=true plus expandPrompt=false. Do not treat\nwords inside the literal prompt, such as storyboard, script, thumbnails, or panels, as a\nrequest to create a storyboard image. If the user includes a timecoded script inside a\nvideo request, keep it in the generate_video prompt. Explicit constraints like no storyboard\npanels, no subtitles, or no captions are constraints on the video render, not instructions\nto call edit_image or generate_image.\n\nSTORYTELLING / COMMERCIAL / TRAILER PROMPTS: For creative video requests, turn the brief\ninto timed, causally connected visual beats before writing the final prompt. Default social\nvideo is 15s 9:16 with a strong first 1-2s, visible escalation, payoff, and brand/CTA/final\nimage. Commercials should show audience desire/problem, transformation, proof/benefit, and\nCTA. Trailers should follow hook → world → disruption → escalation → reveal → title/CTA.\nEvery beat must be generatable: subject, setting, action, camera, lighting, audio, and text\nrole where relevant. Avoid vague \"cinematic\" filler, feature dumps, and beautiful images with\nno visible change.\n\nVIDEO PROMPT QUOTING: ONLY use double quotes for spoken dialogue in video prompts. Never\nquote on-screen text, titles, captions, or visual text elements — describe them without\nquotes. Quotes signal speech to the model and confuse audio generation.\n\nSTORYBOARD TEXT: Structural headings, section numbers, slide titles, panel titles, and\ncaptions in storyboard references may become short audio-only narration/VO or\nkey-message beats, but they are not subtitles, title cards, lower thirds, or visible\noverlays unless the user explicitly asks for visible text, on-screen text, a title\ncard, subtitle, lower third, signage, or CTA. Keep narration as separate brief phrases\nwith pauses; do not concatenate storyboard labels into run-on voiceover.\n\nDIALOGUE DURATION: Spoken dialogue must fit the clip. Estimate 3 words per second\nnatural delivery plus ~1s per acting beat. Hard maximum 3.75 words/second.\nCheck: dialogue words ÷ 3 + beats ≤ duration. Do not submit oversized dialogue.\n\nLATEST USER DURATION WINS: In follow-up turns, use the newest duration the user states,\neven if a previous assistant message mentioned a longer script/runtime. For example, if\nhistory says \"the full script is 66 seconds\" but the user now says \"do a 30 second version\",\ngenerate the 30 second version. Do not ask a clarification question just because history\ncontains another duration; treat the latest user request as the override.\n\nSEEDANCE SHORT-DURATION LIMIT: Seedance supports 4-15s clips. If the user explicitly asks\nfor Seedance below 4s, do not silently round up. Ask whether they prefer a 4s Seedance clip\nor an exact-duration LTX clip. If the user did not explicitly ask for Seedance, choose the\nmodel/tool that can satisfy the requested duration exactly.",
|
|
2293
2293
|
"parameterDocs": {
|
|
2294
2294
|
"prompt": "Video prompt. Use double quotes ONLY for spoken dialogue. Describe visual text without quotes.",
|
|
2295
2295
|
"duration": "Clip duration in seconds. Plan dialogue word count against the 3.75 words/second ceiling."
|
package/openclaw.plugin.json
CHANGED
|
@@ -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.
|
|
5
|
+
"version": "3.36.0",
|
|
6
6
|
"skills": [
|
|
7
7
|
"."
|
|
8
8
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sogni-ai/sogni-creative-agent-skill",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.36.0",
|
|
4
4
|
"description": "Sogni Creative Agent Skill: agent skill and CLI for Sogni AI image, video, and music generation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "sogni-agent.mjs",
|
|
@@ -95,13 +95,13 @@
|
|
|
95
95
|
"sogni-agent.mjs"
|
|
96
96
|
],
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@sogni-ai/sogni-intelligence-client": "3.
|
|
98
|
+
"@sogni-ai/sogni-intelligence-client": "3.25.0",
|
|
99
99
|
"execa": "^9.6.1",
|
|
100
100
|
"json5": "^2.2.3",
|
|
101
101
|
"sharp": "0.35.4"
|
|
102
102
|
},
|
|
103
103
|
"overrides": {
|
|
104
|
-
"@sogni-ai/sogni-client": "5.21.
|
|
104
|
+
"@sogni-ai/sogni-client": "5.21.4"
|
|
105
105
|
},
|
|
106
106
|
"openclaw": {
|
|
107
107
|
"extensions": [
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# MiniMax H3 video LoRA catalog
|
|
2
|
+
|
|
3
|
+
The adapters Sogni publishes for MiniMax H3 — the only video family that loads
|
|
4
|
+
LoRAs. Everything else (LTX, WAN, Seedance, HappyHorse) ignores `--lora`, and
|
|
5
|
+
the CLI refuses the combination rather than rendering as if you had not asked.
|
|
6
|
+
|
|
7
|
+
Video LoRAs are a different shape from the Krea 2 image sliders:
|
|
8
|
+
|
|
9
|
+
- **Positive-only.** A negative strength is not an inverse effect, and `0` is
|
|
10
|
+
off. The bipolar convention belongs to the Krea 2 image sliders alone.
|
|
11
|
+
- **One file per family**, not one per effect.
|
|
12
|
+
- **Availability differs by H3 mode.** Read the live catalog for the exact mode
|
|
13
|
+
you are rendering; the mode's canonical model id is the filter.
|
|
14
|
+
|
|
15
|
+
## Selecting a compatible model
|
|
16
|
+
|
|
17
|
+
LoRAs attach to the resolved H3 model, so name the mode in the same command:
|
|
18
|
+
|
|
19
|
+
| Mode | Selector | Canonical model id |
|
|
20
|
+
|------|----------|--------------------|
|
|
21
|
+
| Text-to-video | `-m minimax-h3-t2v` (`-turbo`) | `minimax-h3-fl2va-fp8_t2v` |
|
|
22
|
+
| Image-to-video | `-m minimax-h3-i2v` (`-turbo`) | `minimax-h3-fl2va-fp8_i2v` |
|
|
23
|
+
| First+last frame | `-m minimax-h3-flf2v` (`-turbo`) | `minimax-h3-fl2va-fp8_flf2v` |
|
|
24
|
+
| Reference-to-video | `-m minimax-h3-r2v` (`-turbo`) | `minimax-h3-ref2va-fp8_r2v` |
|
|
25
|
+
|
|
26
|
+
Bare `-m minimax-h3` is not enough to validate a LoRA request: it resolves by
|
|
27
|
+
frame arguments, and availability differs per mode. Name the explicit mode.
|
|
28
|
+
|
|
29
|
+
## Published adapters
|
|
30
|
+
|
|
31
|
+
`h3-realism-people` (fal) — a realism pass trained on live-action footage of
|
|
32
|
+
people. Restores skin texture and pores, stray hairs, fabric weave, and a fine
|
|
33
|
+
sensor grain the base model smooths away; holds up in close-up. Range `0-2`,
|
|
34
|
+
catalog default `0.8`, usable band `0.6-1`. **It needs its trigger word**: put
|
|
35
|
+
`r34l1sm` near the FRONT of the prompt, or the render comes back as ordinary H3
|
|
36
|
+
with no error. It also pulls the camera in as it climbs — at `1.5` and above the
|
|
37
|
+
shot reliably recomposes and the grade darkens, which on an image-conditioned
|
|
38
|
+
mode can crop the subject out of the frame you supplied. Prefer the default when
|
|
39
|
+
you supplied a first or last frame.
|
|
40
|
+
|
|
41
|
+
`h3-vbvr-video-reasoning` — a prompt-adherence pass that holds the model to what
|
|
42
|
+
was asked instead of improvising. Range `0-1`, default `1`, usable band
|
|
43
|
+
`0.7-1`. No trigger word. Opt-in mature-capable; requires `--no-filter`.
|
|
44
|
+
|
|
45
|
+
`h3-mystic-xxx-v4` — an uncensored all-round adult adapter that keeps motion,
|
|
46
|
+
temporal consistency, and fine detail. Range `0-1`, default `1`, usable band
|
|
47
|
+
`0.2-1`. No trigger word. Requires `--no-filter`.
|
|
48
|
+
|
|
49
|
+
Only `h3-realism-people` is published on every mode. Ref2VA carries it alone.
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Single adapter at its catalog default strength
|
|
55
|
+
sogni-agent --video --ref shot.png -m minimax-h3-i2v \
|
|
56
|
+
--lora h3-realism-people "r34l1sm, a slow push-in as she looks up"
|
|
57
|
+
|
|
58
|
+
# Explicit strength, and a stack (order matters — adapters do not commute)
|
|
59
|
+
sogni-agent --video -m minimax-h3-t2v --no-filter \
|
|
60
|
+
--loras h3-realism-people,h3-vbvr-video-reasoning \
|
|
61
|
+
--lora-strengths 0.8,0.9 "r34l1sm, a welder lowers her mask"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Omitting `--lora-strengths` applies each adapter's **catalog default**. Sending
|
|
65
|
+
a LoRA to the worker with no strength at all falls back to `1.0`, which for
|
|
66
|
+
`h3-realism-people` is already the top of its band — so the CLI fills the
|
|
67
|
+
catalog default in for you rather than letting that happen. Stack up to 8.
|
|
68
|
+
|
|
69
|
+
## Live catalog is the source of truth
|
|
70
|
+
|
|
71
|
+
This page is a snapshot. Sogni publishes and retires adapters without a skill
|
|
72
|
+
release, so read the catalog before relying on an exact range:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
sogni-agent --list-loras --lora-catalog-model minimax-h3-fl2va-fp8_i2v
|
|
76
|
+
sogni-agent --json --list-loras --lora-catalog-model minimax-h3-ref2va-fp8_r2v
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The CLI validates `--lora` against exactly this catalog for the model you
|
|
80
|
+
selected, so an id it accepts is an id the render will actually load, and a
|
|
81
|
+
wrong id fails before it costs a render. A LoRA the model cannot load is dropped
|
|
82
|
+
silently server-side — that check is what stops it reaching that point.
|
package/references/hosted-api.md
CHANGED
|
@@ -124,6 +124,18 @@ submit inline `input.steps`; `--workflow-input <json|@path>` supplies the
|
|
|
124
124
|
`replacementEndSeconds` when interleaving existing video slices. Workflow
|
|
125
125
|
JSON can bind request media into step arguments with
|
|
126
126
|
`sourceStepId: "$input_media"`.
|
|
127
|
+
- LoRA steps: `generate_image`, `edit_image`, `generate_video`, and
|
|
128
|
+
`animate_photo` take an ordered `loras` array plus a positionally aligned
|
|
129
|
+
`loraStrengths` (order matters, adapters do not commute). Step arguments are
|
|
130
|
+
schema-validated before dispatch, so 1-8 entries with matching lengths or the
|
|
131
|
+
step fails with a `400` — omit `loraStrengths` entirely to apply every adapter
|
|
132
|
+
at `1.0`. LoRAs are also model-gated, and there the mismatch is silent: ids
|
|
133
|
+
the chosen model cannot load are dropped without an error, so set the
|
|
134
|
+
model in the same step — `model: krea-2-turbo` or `dark-beast-krea2` for
|
|
135
|
+
`generate_image`, `model: krea-identity-edit` or
|
|
136
|
+
`dark-beast-krea2-identity-edit` for `edit_image`, and a `minimax-h3-*`
|
|
137
|
+
`videoModel` for `generate_video` / `animate_photo`. Published ids and ranges
|
|
138
|
+
come from `GET /v1/loras/comfy?modelId=<canonical-model-id>`.
|
|
127
139
|
- `--api-workflow storyboard-video` generates a storyline, creates one GPT
|
|
128
140
|
Image 2 storyboard sheet, then feeds that artifact into Seedance as the
|
|
129
141
|
video reference. `-Q fast|hq|pro` maps to GPT Image 2 low|medium|high
|
|
@@ -66,6 +66,17 @@ This ensures visual continuity — the new clip picks up exactly where the previ
|
|
|
66
66
|
|
|
67
67
|
When the final stitched output needs a single external soundtrack, add `--concat-audio /path/to/audio.mp3` and optional `--concat-audio-start <sec>` to the same `--concat-videos` command. This is the local-agent advantage over browser-only workflows: generate clips with Sogni, then stitch and mux audio locally.
|
|
68
68
|
|
|
69
|
+
## Preserve a Specific Song or Trending Soundtrack
|
|
70
|
+
|
|
71
|
+
Treat a user-specified original/specific/trending song and its timeline as
|
|
72
|
+
immutable. Never ask a generative video model to imitate, recompose, remix, or
|
|
73
|
+
replace it, including for copyright-avoidance. For MiniMax H3 Ref2VA, author
|
|
74
|
+
`audio reuse` plus `<Audio N>: fully_copy` and explicit choreography times, then
|
|
75
|
+
stream-copy/remux the original soundtrack into the final video. `audio
|
|
76
|
+
reference` explicitly permits a newly generated signal and is not equivalent.
|
|
77
|
+
If exact dance timing is mandatory, loose R2V conditioning is insufficient;
|
|
78
|
+
use a pose/edit-controlled workflow or stop before rendering.
|
|
79
|
+
|
|
69
80
|
## Transition Between Two Videos (Bridge Clip)
|
|
70
81
|
|
|
71
82
|
This recipe transitions between two **finished videos**. To morph between two
|
|
@@ -359,6 +359,9 @@ transition), and `S.SS` is the effective duration to exactly two decimal places
|
|
|
359
359
|
locked frames: up to **9 reference images**,
|
|
360
360
|
**3 reference videos** (24 fps, 2–15 s, each with an optional soundtrack) and
|
|
361
361
|
**3 standalone audio clips** (2–15 s each), **12 files maximum in total**.
|
|
362
|
+
The 24 fps requirement applies to the reference files themselves: normalize any
|
|
363
|
+
other frame rate without changing duration before submission, or H3 will
|
|
364
|
+
time-distort the visual reference relative to its soundtrack.
|
|
362
365
|
Reference-video duration totals may not exceed 15 seconds, and standalone
|
|
363
366
|
reference-audio duration totals may not exceed 15 seconds. It runs a separate
|
|
364
367
|
ref2va checkpoint, so it is never inferred — it must be chosen by name with
|
|
@@ -402,6 +405,21 @@ content and `fully_copy`, `partially_copy`, `reference`, or `weak_reference` for
|
|
|
402
405
|
audio. `detailed_description` is the shot-by-shot target-video timeline and
|
|
403
406
|
uses the same `[Shot N]`, `(Sx)`, and `<d>[Language] ...</d>` rules as Base H3.
|
|
404
407
|
|
|
408
|
+
**Immutable soundtrack rule.** If the user asks for the same, specific,
|
|
409
|
+
original, or trending song/soundtrack—or choreography tied to that audio—the
|
|
410
|
+
source signal and timeline are locked. Never generate a substitute, loose
|
|
411
|
+
imitation, remix, recomposition, or copyright-avoidance melody/lyric change.
|
|
412
|
+
Use `audio reuse` in `summary`, assign every locked `<Audio N>` `fully_copy` in
|
|
413
|
+
`retention_analysis`, name it directly in `non_diegetic_music`, and put the
|
|
414
|
+
source action onset/beat times in `detailed_description`. `audio reference`
|
|
415
|
+
means H3 may generate a new signal and is valid only when the user explicitly
|
|
416
|
+
wants style, timbre, rhythm, or delivery guidance rather than the original
|
|
417
|
+
track. A generative request cannot guarantee waveform identity, so the final
|
|
418
|
+
exact-song deliverable must stream-copy/remux the original audio after render.
|
|
419
|
+
Soundtrack identity and choreography timing are separate: Ref2VA is loose
|
|
420
|
+
conditioning, not an edit-level timing guarantee. If exact movement timing is
|
|
421
|
+
mandatory, use a pose/edit-controlled workflow or stop before paid generation.
|
|
422
|
+
|
|
405
423
|
**Reference grammar.** Reference assets are numbered from 1 independently per
|
|
406
424
|
type. Use the exact angle-bracket labels:
|
|
407
425
|
|
|
@@ -413,9 +431,10 @@ Visible people, objects, scenes, or effects reused from an image or video become
|
|
|
413
431
|
`<Subject N>` entries whose definitions cite their source asset. Reserve
|
|
414
432
|
`<Picture N>` for a concrete frame or storyboard relationship, `<Video N>` for
|
|
415
433
|
a whole-video edit, continuation, camera, cut, rhythm, or temporal relationship,
|
|
416
|
-
and `<Audio N>` for a standalone audio asset or
|
|
417
|
-
|
|
418
|
-
|
|
434
|
+
and `<Audio N>` for a standalone audio asset or a reference-video soundtrack.
|
|
435
|
+
Every soundtracked reference video contributes an `<Audio N>` ordinal before
|
|
436
|
+
standalone audio clips; probe the files and use the runtime's reported order so
|
|
437
|
+
the soundtrack cannot bind to the wrong label.
|
|
419
438
|
|
|
420
439
|
Rewrite aliases such as "image 2", `@Image2`, or `[Image 2]` to the correct H3
|
|
421
440
|
label. Seedance's `@Image1` / `@Video1` / `@Audio1` grammar must not leak into an
|
package/skill-package.json
CHANGED
package/sogni-agent.mjs
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import './node-version-check.mjs';
|
|
11
11
|
import JSON5 from 'json5';
|
|
12
12
|
import { createHash, randomBytes } from 'crypto';
|
|
13
|
+
import { execFileSync } from 'child_process';
|
|
13
14
|
import { createRequire } from 'module';
|
|
14
15
|
import { readFileSync, writeFileSync, existsSync, mkdirSync, mkdtempSync, statSync, readdirSync, realpathSync, lstatSync, unlinkSync, rmdirSync, rmSync, renameSync } from 'fs';
|
|
15
16
|
import { join, dirname, basename, extname, sep, resolve } from 'path';
|
|
@@ -2622,6 +2623,10 @@ const options = {
|
|
|
2622
2623
|
extractFrameAt: null, // --extract-frame-at <video> <seconds> <image>
|
|
2623
2624
|
extractFrameAtSeconds: null,
|
|
2624
2625
|
extractFrameAtOutput: null,
|
|
2626
|
+
trimVideo: null, // --trim-video <video> <start> <duration> <output>
|
|
2627
|
+
trimVideoStart: null,
|
|
2628
|
+
trimVideoDuration: null,
|
|
2629
|
+
trimVideoOutput: null,
|
|
2625
2630
|
verifyVideo: null, // --verify-video <video>: probe streams and decode the full file
|
|
2626
2631
|
sourceReelDir: null, // --source-reel <image-folder>: animate folder images into a stitched video
|
|
2627
2632
|
sourceReelImageSeconds: 3,
|
|
@@ -3302,6 +3307,25 @@ for (let i = 0; i < args.length; i++) {
|
|
|
3302
3307
|
options.extractFrameAt = videoArg;
|
|
3303
3308
|
options.extractFrameAtSeconds = parseNonNegativeNumberValue(secondsRaw, arg + ' (seconds)');
|
|
3304
3309
|
options.extractFrameAtOutput = imageArg;
|
|
3310
|
+
} else if (arg === '--trim-video') {
|
|
3311
|
+
const videoArg = requireFlagValue(args, i, arg);
|
|
3312
|
+
i++;
|
|
3313
|
+
const startRaw = requireFlagValue(args, i, arg + ' (start seconds)');
|
|
3314
|
+
i++;
|
|
3315
|
+
const durationRaw = requireFlagValue(args, i, arg + ' (duration seconds)');
|
|
3316
|
+
i++;
|
|
3317
|
+
const outputArg = requireFlagValue(args, i, arg + ' (output video)');
|
|
3318
|
+
i++;
|
|
3319
|
+
options.trimVideo = videoArg;
|
|
3320
|
+
options.trimVideoStart = parseNonNegativeNumberValue(startRaw, arg + ' (start seconds)');
|
|
3321
|
+
options.trimVideoDuration = parseNumberValue(durationRaw, arg + ' (duration seconds)');
|
|
3322
|
+
if (options.trimVideoDuration <= 0) {
|
|
3323
|
+
fatalCliError('--trim-video duration must be greater than zero.', {
|
|
3324
|
+
code: 'INVALID_ARGUMENT',
|
|
3325
|
+
details: { flag: '--trim-video', duration: options.trimVideoDuration }
|
|
3326
|
+
});
|
|
3327
|
+
}
|
|
3328
|
+
options.trimVideoOutput = outputArg;
|
|
3305
3329
|
} else if (arg === '--verify-video') {
|
|
3306
3330
|
const raw = requireFlagValue(args, i, arg);
|
|
3307
3331
|
i++;
|
|
@@ -3962,6 +3986,7 @@ General:
|
|
|
3962
3986
|
--extract-last-frame <video> <image> Extract last frame from a video (safe ffmpeg wrapper)
|
|
3963
3987
|
--extract-first-frame <video> <image> Extract first frame from a video (safe ffmpeg wrapper)
|
|
3964
3988
|
--extract-frame-at <video> <sec> <image> Extract a timestamped frame (safe ffmpeg wrapper)
|
|
3989
|
+
--trim-video <video> <start> <duration> <output> Create a frame-accurate H.264/AAC clip
|
|
3965
3990
|
--verify-video <video> Verify streams and fully decode a video (safe ffmpeg/ffprobe wrapper)
|
|
3966
3991
|
--concat-videos <out> <clips...> Concatenate video clips (safe ffmpeg wrapper, min 2 clips).
|
|
3967
3992
|
Normalizes fps/size and fills silent audio so mismatched clips stitch cleanly.
|
|
@@ -4528,30 +4553,97 @@ if (options.music && options.loras.length > 0) {
|
|
|
4528
4553
|
}
|
|
4529
4554
|
|
|
4530
4555
|
if (options.video && options.loras.length > 0) {
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
{ code: 'INVALID_ARGUMENT' }
|
|
4537
|
-
);
|
|
4538
|
-
}
|
|
4539
|
-
if (!DR34ML4Y_SUPPORTED_MODEL_IDS.has(options.model)) {
|
|
4540
|
-
fatalCliError(
|
|
4541
|
-
`"${DR34ML4Y_LORA_ID}" requires a supported LTX-2.3 I2V model: ` +
|
|
4542
|
-
'ltx23-22b-fp8_i2v, ltx23-22b-fp8_i2v_dev, or 10eros. ' +
|
|
4543
|
-
'The separately trained WAN DR34ML4Y artifact is not installed on Sogni.',
|
|
4544
|
-
{ code: 'INVALID_ARGUMENT' }
|
|
4545
|
-
);
|
|
4556
|
+
if (options.loras.length > 8) {
|
|
4557
|
+
fatalCliError('Video generation supports at most 8 LoRAs per render.', {
|
|
4558
|
+
code: 'INVALID_ARGUMENT',
|
|
4559
|
+
details: { loras: options.loras.length, maximum: 8 }
|
|
4560
|
+
});
|
|
4546
4561
|
}
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4562
|
+
|
|
4563
|
+
if (options.loras.includes(DR34ML4Y_LORA_ID)) {
|
|
4564
|
+
// dr34ml4y is worker-internal: it ships no public catalog row, so it cannot
|
|
4565
|
+
// be checked against the catalog and keeps the hardcoded gate it has always
|
|
4566
|
+
// had. Mixing it with a catalogued adapter is a model conflict either way.
|
|
4567
|
+
const foreignLoras = options.loras.filter(loraId => loraId !== DR34ML4Y_LORA_ID);
|
|
4568
|
+
if (foreignLoras.length > 0) {
|
|
4569
|
+
fatalCliError(
|
|
4570
|
+
`"${DR34ML4Y_LORA_ID}" cannot be stacked with "${foreignLoras[0]}"; ` +
|
|
4571
|
+
'they belong to different model families.',
|
|
4572
|
+
{ code: 'INVALID_ARGUMENT' }
|
|
4573
|
+
);
|
|
4574
|
+
}
|
|
4575
|
+
if (!DR34ML4Y_SUPPORTED_MODEL_IDS.has(options.model)) {
|
|
4576
|
+
fatalCliError(
|
|
4577
|
+
`"${DR34ML4Y_LORA_ID}" requires a supported LTX-2.3 I2V model: ` +
|
|
4578
|
+
'ltx23-22b-fp8_i2v, ltx23-22b-fp8_i2v_dev, or 10eros. ' +
|
|
4579
|
+
'The separately trained WAN DR34ML4Y artifact is not installed on Sogni.',
|
|
4580
|
+
{ code: 'INVALID_ARGUMENT' }
|
|
4581
|
+
);
|
|
4582
|
+
}
|
|
4583
|
+
if (!options.noFilter) {
|
|
4584
|
+
fatalCliError(
|
|
4585
|
+
`"${DR34ML4Y_LORA_ID}" is an opt-in mature-theme LoRA and requires --no-filter.`,
|
|
4586
|
+
{ code: 'INVALID_ARGUMENT' }
|
|
4587
|
+
);
|
|
4588
|
+
}
|
|
4589
|
+
if (options.loraStrengths.length === 0) {
|
|
4590
|
+
options.loraStrengths = options.loras.map(() => DR34ML4Y_DEFAULT_STRENGTH);
|
|
4591
|
+
}
|
|
4592
|
+
} else {
|
|
4593
|
+
// Every publicly catalogued video LoRA — the MiniMax H3 adapters today — is
|
|
4594
|
+
// checked against the live catalog for the RESOLVED model id. Keying on the
|
|
4595
|
+
// catalog rather than a hardcoded list means an adapter published later
|
|
4596
|
+
// works without a CLI release, and a wrong id fails here instead of being
|
|
4597
|
+
// dropped server-side and rendering as if no LoRA had been asked for.
|
|
4598
|
+
let videoLoraCatalog;
|
|
4599
|
+
try {
|
|
4600
|
+
videoLoraCatalog = await fetchLoraCatalog(options.model);
|
|
4601
|
+
} catch (cause) {
|
|
4602
|
+
fatalCliError(
|
|
4603
|
+
`Could not read the LoRA catalog for "${options.model}": ${cause?.message || cause}`,
|
|
4604
|
+
{ code: cause?.code || 'LORA_CATALOG_UNAVAILABLE' }
|
|
4605
|
+
);
|
|
4606
|
+
}
|
|
4607
|
+
const videoLoraEntries = new Map(
|
|
4608
|
+
(videoLoraCatalog?.loras || [])
|
|
4609
|
+
.map(loraCatalogEntryFromPayload)
|
|
4610
|
+
.filter(entry => entry.loraId)
|
|
4611
|
+
.map(entry => [entry.loraId, entry])
|
|
4551
4612
|
);
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4613
|
+
const unknownVideoLoras = options.loras.filter(loraId => !videoLoraEntries.has(loraId));
|
|
4614
|
+
if (unknownVideoLoras.length > 0) {
|
|
4615
|
+
const availableIds = [...videoLoraEntries.keys()];
|
|
4616
|
+
const isUnresolvedH3Alias = /^minimax-h3(-turbo)?$/.test(String(options.model || ''));
|
|
4617
|
+
fatalCliError(
|
|
4618
|
+
`Video LoRA "${unknownVideoLoras[0]}" is not published for model "${options.model}". ` +
|
|
4619
|
+
(availableIds.length > 0
|
|
4620
|
+
? `Available for this model: ${availableIds.join(', ')}.`
|
|
4621
|
+
: isUnresolvedH3Alias
|
|
4622
|
+
? 'Name an explicit H3 mode (for example -m minimax-h3-i2v); LoRA availability differs per mode.'
|
|
4623
|
+
: 'That model loads no LoRAs.') +
|
|
4624
|
+
' Run --list-loras --lora-model <id> for the live catalog.',
|
|
4625
|
+
{ code: 'INVALID_ARGUMENT' }
|
|
4626
|
+
);
|
|
4627
|
+
}
|
|
4628
|
+
const matureVideoLoras = options.loras.filter(loraId => {
|
|
4629
|
+
const entry = videoLoraEntries.get(loraId);
|
|
4630
|
+
return Boolean(entry?.nsfw || entry?.sexual);
|
|
4631
|
+
});
|
|
4632
|
+
if (matureVideoLoras.length > 0 && !options.noFilter) {
|
|
4633
|
+
fatalCliError(
|
|
4634
|
+
`"${matureVideoLoras[0]}" is an opt-in mature-theme LoRA and requires --no-filter.`,
|
|
4635
|
+
{ code: 'INVALID_ARGUMENT' }
|
|
4636
|
+
);
|
|
4637
|
+
}
|
|
4638
|
+
if (options.loraStrengths.length === 0) {
|
|
4639
|
+
// The catalog default, not 1.0: the worker falls back to 1.0 for any LoRA
|
|
4640
|
+
// sent without a strength, which for h3-realism-people is already the top
|
|
4641
|
+
// of its usable band.
|
|
4642
|
+
options.loraStrengths = options.loras.map(loraId => {
|
|
4643
|
+
const entry = videoLoraEntries.get(loraId);
|
|
4644
|
+
return Number.isFinite(entry?.default) ? entry.default : 1;
|
|
4645
|
+
});
|
|
4646
|
+
}
|
|
4555
4647
|
}
|
|
4556
4648
|
}
|
|
4557
4649
|
|
|
@@ -5032,6 +5124,7 @@ const commandUsesGenerationSeed = !options.apiChat &&
|
|
|
5032
5124
|
!options.extractFrameAt &&
|
|
5033
5125
|
!options.verifyVideo &&
|
|
5034
5126
|
!options.concatVideos &&
|
|
5127
|
+
!options.trimVideo &&
|
|
5035
5128
|
!options.sourceReelDir &&
|
|
5036
5129
|
!options.remixAudio &&
|
|
5037
5130
|
!options.upscaleImage &&
|
|
@@ -5073,7 +5166,7 @@ const wan3HasMediaInput = isWan3ModelLocal(options.model) && Boolean(
|
|
|
5073
5166
|
|| options.wan3ReferenceFileUrl
|
|
5074
5167
|
|| options.wan3ReferenceLinkUrl
|
|
5075
5168
|
);
|
|
5076
|
-
if (!options.prompt && !wan3HasMediaInput && !options.upscaleImage && !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.verifyVideo && !options.concatVideos && !options.sourceReelDir && !options.remixAudio && !options.listMedia && !options.memoryAction && !options.personalityAction && !personaUtilityAction) {
|
|
5169
|
+
if (!options.prompt && !wan3HasMediaInput && !options.upscaleImage && !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) {
|
|
5077
5170
|
fatalCliError('No prompt provided. Use --help for usage.', { code: 'INVALID_ARGUMENT' });
|
|
5078
5171
|
}
|
|
5079
5172
|
|
|
@@ -5465,6 +5558,25 @@ if (options.video) {
|
|
|
5465
5558
|
if (options.refImageEnd) {
|
|
5466
5559
|
fatalCliError('MiniMax H3 r2v has no end-frame anchor; use -c/--context for another loose image or minimax-h3-flf2v for first/last frames.', { code: 'INVALID_ARGUMENT' });
|
|
5467
5560
|
}
|
|
5561
|
+
const localVideoReferences = [options.refVideo, ...options.refVideos]
|
|
5562
|
+
.filter((reference) => reference && !isHttpUrl(reference) && existsSync(reference));
|
|
5563
|
+
for (const reference of localVideoReferences) {
|
|
5564
|
+
const frameRate = probeLocalVideoFrameRate(reference);
|
|
5565
|
+
if (!frameRate) {
|
|
5566
|
+
fatalCliError(
|
|
5567
|
+
`MiniMax H3 r2v could not verify the reference-video frame rate for "${reference}". ` +
|
|
5568
|
+
'Install ffprobe or provide a readable 24fps file before generation.',
|
|
5569
|
+
{ code: 'INVALID_ARGUMENT', details: { reference, fps: null } },
|
|
5570
|
+
);
|
|
5571
|
+
}
|
|
5572
|
+
if (Math.abs(frameRate - 24) > 0.001) {
|
|
5573
|
+
fatalCliError(
|
|
5574
|
+
`MiniMax H3 r2v reference video must be exactly 24fps; "${reference}" is ${frameRate.toFixed(3)}fps. ` +
|
|
5575
|
+
'Normalize it to 24fps without changing duration before generation, or choreography and soundtrack timing will drift.',
|
|
5576
|
+
{ code: 'INVALID_ARGUMENT', details: { reference, fps: frameRate } },
|
|
5577
|
+
);
|
|
5578
|
+
}
|
|
5579
|
+
}
|
|
5468
5580
|
} else {
|
|
5469
5581
|
// HappyHorse reference-to-video: 1-9 loose image references via -c/--context.
|
|
5470
5582
|
if (!Array.isArray(options.contextImages) || options.contextImages.length === 0) {
|
|
@@ -9812,6 +9924,29 @@ function parseFrameRate(raw) {
|
|
|
9812
9924
|
return Number.isFinite(v) && v > 0 ? v : null;
|
|
9813
9925
|
}
|
|
9814
9926
|
|
|
9927
|
+
function probeLocalVideoFrameRate(filePath) {
|
|
9928
|
+
const ffprobePath = getEnv('FFPROBE_PATH') || 'ffprobe';
|
|
9929
|
+
sanitizePath(ffprobePath, 'FFPROBE_PATH');
|
|
9930
|
+
try {
|
|
9931
|
+
const stdout = execFileSync(
|
|
9932
|
+
ffprobePath,
|
|
9933
|
+
[
|
|
9934
|
+
'-v', 'error',
|
|
9935
|
+
'-select_streams', 'v:0',
|
|
9936
|
+
'-show_entries', 'stream=avg_frame_rate,r_frame_rate',
|
|
9937
|
+
'-of', 'default=noprint_wrappers=1:nokey=1',
|
|
9938
|
+
filePath,
|
|
9939
|
+
],
|
|
9940
|
+
{ encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] },
|
|
9941
|
+
);
|
|
9942
|
+
for (const candidate of String(stdout || '').trim().split(/\s+/)) {
|
|
9943
|
+
const frameRate = parseFrameRate(candidate);
|
|
9944
|
+
if (frameRate) return frameRate;
|
|
9945
|
+
}
|
|
9946
|
+
} catch {}
|
|
9947
|
+
return null;
|
|
9948
|
+
}
|
|
9949
|
+
|
|
9815
9950
|
// Probe a media file's primary video stream + whether it has any audio.
|
|
9816
9951
|
// Fields are null when the probe fails (e.g. ffprobe missing); callers fall
|
|
9817
9952
|
// back to safe defaults unless they explicitly require verification.
|
|
@@ -9890,6 +10025,45 @@ async function verifyVideoFile(videoPath) {
|
|
|
9890
10025
|
return { ...info, decodable: true };
|
|
9891
10026
|
}
|
|
9892
10027
|
|
|
10028
|
+
async function trimVideoClip(inputPath, startSeconds, durationSeconds, outputPath) {
|
|
10029
|
+
sanitizePath(inputPath, 'trim input video');
|
|
10030
|
+
sanitizePath(outputPath, 'trim output video');
|
|
10031
|
+
const ffmpegPath = await ensureFfmpegAvailable();
|
|
10032
|
+
const result = await runCommand(ffmpegPath, [
|
|
10033
|
+
'-hide_banner',
|
|
10034
|
+
'-loglevel', 'error',
|
|
10035
|
+
'-y',
|
|
10036
|
+
'-i', inputPath,
|
|
10037
|
+
'-ss', String(startSeconds),
|
|
10038
|
+
'-t', String(durationSeconds),
|
|
10039
|
+
'-map', '0:v:0',
|
|
10040
|
+
'-map', '0:a?',
|
|
10041
|
+
'-c:v', 'libx264',
|
|
10042
|
+
'-preset', 'medium',
|
|
10043
|
+
'-crf', '16',
|
|
10044
|
+
'-pix_fmt', 'yuv420p',
|
|
10045
|
+
'-c:a', 'aac',
|
|
10046
|
+
'-b:a', '192k',
|
|
10047
|
+
'-movflags', '+faststart',
|
|
10048
|
+
outputPath
|
|
10049
|
+
], { captureOutput: true });
|
|
10050
|
+
if (result.error || result.status !== 0 || !isNonEmptyFile(outputPath)) {
|
|
10051
|
+
const err = new Error('Failed to trim video clip.');
|
|
10052
|
+
err.code = 'FFMPEG_TRIM_VIDEO_FAILED';
|
|
10053
|
+
err.details = {
|
|
10054
|
+
inputPath,
|
|
10055
|
+
outputPath,
|
|
10056
|
+
startSeconds,
|
|
10057
|
+
durationSeconds,
|
|
10058
|
+
stderr: result.stderr || '',
|
|
10059
|
+
stdout: result.stdout || '',
|
|
10060
|
+
status: result.status
|
|
10061
|
+
};
|
|
10062
|
+
throw err;
|
|
10063
|
+
}
|
|
10064
|
+
return verifyVideoFile(outputPath);
|
|
10065
|
+
}
|
|
10066
|
+
|
|
9893
10067
|
// Concatenate clips using the concat *filter* (not the concat demuxer). The
|
|
9894
10068
|
// demuxer corrupts timestamps when clips differ in fps/timebase and desyncs
|
|
9895
10069
|
// audio when a clip has no audio track. Here we probe each clip, normalize every
|
|
@@ -9915,6 +10089,13 @@ async function buildConcatVideoFromClips(outputPath, clips, { audioPath = null,
|
|
|
9915
10089
|
: (fpsList.length ? Math.max(...fpsList) : 24);
|
|
9916
10090
|
fps = Math.max(1, Math.round(fps));
|
|
9917
10091
|
const totalDuration = infos.reduce((sum, x) => sum + (x.duration || 0), 0);
|
|
10092
|
+
if (audioPath && !(totalDuration > 0)) {
|
|
10093
|
+
const err = new Error('Cannot replace concatenated audio without readable clip durations.');
|
|
10094
|
+
err.code = 'FFPROBE_VERIFY_FAILED';
|
|
10095
|
+
err.hint = 'Install ffprobe, confirm every clip is playable, and retry.';
|
|
10096
|
+
err.details = { clips, audioPath };
|
|
10097
|
+
throw err;
|
|
10098
|
+
}
|
|
9918
10099
|
|
|
9919
10100
|
const filterParts = [];
|
|
9920
10101
|
const concatInputs = [];
|
|
@@ -9923,15 +10104,21 @@ async function buildConcatVideoFromClips(outputPath, clips, { audioPath = null,
|
|
|
9923
10104
|
`[${idx}:v]fps=${fps},scale=${targetW}:${targetH}:force_original_aspect_ratio=decrease,` +
|
|
9924
10105
|
`pad=${targetW}:${targetH}:(ow-iw)/2:(oh-ih)/2,setsar=1,format=yuv420p[v${idx}]`
|
|
9925
10106
|
);
|
|
9926
|
-
if (
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
10107
|
+
if (!audioPath) {
|
|
10108
|
+
if (info.hasAudio) {
|
|
10109
|
+
filterParts.push(`[${idx}:a]aresample=async=1:first_pts=0,aformat=sample_rates=44100:channel_layouts=stereo[a${idx}]`);
|
|
10110
|
+
} else {
|
|
10111
|
+
const dur = info.duration && info.duration > 0 ? info.duration : (1 / fps);
|
|
10112
|
+
filterParts.push(`anullsrc=channel_layout=stereo:sample_rate=44100,atrim=duration=${dur.toFixed(6)},asetpts=PTS-STARTPTS[a${idx}]`);
|
|
10113
|
+
}
|
|
9931
10114
|
}
|
|
9932
|
-
concatInputs.push(`[v${idx}][a${idx}]`);
|
|
10115
|
+
concatInputs.push(audioPath ? `[v${idx}]` : `[v${idx}][a${idx}]`);
|
|
9933
10116
|
});
|
|
9934
|
-
filterParts.push(
|
|
10117
|
+
filterParts.push(
|
|
10118
|
+
audioPath
|
|
10119
|
+
? `${concatInputs.join('')}concat=n=${infos.length}:v=1:a=0[cv]`
|
|
10120
|
+
: `${concatInputs.join('')}concat=n=${infos.length}:v=1:a=1[cv][ca]`
|
|
10121
|
+
);
|
|
9935
10122
|
|
|
9936
10123
|
const args = ['-y'];
|
|
9937
10124
|
clips.forEach((clip) => { args.push('-i', clip); });
|
|
@@ -11611,6 +11798,39 @@ async function main() {
|
|
|
11611
11798
|
return;
|
|
11612
11799
|
}
|
|
11613
11800
|
|
|
11801
|
+
if (options.trimVideo) {
|
|
11802
|
+
const inputPath = sanitizePath(options.trimVideo, '--trim-video input');
|
|
11803
|
+
const outputPath = sanitizePath(options.trimVideoOutput, '--trim-video output');
|
|
11804
|
+
if (!existsSync(inputPath)) {
|
|
11805
|
+
const err = new Error(`Video file not found: ${inputPath}`);
|
|
11806
|
+
err.code = 'FILE_NOT_FOUND';
|
|
11807
|
+
throw err;
|
|
11808
|
+
}
|
|
11809
|
+
const verification = await trimVideoClip(
|
|
11810
|
+
inputPath,
|
|
11811
|
+
options.trimVideoStart,
|
|
11812
|
+
options.trimVideoDuration,
|
|
11813
|
+
outputPath
|
|
11814
|
+
);
|
|
11815
|
+
if (options.json || JSON_ERROR_MODE) {
|
|
11816
|
+
console.log(JSON.stringify({
|
|
11817
|
+
success: true,
|
|
11818
|
+
type: 'trim-video',
|
|
11819
|
+
inputPath,
|
|
11820
|
+
outputPath,
|
|
11821
|
+
start: options.trimVideoStart,
|
|
11822
|
+
duration: options.trimVideoDuration,
|
|
11823
|
+
...verification,
|
|
11824
|
+
timestamp: new Date().toISOString()
|
|
11825
|
+
}));
|
|
11826
|
+
} else {
|
|
11827
|
+
console.log(
|
|
11828
|
+
`Trimmed ${options.trimVideoDuration}s from ${options.trimVideoStart}s to: ${outputPath}`
|
|
11829
|
+
);
|
|
11830
|
+
}
|
|
11831
|
+
return;
|
|
11832
|
+
}
|
|
11833
|
+
|
|
11614
11834
|
if (options.verifyVideo) {
|
|
11615
11835
|
const videoPath = sanitizePath(options.verifyVideo, '--verify-video input');
|
|
11616
11836
|
if (!existsSync(videoPath)) {
|
|
@@ -12221,6 +12441,33 @@ async function main() {
|
|
|
12221
12441
|
const additionalVideoBuffers = isMiniMaxH3R2v
|
|
12222
12442
|
? await Promise.all(options.refVideos.map((reference) => fetchMediaBuffer(reference)))
|
|
12223
12443
|
: [];
|
|
12444
|
+
const miniMaxH3ReferenceVideoDurations = isMiniMaxH3R2v
|
|
12445
|
+
? await Promise.all(
|
|
12446
|
+
[
|
|
12447
|
+
...(videoBuffer ? [{ buffer: videoBuffer, source: options.refVideo }] : []),
|
|
12448
|
+
...additionalVideoBuffers.map((buffer, index) => ({
|
|
12449
|
+
buffer,
|
|
12450
|
+
source: options.refVideos[index]
|
|
12451
|
+
}))
|
|
12452
|
+
].map(async ({ buffer, source }, index) => {
|
|
12453
|
+
const duration = await probeLocalMediaDurationSeconds(source)
|
|
12454
|
+
?? await probeMediaBufferDurationSeconds(
|
|
12455
|
+
buffer,
|
|
12456
|
+
mediaFilenameFromSource(source, `h3-reference-video-${index + 1}.mp4`)
|
|
12457
|
+
);
|
|
12458
|
+
if (!Number.isFinite(duration) || duration < 2 || duration > 15) {
|
|
12459
|
+
fatalCliError(
|
|
12460
|
+
`MiniMax H3 reference video ${index + 1} must be between 2 and 15 seconds.`,
|
|
12461
|
+
{
|
|
12462
|
+
code: 'INVALID_ARGUMENT',
|
|
12463
|
+
details: { source, duration: duration ?? null }
|
|
12464
|
+
}
|
|
12465
|
+
);
|
|
12466
|
+
}
|
|
12467
|
+
return duration;
|
|
12468
|
+
})
|
|
12469
|
+
)
|
|
12470
|
+
: [];
|
|
12224
12471
|
let pretrimmedMiniMaxH3ReferenceAudio = false;
|
|
12225
12472
|
if (audioBuffer) {
|
|
12226
12473
|
audioBuffer = await prepareReferenceAudioForVideoBuffer(audioBuffer, options.refAudio);
|
|
@@ -12485,6 +12732,9 @@ async function main() {
|
|
|
12485
12732
|
if (additionalVideoBuffers.length > 0) {
|
|
12486
12733
|
projectConfig.referenceVideos = additionalVideoBuffers;
|
|
12487
12734
|
}
|
|
12735
|
+
if (miniMaxH3ReferenceVideoDurations.length > 0) {
|
|
12736
|
+
projectConfig.referenceVideoDurations = miniMaxH3ReferenceVideoDurations;
|
|
12737
|
+
}
|
|
12488
12738
|
if (seedanceReferenceImageUrls.length > 0) {
|
|
12489
12739
|
projectConfig.referenceImageUrls = seedanceReferenceImageUrls;
|
|
12490
12740
|
}
|
package/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '3.
|
|
1
|
+
export const PACKAGE_VERSION = '3.36.0';
|