@sogni-ai/sogni-creative-agent-skill 3.40.1 → 3.41.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 +4 -1
- package/.agents/skills/sogni-creative-agent-skill/references/hosted-api.md +11 -2
- package/.agents/skills/sogni-creative-agent-skill/references/models.md +19 -0
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +11 -0
- package/README.md +1 -0
- package/SKILL.md +9 -2
- package/desktop-extension/manifest.json +1 -1
- package/generated/creative-agent-runtime.mjs +132 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -3
- package/references/hosted-api.md +11 -2
- package/references/models.md +19 -0
- package/skill-package.json +1 -1
- package/skills/README.md +1 -1
- package/skills/video_editing.md +4 -1
- package/sogni-agent.mjs +297 -9
- 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.41.0"
|
|
7
7
|
author: Sogni AI
|
|
8
8
|
hermes:
|
|
9
9
|
category: creative
|
|
@@ -80,6 +80,9 @@ sogni-agent-hermes -c ./source.png -o ./edited.png "make it night; add fireflies
|
|
|
80
80
|
# Promptless RTX VSR upscale
|
|
81
81
|
sogni-agent-hermes --upscale ./source.png -o ./upscaled.png
|
|
82
82
|
|
|
83
|
+
# Promptless FlashVSR video upscale to 1440p (or --upscale-resolution 1080)
|
|
84
|
+
sogni-agent-hermes --upscale-video ./clip.mp4 -o ./clip-1440p.mp4
|
|
85
|
+
|
|
83
86
|
# Generate or animate video
|
|
84
87
|
sogni-agent-hermes --video -o ./video.mp4 "a paper dragon takes flight"
|
|
85
88
|
sogni-agent-hermes --video --ref ./start.png -o ./animated.mp4 "slow camera push-in"
|
|
@@ -61,7 +61,8 @@ whenever latency or cost rules out an LLM round-trip.
|
|
|
61
61
|
- Preserve exact image prompts, visible lettering, chosen models, source
|
|
62
62
|
selection, aspect ratio, and the latest requested duration. New tasks do not
|
|
63
63
|
inherit settings from unrelated previous renders. A pure size increase uses
|
|
64
|
-
`upscale_image
|
|
64
|
+
`upscale_image` for images and `upscale_video` for videos; editing requires
|
|
65
|
+
an actual source reference.
|
|
65
66
|
- Separate image variations need `numberOfVariations` and a complete Dynamic
|
|
66
67
|
Prompt branch per output. Repeat shared text, branding, dialogue, and loop
|
|
67
68
|
motion in every affected branch. A single storyboard sheet instead needs all
|
|
@@ -123,7 +124,7 @@ requests keep their existing timeouts.
|
|
|
123
124
|
|
|
124
125
|
- `creative-tools` — the public API default when `sogni_tools` is omitted or
|
|
125
126
|
true. Generation/editing tools (`generate_image`, `generate_video`,
|
|
126
|
-
`generate_music`, `generate_speech`, `edit_image`, `upscale_image`, `apply_style`, `restore_photo`,
|
|
127
|
+
`generate_music`, `generate_speech`, `edit_image`, `upscale_image`, `upscale_video`, `apply_style`, `restore_photo`,
|
|
127
128
|
`refine_result`, `animate_photo`, `change_angle`, `video_to_video`,
|
|
128
129
|
`stitch_video`, `orbit_video`, `dance_montage`, `sound_to_video`,
|
|
129
130
|
`extend_video`, `replace_video_segment`, `overlay_video`, `add_subtitles`),
|
|
@@ -147,6 +148,14 @@ either `scale: 2|3|4` or `targetLongestEdge`. Use `7680` for 8K or `15360` for
|
|
|
147
148
|
16K. The promptless NVIDIA RTX VSR path preserves the source aspect ratio,
|
|
148
149
|
aligns both output edges to 8px, and returns JPG when the target exceeds 8K.
|
|
149
150
|
|
|
151
|
+
For a pure resolution increase of a video, call `upscale_video` with
|
|
152
|
+
`sourceVideoIndex` (generated results are 0-based; -1 is the first upload) and
|
|
153
|
+
an optional `targetResolution` of 1080 or 1440. The promptless FlashVSR path
|
|
154
|
+
keeps every frame, the frame rate, the aspect ratio, and the audio; the server
|
|
155
|
+
reads the source metadata itself, so the model never supplies frames or fps.
|
|
156
|
+
It cannot produce 4K, and it is not a substitute for `video_to_video` when the
|
|
157
|
+
user asks a generative model such as Seedance to re-render the clip.
|
|
158
|
+
|
|
150
159
|
## --durable-chat (`POST /v1/chat/runs`)
|
|
151
160
|
|
|
152
161
|
Long-running, LLM-in-the-loop turns persisted as chat-run records instead of a
|
|
@@ -73,6 +73,25 @@ fits the result inside the requested box without cropping or stretching. Both
|
|
|
73
73
|
16K; targets above 7680px return JPG. If a scale leaves the short edge below
|
|
74
74
|
512px, use the minimum target longest edge reported by the CLI/tool.
|
|
75
75
|
|
|
76
|
+
### Video upscaling
|
|
77
|
+
|
|
78
|
+
| Model | Kind | Use Case |
|
|
79
|
+
|-------|------|----------|
|
|
80
|
+
| `flashvsr_v1.1_tiny_long_bf16` | Video job | Promptless FlashVSR v1.1 upscale of one finished video to 1080p or 1440p |
|
|
81
|
+
|
|
82
|
+
FlashVSR is not a generation model. Invoke it with
|
|
83
|
+
`sogni-agent --upscale-video <path|url>` (optionally
|
|
84
|
+
`--upscale-resolution 1080|1440`), or use the hosted `upscale_video` tool with
|
|
85
|
+
`sourceVideoIndex` and an optional `targetResolution`. The output short edge
|
|
86
|
+
becomes 1080 or 1440 (default 1440; 1080 when the source is below 720p) while
|
|
87
|
+
the aspect ratio, every frame, the exact frame rate, and the original audio are
|
|
88
|
+
kept; nothing is trimmed, cropped, restyled, or interpolated. Sources must be
|
|
89
|
+
at most 768px on the short edge and about 1344x768 pixels overall (768x1344 in
|
|
90
|
+
portrait), 1-362 frames (about 15 seconds), 1-60 fps,
|
|
91
|
+
SDR with square pixels, and 100 MB or less; 1440p needs a source short edge of
|
|
92
|
+
at least 720px and 1080p at least 540px. 4K is not available. The direct CLI
|
|
93
|
+
reads the exact frame count and rate with a local ffprobe.
|
|
94
|
+
|
|
76
95
|
For Krea 2 Turbo, hosted/chat planning may use the creative-agent selector
|
|
77
96
|
`krea-2-turbo`; direct CLI `-m` uses the worker model ID
|
|
78
97
|
`krea2_turbo_fp8_scaled`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sogni-creative-agent",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.41.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,14 @@
|
|
|
1
|
+
## [3.41.0](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.40.1...v3.41.0) (2026-09-10)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* Add `--upscale-video <path|url>` with `--upscale-resolution 1080|1440` for promptless FlashVSR v1.1 video upscaling. The CLI reads the source's exact size, frame count and frame rate with local ffprobe, checks the public limits (short edge up to 768px and area up to about 1344x768, 1-362 frames and about 15 seconds, 1-60 fps, SDR with square pixels, 100 MB), and saves the MP4 with the original audio. Prompts, more than one output, timing or size overrides, and other media are rejected.
|
|
6
|
+
* Route pure video upscales to `--upscale-video` or the hosted `upscale_video` tool rather than `video_to_video`, and carry the `upscale_video` contracts in the public runtime.
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* Align the public runtime dependencies with Intelligence Client 3.29.0 and Sogni Client 5.38.0.
|
|
11
|
+
|
|
1
12
|
## [3.40.1](https://github.com/Sogni-AI/sogni-creative-agent-skill/compare/v3.40.0...v3.40.1) (2026-09-10)
|
|
2
13
|
|
|
3
14
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -644,6 +644,7 @@ Prefer `-Q fast|hq|pro` for images and automatic workflow routing for video. Pas
|
|
|
644
644
|
| Highest-quality images | `qwen_image_2512_fp8` (or `-Q pro`) |
|
|
645
645
|
| Image editing | `qwen_image_edit_2511_fp8_lightning` |
|
|
646
646
|
| Deterministic image upscaling through 16K | `rtx_vsr_pro` via `--upscale` |
|
|
647
|
+
| Promptless video upscaling to 1080p/1440p | `flashvsr_v1.1_tiny_long_bf16` via `--upscale-video` |
|
|
647
648
|
| Dark Beast Krea 2 images | `dark_beast_krea2_fp8` |
|
|
648
649
|
| Identity-preserving Krea image edits | `krea2_identity_edit_v1_2` |
|
|
649
650
|
| Uncensored identity-preserving Krea edits | `dark_beast_krea2_identity_edit_v1_2` |
|
package/SKILL.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sogni-creative-agent-skill
|
|
3
|
-
description: "Sogni Creative Agent Skill: agent skill and CLI for image, video, and music generation using Sogni AI's decentralized GPU network. Supports 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 Balanced/LightX2V Turbo/FastH3 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\"."
|
|
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, promptless FlashVSR video upscaling to 1080p/1440p, one-click image-folder loop reels, personas (named people with saved reference photos and voice clips), persistent memories, custom personality, style transfer, angle synthesis, MiniMax H3/H3 Balanced/LightX2V Turbo/FastH3 Turbo/Seedance/HappyHorse/LTX/WAN video, music/lyrics, hosted chat, durable workflows, replay records, and multi-step creative workflows. Ask the agent to \"draw\", \"generate\", \"create an image\", \"upscale an image\", \"upscale a video\", \"make a video/animate\", \"turn this image folder into a loop\", \"make music\", \"apply a style\", or \"generate me as a superhero\"."
|
|
4
4
|
metadata:
|
|
5
|
-
version: "3.
|
|
5
|
+
version: "3.41.0"
|
|
6
6
|
homepage: https://sogni.ai
|
|
7
7
|
openclaw:
|
|
8
8
|
emoji: "🎨"
|
|
@@ -173,6 +173,10 @@ sogni-agent -q --upscale /path/to/input.jpg --target-longest-edge 4096 -o ./upsc
|
|
|
173
173
|
sogni-agent -q --upscale /path/to/input.jpg --target-longest-edge 7680 -o ./upscaled-8k.png
|
|
174
174
|
sogni-agent -q --upscale /path/to/input.jpg --target-longest-edge 15360 -o ./upscaled-16k.jpg
|
|
175
175
|
|
|
176
|
+
# FlashVSR video upscale (promptless; 1440p by default, 1080p below 720p sources; keeps every frame, fps, audio)
|
|
177
|
+
sogni-agent -q --upscale-video /path/to/clip.mp4 -o ./clip-1440p.mp4
|
|
178
|
+
sogni-agent -q --upscale-video /path/to/clip.mp4 --upscale-resolution 1080 -o ./clip-1080p.mp4
|
|
179
|
+
|
|
176
180
|
# Photobooth (face transfer — new portrait from a face photo)
|
|
177
181
|
sogni-agent -q --photobooth --ref /path/to/face.jpg -o ./stylized.png "80s fashion portrait"
|
|
178
182
|
|
|
@@ -274,6 +278,8 @@ sogni-agent doctor --json
|
|
|
274
278
|
| `--upscale <path\|url>` | Promptless deterministic RTX VSR upscale | - |
|
|
275
279
|
| `--upscale-scale 2\|3\|4` | Upscale factor when no explicit target is supplied | 2 |
|
|
276
280
|
| `--target-longest-edge <px>` | RTX VSR target longest edge, preserving aspect ratio | 512–15360 box |
|
|
281
|
+
| `--upscale-video <path\|url>` | Promptless FlashVSR video upscale (needs local ffprobe) | - |
|
|
282
|
+
| `--upscale-resolution 1080\|1440` | FlashVSR output short edge | 1440 (1080 below 720p) |
|
|
277
283
|
| `-m <id>` | Explicit model | `z_image_turbo_bf16` |
|
|
278
284
|
| `-w` / `-h` | Width / height | 512×512 |
|
|
279
285
|
| `-n <num>` | Output count (`{a\|b\|c}` prompt variations cycle); capped at 16, raise with `SOGNI_MAX_COUNT` | 1 |
|
|
@@ -309,6 +315,7 @@ sogni-agent doctor --json
|
|
|
309
315
|
### Upscaling vs. generative editing
|
|
310
316
|
|
|
311
317
|
- For a pure resolution increase that must preserve the source composition, use `--upscale` in direct CLI mode or `upscale_image` on hosted tool surfaces. RTX VSR is deterministic and promptless: never invent a prompt, and never route this request through `restore_photo`, `refine_result`, or `edit_image`.
|
|
318
|
+
- For a pure resolution increase of an existing video (upscale, sharpen, HD/1080p/1440p/2K copy), use `--upscale-video` in direct CLI mode or `upscale_video` on hosted tool surfaces. FlashVSR is promptless and keeps every frame, the frame rate, the aspect ratio, and the audio. Never route it through `video_to_video` or `generate_video` unless the user names a generative model such as Seedance for a re-render. Output is 1080p or 1440p only — say so if the user asks for 4K. Sources must be ≤768px on the short edge (1440p needs ≥720px, 1080p ≥540px) and at most about 1344×768 pixels (768×1344 portrait), ≤362 frames (~15 s), 1–60 fps, and ≤100 MB.
|
|
312
319
|
- `--upscale-scale` accepts 2, 3, or 4; `--target-longest-edge` overrides it. The CLI derives an aspect-preserving target box and aligns both edges to the worker's 8-pixel step. Both output edges must remain within 512–15360px. Targets above 7680px use JPG so 16K results remain practical to transfer and display. If a scale would make the short edge smaller than 512px, the CLI reports the minimum valid `--target-longest-edge` instead of stretching the image; aspect ratios that cannot fit the box are rejected.
|
|
313
320
|
|
|
314
321
|
### Segmentation and 3D reconstruction
|
|
@@ -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.41.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",
|
|
@@ -34,6 +34,7 @@ const GATING_POLICIES = [
|
|
|
34
34
|
"generate_video",
|
|
35
35
|
"sound_to_video",
|
|
36
36
|
"video_to_video",
|
|
37
|
+
"upscale_video",
|
|
37
38
|
"generate_music",
|
|
38
39
|
"generate_speech",
|
|
39
40
|
"extend_video",
|
|
@@ -69,6 +70,7 @@ const GATING_POLICIES = [
|
|
|
69
70
|
"generate_video",
|
|
70
71
|
"sound_to_video",
|
|
71
72
|
"video_to_video",
|
|
73
|
+
"upscale_video",
|
|
72
74
|
"generate_music",
|
|
73
75
|
"generate_speech",
|
|
74
76
|
"extend_video",
|
|
@@ -103,6 +105,7 @@ const GATING_POLICIES = [
|
|
|
103
105
|
"generate_video",
|
|
104
106
|
"sound_to_video",
|
|
105
107
|
"video_to_video",
|
|
108
|
+
"upscale_video",
|
|
106
109
|
"generate_music",
|
|
107
110
|
"generate_speech",
|
|
108
111
|
"extend_video",
|
|
@@ -138,6 +141,7 @@ const GATING_POLICIES = [
|
|
|
138
141
|
"generate_video",
|
|
139
142
|
"sound_to_video",
|
|
140
143
|
"video_to_video",
|
|
144
|
+
"upscale_video",
|
|
141
145
|
"generate_music",
|
|
142
146
|
"generate_speech",
|
|
143
147
|
"extend_video",
|
|
@@ -316,6 +320,31 @@ const GATING_POLICIES = [
|
|
|
316
320
|
},
|
|
317
321
|
"rationale": "The planner identified uploaded-video stitching. Use stitch_video with the uploaded clips instead of rendering a fresh clip."
|
|
318
322
|
},
|
|
323
|
+
{
|
|
324
|
+
"policyId": "UPLOADED_BASE_VIDEO_UPSCALE",
|
|
325
|
+
"version": "1.0.0",
|
|
326
|
+
"trigger": {
|
|
327
|
+
"allOf": [
|
|
328
|
+
"has_uploaded_video",
|
|
329
|
+
"video_modification:upscale"
|
|
330
|
+
],
|
|
331
|
+
"sources": {
|
|
332
|
+
"has_uploaded_video": "session_state",
|
|
333
|
+
"video_modification:upscale": "planner"
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"effect": {
|
|
337
|
+
"forbid": [
|
|
338
|
+
"generate_video",
|
|
339
|
+
"animate_photo",
|
|
340
|
+
"video_to_video"
|
|
341
|
+
],
|
|
342
|
+
"require": [
|
|
343
|
+
"upscale_video"
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
"rationale": "The planner identified a pure resolution upscale of the uploaded video. Use the promptless upscale_video tool; do not re-render the clip with a generative model."
|
|
347
|
+
},
|
|
319
348
|
{
|
|
320
349
|
"policyId": "HAS_PERSONA_AND_REQUESTS_VIDEO",
|
|
321
350
|
"version": "1.0.0",
|
|
@@ -494,6 +523,15 @@ const REPAIR_RECIPES = [
|
|
|
494
523
|
"maxRetries": 0,
|
|
495
524
|
"repairNoteTemplate": "I need more details before I can run {{toolName}}. {{missingDetail}}"
|
|
496
525
|
},
|
|
526
|
+
{
|
|
527
|
+
"recipeId": "upscale_video.user_input_incomplete",
|
|
528
|
+
"version": "1.0.0",
|
|
529
|
+
"toolName": "upscale_video",
|
|
530
|
+
"errorCode": "USER_INPUT_INCOMPLETE",
|
|
531
|
+
"mode": "stopAndAsk",
|
|
532
|
+
"maxRetries": 0,
|
|
533
|
+
"repairNoteTemplate": "I need more details before I can run {{toolName}}. {{missingDetail}}"
|
|
534
|
+
},
|
|
497
535
|
{
|
|
498
536
|
"recipeId": "generate_music.user_input_incomplete",
|
|
499
537
|
"version": "1.0.0",
|
|
@@ -674,6 +712,15 @@ const REPAIR_RECIPES = [
|
|
|
674
712
|
"maxRetries": 0,
|
|
675
713
|
"repairNoteTemplate": "You have hit the credit limit for this turn. Buy Spark Packs to continue: https://docs.sogni.ai/pricing/#spark-packs"
|
|
676
714
|
},
|
|
715
|
+
{
|
|
716
|
+
"recipeId": "upscale_video.cost_limit_exceeded",
|
|
717
|
+
"version": "1.0.0",
|
|
718
|
+
"toolName": "upscale_video",
|
|
719
|
+
"errorCode": "COST_LIMIT_EXCEEDED",
|
|
720
|
+
"mode": "stopAndAsk",
|
|
721
|
+
"maxRetries": 0,
|
|
722
|
+
"repairNoteTemplate": "You have hit the credit limit for this turn. Buy Spark Packs to continue: https://docs.sogni.ai/pricing/#spark-packs"
|
|
723
|
+
},
|
|
677
724
|
{
|
|
678
725
|
"recipeId": "generate_music.cost_limit_exceeded",
|
|
679
726
|
"version": "1.0.0",
|
|
@@ -854,6 +901,15 @@ const REPAIR_RECIPES = [
|
|
|
854
901
|
"maxRetries": 0,
|
|
855
902
|
"repairNoteTemplate": "I cannot find the asset that {{toolName}} needs. {{message}} Which uploaded or generated asset did you want?"
|
|
856
903
|
},
|
|
904
|
+
{
|
|
905
|
+
"recipeId": "upscale_video.asset_not_found",
|
|
906
|
+
"version": "1.0.0",
|
|
907
|
+
"toolName": "upscale_video",
|
|
908
|
+
"errorCode": "ASSET_NOT_FOUND",
|
|
909
|
+
"mode": "stopAndAsk",
|
|
910
|
+
"maxRetries": 0,
|
|
911
|
+
"repairNoteTemplate": "I cannot find the asset that {{toolName}} needs. {{message}} Which uploaded or generated asset did you want?"
|
|
912
|
+
},
|
|
857
913
|
{
|
|
858
914
|
"recipeId": "generate_music.asset_not_found",
|
|
859
915
|
"version": "1.0.0",
|
|
@@ -1061,6 +1117,15 @@ const REPAIR_RECIPES = [
|
|
|
1061
1117
|
"maxRetries": 0,
|
|
1062
1118
|
"repairNoteTemplate": "{{toolName}} could not run: {{message}}"
|
|
1063
1119
|
},
|
|
1120
|
+
{
|
|
1121
|
+
"recipeId": "upscale_video.workflow_validation_failed",
|
|
1122
|
+
"version": "1.0.0",
|
|
1123
|
+
"toolName": "upscale_video",
|
|
1124
|
+
"errorCode": "WORKFLOW_VALIDATION_FAILED",
|
|
1125
|
+
"mode": "stopAndAsk",
|
|
1126
|
+
"maxRetries": 0,
|
|
1127
|
+
"repairNoteTemplate": "{{toolName}} could not run: {{message}}"
|
|
1128
|
+
},
|
|
1064
1129
|
{
|
|
1065
1130
|
"recipeId": "generate_music.workflow_validation_failed",
|
|
1066
1131
|
"version": "1.0.0",
|
|
@@ -1241,6 +1306,15 @@ const REPAIR_RECIPES = [
|
|
|
1241
1306
|
"maxRetries": 0,
|
|
1242
1307
|
"repairNoteTemplate": "{{toolName}} rejected the arguments: {{message}}"
|
|
1243
1308
|
},
|
|
1309
|
+
{
|
|
1310
|
+
"recipeId": "upscale_video.parameter_invalid",
|
|
1311
|
+
"version": "1.0.0",
|
|
1312
|
+
"toolName": "upscale_video",
|
|
1313
|
+
"errorCode": "PARAMETER_INVALID",
|
|
1314
|
+
"mode": "stopAndAsk",
|
|
1315
|
+
"maxRetries": 0,
|
|
1316
|
+
"repairNoteTemplate": "{{toolName}} rejected the arguments: {{message}}"
|
|
1317
|
+
},
|
|
1244
1318
|
{
|
|
1245
1319
|
"recipeId": "generate_music.parameter_invalid",
|
|
1246
1320
|
"version": "1.0.0",
|
|
@@ -1394,6 +1468,15 @@ const REPAIR_RECIPES = [
|
|
|
1394
1468
|
"maxRetries": 0,
|
|
1395
1469
|
"repairNoteTemplate": "The {{toolName}} worker failed. {{message}} Want me to try again or change the request?"
|
|
1396
1470
|
},
|
|
1471
|
+
{
|
|
1472
|
+
"recipeId": "upscale_video.gpu_worker_failed",
|
|
1473
|
+
"version": "1.0.0",
|
|
1474
|
+
"toolName": "upscale_video",
|
|
1475
|
+
"errorCode": "GPU_WORKER_FAILED",
|
|
1476
|
+
"mode": "stopAndAsk",
|
|
1477
|
+
"maxRetries": 0,
|
|
1478
|
+
"repairNoteTemplate": "The {{toolName}} worker failed. {{message}} Want me to try again or change the request?"
|
|
1479
|
+
},
|
|
1397
1480
|
{
|
|
1398
1481
|
"recipeId": "generate_music.gpu_worker_failed",
|
|
1399
1482
|
"version": "1.0.0",
|
|
@@ -1574,6 +1657,15 @@ const REPAIR_RECIPES = [
|
|
|
1574
1657
|
"maxRetries": 0,
|
|
1575
1658
|
"repairNoteTemplate": "The model {{toolName}} wanted is offline. {{message}} Pick a different model or try again later."
|
|
1576
1659
|
},
|
|
1660
|
+
{
|
|
1661
|
+
"recipeId": "upscale_video.model_unavailable",
|
|
1662
|
+
"version": "1.0.0",
|
|
1663
|
+
"toolName": "upscale_video",
|
|
1664
|
+
"errorCode": "MODEL_UNAVAILABLE",
|
|
1665
|
+
"mode": "stopAndAsk",
|
|
1666
|
+
"maxRetries": 0,
|
|
1667
|
+
"repairNoteTemplate": "The model {{toolName}} wanted is offline. {{message}} Pick a different model or try again later."
|
|
1668
|
+
},
|
|
1577
1669
|
{
|
|
1578
1670
|
"recipeId": "generate_music.model_unavailable",
|
|
1579
1671
|
"version": "1.0.0",
|
|
@@ -1754,6 +1846,15 @@ const REPAIR_RECIPES = [
|
|
|
1754
1846
|
"maxRetries": 0,
|
|
1755
1847
|
"repairNoteTemplate": "{{toolName}} needs permission you have not granted yet. {{message}}"
|
|
1756
1848
|
},
|
|
1849
|
+
{
|
|
1850
|
+
"recipeId": "upscale_video.permission_required",
|
|
1851
|
+
"version": "1.0.0",
|
|
1852
|
+
"toolName": "upscale_video",
|
|
1853
|
+
"errorCode": "PERMISSION_REQUIRED",
|
|
1854
|
+
"mode": "stopAndAsk",
|
|
1855
|
+
"maxRetries": 0,
|
|
1856
|
+
"repairNoteTemplate": "{{toolName}} needs permission you have not granted yet. {{message}}"
|
|
1857
|
+
},
|
|
1757
1858
|
{
|
|
1758
1859
|
"recipeId": "generate_music.permission_required",
|
|
1759
1860
|
"version": "1.0.0",
|
|
@@ -2044,6 +2145,15 @@ const REPAIR_RECIPES = [
|
|
|
2044
2145
|
"maxRetries": 0,
|
|
2045
2146
|
"repairNoteTemplate": "{{toolName}} timed out. {{message}} Want me to retry, or simplify the request?"
|
|
2046
2147
|
},
|
|
2148
|
+
{
|
|
2149
|
+
"recipeId": "upscale_video.provider_timeout",
|
|
2150
|
+
"version": "1.0.0",
|
|
2151
|
+
"toolName": "upscale_video",
|
|
2152
|
+
"errorCode": "PROVIDER_TIMEOUT",
|
|
2153
|
+
"mode": "stopAndAsk",
|
|
2154
|
+
"maxRetries": 0,
|
|
2155
|
+
"repairNoteTemplate": "{{toolName}} timed out. {{message}} Want me to retry, or simplify the request?"
|
|
2156
|
+
},
|
|
2047
2157
|
{
|
|
2048
2158
|
"recipeId": "generate_music.provider_timeout",
|
|
2049
2159
|
"version": "1.0.0",
|
|
@@ -2224,6 +2334,15 @@ const REPAIR_RECIPES = [
|
|
|
2224
2334
|
"maxRetries": 0,
|
|
2225
2335
|
"repairNoteTemplate": "The {{toolName}} run was cancelled by the user. I will stop here unless you ask me to try again."
|
|
2226
2336
|
},
|
|
2337
|
+
{
|
|
2338
|
+
"recipeId": "upscale_video.user_cancelled",
|
|
2339
|
+
"version": "1.0.0",
|
|
2340
|
+
"toolName": "upscale_video",
|
|
2341
|
+
"errorCode": "USER_CANCELLED",
|
|
2342
|
+
"mode": "stopAndAsk",
|
|
2343
|
+
"maxRetries": 0,
|
|
2344
|
+
"repairNoteTemplate": "The {{toolName}} run was cancelled by the user. I will stop here unless you ask me to try again."
|
|
2345
|
+
},
|
|
2227
2346
|
{
|
|
2228
2347
|
"recipeId": "generate_music.user_cancelled",
|
|
2229
2348
|
"version": "1.0.0",
|
|
@@ -2330,6 +2449,16 @@ const PROMPT_CONTRACTS = [
|
|
|
2330
2449
|
"targetLongestEdge": "Explicit output longest edge in pixels, 512-15360. Use 7680 for 8K or 15360 for the 16K maximum. It must be larger than the source, and large enough that the other 8px-aligned edge remains at least 512px; aspect ratio is preserved."
|
|
2331
2450
|
}
|
|
2332
2451
|
},
|
|
2452
|
+
{
|
|
2453
|
+
"contractId": "upscale_video_v1",
|
|
2454
|
+
"version": "1.0.0",
|
|
2455
|
+
"toolName": "upscale_video",
|
|
2456
|
+
"baseDescription": "upscale_video performs promptless, deterministic FlashVSR super-resolution of exactly one\nuploaded or generated video. Use it when the user asks to upscale, enlarge, sharpen, or increase\nthe resolution of an existing video, or wants a 1080p, 1440p, 2K, or HD copy of it. The output\nkeeps every source frame, the exact frame rate, the full aspect ratio, and the original audio.\n\nDo not invent a prompt and do not route a pure video upscale through video_to_video,\ngenerate_video, extend_video, or replace_video_segment; those tools re-render or edit content.\nUse video_to_video only when the user explicitly names a generative model such as Seedance for\nthe re-render. Do not use upscale_image for videos.\n\nOmit sourceVideoIndex to use the latest generated video, falling back to the most recent upload.\nUse zero-based non-negative indices for generated videos; -1 selects the first uploaded video\nand -2 the second. targetResolution is the output short edge: omit it for 1440p (or 1080p when\nthe source is too small for 1440p), and set 1080 when the user asks for 1080p or Full HD.\nThe output is at most twice the source size, so 1440p needs a source short edge of 720-768px\nand 1080p needs 540-768px. Sources must also be at most about 1344x768 pixels (768x1344 in\nportrait), 362 frames (about 15 seconds), 1-60 fps, and 100 MB. If the tool reports the source\nis outside these limits, explain the limit to the user instead of switching to a generative\nvideo tool. It cannot produce 4K or any size above 1440p: when the user asks for one, say so and\noffer 1440p instead of silently delivering less.",
|
|
2457
|
+
"parameterDocs": {
|
|
2458
|
+
"sourceVideoIndex": "Omit for the latest generated video, then the most recent upload. Generated videos are zero-based; -1/-2 select uploaded videos.",
|
|
2459
|
+
"targetResolution": "Output short edge in pixels: 1440 or 1080. Omit for the default (1440, or 1080 for sources under 720px); set 1080 when the user asks for 1080p or Full HD."
|
|
2460
|
+
}
|
|
2461
|
+
},
|
|
2333
2462
|
{
|
|
2334
2463
|
"contractId": "apply_style_v1",
|
|
2335
2464
|
"version": "1.0.0",
|
|
@@ -2423,13 +2552,13 @@ const PROMPT_CONTRACTS = [
|
|
|
2423
2552
|
},
|
|
2424
2553
|
{
|
|
2425
2554
|
"contractId": "video_to_video_v1",
|
|
2426
|
-
"version": "1.
|
|
2555
|
+
"version": "1.1.0",
|
|
2427
2556
|
"toolName": "video_to_video",
|
|
2428
|
-
"baseDescription": "video_to_video transforms an uploaded video. Use for uploaded-video restyling,
|
|
2557
|
+
"baseDescription": "video_to_video transforms an uploaded video. Use for uploaded-video restyling, generative\nenhancement or remastering, motion transfer from video to image, subject replacement, edge/pose/\ndepth-guided restyle, or explicit Seedance V2V transforms. Wan 3 is not a V2V model;\nits video inputs are loose references for new generation through generate_video.\nFor a pure resolution upscale (a sharper 1080p, 1440p, 2K, or HD copy of the same video),\nuse upscale_video instead; it is promptless and keeps every frame, the frame rate, and the audio.\n\nThis tool requires an uploaded video source. Do not use it for generated video indices. For\ngenerated or uploaded partial edits use replace_video_segment; for appended time use\nextend_video; for logos/text overlays use overlay_video; for stitching use stitch_video.\n\nChoose controlMode by intent. Use detailer for generative detail enhancement without restyling\nwhen the user wants the content re-rendered rather than only more resolution.\nUse seedance-v2v only when the user asks to transform/enhance/remaster an uploaded video\nwith Seedance, including uploaded-video upscale/remaster requests that name Seedance. For detailer,\ndescribe the original scene plus quality terms, not new content.\nUse outpaint to extend/expand the frame or change aspect ratio (positional, mask-free); set\noutpaintPosition and optionally outpaintAspectRatio. Use inpaint to regenerate a region\nwhile preserving the rest. If the user supplied a mask, set maskImageIndex; otherwise\nomit maskImageIndex so execution derives one from the source video and prompt.",
|
|
2429
2558
|
"parameterDocs": {
|
|
2430
2559
|
"prompt": "Describe the target appearance in present tense. For detailer, describe the original content plus quality qualifiers only. For outpaint, describe what fills the new area; for inpaint, describe only the masked region.",
|
|
2431
2560
|
"videoSourceIndex": "Uploaded video index. Omit when there is one uploaded video; use 0 for first uploaded video or -1 if using negative upload notation.",
|
|
2432
|
-
"controlMode": "Pick from intent: detailer for
|
|
2561
|
+
"controlMode": "Pick from intent: detailer for generative enhancement, seedance-v2v for explicit Seedance V2V, canny/depth for video-only control restyles, pose for motion transfer onto a reference-image subject, animate-move/replace for WAN Animate, outpaint to extend/expand the canvas, inpaint to regenerate a masked region.",
|
|
2433
2562
|
"sourceImageIndex": "Required for animate-move, animate-replace, and pose when more than one image is available; the sole reference image may be auto-selected. LTX pose always needs a reference image. Ignored by canny, depth, detailer, outpaint, and inpaint.",
|
|
2434
2563
|
"outpaintPosition": "outpaint only. Where the original frame sits in the expanded canvas (center/top/bottom/left/right); determines grow direction. Default center.",
|
|
2435
2564
|
"outpaintAspectRatio": "outpaint only, optional. Target aspect ratio (e.g. 16:9) for the expanded canvas; the canvas only grows, never crops. Set only when the user names a target shape/orientation.",
|
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.41.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.41.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.29.0",
|
|
99
99
|
"execa": "^10.0.1",
|
|
100
100
|
"json5": "^2.2.3",
|
|
101
101
|
"sharp": "0.35.4"
|
|
102
102
|
},
|
|
103
103
|
"overrides": {
|
|
104
|
-
"@sogni-ai/sogni-client": "5.
|
|
104
|
+
"@sogni-ai/sogni-client": "5.38.0"
|
|
105
105
|
},
|
|
106
106
|
"openclaw": {
|
|
107
107
|
"extensions": [
|
package/references/hosted-api.md
CHANGED
|
@@ -61,7 +61,8 @@ whenever latency or cost rules out an LLM round-trip.
|
|
|
61
61
|
- Preserve exact image prompts, visible lettering, chosen models, source
|
|
62
62
|
selection, aspect ratio, and the latest requested duration. New tasks do not
|
|
63
63
|
inherit settings from unrelated previous renders. A pure size increase uses
|
|
64
|
-
`upscale_image
|
|
64
|
+
`upscale_image` for images and `upscale_video` for videos; editing requires
|
|
65
|
+
an actual source reference.
|
|
65
66
|
- Separate image variations need `numberOfVariations` and a complete Dynamic
|
|
66
67
|
Prompt branch per output. Repeat shared text, branding, dialogue, and loop
|
|
67
68
|
motion in every affected branch. A single storyboard sheet instead needs all
|
|
@@ -123,7 +124,7 @@ requests keep their existing timeouts.
|
|
|
123
124
|
|
|
124
125
|
- `creative-tools` — the public API default when `sogni_tools` is omitted or
|
|
125
126
|
true. Generation/editing tools (`generate_image`, `generate_video`,
|
|
126
|
-
`generate_music`, `generate_speech`, `edit_image`, `upscale_image`, `apply_style`, `restore_photo`,
|
|
127
|
+
`generate_music`, `generate_speech`, `edit_image`, `upscale_image`, `upscale_video`, `apply_style`, `restore_photo`,
|
|
127
128
|
`refine_result`, `animate_photo`, `change_angle`, `video_to_video`,
|
|
128
129
|
`stitch_video`, `orbit_video`, `dance_montage`, `sound_to_video`,
|
|
129
130
|
`extend_video`, `replace_video_segment`, `overlay_video`, `add_subtitles`),
|
|
@@ -147,6 +148,14 @@ either `scale: 2|3|4` or `targetLongestEdge`. Use `7680` for 8K or `15360` for
|
|
|
147
148
|
16K. The promptless NVIDIA RTX VSR path preserves the source aspect ratio,
|
|
148
149
|
aligns both output edges to 8px, and returns JPG when the target exceeds 8K.
|
|
149
150
|
|
|
151
|
+
For a pure resolution increase of a video, call `upscale_video` with
|
|
152
|
+
`sourceVideoIndex` (generated results are 0-based; -1 is the first upload) and
|
|
153
|
+
an optional `targetResolution` of 1080 or 1440. The promptless FlashVSR path
|
|
154
|
+
keeps every frame, the frame rate, the aspect ratio, and the audio; the server
|
|
155
|
+
reads the source metadata itself, so the model never supplies frames or fps.
|
|
156
|
+
It cannot produce 4K, and it is not a substitute for `video_to_video` when the
|
|
157
|
+
user asks a generative model such as Seedance to re-render the clip.
|
|
158
|
+
|
|
150
159
|
## --durable-chat (`POST /v1/chat/runs`)
|
|
151
160
|
|
|
152
161
|
Long-running, LLM-in-the-loop turns persisted as chat-run records instead of a
|
package/references/models.md
CHANGED
|
@@ -73,6 +73,25 @@ fits the result inside the requested box without cropping or stretching. Both
|
|
|
73
73
|
16K; targets above 7680px return JPG. If a scale leaves the short edge below
|
|
74
74
|
512px, use the minimum target longest edge reported by the CLI/tool.
|
|
75
75
|
|
|
76
|
+
### Video upscaling
|
|
77
|
+
|
|
78
|
+
| Model | Kind | Use Case |
|
|
79
|
+
|-------|------|----------|
|
|
80
|
+
| `flashvsr_v1.1_tiny_long_bf16` | Video job | Promptless FlashVSR v1.1 upscale of one finished video to 1080p or 1440p |
|
|
81
|
+
|
|
82
|
+
FlashVSR is not a generation model. Invoke it with
|
|
83
|
+
`sogni-agent --upscale-video <path|url>` (optionally
|
|
84
|
+
`--upscale-resolution 1080|1440`), or use the hosted `upscale_video` tool with
|
|
85
|
+
`sourceVideoIndex` and an optional `targetResolution`. The output short edge
|
|
86
|
+
becomes 1080 or 1440 (default 1440; 1080 when the source is below 720p) while
|
|
87
|
+
the aspect ratio, every frame, the exact frame rate, and the original audio are
|
|
88
|
+
kept; nothing is trimmed, cropped, restyled, or interpolated. Sources must be
|
|
89
|
+
at most 768px on the short edge and about 1344x768 pixels overall (768x1344 in
|
|
90
|
+
portrait), 1-362 frames (about 15 seconds), 1-60 fps,
|
|
91
|
+
SDR with square pixels, and 100 MB or less; 1440p needs a source short edge of
|
|
92
|
+
at least 720px and 1080p at least 540px. 4K is not available. The direct CLI
|
|
93
|
+
reads the exact frame count and rate with a local ffprobe.
|
|
94
|
+
|
|
76
95
|
For Krea 2 Turbo, hosted/chat planning may use the creative-agent selector
|
|
77
96
|
`krea-2-turbo`; direct CLI `-m` uses the worker model ID
|
|
78
97
|
`krea2_turbo_fp8_scaled`.
|
package/skill-package.json
CHANGED
package/skills/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Available to every per-skill consumer. Sogni-hosted chat loads all capabilities
|
|
|
23
23
|
| [`image_generation`](./image_generation.md) | `generate_image` |
|
|
24
24
|
| [`image_editing`](./image_editing.md) | `edit_image`, `upscale_image`, `restore_photo`, `apply_style`, `change_angle`, `refine_result` |
|
|
25
25
|
| [`video_generation`](./video_generation.md) | `generate_video` |
|
|
26
|
-
| [`video_editing`](./video_editing.md) | `animate_photo`, `sound_to_video`, `video_to_video`, `stitch_video`, `orbit_video`, `dance_montage`, `extend_video`, `replace_video_segment`, `overlay_video`, `add_subtitles` |
|
|
26
|
+
| [`video_editing`](./video_editing.md) | `animate_photo`, `sound_to_video`, `video_to_video`, `upscale_video`, `stitch_video`, `orbit_video`, `dance_montage`, `extend_video`, `replace_video_segment`, `overlay_video`, `add_subtitles` |
|
|
27
27
|
| [`music_generation`](./music_generation.md) | `generate_music` |
|
|
28
28
|
| [`media_analysis`](./media_analysis.md) | `analyze_image`, `analyze_video`, `extract_metadata` |
|
|
29
29
|
| [`persona_management`](./persona_management.md) | `resolve_personas`, `manage_memory` |
|
package/skills/video_editing.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: video_editing
|
|
3
|
-
description: Source-conditioned video flows: animate a photo, audio-driven motion, video style transfer, Seedance/HappyHorse/MiniMax H3 references, stitching, orbits, dance-montage compositions, segment extend/replace, and pure-ffmpeg post-production (overlay, subtitles).
|
|
3
|
+
description: Source-conditioned video flows: animate a photo, audio-driven motion, video style transfer, promptless FlashVSR video upscaling, Seedance/HappyHorse/MiniMax H3 references, stitching, orbits, dance-montage compositions, segment extend/replace, and pure-ffmpeg post-production (overlay, subtitles).
|
|
4
4
|
always_loaded: false
|
|
5
5
|
tool_names:
|
|
6
6
|
- animate_photo
|
|
7
7
|
- sound_to_video
|
|
8
8
|
- video_to_video
|
|
9
|
+
- upscale_video
|
|
9
10
|
- stitch_video
|
|
10
11
|
- orbit_video
|
|
11
12
|
- dance_montage
|
|
@@ -24,6 +25,7 @@ Convert a still image, audio track, or existing clip into video, plus Seedance a
|
|
|
24
25
|
- `animate_photo` — photo-to-video animation with LTX/WAN/Seedance/HappyHorse/MiniMax H3 i2v and first/last-frame routing.
|
|
25
26
|
- `sound_to_video` — audio-synced video generation.
|
|
26
27
|
- `video_to_video` — video style transfer with ControlNet.
|
|
28
|
+
- `upscale_video` — promptless FlashVSR upscale of one uploaded or generated video to 1080p or 1440p, keeping every frame, the frame rate, the aspect ratio, and the audio.
|
|
27
29
|
- `stitch_video` — concatenate previously rendered clips.
|
|
28
30
|
- `orbit_video` — 360° orbit composition with optional dialogue.
|
|
29
31
|
- `dance_montage` — beat-synced dance-style composition over uploaded photos.
|
|
@@ -36,6 +38,7 @@ Convert a still image, audio track, or existing clip into video, plus Seedance a
|
|
|
36
38
|
|
|
37
39
|
- Per-clip retry and the batch progress contract are sacred — never collapse a multi-clip render down to a single waterfall call.
|
|
38
40
|
- `animate_photo` errors with `all_failed` must surface to the user; do not auto-retry from inside the chat loop.
|
|
41
|
+
- Use `upscale_video` when the user only wants a sharper, higher-resolution copy of an existing video. Pick the source with `sourceVideoIndex` (generated results are 0-based; -1 is the first upload) and optionally `targetResolution` 1080 or 1440 (default 1440, or 1080 for sources under 720p). It cannot produce 4K. Sources must be ≤768px on the short edge and at most about 1344×768 pixels (768×1344 portrait), ≤362 frames (~15 s), 1-60 fps, and ≤100 MB. Never invent a prompt or substitute `video_to_video`/`generate_video` unless the user names a generative model such as Seedance for a re-render.
|
|
39
42
|
- For multiple prompt-only takes from one fixed source/end image and shared settings, prefer one Dynamic Prompt request with `numberOfVariations`/`-n`, then stitch the returned clips if the user asked for a single final video.
|
|
40
43
|
- Keep per-clip prompt arrays and source/end image arrays when clips need different assets, durations, audio windows, or other per-output settings.
|
|
41
44
|
- HappyHorse i2v uses exactly one first-frame image and r2v uses 1-9 image references; do not attach reference audio, reference video, ControlNet, or negative prompts.
|
package/sogni-agent.mjs
CHANGED
|
@@ -1368,6 +1368,171 @@ function resolveRtxVsrDimensions(sourceWidth, sourceHeight, { scale = 2, targetL
|
|
|
1368
1368
|
};
|
|
1369
1369
|
}
|
|
1370
1370
|
|
|
1371
|
+
// Promptless FlashVSR video upscaling (--upscale-video). The server probes the
|
|
1372
|
+
// uploaded source and stays authoritative; these public limits let the CLI
|
|
1373
|
+
// explain an unsupported clip before any upload.
|
|
1374
|
+
const FLASHVSR_MODEL_ID = 'flashvsr_v1.1_tiny_long_bf16';
|
|
1375
|
+
const VIDEO_UPSCALE_RESOLUTIONS = [1080, 1440];
|
|
1376
|
+
const VIDEO_UPSCALE_DEFAULT_RESOLUTION = 1440;
|
|
1377
|
+
const VIDEO_UPSCALE_MAX_SOURCE_SHORT_EDGE = 768;
|
|
1378
|
+
// Source area counted in 64-pixel blocks: about 1344x768, or 768x1344 in portrait.
|
|
1379
|
+
const VIDEO_UPSCALE_MAX_SOURCE_BLOCK_PIXELS = 1344 * 768;
|
|
1380
|
+
const VIDEO_UPSCALE_MAX_FRAMES = 362;
|
|
1381
|
+
const VIDEO_UPSCALE_MAX_DURATION_SECONDS = 362 / 24;
|
|
1382
|
+
const VIDEO_UPSCALE_MIN_FPS = 1;
|
|
1383
|
+
const VIDEO_UPSCALE_MAX_FPS = 60;
|
|
1384
|
+
const VIDEO_UPSCALE_MAX_BYTES = 100 * 1024 * 1024;
|
|
1385
|
+
const VIDEO_UPSCALE_MAX_OUTPUT_LONG_EDGE = 2560;
|
|
1386
|
+
const VIDEO_UPSCALE_MAX_OUTPUT_PIXELS = 2560 * 1440;
|
|
1387
|
+
const FLASHVSR_UNAVAILABLE_MESSAGE = 'FlashVSR video upscaling is not available yet. Please try again later.';
|
|
1388
|
+
|
|
1389
|
+
function parseVideoUpscaleResolutionValue(raw, flag) {
|
|
1390
|
+
const value = Number(String(raw ?? '').trim().toLowerCase().replace(/p$/, ''));
|
|
1391
|
+
if (!VIDEO_UPSCALE_RESOLUTIONS.includes(value)) {
|
|
1392
|
+
fatalCliError(`${flag} must be 1080 or 1440.`, {
|
|
1393
|
+
code: 'INVALID_ARGUMENT',
|
|
1394
|
+
details: { flag, value: raw, allowed: VIDEO_UPSCALE_RESOLUTIONS }
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
return value;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
function videoUpscaleOutputFor(sourceWidth, sourceHeight, resolution) {
|
|
1401
|
+
const ratio = resolution / Math.min(sourceWidth, sourceHeight);
|
|
1402
|
+
if (ratio > 2) {
|
|
1403
|
+
return {
|
|
1404
|
+
problem: `${resolution}p needs a source at least ${resolution / 2}px on its short edge; this video is ${sourceWidth}×${sourceHeight}.`
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
if (ratio <= 1) {
|
|
1408
|
+
return { problem: `This ${sourceWidth}×${sourceHeight} video is already ${resolution}p or larger.` };
|
|
1409
|
+
}
|
|
1410
|
+
const width = Math.round((sourceWidth * ratio) / 2) * 2;
|
|
1411
|
+
const height = Math.round((sourceHeight * ratio) / 2) * 2;
|
|
1412
|
+
if (Math.max(width, height) > VIDEO_UPSCALE_MAX_OUTPUT_LONG_EDGE || width * height > VIDEO_UPSCALE_MAX_OUTPUT_PIXELS) {
|
|
1413
|
+
return {
|
|
1414
|
+
problem: `At ${resolution}p this ${sourceWidth}×${sourceHeight} video would be ${width}×${height}, larger than the 2560×1440 upscale output limit.`
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
return { resolution, width, height };
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
// Output geometry matches the server's derivation: the short edge becomes the
|
|
1421
|
+
// target and both edges round to even pixels. Without an explicit resolution,
|
|
1422
|
+
// 1440p is used when the source allows it and 1080p otherwise.
|
|
1423
|
+
function resolveVideoUpscaleOutput(sourceWidth, sourceHeight, requestedResolution = null) {
|
|
1424
|
+
if (Math.min(sourceWidth, sourceHeight) > VIDEO_UPSCALE_MAX_SOURCE_SHORT_EDGE) {
|
|
1425
|
+
fatalCliError(
|
|
1426
|
+
`This video is ${sourceWidth}×${sourceHeight}; video upscaling accepts sources up to ${VIDEO_UPSCALE_MAX_SOURCE_SHORT_EDGE}px on the short edge.`,
|
|
1427
|
+
{ code: 'INVALID_UPSCALE_SOURCE', details: { sourceWidth, sourceHeight } }
|
|
1428
|
+
);
|
|
1429
|
+
}
|
|
1430
|
+
if (Math.ceil(sourceWidth / 64) * 64 * Math.ceil(sourceHeight / 64) * 64 > VIDEO_UPSCALE_MAX_SOURCE_BLOCK_PIXELS) {
|
|
1431
|
+
fatalCliError(
|
|
1432
|
+
`This video is ${sourceWidth}×${sourceHeight}; video upscaling accepts sources up to about 1344×768 pixels, or 768×1344 in portrait.`,
|
|
1433
|
+
{ code: 'INVALID_UPSCALE_SOURCE', details: { sourceWidth, sourceHeight } }
|
|
1434
|
+
);
|
|
1435
|
+
}
|
|
1436
|
+
const candidates = requestedResolution ? [requestedResolution] : [VIDEO_UPSCALE_DEFAULT_RESOLUTION, 1080];
|
|
1437
|
+
let lastProblem = '';
|
|
1438
|
+
for (const resolution of candidates) {
|
|
1439
|
+
const output = videoUpscaleOutputFor(sourceWidth, sourceHeight, resolution);
|
|
1440
|
+
if (!output.problem) return output;
|
|
1441
|
+
lastProblem = output.problem;
|
|
1442
|
+
}
|
|
1443
|
+
fatalCliError(lastProblem, {
|
|
1444
|
+
code: 'INVALID_UPSCALE_SIZE',
|
|
1445
|
+
details: { sourceWidth, sourceHeight, requestedResolution },
|
|
1446
|
+
...(requestedResolution === 1440 ? { hint: 'Use --upscale-resolution 1080 for this source.' } : {})
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
// Read the exact source geometry, frame count, and frame rate with ffprobe so
|
|
1451
|
+
// the request matches what the server verifies after upload.
|
|
1452
|
+
async function probeVideoUpscaleSource(buffer, sourceLabel) {
|
|
1453
|
+
if (buffer.length > VIDEO_UPSCALE_MAX_BYTES) {
|
|
1454
|
+
fatalCliError('Video upscaling accepts source files up to 100 MB.', {
|
|
1455
|
+
code: 'INVALID_UPSCALE_SOURCE',
|
|
1456
|
+
details: { sizeBytes: buffer.length, maxBytes: VIDEO_UPSCALE_MAX_BYTES }
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1459
|
+
const ffprobePath = getEnv('FFPROBE_PATH') || 'ffprobe';
|
|
1460
|
+
sanitizePath(ffprobePath, 'FFPROBE_PATH');
|
|
1461
|
+
const tempDir = createTrackedTempDir('sogni-video-upscale-probe-');
|
|
1462
|
+
const inputPath = mediaTempInputPath(tempDir, sourceLabel, '.mp4');
|
|
1463
|
+
let result;
|
|
1464
|
+
try {
|
|
1465
|
+
writeFileSync(inputPath, buffer);
|
|
1466
|
+
result = await runCommand(ffprobePath, [
|
|
1467
|
+
'-v', 'error',
|
|
1468
|
+
'-select_streams', 'v:0',
|
|
1469
|
+
'-count_frames',
|
|
1470
|
+
'-show_entries',
|
|
1471
|
+
'stream=width,height,nb_read_frames,avg_frame_rate,r_frame_rate,sample_aspect_ratio,color_transfer:stream_side_data=rotation',
|
|
1472
|
+
'-of', 'json',
|
|
1473
|
+
inputPath,
|
|
1474
|
+
], { captureOutput: true });
|
|
1475
|
+
} finally {
|
|
1476
|
+
try { if (existsSync(inputPath)) unlinkSync(inputPath); } catch {}
|
|
1477
|
+
try { rmdirSync(tempDir); } catch {}
|
|
1478
|
+
}
|
|
1479
|
+
if (result?.error && result.status === null) {
|
|
1480
|
+
const err = new Error('ffprobe is required for --upscale-video.');
|
|
1481
|
+
err.code = 'MISSING_FFPROBE';
|
|
1482
|
+
err.hint = 'Install ffmpeg/ffprobe (e.g. `brew install ffmpeg` / `apt install ffmpeg`) or set FFPROBE_PATH to a working ffprobe binary.';
|
|
1483
|
+
err.details = { ffprobePath };
|
|
1484
|
+
throw err;
|
|
1485
|
+
}
|
|
1486
|
+
let stream = null;
|
|
1487
|
+
try {
|
|
1488
|
+
stream = JSON.parse(result?.stdout || '{}')?.streams?.[0] ?? null;
|
|
1489
|
+
} catch {
|
|
1490
|
+
stream = null;
|
|
1491
|
+
}
|
|
1492
|
+
const width = Number(stream?.width);
|
|
1493
|
+
const height = Number(stream?.height);
|
|
1494
|
+
const frames = Number(stream?.nb_read_frames);
|
|
1495
|
+
const fps = parseFrameRate(stream?.avg_frame_rate);
|
|
1496
|
+
if (result?.status !== 0 || ![width, height, frames].every((value) => Number.isSafeInteger(value) && value > 0) || !fps) {
|
|
1497
|
+
fatalCliError('The source video dimensions, frame count, or frame rate could not be read. Use an MP4 or MOV file of 100 MB or less.', {
|
|
1498
|
+
code: 'INVALID_UPSCALE_SOURCE',
|
|
1499
|
+
details: { source: sourceLabel }
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
if (fps < VIDEO_UPSCALE_MIN_FPS || fps > VIDEO_UPSCALE_MAX_FPS) {
|
|
1503
|
+
fatalCliError(`This video runs at ${Number(fps.toFixed(3))} fps; video upscaling accepts ${VIDEO_UPSCALE_MIN_FPS}-${VIDEO_UPSCALE_MAX_FPS} fps.`, {
|
|
1504
|
+
code: 'INVALID_UPSCALE_SOURCE',
|
|
1505
|
+
details: { fps }
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
if (frames > VIDEO_UPSCALE_MAX_FRAMES || frames / fps > VIDEO_UPSCALE_MAX_DURATION_SECONDS + 0.001) {
|
|
1509
|
+
fatalCliError(
|
|
1510
|
+
`This video is ${frames} frames (${(frames / fps).toFixed(2)} s); video upscaling accepts up to ${VIDEO_UPSCALE_MAX_FRAMES} frames and about 15 seconds.`,
|
|
1511
|
+
{ code: 'INVALID_UPSCALE_SOURCE', details: { frames, fps } }
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
const rotated = Array.isArray(stream?.side_data_list)
|
|
1515
|
+
&& stream.side_data_list.some((item) => Number(item?.rotation || 0) % 360 !== 0);
|
|
1516
|
+
if (!['1:1', 'N/A', undefined].includes(stream?.sample_aspect_ratio) || rotated) {
|
|
1517
|
+
fatalCliError('Export the video with square pixels and its rotation applied before upscaling.', {
|
|
1518
|
+
code: 'INVALID_UPSCALE_SOURCE'
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
if (['smpte2084', 'arib-std-b67'].includes(stream?.color_transfer ?? '')) {
|
|
1522
|
+
fatalCliError('Convert HDR video to SDR before upscaling.', { code: 'INVALID_UPSCALE_SOURCE' });
|
|
1523
|
+
}
|
|
1524
|
+
return { width, height, frames, fps, sizeBytes: buffer.length };
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
function annotateVideoUpscaleError(error) {
|
|
1528
|
+
const message = String(error?.message || error?.originalError?.message || '');
|
|
1529
|
+
if (error && typeof error === 'object' && message.includes(FLASHVSR_UNAVAILABLE_MESSAGE)) {
|
|
1530
|
+
if (!error.code || error.code === 'PROJECT_ERROR') error.code = 'MODEL_UNAVAILABLE';
|
|
1531
|
+
error.hint = 'FlashVSR upscaling workers are not online yet, so nothing was charged. Try again later.';
|
|
1532
|
+
}
|
|
1533
|
+
return error;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1371
1536
|
// Safety cap for -n/--count: every output is a paid generation, so a typo like
|
|
1372
1537
|
// `-n 1000` (meant `-n 10`) must not launch a thousand-render batch. Raise
|
|
1373
1538
|
// deliberately with SOGNI_MAX_COUNT when a bigger batch is really wanted.
|
|
@@ -2721,6 +2886,8 @@ const options = {
|
|
|
2721
2886
|
upscaleImage: null, // Source image for promptless RTX VSR upscaling
|
|
2722
2887
|
upscaleScale: 2,
|
|
2723
2888
|
upscaleTargetLongestEdge: null,
|
|
2889
|
+
upscaleVideo: null, // Source video for promptless FlashVSR upscaling
|
|
2890
|
+
upscaleResolution: null, // FlashVSR output short edge (1080 | 1440)
|
|
2724
2891
|
looping: false, // Create looping video (i2v only): generate A→B then B→A and concatenate
|
|
2725
2892
|
photobooth: false, // Photobooth mode (InstantID face transfer)
|
|
2726
2893
|
cnStrength: null, // ControlNet strength override
|
|
@@ -2907,6 +3074,8 @@ const cliSet = {
|
|
|
2907
3074
|
upscaleImage: false,
|
|
2908
3075
|
upscaleScale: false,
|
|
2909
3076
|
upscaleTargetLongestEdge: false,
|
|
3077
|
+
upscaleVideo: false,
|
|
3078
|
+
upscaleResolution: false,
|
|
2910
3079
|
looping: false,
|
|
2911
3080
|
photobooth: false,
|
|
2912
3081
|
cnStrength: false,
|
|
@@ -3308,6 +3477,16 @@ for (let i = 0; i < args.length; i++) {
|
|
|
3308
3477
|
RTX_VSR_MAX_DIMENSION
|
|
3309
3478
|
);
|
|
3310
3479
|
cliSet.upscaleTargetLongestEdge = true;
|
|
3480
|
+
} else if (arg === '--upscale-video') {
|
|
3481
|
+
const raw = expandHomePath(requireFlagValue(args, i, arg));
|
|
3482
|
+
i++;
|
|
3483
|
+
options.upscaleVideo = raw;
|
|
3484
|
+
cliSet.upscaleVideo = true;
|
|
3485
|
+
} else if (arg === '--upscale-resolution') {
|
|
3486
|
+
const raw = requireFlagValue(args, i, arg);
|
|
3487
|
+
i++;
|
|
3488
|
+
options.upscaleResolution = parseVideoUpscaleResolutionValue(raw, arg);
|
|
3489
|
+
cliSet.upscaleResolution = true;
|
|
3311
3490
|
} else if (arg === '--photobooth') {
|
|
3312
3491
|
options.photobooth = true;
|
|
3313
3492
|
cliSet.photobooth = true;
|
|
@@ -3943,6 +4122,8 @@ Image Options:
|
|
|
3943
4122
|
--upscale <path|url> Promptless NVIDIA RTX VSR upscale, up to 16K (one source image)
|
|
3944
4123
|
--upscale-scale <n> Enlarge longest edge by 2, 3, or 4 (default: 2)
|
|
3945
4124
|
--target-longest-edge <px> Explicit output longest edge, up to 15360 (overrides scale)
|
|
4125
|
+
--upscale-video <path|url> Promptless FlashVSR upscale of one video to 1080p/1440p (keeps frames, fps, audio)
|
|
4126
|
+
--upscale-resolution <p> Output short edge for --upscale-video: 1080 or 1440 (default: 1440; 1080 below 720p)
|
|
3946
4127
|
|
|
3947
4128
|
Photobooth (Face Transfer):
|
|
3948
4129
|
--photobooth Face transfer mode (InstantID + SDXL Turbo)
|
|
@@ -4183,6 +4364,9 @@ LTX 2.3 rollback-only capabilities:
|
|
|
4183
4364
|
ltx23-22b-fp8_v2v_distilled Video-to-video rollback
|
|
4184
4365
|
ltx23-22b-10eros-v1.4-fp8mixed_i2v Private mature-theme I2V; first and/or last frame; requires --no-filter
|
|
4185
4366
|
|
|
4367
|
+
Video Upscale Model:
|
|
4368
|
+
flashvsr_v1.1_tiny_long_bf16 Promptless FlashVSR upscale to 1080p/1440p (--upscale-video)
|
|
4369
|
+
|
|
4186
4370
|
Music Models:
|
|
4187
4371
|
ace_step_1.5_xl_turbo Default direct music generation
|
|
4188
4372
|
ace_step_1.5_xl_sft Quality variant with stronger lyric handling
|
|
@@ -4635,7 +4819,7 @@ if (options.outputFormat) {
|
|
|
4635
4819
|
details: { outputFormat: options.outputFormat }
|
|
4636
4820
|
});
|
|
4637
4821
|
}
|
|
4638
|
-
} else if (options.video) {
|
|
4822
|
+
} else if (options.video || options.upscaleVideo) {
|
|
4639
4823
|
if (options.outputFormat !== 'mp4') {
|
|
4640
4824
|
fatalCliError('Video output format must be "mp4".', {
|
|
4641
4825
|
code: 'INVALID_ARGUMENT',
|
|
@@ -5144,6 +5328,17 @@ if (options.music) {
|
|
|
5144
5328
|
if (!cliSet.timeout && !timeoutFromConfig && options.timeout === 30000) {
|
|
5145
5329
|
options.timeout = 1800000; // 30 min for queued and long-running video jobs
|
|
5146
5330
|
}
|
|
5331
|
+
} else if (options.upscaleVideo) {
|
|
5332
|
+
if (options.model && options.model !== FLASHVSR_MODEL_ID) {
|
|
5333
|
+
fatalCliError(`--upscale-video requires model ${FLASHVSR_MODEL_ID}.`, {
|
|
5334
|
+
code: 'INVALID_ARGUMENT',
|
|
5335
|
+
details: { model: options.model, requiredModel: FLASHVSR_MODEL_ID }
|
|
5336
|
+
});
|
|
5337
|
+
}
|
|
5338
|
+
options.model = FLASHVSR_MODEL_ID;
|
|
5339
|
+
if (!cliSet.timeout && !timeoutFromConfig && options.timeout === 30000) {
|
|
5340
|
+
options.timeout = 1800000; // 30 min for queued video work
|
|
5341
|
+
}
|
|
5147
5342
|
} else if (options.upscaleImage) {
|
|
5148
5343
|
if (options.model && options.model !== RTX_VSR_MODEL_ID) {
|
|
5149
5344
|
fatalCliError(`--upscale requires model ${RTX_VSR_MODEL_ID}.`, {
|
|
@@ -5268,6 +5463,7 @@ const commandUsesGenerationSeed = !options.apiChat &&
|
|
|
5268
5463
|
!options.sourceReelDir &&
|
|
5269
5464
|
!options.remixAudio &&
|
|
5270
5465
|
!options.upscaleImage &&
|
|
5466
|
+
!options.upscaleVideo &&
|
|
5271
5467
|
!options.listMedia &&
|
|
5272
5468
|
!options.memoryAction &&
|
|
5273
5469
|
!options.personalityAction &&
|
|
@@ -5306,7 +5502,7 @@ const wan3HasMediaInput = isWan3ModelLocal(options.model) && Boolean(
|
|
|
5306
5502
|
|| options.wan3ReferenceFileUrl
|
|
5307
5503
|
|| options.wan3ReferenceLinkUrl
|
|
5308
5504
|
);
|
|
5309
|
-
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) {
|
|
5505
|
+
if (!options.prompt && !wan3HasMediaInput && !options.upscaleImage && !options.upscaleVideo && !options.apiChat && !apiWorkflowUtilityAction && !apiWorkflowStartAction && !apiModelUtilityAction && !liveModelUtilityAction && !loraCatalogUtilityAction && !apiReplayUtilityAction && !contractUtilityAction && !storyboardPlanUtilityAction && !options.estimateVideoCost && !options.multiAngle && !options.showBalance && !options.showVersion && !options.doctor && !options.extractLastFrame && !options.extractFirstFrame && !options.extractFrameAt && !options.trimVideo && !options.verifyVideo && !options.concatVideos && !options.sourceReelDir && !options.remixAudio && !options.listMedia && !options.memoryAction && !options.personalityAction && !personaUtilityAction) {
|
|
5310
5506
|
fatalCliError('No prompt provided. Use --help for usage.', { code: 'INVALID_ARGUMENT' });
|
|
5311
5507
|
}
|
|
5312
5508
|
|
|
@@ -5349,6 +5545,38 @@ if (!options.upscaleImage && (cliSet.upscaleScale || cliSet.upscaleTargetLongest
|
|
|
5349
5545
|
});
|
|
5350
5546
|
}
|
|
5351
5547
|
|
|
5548
|
+
if (options.upscaleVideo) {
|
|
5549
|
+
if (options.prompt) {
|
|
5550
|
+
fatalCliError('--upscale-video is promptless and does not accept a prompt.', { code: 'INVALID_ARGUMENT' });
|
|
5551
|
+
}
|
|
5552
|
+
if (
|
|
5553
|
+
options.upscaleImage || options.video || options.music || options.photobooth || options.multiAngle
|
|
5554
|
+
|| options.contextImages.length > 0 || options.refImage || options.refImageEnd || options.refAudio
|
|
5555
|
+
|| options.refAudios.length > 0 || options.refVideo || options.refVideos.length > 0 || options.refMask
|
|
5556
|
+
) {
|
|
5557
|
+
fatalCliError('--upscale-video cannot be combined with --upscale, --video, --music, photobooth, --multi-angle, --ref, --ref-end, --ref-audio, --ref-video, --mask, or -c/--context.', {
|
|
5558
|
+
code: 'INVALID_ARGUMENT'
|
|
5559
|
+
});
|
|
5560
|
+
}
|
|
5561
|
+
if (options.count !== 1) {
|
|
5562
|
+
fatalCliError('--upscale-video produces exactly one output; omit -n/--count or set it to 1.', {
|
|
5563
|
+
code: 'INVALID_ARGUMENT',
|
|
5564
|
+
details: { count: options.count }
|
|
5565
|
+
});
|
|
5566
|
+
}
|
|
5567
|
+
if (cliSet.width || cliSet.height || cliSet.fps || cliSet.duration || cliSet.frames) {
|
|
5568
|
+
fatalCliError('--upscale-video keeps the source frames, frame rate, and aspect ratio; choose the output with --upscale-resolution 1080 or 1440.', {
|
|
5569
|
+
code: 'INVALID_ARGUMENT'
|
|
5570
|
+
});
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
|
|
5574
|
+
if (!options.upscaleVideo && cliSet.upscaleResolution) {
|
|
5575
|
+
fatalCliError('--upscale-resolution requires --upscale-video <path|url>.', {
|
|
5576
|
+
code: 'INVALID_ARGUMENT'
|
|
5577
|
+
});
|
|
5578
|
+
}
|
|
5579
|
+
|
|
5352
5580
|
if (options.legacyWan3TaskType !== null) {
|
|
5353
5581
|
fatalCliError(
|
|
5354
5582
|
'--wan3-task-type has been removed because Wan 3 has no provider edit/extend task mode. Use --workflow r2v with --ref-video for loose conditioning, or select a video-to-video model for editing.',
|
|
@@ -12280,7 +12508,7 @@ async function main() {
|
|
|
12280
12508
|
|
|
12281
12509
|
// Video catalog data is loaded before model-aware dimension planning.
|
|
12282
12510
|
// Other media types retain the connected-stage lookup used previously.
|
|
12283
|
-
if (!options.video) {
|
|
12511
|
+
if (!options.video && !options.upscaleVideo) {
|
|
12284
12512
|
await loadLiveModelDefaults(options.model);
|
|
12285
12513
|
}
|
|
12286
12514
|
await ensureSufficientVideoBalance(client, log);
|
|
@@ -12359,13 +12587,13 @@ async function main() {
|
|
|
12359
12587
|
client.on(ClientEvent.JOB_COMPLETED, (data) => {
|
|
12360
12588
|
const jobData = data.job?.data || {};
|
|
12361
12589
|
results.push({
|
|
12362
|
-
resultUrl: data.resultUrl || (options.music ? data.audioUrl : options.video ? data.videoUrl : data.imageUrl),
|
|
12590
|
+
resultUrl: data.resultUrl || (options.music ? data.audioUrl : (options.video || options.upscaleVideo) ? data.videoUrl : data.imageUrl),
|
|
12363
12591
|
seed: jobData.seed,
|
|
12364
12592
|
jobIndex: data.jobIndex,
|
|
12365
12593
|
projectId: data.projectId
|
|
12366
12594
|
});
|
|
12367
12595
|
completedJobs++;
|
|
12368
|
-
log(`${options.music ? 'Music' : options.video ? 'Video' : 'Image'} ${completedJobs}/${options.count} completed`);
|
|
12596
|
+
log(`${options.music ? 'Music' : (options.video || options.upscaleVideo) ? 'Video' : 'Image'} ${completedJobs}/${options.count} completed`);
|
|
12369
12597
|
|
|
12370
12598
|
if (completedJobs >= options.count) {
|
|
12371
12599
|
clearTimeout(timeout);
|
|
@@ -12396,7 +12624,7 @@ async function main() {
|
|
|
12396
12624
|
});
|
|
12397
12625
|
|
|
12398
12626
|
// Progress for longer-running media jobs.
|
|
12399
|
-
if (options.video || options.music) {
|
|
12627
|
+
if (options.video || options.music || options.upscaleVideo) {
|
|
12400
12628
|
client.on(ClientEvent.PROJECT_PROGRESS, (data) => {
|
|
12401
12629
|
if (data.percentage && data.percentage > 0) {
|
|
12402
12630
|
log(`Progress: ${Math.round(data.percentage)}%`);
|
|
@@ -13081,6 +13309,49 @@ async function main() {
|
|
|
13081
13309
|
if (audioResult?.error || audioResult?.message) {
|
|
13082
13310
|
throw buildProjectResultError(audioResult);
|
|
13083
13311
|
}
|
|
13312
|
+
} else if (options.upscaleVideo) {
|
|
13313
|
+
log(`Upscaling video with ${FLASHVSR_MODEL_ID}...`);
|
|
13314
|
+
const sourceBuffer = await fetchMediaBuffer(options.upscaleVideo);
|
|
13315
|
+
const source = await probeVideoUpscaleSource(sourceBuffer, options.upscaleVideo);
|
|
13316
|
+
const target = resolveVideoUpscaleOutput(source.width, source.height, options.upscaleResolution);
|
|
13317
|
+
options.width = target.width;
|
|
13318
|
+
options.height = target.height;
|
|
13319
|
+
options.frames = source.frames;
|
|
13320
|
+
options.fps = source.fps;
|
|
13321
|
+
options.outputFormat = 'mp4';
|
|
13322
|
+
options._videoUpscale = { source, resolution: target.resolution };
|
|
13323
|
+
log(
|
|
13324
|
+
`Source ${source.width}x${source.height}, ${source.frames} frames at ${Number(source.fps.toFixed(3))} fps; ` +
|
|
13325
|
+
`output ${target.width}x${target.height} (${target.resolution}p), every frame and the audio kept.`
|
|
13326
|
+
);
|
|
13327
|
+
|
|
13328
|
+
// The exact frame count and rate satisfy the SDK's FlashVSR validation;
|
|
13329
|
+
// the server re-probes the upload and adopts its verified size, so the
|
|
13330
|
+
// output width/height are not sent.
|
|
13331
|
+
const upscaleVideoConfig = {
|
|
13332
|
+
modelId: FLASHVSR_MODEL_ID,
|
|
13333
|
+
positivePrompt: '',
|
|
13334
|
+
numberOfMedia: 1,
|
|
13335
|
+
referenceVideo: sourceBuffer,
|
|
13336
|
+
upscaleResolution: target.resolution,
|
|
13337
|
+
frames: source.frames,
|
|
13338
|
+
fps: source.fps,
|
|
13339
|
+
tokenType: options.tokenType || 'spark',
|
|
13340
|
+
waitForCompletion: false,
|
|
13341
|
+
autoResizeVideoAssets: false
|
|
13342
|
+
};
|
|
13343
|
+
|
|
13344
|
+
let upscaleVideoResult;
|
|
13345
|
+
try {
|
|
13346
|
+
upscaleVideoResult = trackProjectResult(
|
|
13347
|
+
await client.createVideoProject(withBillingMode(upscaleVideoConfig))
|
|
13348
|
+
);
|
|
13349
|
+
} catch (error) {
|
|
13350
|
+
throw annotateVideoUpscaleError(error);
|
|
13351
|
+
}
|
|
13352
|
+
if (upscaleVideoResult?.error || upscaleVideoResult?.message) {
|
|
13353
|
+
throw annotateVideoUpscaleError(buildProjectResultError(upscaleVideoResult));
|
|
13354
|
+
}
|
|
13084
13355
|
} else if (options.upscaleImage) {
|
|
13085
13356
|
log(`Upscaling with ${RTX_VSR_MODEL_ID}...`);
|
|
13086
13357
|
const sourceBuffer = await fetchMediaBuffer(options.upscaleImage);
|
|
@@ -13334,7 +13605,7 @@ async function main() {
|
|
|
13334
13605
|
const seeds = results.map(r => r.seed ?? options.seed);
|
|
13335
13606
|
const renderInfo = {
|
|
13336
13607
|
timestamp: new Date().toISOString(),
|
|
13337
|
-
type: options.music ? 'music' : options.video ? 'video' : 'image',
|
|
13608
|
+
type: options.music ? 'music' : (options.video || options.upscaleVideo) ? 'video' : 'image',
|
|
13338
13609
|
prompt: options.prompt,
|
|
13339
13610
|
model: options.model,
|
|
13340
13611
|
width: options.music ? null : options.width,
|
|
@@ -13380,6 +13651,14 @@ async function main() {
|
|
|
13380
13651
|
renderInfo.shift = options.musicShift;
|
|
13381
13652
|
}
|
|
13382
13653
|
}
|
|
13654
|
+
if (options.upscaleVideo && options._videoUpscale) {
|
|
13655
|
+
renderInfo.upscaleResolution = options._videoUpscale.resolution;
|
|
13656
|
+
renderInfo.fps = options.fps;
|
|
13657
|
+
renderInfo.frames = options.frames;
|
|
13658
|
+
renderInfo.sourceVideo = options.upscaleVideo;
|
|
13659
|
+
renderInfo.sourceWidth = options._videoUpscale.source.width;
|
|
13660
|
+
renderInfo.sourceHeight = options._videoUpscale.source.height;
|
|
13661
|
+
}
|
|
13383
13662
|
if (options.video) {
|
|
13384
13663
|
renderInfo.workflow = options.videoWorkflow;
|
|
13385
13664
|
renderInfo.fps = options.fps;
|
|
@@ -13558,7 +13837,7 @@ async function main() {
|
|
|
13558
13837
|
await buildConcatVideoFromClips(options.output, [clip1Path, clip2Path]);
|
|
13559
13838
|
log(`Saved looping video to ${options.output}`);
|
|
13560
13839
|
} else {
|
|
13561
|
-
writeOutputFileSafe(options.output, buffer, options.video ? 'video' : options.music ? 'audio' : 'image');
|
|
13840
|
+
writeOutputFileSafe(options.output, buffer, (options.video || options.upscaleVideo) ? 'video' : options.music ? 'audio' : 'image');
|
|
13562
13841
|
log(`Saved to ${options.output}`);
|
|
13563
13842
|
}
|
|
13564
13843
|
}
|
|
@@ -13567,7 +13846,7 @@ async function main() {
|
|
|
13567
13846
|
if (options.json) {
|
|
13568
13847
|
const output = {
|
|
13569
13848
|
success: true,
|
|
13570
|
-
type: options.music ? 'music' : options.video ? 'video' : 'image',
|
|
13849
|
+
type: options.music ? 'music' : (options.video || options.upscaleVideo) ? 'video' : 'image',
|
|
13571
13850
|
prompt: options.prompt,
|
|
13572
13851
|
model: options.model,
|
|
13573
13852
|
width: options.music ? null : options.width,
|
|
@@ -13611,6 +13890,13 @@ async function main() {
|
|
|
13611
13890
|
output.shift = options.musicShift;
|
|
13612
13891
|
}
|
|
13613
13892
|
}
|
|
13893
|
+
if (options.upscaleVideo && options._videoUpscale) {
|
|
13894
|
+
output.upscaleResolution = options._videoUpscale.resolution;
|
|
13895
|
+
output.fps = options.fps;
|
|
13896
|
+
output.frames = options.frames;
|
|
13897
|
+
output.sourceWidth = options._videoUpscale.source.width;
|
|
13898
|
+
output.sourceHeight = options._videoUpscale.source.height;
|
|
13899
|
+
}
|
|
13614
13900
|
if (options.video) {
|
|
13615
13901
|
output.workflow = options.videoWorkflow;
|
|
13616
13902
|
output.fps = options.fps;
|
|
@@ -13686,6 +13972,8 @@ async function main() {
|
|
|
13686
13972
|
}
|
|
13687
13973
|
|
|
13688
13974
|
} catch (error) {
|
|
13975
|
+
// A FlashVSR refusal can also arrive as a project event after submission.
|
|
13976
|
+
if (options.upscaleVideo) annotateVideoUpscaleError(error);
|
|
13689
13977
|
// Token auto-fallback: if using auto mode and got insufficient balance, retry with the other token
|
|
13690
13978
|
const isBalanceError = isStructuredInsufficientBalanceError(error);
|
|
13691
13979
|
if (_allowAutoTokenFallback && isBalanceError && options.tokenType === 'spark') {
|
package/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '3.
|
|
1
|
+
export const PACKAGE_VERSION = '3.41.0';
|