@sogni-ai/sogni-creative-agent-skill 3.8.0 → 3.9.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/SKILL.md +2 -1
- package/llm.txt +1 -1
- package/package.json +1 -1
- package/references/video-editing.md +19 -7
- package/sogni-agent.mjs +284 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [3.9.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.8.0...v3.9.0) (2026-06-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* wire ltx23 lora video controls ([968aa9a](https://github.com/Sogni-AI/sogni-creative-agent-skill/commit/968aa9aca2bf5cfc30d7f73b513f4ff0afb9cf94))
|
|
7
|
+
|
|
1
8
|
# [3.7.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.6.4...v3.7.0) (2026-06-25)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -14,6 +21,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
14
21
|
|
|
15
22
|
## [Unreleased]
|
|
16
23
|
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **LTX-2.3 LoRA controls are now wired through the public CLI.** Direct `sogni-agent` video generation now
|
|
27
|
+
supports `--control-type outpaint` with `--outpaint-position` / `--outpaint-aspect-ratio`,
|
|
28
|
+
`--control-type inpaint --mask <image>`, and automatic `transition` LoRA attachment for LTX-2.3 i2v jobs
|
|
29
|
+
that provide both `--ref` and `--ref-end`.
|
|
30
|
+
|
|
17
31
|
## [3.8.0] - 2026-06-30
|
|
18
32
|
|
|
19
33
|
### Changed
|
package/README.md
CHANGED
|
@@ -504,7 +504,7 @@ Music generation uses `--music` and outputs `mp3` by default. `--audio` remains
|
|
|
504
504
|
|
|
505
505
|
V2V defaults mirror Sogni Chat workflow tuning: `canny`, `pose`, and `depth` use ControlNet strength `0.85` with detailer assist; `detailer` uses strength `1.0`. Use `-m seedance2-v2v` for Seedance V2V without ControlNet. Seedance accepts public HTTPS image, video, and audio references that pass CLI URL safety checks; localhost and private-network URLs are rejected before forwarding. Audio references must be paired with an image or video reference.
|
|
506
506
|
|
|
507
|
-
The LTX-2.3 v2v model `ltx23-22b-fp8_v2v_distilled` also supports two extra control modes: **`outpaint`** extends/expands the video canvas (e.g. make a vertical clip widescreen, or add space in a direction) — it is positional and mask-free, anchored with a position (`center|top|bottom|left|right`) and an optional target aspect ratio (`16:9|9:16|1:1|4:3|3:4|21:9`), and the canvas only grows, never crops; **`inpaint`** regenerates a masked region of the source video and **requires a mask image** (white pixels = region to regenerate). The hosted `video_to_video` tool selects these with `controlMode` `outpaint`/`inpaint
|
|
507
|
+
The LTX-2.3 v2v model `ltx23-22b-fp8_v2v_distilled` also supports two extra control modes: **`outpaint`** extends/expands the video canvas (e.g. make a vertical clip widescreen, or add space in a direction) — it is positional and mask-free, anchored with a position (`center|top|bottom|left|right`) and an optional target aspect ratio (`16:9|9:16|1:1|4:3|3:4|21:9`), and the canvas only grows, never crops; **`inpaint`** regenerates a masked region of the source video and **requires a mask image** (white pixels = region to regenerate) in direct CLI/SDK mode. The hosted `video_to_video` tool selects these with `controlMode` `outpaint`/`inpaint` and can derive an inpaint mask when the user did not upload one. The direct CLI and sogni-client SDK example expose them via `--control-type` / `control-type` (`canny|pose|depth|detailer|outpaint|inpaint`), with `--outpaint-position` for outpaint and `--mask` for inpaint. See `references/video-editing.md` for details.
|
|
508
508
|
|
|
509
509
|
---
|
|
510
510
|
|
package/SKILL.md
CHANGED
|
@@ -184,7 +184,8 @@ sogni-agent doctor --json
|
|
|
184
184
|
| `-n <num>` | Output count (`{a\|b\|c}` prompt variations cycle); capped at 16, raise with `SOGNI_MAX_COUNT` | 1 |
|
|
185
185
|
| `--video`, `--music` | Generate video / music instead of image | - |
|
|
186
186
|
| `--workflow <t>` | Force `t2v\|i2v\|s2v\|ia2v\|a2v\|v2v\|animate-move\|animate-replace` | inferred |
|
|
187
|
-
| `--ref`, `--ref-end`, `--ref-audio`, `--ref-video` | Start frame / end frame / audio / video references | - |
|
|
187
|
+
| `--ref`, `--ref-end`, `--ref-audio`, `--ref-video`, `--mask` | Start frame / end frame / audio / video / inpaint mask references | - |
|
|
188
|
+
| `--control-type`, `--outpaint-position`, `--outpaint-aspect-ratio` | LTX-2.3 v2v control mode and outpaint canvas controls | - |
|
|
188
189
|
| `--duration <sec>` | Video or music length | video 5, music 30 |
|
|
189
190
|
| `--target-resolution <px>` | Short-side target preserving aspect ratio (use `2160` for Seedance 4K) | - |
|
|
190
191
|
| `--photobooth` | Face transfer mode (with `--ref`) | - |
|
package/llm.txt
CHANGED
|
@@ -87,7 +87,7 @@ You can also export `SOGNI_API_KEY` instead of writing the file. Confirm with
|
|
|
87
87
|
`--thinking` / `--no-thinking`, `--list-replays [n]`, `--get-replay <id>`,
|
|
88
88
|
`--ingest-replay <json|@path>`.
|
|
89
89
|
- Media references from `-c`, `--ref`, `--ref-end`, `--ref-audio`,
|
|
90
|
-
`--reference-audio-identity`,
|
|
90
|
+
`--reference-audio-identity`, `--ref-video`, and `--mask` are uploaded and forwarded as
|
|
91
91
|
`media_references`; API chat also attaches image refs as vision inputs.
|
|
92
92
|
Workflow JSON can bind refs with `sourceStepId: "$input_media"`.
|
|
93
93
|
- Cost policy: `--workflow-max-cost`, `--confirm-cost`, `--no-confirm-cost`.
|
package/package.json
CHANGED
|
@@ -199,13 +199,25 @@ beyond `canny`/`pose`/`depth`/`detailer`:
|
|
|
199
199
|
These modes run as Sogni Projects on the v2v surface. In the hosted
|
|
200
200
|
`video_to_video` tool the control mode is selected with `controlMode` set to
|
|
201
201
|
`outpaint` or `inpaint` (with `outpaintPosition` / optional
|
|
202
|
-
`outpaintAspectRatio` for outpaint, or `maskImageIndex` for inpaint).
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
(
|
|
206
|
-
(
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
`outpaintAspectRatio` for outpaint, or `maskImageIndex` for inpaint). Hosted
|
|
203
|
+
execution can derive an inpaint mask if the user did not upload one. The direct
|
|
204
|
+
CLI and underlying sogni-client SDK example expose them as `--control-type` /
|
|
205
|
+
`control-type` (`canny|pose|depth|detailer|outpaint|inpaint`), with `--mask`
|
|
206
|
+
for direct inpaint (white = region to regenerate), `--outpaint-position`
|
|
207
|
+
(`center|top|bottom|left|right`), and optional `--outpaint-aspect-ratio`
|
|
208
|
+
(`16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `21:9`) for direct outpaint. These
|
|
209
|
+
extension/inpaint controls are video-only.
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
sogni-agent -q --video --workflow v2v -m ltx23 \
|
|
213
|
+
--ref-video ./source.mp4 --control-type outpaint \
|
|
214
|
+
--outpaint-position center --outpaint-aspect-ratio 16:9 \
|
|
215
|
+
-o ./outpainted.mp4 "Extend the surrounding scene naturally"
|
|
216
|
+
|
|
217
|
+
sogni-agent -q --video --workflow v2v -m ltx23 \
|
|
218
|
+
--ref-video ./source.mp4 --control-type inpaint --mask ./mask.png \
|
|
219
|
+
-o ./inpainted.mp4 "Replace the masked region with clean matching detail"
|
|
220
|
+
```
|
|
209
221
|
|
|
210
222
|
## Music-to-Video Pipeline
|
|
211
223
|
|
package/sogni-agent.mjs
CHANGED
|
@@ -1555,6 +1555,14 @@ const MULTI_ANGLE_DISTANCE_ALIASES = new Map([
|
|
|
1555
1555
|
['wide shot', 'wide']
|
|
1556
1556
|
]);
|
|
1557
1557
|
|
|
1558
|
+
const VIDEO_CONTROLNET_NAMES = ['canny', 'pose', 'depth', 'detailer', 'outpaint', 'inpaint'];
|
|
1559
|
+
const VIDEO_CONTROLNET_NAME_SET = new Set(VIDEO_CONTROLNET_NAMES);
|
|
1560
|
+
const OUTPAINT_POSITIONS = ['center', 'top', 'bottom', 'left', 'right'];
|
|
1561
|
+
const OUTPAINT_POSITION_SET = new Set(OUTPAINT_POSITIONS);
|
|
1562
|
+
const LTX_TRANSITION_LORA_ID = 'transition';
|
|
1563
|
+
const LTX_TRANSITION_TRIGGER = 'zhuanchang';
|
|
1564
|
+
const LTX_TRANSITION_DEFAULT_STRENGTH = 1.0;
|
|
1565
|
+
|
|
1558
1566
|
function normalizeMultiAngleValue(value, aliases, allowedKeys, label) {
|
|
1559
1567
|
if (!value) return null;
|
|
1560
1568
|
const normalized = value.toLowerCase().replace(/_/g, '-').replace(/\s+/g, ' ').trim();
|
|
@@ -1577,6 +1585,123 @@ function buildMultiAnglePrompt({ azimuth, elevation, distance, description }) {
|
|
|
1577
1585
|
return parts.join(' ');
|
|
1578
1586
|
}
|
|
1579
1587
|
|
|
1588
|
+
function normalizeVideoControlNetName(value) {
|
|
1589
|
+
if (!value) return null;
|
|
1590
|
+
const normalized = String(value).trim().toLowerCase().replace(/_/g, '-');
|
|
1591
|
+
return normalized || null;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
function normalizeOutpaintPositionValue(value) {
|
|
1595
|
+
if (!value) return null;
|
|
1596
|
+
const normalized = String(value).trim().toLowerCase().replace(/_/g, '-');
|
|
1597
|
+
return OUTPAINT_POSITION_SET.has(normalized) ? normalized : null;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
function parseOutpaintAspectRatio(value) {
|
|
1601
|
+
if (!value) return null;
|
|
1602
|
+
const match = String(value).trim().match(/^(\d+(?:\.\d+)?)\s*[:x/]\s*(\d+(?:\.\d+)?)$/i);
|
|
1603
|
+
if (!match) return null;
|
|
1604
|
+
const width = Number(match[1]);
|
|
1605
|
+
const height = Number(match[2]);
|
|
1606
|
+
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) return null;
|
|
1607
|
+
return width / height;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
function isLtx23V2VModelId(modelId) {
|
|
1611
|
+
return !!modelId && modelId.includes('ltx23') && /_v2v(_|$)/.test(modelId);
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
function isLtxI2vTransitionModelId(modelId) {
|
|
1615
|
+
return !!modelId && modelId.includes('ltx') && /_i2v(_|$)/.test(modelId);
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
function applyLtxTransitionLora(projectConfig, modelId, hasStartFrame, hasEndFrame) {
|
|
1619
|
+
if (!hasStartFrame || !hasEndFrame || !isLtxI2vTransitionModelId(modelId)) {
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
const loras = Array.isArray(projectConfig.loras) ? [...projectConfig.loras] : [];
|
|
1623
|
+
const loraStrengths = Array.isArray(projectConfig.loraStrengths) ? [...projectConfig.loraStrengths] : [];
|
|
1624
|
+
if (!loras.includes(LTX_TRANSITION_LORA_ID)) {
|
|
1625
|
+
loras.push(LTX_TRANSITION_LORA_ID);
|
|
1626
|
+
loraStrengths.push(LTX_TRANSITION_DEFAULT_STRENGTH);
|
|
1627
|
+
}
|
|
1628
|
+
projectConfig.loras = loras;
|
|
1629
|
+
projectConfig.loraStrengths = loraStrengths;
|
|
1630
|
+
const prompt = String(projectConfig.positivePrompt || '');
|
|
1631
|
+
if (!new RegExp(`\\b${LTX_TRANSITION_TRIGGER}\\b`, 'i').test(prompt)) {
|
|
1632
|
+
projectConfig.positivePrompt = prompt ? `${prompt}, ${LTX_TRANSITION_TRIGGER}` : LTX_TRANSITION_TRIGGER;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
function computeOutpaintCanvas(sourceWidth, sourceHeight, aspectRatioArg, position, rules = DEFAULT_VIDEO_DIMENSION_RULES) {
|
|
1637
|
+
const step = rules.dimensionMultiple || DEFAULT_VIDEO_DIMENSION_RULES.dimensionMultiple;
|
|
1638
|
+
const minD = rules.minDimension || DEFAULT_VIDEO_DIMENSION_RULES.minDimension;
|
|
1639
|
+
const maxD = rules.maxDimension || DEFAULT_VIDEO_DIMENSION_RULES.maxDimension;
|
|
1640
|
+
let srcW = Number.isFinite(sourceWidth) && sourceWidth > 0 ? sourceWidth : 1920;
|
|
1641
|
+
let srcH = Number.isFinite(sourceHeight) && sourceHeight > 0 ? sourceHeight : 1088;
|
|
1642
|
+
if (srcW > maxD || srcH > maxD) {
|
|
1643
|
+
const scale = Math.min(maxD / srcW, maxD / srcH);
|
|
1644
|
+
srcW *= scale;
|
|
1645
|
+
srcH *= scale;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
let targetW = srcW;
|
|
1649
|
+
let targetH = srcH;
|
|
1650
|
+
const parsedAspect = parseOutpaintAspectRatio(aspectRatioArg);
|
|
1651
|
+
if (parsedAspect) {
|
|
1652
|
+
const srcAspect = srcW / srcH;
|
|
1653
|
+
if (parsedAspect > srcAspect) targetW = srcH * parsedAspect;
|
|
1654
|
+
else if (parsedAspect < srcAspect) targetH = srcW / parsedAspect;
|
|
1655
|
+
} else {
|
|
1656
|
+
const factor = 1.5;
|
|
1657
|
+
if (position === 'left' || position === 'right') targetW = srcW * factor;
|
|
1658
|
+
else if (position === 'top' || position === 'bottom') targetH = srcH * factor;
|
|
1659
|
+
else {
|
|
1660
|
+
targetW = srcW * factor;
|
|
1661
|
+
targetH = srcH * factor;
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
const snapUp = (value) => Math.ceil(value / step) * step;
|
|
1666
|
+
let width = Math.min(maxD, Math.max(minD, snapUp(targetW)));
|
|
1667
|
+
let height = Math.min(maxD, Math.max(minD, snapUp(targetH)));
|
|
1668
|
+
width = Math.max(width, Math.min(maxD, snapUp(srcW)));
|
|
1669
|
+
height = Math.max(height, Math.min(maxD, snapUp(srcH)));
|
|
1670
|
+
return { width, height };
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
function computeSourceAspectCanvas(sourceWidth, sourceHeight, rules = DEFAULT_VIDEO_DIMENSION_RULES, targetResolution = null) {
|
|
1674
|
+
const step = rules.dimensionMultiple || DEFAULT_VIDEO_DIMENSION_RULES.dimensionMultiple;
|
|
1675
|
+
const minD = rules.minDimension || DEFAULT_VIDEO_DIMENSION_RULES.minDimension;
|
|
1676
|
+
const maxD = rules.maxDimension || DEFAULT_VIDEO_DIMENSION_RULES.maxDimension;
|
|
1677
|
+
let width = Number.isFinite(sourceWidth) && sourceWidth > 0 ? sourceWidth : 1920;
|
|
1678
|
+
let height = Number.isFinite(sourceHeight) && sourceHeight > 0 ? sourceHeight : 1088;
|
|
1679
|
+
if (Number.isFinite(targetResolution) && targetResolution > 0) {
|
|
1680
|
+
const roundedTarget = Math.max(minD, Math.round(targetResolution / step) * step);
|
|
1681
|
+
if (width <= height) {
|
|
1682
|
+
height = Math.round((height * roundedTarget) / width / step) * step;
|
|
1683
|
+
width = roundedTarget;
|
|
1684
|
+
} else {
|
|
1685
|
+
width = Math.round((width * roundedTarget) / height / step) * step;
|
|
1686
|
+
height = roundedTarget;
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
if (width > maxD || height > maxD) {
|
|
1690
|
+
const scale = Math.min(maxD / width, maxD / height);
|
|
1691
|
+
width *= scale;
|
|
1692
|
+
height *= scale;
|
|
1693
|
+
}
|
|
1694
|
+
if (width < minD || height < minD) {
|
|
1695
|
+
const scale = Math.max(minD / width, minD / height);
|
|
1696
|
+
width *= scale;
|
|
1697
|
+
height *= scale;
|
|
1698
|
+
}
|
|
1699
|
+
return {
|
|
1700
|
+
width: Math.max(minD, Math.min(maxD, Math.round(width / step) * step)),
|
|
1701
|
+
height: Math.max(minD, Math.min(maxD, Math.round(height / step) * step))
|
|
1702
|
+
};
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1580
1705
|
function loadOpenClawPluginConfig() {
|
|
1581
1706
|
const openclawPluginConfig = getEnv('OPENCLAW_PLUGIN_CONFIG');
|
|
1582
1707
|
if (openclawPluginConfig) {
|
|
@@ -1682,6 +1807,9 @@ const options = {
|
|
|
1682
1807
|
refVideo: null, // Reference video for animate workflows (primary)
|
|
1683
1808
|
refVideos: [], // Additional Seedance loose video refs; first --ref-video fills refVideo, subsequent calls append here
|
|
1684
1809
|
videoStart: null, // Optional start offset into reference video
|
|
1810
|
+
refMask: null, // Inpaint mask image for LTX-2.3 v2v inpaint
|
|
1811
|
+
outpaintPosition: null, // LTX-2.3 v2v outpaint canvas anchor
|
|
1812
|
+
outpaintAspectRatio: null, // Optional target aspect ratio for outpaint canvas growth
|
|
1685
1813
|
contextImages: [], // Context images for image editing
|
|
1686
1814
|
looping: false, // Create looping video (i2v only): generate A→B then B→A and concatenate
|
|
1687
1815
|
photobooth: false, // Photobooth mode (InstantID face transfer)
|
|
@@ -1826,6 +1954,9 @@ const cliSet = {
|
|
|
1826
1954
|
refVideo: false,
|
|
1827
1955
|
refVideos: false,
|
|
1828
1956
|
videoStart: false,
|
|
1957
|
+
refMask: false,
|
|
1958
|
+
outpaintPosition: false,
|
|
1959
|
+
outpaintAspectRatio: false,
|
|
1829
1960
|
context: false,
|
|
1830
1961
|
looping: false,
|
|
1831
1962
|
photobooth: false,
|
|
@@ -2182,16 +2313,31 @@ for (let i = 0; i < args.length; i++) {
|
|
|
2182
2313
|
i++;
|
|
2183
2314
|
options.cnGuidanceEnd = parseNumberValue(raw, arg);
|
|
2184
2315
|
cliSet.cnGuidanceEnd = true;
|
|
2185
|
-
} else if (arg === '--controlnet-name') {
|
|
2316
|
+
} else if (arg === '--controlnet-name' || arg === '--control-type') {
|
|
2186
2317
|
const raw = requireFlagValue(args, i, arg);
|
|
2187
2318
|
i++;
|
|
2188
|
-
options.videoControlNetName = raw;
|
|
2319
|
+
options.videoControlNetName = normalizeVideoControlNetName(raw);
|
|
2189
2320
|
cliSet.videoControlNetName = true;
|
|
2190
2321
|
} else if (arg === '--controlnet-strength') {
|
|
2191
2322
|
const raw = requireFlagValue(args, i, arg);
|
|
2192
2323
|
i++;
|
|
2193
2324
|
options.videoControlNetStrength = parseNumberValue(raw, arg);
|
|
2194
2325
|
cliSet.videoControlNetStrength = true;
|
|
2326
|
+
} else if (arg === '--mask' || arg === '--ref-mask' || arg === '--reference-mask') {
|
|
2327
|
+
const raw = expandHomePath(requireFlagValue(args, i, arg));
|
|
2328
|
+
i++;
|
|
2329
|
+
options.refMask = raw;
|
|
2330
|
+
cliSet.refMask = true;
|
|
2331
|
+
} else if (arg === '--outpaint-position') {
|
|
2332
|
+
const raw = requireFlagValue(args, i, arg);
|
|
2333
|
+
i++;
|
|
2334
|
+
options.outpaintPosition = raw;
|
|
2335
|
+
cliSet.outpaintPosition = true;
|
|
2336
|
+
} else if (arg === '--outpaint-aspect-ratio' || arg === '--outpaint-ratio') {
|
|
2337
|
+
const raw = requireFlagValue(args, i, arg);
|
|
2338
|
+
i++;
|
|
2339
|
+
options.outpaintAspectRatio = raw;
|
|
2340
|
+
cliSet.outpaintAspectRatio = true;
|
|
2195
2341
|
} else if (arg === '--sam2-coordinates') {
|
|
2196
2342
|
const raw = requireFlagValue(args, i, arg);
|
|
2197
2343
|
i++;
|
|
@@ -2706,8 +2852,12 @@ Seedance Reference Modes (mutually exclusive on seedance2 / seedance2-mini / see
|
|
|
2706
2852
|
All three modalities pull caps from the canonical
|
|
2707
2853
|
@sogni-ai/sogni-protocol seedance-reference-limits catalog.
|
|
2708
2854
|
--video-start <sec> Start offset into --ref-video for segmented V2V/animate
|
|
2709
|
-
--controlnet-name <n> ControlNet type for v2v: canny|pose|depth|detailer
|
|
2855
|
+
--controlnet-name <n> ControlNet type for v2v: canny|pose|depth|detailer|outpaint|inpaint
|
|
2856
|
+
--control-type <n> Alias for --controlnet-name
|
|
2710
2857
|
--controlnet-strength <n> ControlNet strength for v2v (0.0-1.0, default: 0.8)
|
|
2858
|
+
--mask <path|url> Inpaint mask image for LTX-2.3 v2v inpaint (white = regenerate)
|
|
2859
|
+
--outpaint-position <p> LTX-2.3 outpaint anchor: center|top|bottom|left|right
|
|
2860
|
+
--outpaint-aspect-ratio <r> LTX-2.3 outpaint target ratio, e.g. 16:9 or 9:16
|
|
2711
2861
|
--sam2-coordinates <coords> SAM2 click coords for animate-replace (x,y or x1,y1;x2,y2)
|
|
2712
2862
|
--trim-end-frame Trim last frame for seamless video stitching
|
|
2713
2863
|
--first-frame-strength <n> Keyframe strength for start frame (0.0-1.0)
|
|
@@ -3583,8 +3733,8 @@ if (options.apiChat && !options.prompt && getApiModeMediaReferences().length ===
|
|
|
3583
3733
|
fatalCliError('--api-chat requires a prompt or media reference for planning.', { code: 'INVALID_ARGUMENT' });
|
|
3584
3734
|
}
|
|
3585
3735
|
|
|
3586
|
-
if (!options.video && !options.apiChat && !options.apiWorkflowAction && (options.refAudio || options.refVideo || options.referenceAudioIdentity || options.voicePersonaName || options.videoWorkflow || options.frames || options.targetResolution || options.audioStart !== null || options.audioDuration !== null || options.videoStart !== null)) {
|
|
3587
|
-
fatalCliError('Video-only options (--workflow/--frames/--target-resolution/--ref-audio/--ref-video/--reference-audio-identity/--voice-persona) require --video.', {
|
|
3736
|
+
if (!options.video && !options.apiChat && !options.apiWorkflowAction && (options.refAudio || options.refVideo || options.refMask || options.referenceAudioIdentity || options.voicePersonaName || options.videoWorkflow || options.frames || options.targetResolution || options.audioStart !== null || options.audioDuration !== null || options.videoStart !== null || options.outpaintPosition || options.outpaintAspectRatio)) {
|
|
3737
|
+
fatalCliError('Video-only options (--workflow/--frames/--target-resolution/--ref-audio/--ref-video/--mask/--outpaint-position/--reference-audio-identity/--voice-persona) require --video.', {
|
|
3588
3738
|
code: 'INVALID_ARGUMENT'
|
|
3589
3739
|
});
|
|
3590
3740
|
}
|
|
@@ -3689,7 +3839,7 @@ if (options.video) {
|
|
|
3689
3839
|
fatalCliError('v2v requires --ref-video.', { code: 'INVALID_ARGUMENT' });
|
|
3690
3840
|
}
|
|
3691
3841
|
if (!options.videoControlNetName && !isSeedanceModel(options.model)) {
|
|
3692
|
-
fatalCliError(
|
|
3842
|
+
fatalCliError(`v2v requires --controlnet-name/--control-type (${VIDEO_CONTROLNET_NAMES.join('|')}).`, { code: 'INVALID_ARGUMENT' });
|
|
3693
3843
|
}
|
|
3694
3844
|
if (!isSeedanceVideo && options.refAudio) {
|
|
3695
3845
|
fatalCliError('v2v does not accept reference audio.', { code: 'INVALID_ARGUMENT' });
|
|
@@ -3766,11 +3916,61 @@ if (options.video) {
|
|
|
3766
3916
|
|
|
3767
3917
|
// Validate controlnet-name values
|
|
3768
3918
|
if (options.videoControlNetName) {
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
fatalCliError(`Unknown --controlnet-name "${options.videoControlNetName}". Use: ${validControlNets.join('|')}`, {
|
|
3919
|
+
if (!VIDEO_CONTROLNET_NAME_SET.has(options.videoControlNetName)) {
|
|
3920
|
+
fatalCliError(`Unknown --controlnet-name "${options.videoControlNetName}". Use: ${VIDEO_CONTROLNET_NAMES.join('|')}`, {
|
|
3772
3921
|
code: 'INVALID_ARGUMENT',
|
|
3773
|
-
details: { flag: '--controlnet-name', value: options.videoControlNetName, allowed:
|
|
3922
|
+
details: { flag: '--controlnet-name', value: options.videoControlNetName, allowed: VIDEO_CONTROLNET_NAMES }
|
|
3923
|
+
});
|
|
3924
|
+
}
|
|
3925
|
+
if ((options.videoControlNetName === 'outpaint' || options.videoControlNetName === 'inpaint') && !isLtx23V2VModelId(options.model)) {
|
|
3926
|
+
fatalCliError(`${options.videoControlNetName} control requires the LTX-2.3 v2v model.`, {
|
|
3927
|
+
code: 'INVALID_ARGUMENT',
|
|
3928
|
+
details: { controlNetName: options.videoControlNetName, model: options.model },
|
|
3929
|
+
hint: 'Use --workflow v2v -m ltx23 --control-type ' + options.videoControlNetName
|
|
3930
|
+
});
|
|
3931
|
+
}
|
|
3932
|
+
if (options.videoControlNetName === 'inpaint' && !options.refMask) {
|
|
3933
|
+
fatalCliError('LTX-2.3 v2v inpaint requires --mask <image> (white pixels = region to regenerate).', {
|
|
3934
|
+
code: 'INVALID_ARGUMENT'
|
|
3935
|
+
});
|
|
3936
|
+
}
|
|
3937
|
+
if (options.videoControlNetName === 'outpaint' && !options.outpaintPosition) {
|
|
3938
|
+
options.outpaintPosition = 'center';
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3942
|
+
if (options.refMask && options.videoControlNetName !== 'inpaint') {
|
|
3943
|
+
fatalCliError('--mask is only supported with --control-type inpaint.', {
|
|
3944
|
+
code: 'INVALID_ARGUMENT'
|
|
3945
|
+
});
|
|
3946
|
+
}
|
|
3947
|
+
|
|
3948
|
+
if (options.outpaintPosition) {
|
|
3949
|
+
const normalizedOutpaintPosition = normalizeOutpaintPositionValue(options.outpaintPosition);
|
|
3950
|
+
if (!normalizedOutpaintPosition) {
|
|
3951
|
+
fatalCliError(`Invalid --outpaint-position "${options.outpaintPosition}". Use: ${OUTPAINT_POSITIONS.join('|')}`, {
|
|
3952
|
+
code: 'INVALID_ARGUMENT',
|
|
3953
|
+
details: { flag: '--outpaint-position', value: options.outpaintPosition, allowed: OUTPAINT_POSITIONS }
|
|
3954
|
+
});
|
|
3955
|
+
}
|
|
3956
|
+
if (options.videoControlNetName !== 'outpaint') {
|
|
3957
|
+
fatalCliError('--outpaint-position is only supported with --control-type outpaint.', {
|
|
3958
|
+
code: 'INVALID_ARGUMENT'
|
|
3959
|
+
});
|
|
3960
|
+
}
|
|
3961
|
+
options.outpaintPosition = normalizedOutpaintPosition;
|
|
3962
|
+
}
|
|
3963
|
+
|
|
3964
|
+
if (options.outpaintAspectRatio) {
|
|
3965
|
+
if (!parseOutpaintAspectRatio(options.outpaintAspectRatio)) {
|
|
3966
|
+
fatalCliError(`Invalid --outpaint-aspect-ratio "${options.outpaintAspectRatio}". Use a ratio like 16:9 or 9:16.`, {
|
|
3967
|
+
code: 'INVALID_ARGUMENT',
|
|
3968
|
+
details: { flag: '--outpaint-aspect-ratio', value: options.outpaintAspectRatio }
|
|
3969
|
+
});
|
|
3970
|
+
}
|
|
3971
|
+
if (options.videoControlNetName !== 'outpaint') {
|
|
3972
|
+
fatalCliError('--outpaint-aspect-ratio is only supported with --control-type outpaint.', {
|
|
3973
|
+
code: 'INVALID_ARGUMENT'
|
|
3774
3974
|
});
|
|
3775
3975
|
}
|
|
3776
3976
|
}
|
|
@@ -4393,6 +4593,7 @@ function getApiModeMediaReferences() {
|
|
|
4393
4593
|
for (const value of options.refVideos || []) {
|
|
4394
4594
|
if (value) refs.push({ flag: '--ref-video', value, kind: 'video' });
|
|
4395
4595
|
}
|
|
4596
|
+
if (options.refMask) refs.push({ flag: '--mask', value: options.refMask, kind: 'image' });
|
|
4396
4597
|
return refs;
|
|
4397
4598
|
}
|
|
4398
4599
|
|
|
@@ -4460,6 +4661,7 @@ function apiMediaReferenceUploadType(ref, index) {
|
|
|
4460
4661
|
if (ref.kind === 'audio') return 'referenceAudio';
|
|
4461
4662
|
if (ref.kind === 'video') return 'referenceVideo';
|
|
4462
4663
|
if (ref.flag === '--ref-end') return 'referenceImageEnd';
|
|
4664
|
+
if (ref.flag === '--mask') return `contextImage${Math.min(index + 1, 16)}`;
|
|
4463
4665
|
if (ref.flag === '-c/--context') return `contextImage${Math.min(index + 1, 16)}`;
|
|
4464
4666
|
return 'referenceImage';
|
|
4465
4667
|
}
|
|
@@ -8588,6 +8790,7 @@ async function main() {
|
|
|
8588
8790
|
let endImageBuffer = options.refImageEnd && !useRefImageEndUrl ? await fetchMediaBuffer(options.refImageEnd) : undefined;
|
|
8589
8791
|
let audioBuffer = options.refAudio && !useRefAudioUrl ? await fetchMediaBuffer(options.refAudio) : undefined;
|
|
8590
8792
|
let videoBuffer = options.refVideo && !useRefVideoUrl ? await fetchMediaBuffer(options.refVideo) : undefined;
|
|
8793
|
+
let maskBuffer = options.refMask ? await fetchMediaBuffer(options.refMask) : undefined;
|
|
8591
8794
|
if (audioBuffer) {
|
|
8592
8795
|
audioBuffer = await prepareReferenceAudioForVideoBuffer(audioBuffer, options.refAudio);
|
|
8593
8796
|
}
|
|
@@ -8618,6 +8821,62 @@ async function main() {
|
|
|
8618
8821
|
const modelDefaults = getModelDefaults(options.model, openclawConfig);
|
|
8619
8822
|
const videoDimensionRules = videoDimensionRulesFromDefaults(modelDefaults, options.model);
|
|
8620
8823
|
|
|
8824
|
+
if (
|
|
8825
|
+
options.videoWorkflow === 'v2v' &&
|
|
8826
|
+
(options.videoControlNetName === 'outpaint' || options.videoControlNetName === 'inpaint')
|
|
8827
|
+
) {
|
|
8828
|
+
let sourceVideoDimensions = null;
|
|
8829
|
+
if (options.refVideo && !isHttpUrl(options.refVideo) && existsSync(options.refVideo)) {
|
|
8830
|
+
const probed = await probeVideoStreamInfo(options.refVideo);
|
|
8831
|
+
if (probed.width && probed.height) {
|
|
8832
|
+
sourceVideoDimensions = { width: probed.width, height: probed.height };
|
|
8833
|
+
}
|
|
8834
|
+
}
|
|
8835
|
+
|
|
8836
|
+
if (options.videoControlNetName === 'outpaint') {
|
|
8837
|
+
const outpaintDimensions = computeOutpaintCanvas(
|
|
8838
|
+
sourceVideoDimensions?.width ?? options.width,
|
|
8839
|
+
sourceVideoDimensions?.height ?? options.height,
|
|
8840
|
+
options.outpaintAspectRatio,
|
|
8841
|
+
options.outpaintPosition || 'center',
|
|
8842
|
+
videoDimensionRules
|
|
8843
|
+
);
|
|
8844
|
+
if (outpaintDimensions.width !== options.width || outpaintDimensions.height !== options.height) {
|
|
8845
|
+
if (!options.quiet) {
|
|
8846
|
+
const ratioLabel = options.outpaintAspectRatio ? ` for ${options.outpaintAspectRatio}` : '';
|
|
8847
|
+
console.error(
|
|
8848
|
+
`Adjusted outpaint canvas from ${options.width}x${options.height} ` +
|
|
8849
|
+
`to ${outpaintDimensions.width}x${outpaintDimensions.height}${ratioLabel}.`
|
|
8850
|
+
);
|
|
8851
|
+
}
|
|
8852
|
+
options.width = outpaintDimensions.width;
|
|
8853
|
+
options.height = outpaintDimensions.height;
|
|
8854
|
+
}
|
|
8855
|
+
} else if (options.videoControlNetName === 'inpaint' && sourceVideoDimensions) {
|
|
8856
|
+
const hasExplicitVideoDimensions =
|
|
8857
|
+
(cliSet.width || widthFromConfig || widthFromPrompt) &&
|
|
8858
|
+
(cliSet.height || heightFromConfig || heightFromPrompt);
|
|
8859
|
+
if (!hasExplicitVideoDimensions) {
|
|
8860
|
+
const inpaintDimensions = computeSourceAspectCanvas(
|
|
8861
|
+
sourceVideoDimensions.width,
|
|
8862
|
+
sourceVideoDimensions.height,
|
|
8863
|
+
videoDimensionRules,
|
|
8864
|
+
options.targetResolution
|
|
8865
|
+
);
|
|
8866
|
+
if (inpaintDimensions.width !== options.width || inpaintDimensions.height !== options.height) {
|
|
8867
|
+
if (!options.quiet) {
|
|
8868
|
+
console.error(
|
|
8869
|
+
`Adjusted inpaint canvas from ${options.width}x${options.height} ` +
|
|
8870
|
+
`to ${inpaintDimensions.width}x${inpaintDimensions.height} to match the source video aspect.`
|
|
8871
|
+
);
|
|
8872
|
+
}
|
|
8873
|
+
options.width = inpaintDimensions.width;
|
|
8874
|
+
options.height = inpaintDimensions.height;
|
|
8875
|
+
}
|
|
8876
|
+
}
|
|
8877
|
+
}
|
|
8878
|
+
}
|
|
8879
|
+
|
|
8621
8880
|
// Pre-resize reference images to model-compatible dimensions if needed for i2v workflow.
|
|
8622
8881
|
if (options.videoWorkflow === 'i2v' && imageBuffer && options._needsRefResize) {
|
|
8623
8882
|
const dims = getImageDimensionsFromBuffer(imageBuffer);
|
|
@@ -8685,6 +8944,12 @@ async function main() {
|
|
|
8685
8944
|
if (endImageBuffer) {
|
|
8686
8945
|
projectConfig.referenceImageEnd = endImageBuffer;
|
|
8687
8946
|
}
|
|
8947
|
+
applyLtxTransitionLora(
|
|
8948
|
+
projectConfig,
|
|
8949
|
+
options.model,
|
|
8950
|
+
Boolean(projectConfig.referenceImage),
|
|
8951
|
+
Boolean(projectConfig.referenceImageEnd)
|
|
8952
|
+
);
|
|
8688
8953
|
if (audioBuffer) {
|
|
8689
8954
|
projectConfig.referenceAudio = audioBuffer;
|
|
8690
8955
|
}
|
|
@@ -8733,14 +8998,20 @@ async function main() {
|
|
|
8733
8998
|
projectConfig.shift = modelDefaults.shift;
|
|
8734
8999
|
}
|
|
8735
9000
|
if (options.videoControlNetName && !isSeedanceModel(options.model)) {
|
|
8736
|
-
const
|
|
9001
|
+
const isInOutpaintControl = options.videoControlNetName === 'outpaint' || options.videoControlNetName === 'inpaint';
|
|
8737
9002
|
projectConfig.controlNet = {
|
|
8738
9003
|
name: options.videoControlNetName,
|
|
8739
|
-
strength:
|
|
9004
|
+
strength: isInOutpaintControl ? 1.0 : resolveVideoControlNetStrength(options.videoControlNetName, options.videoControlNetStrength)
|
|
8740
9005
|
};
|
|
8741
|
-
if (options.videoControlNetName !== 'detailer') {
|
|
9006
|
+
if (!isInOutpaintControl && options.videoControlNetName !== 'detailer') {
|
|
8742
9007
|
projectConfig.detailerStrength = 0.6;
|
|
8743
9008
|
}
|
|
9009
|
+
if (options.videoControlNetName === 'inpaint' && maskBuffer) {
|
|
9010
|
+
projectConfig.referenceMask = maskBuffer;
|
|
9011
|
+
}
|
|
9012
|
+
if (options.videoControlNetName === 'outpaint') {
|
|
9013
|
+
projectConfig.outpaintPosition = options.outpaintPosition || 'center';
|
|
9014
|
+
}
|
|
8744
9015
|
} else if (options.videoControlNetName && isSeedanceModel(options.model) && !options.quiet) {
|
|
8745
9016
|
console.error('Warning: --controlnet-name ignored for Seedance V2V models.');
|
|
8746
9017
|
}
|