reelforge 1.20.0 → 1.20.2
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/README.md +295 -295
- package/bin/reelforge.js +8 -8
- package/dist/commands/compose.js +28 -28
- package/dist/commands/create.js +3 -24
- package/package.json +44 -44
package/README.md
CHANGED
|
@@ -1,295 +1,295 @@
|
|
|
1
|
-
# reelforge
|
|
2
|
-
|
|
3
|
-
> Turn a topic or script into a finished vertical video — narration, visuals, and subtitles, assembled for you. Every capability is a command, with `--help` at every level.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g reelforge
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Or use directly without install:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npx reelforge <command>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
After install, two binaries are on your `PATH` — `reelforge` and the short alias `rf`. Both behave identically; the docs use `rf` from here on.
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
rf --version # same as `reelforge --version`
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Quick start
|
|
24
|
-
|
|
25
|
-
The CLI ships pointing at the hosted service. Log in once, then call:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install -g reelforge
|
|
29
|
-
rf login # opens browser; headless? rf login <api_key>
|
|
30
|
-
rf whoami # balance + api_keys
|
|
31
|
-
rf create "为什么我们还没找到外星文明?" # auto-saves to ./<title>-<id>.mp4 in cwd
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
That's the whole story — no server to run.
|
|
35
|
-
|
|
36
|
-
### Output behavior
|
|
37
|
-
|
|
38
|
-
| invocation | result |
|
|
39
|
-
|---|---|
|
|
40
|
-
| `rf create "..."` | Saves to `./<sanitized-title>-<task_id_short>.mp4`, prints the path |
|
|
41
|
-
| `rf create "..." -o ./videos/space.mp4` | Saves to that exact path (must include filename, not just a directory) |
|
|
42
|
-
| `rf create "..." --no-download` | Skips local save, prints JSON result with `video_url` |
|
|
43
|
-
| `rf create "..." \| jq .video_url` | When stdout is piped, download is skipped automatically |
|
|
44
|
-
|
|
45
|
-
## Global options
|
|
46
|
-
|
|
47
|
-
| flag | description |
|
|
48
|
-
|---|---|
|
|
49
|
-
| `-s, --server <url>` | Server URL (overrides `$REELFORGE_SERVER`; defaults to the hosted service) |
|
|
50
|
-
| `-k, --api-key <key>` | API key (overrides `$REELFORGE_API_KEY` and `reelforge login` saved key) |
|
|
51
|
-
| `--json` | Output raw JSON instead of pretty text — pipe-friendly |
|
|
52
|
-
| `--quiet` | Suppress informational messages on stderr |
|
|
53
|
-
| `-v, --version` | Show CLI version |
|
|
54
|
-
| `-h, --help` | Show help (works on every sub-command) |
|
|
55
|
-
|
|
56
|
-
## Command map
|
|
57
|
-
|
|
58
|
-
Run `rf <command> --help` for full details on any of these.
|
|
59
|
-
|
|
60
|
-
### Core capabilities
|
|
61
|
-
|
|
62
|
-
| command | what it does |
|
|
63
|
-
|---|---|
|
|
64
|
-
| `llm chat -p <text>` | Send one prompt to the configured model |
|
|
65
|
-
| `llm presets` | List built-in model presets |
|
|
66
|
-
| `tts ... -t <text> -o out.mp3` | Text-to-speech (free local + cloud voice options) |
|
|
67
|
-
| `tts voices [--locale zh]` | List supported voices |
|
|
68
|
-
| `images generate -p <prompt>` | Image generation |
|
|
69
|
-
|
|
70
|
-
### Content / audio / subtitle atomics
|
|
71
|
-
|
|
72
|
-
| command | what it does |
|
|
73
|
-
|---|---|
|
|
74
|
-
| `content scene-plan -t <topic>` | Single LLM call: title + master script + per-scene image prompts (replaces the old narration / split / image-prompts / title trio) |
|
|
75
|
-
| `content scene-plan --script <text-or-@file>` | Same, but the user supplies the script verbatim — LLM only segments and writes image prompts |
|
|
76
|
-
| `audio transcribe -f <file>` / `--url <url>` | Speech-to-text with word + segment timestamps |
|
|
77
|
-
| `subtitles split -t <text-or-@file>` | Deterministic tiered-punctuation subtitle line splitter (pure function, zero billing) |
|
|
78
|
-
|
|
79
|
-
### Composition
|
|
80
|
-
|
|
81
|
-
| command | what it does |
|
|
82
|
-
|---|---|
|
|
83
|
-
| `templates list [--size 1080x1920] [--type image]` | List HTML frame templates |
|
|
84
|
-
| `templates preview <keyOrPath> [-o out.png]` | Render a preview from a preset key **or your own local .html file** |
|
|
85
|
-
| `templates show <key> [-o file.html]` | Print or save the source HTML of any preset — copy it as a starting point for a custom template |
|
|
86
|
-
| `frames render -t <keyOrPath> --title ... --text ...` | Render a single composed frame to PNG. `-t` accepts a preset key **or a local .html path** |
|
|
87
|
-
| `compositions concat <v1> <v2> -o out.mp4` | FFmpeg concat (+ optional BGM) |
|
|
88
|
-
| `compositions bgm -i video.mp4 --bgm bgm.mp3 -o out.mp4` | Add background music |
|
|
89
|
-
| `compositions image-to-video -i img.png -a aud.mp3 -o out.mp4` | Build video from image + audio |
|
|
90
|
-
| `compositions overlay -v video.mp4 --overlay overlay.png -o out.mp4` | Overlay PNG on video |
|
|
91
|
-
|
|
92
|
-
### End-to-end pipelines
|
|
93
|
-
|
|
94
|
-
All `pipelines *` commands submit an **async task** and (by default) poll until it finishes with a live progress indicator on stderr. Use `--no-wait` to return immediately with a `task_id`, then `rf tasks wait <id>` later.
|
|
95
|
-
|
|
96
|
-
The standard pipeline turns a topic or script into a finished vertical video — narration, visuals, and subtitles are generated and assembled for you. One continuous narration track; visuals cut at scene boundaries; subtitles cut at line boundaries.
|
|
97
|
-
|
|
98
|
-
| command | what it does |
|
|
99
|
-
|---|---|
|
|
100
|
-
| `pipelines standard -t <topic>` (or `--script <text>`) | Audio-first pipeline; `-d/--duration` and `-p/--pace` are the two main knobs |
|
|
101
|
-
|
|
102
|
-
#### Composition knobs
|
|
103
|
-
|
|
104
|
-
Three independent axes — mix and match as you like:
|
|
105
|
-
|
|
106
|
-
| flag | values | default | what changes |
|
|
107
|
-
|---|---|---|---|
|
|
108
|
-
| `--motion` | `off` / `lite` / `max` | `lite` | per-scene zoompan + crossfade intensity |
|
|
109
|
-
| `--layout` | `full` / `blur-bg` / `letterbox` | `full` | how the image sits in the canvas |
|
|
110
|
-
| `--subtitle-style` | `plate` / `stroke` / `cinema` | `plate` | subtitle look |
|
|
111
|
-
|
|
112
|
-
**Layout presets**:
|
|
113
|
-
- `full` — image fills the whole 1080×1920 canvas. Generates a 1080×1920 image. High-impact; best for human portraits, landscapes, 9:16-native content.
|
|
114
|
-
- `blur-bg` — image at 1080×1080 centered, top/bottom is a gaussian-blurred copy of the **same image** moving in sync with the foreground. Generates a 1080×1080 image (cheaper + no wasted pixels). Best for charts, screenshots, non-9:16 source content (小红书 / 抖音 style).
|
|
115
|
-
- `letterbox` — image at 1080×1080 centered, top/bottom is a solid matte (CSS color). Generates a 1080×1080 image. Cinematic / calm. Customize the matte with `--layout-matte-color "#1a1a1a"` (default `black`).
|
|
116
|
-
|
|
117
|
-
Examples:
|
|
118
|
-
```bash
|
|
119
|
-
rf create "财经日报" --layout blur-bg # 小红书 / 抖音
|
|
120
|
-
rf create "纪录片片段" --layout letterbox --motion max # 电影感
|
|
121
|
-
rf create "..." --layout letterbox --layout-matte-color "#1a1a1a" # 柔和黑
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Resources
|
|
125
|
-
|
|
126
|
-
| command | what it does |
|
|
127
|
-
|---|---|
|
|
128
|
-
| `bgm list / upload <file> / delete <name>` | Manage background music |
|
|
129
|
-
| `files list / upload <file> / download <path> / delete <path>` | Manage user assets |
|
|
130
|
-
|
|
131
|
-
### System
|
|
132
|
-
|
|
133
|
-
| command | what it does |
|
|
134
|
-
|---|---|
|
|
135
|
-
| `config get` | Read server config (keys masked) |
|
|
136
|
-
| `config set <key> <value>` | Update a dotted-path setting (e.g. `llm.api_key sk-xxx`) |
|
|
137
|
-
| `config patch <file>` | Apply a JSON-merge patch |
|
|
138
|
-
| `tasks list [--status running]` | List recent tasks |
|
|
139
|
-
| `tasks get <id>` / `tasks wait <id>` / `tasks cancel <id>` | Task lifecycle |
|
|
140
|
-
| `history list / get <id> / delete <id>` | Browse / delete completed runs |
|
|
141
|
-
| `health` | Server health + capability check |
|
|
142
|
-
|
|
143
|
-
### Heavy brand customization (custom overlay templates)
|
|
144
|
-
|
|
145
|
-
`--motion` / `--layout` / `--subtitle-*` / `--brand-*` cover the common cases. For full visual identity ownership (custom path bar, accent decorations, light theme, footer block, etc.) pass a custom overlay HTML via `--frame-template <local.html | preset_key>`:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
rf templates show 1080x1920/default.html -o ./my-brand.html
|
|
149
|
-
# ...edit my-brand.html (change colors, add structure, etc.)...
|
|
150
|
-
rf create "我的视频" --frame-template ./my-brand.html
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
**Contract for custom HTML**:
|
|
154
|
-
|
|
155
|
-
- Canvas is **1080×1920** (pipeline-fixed; don't declare a different size in `<meta>`).
|
|
156
|
-
- Background must be **transparent** — the scene image is composited by the renderer outside the HTML layer.
|
|
157
|
-
- **`{{image}}` no longer exists.** Using `<img src="{{image}}">` is a hard error at submit time. The image is composited by the renderer.
|
|
158
|
-
- The pipeline injects these placeholders for you:
|
|
159
|
-
|
|
160
|
-
| Placeholder | What it is |
|
|
161
|
-
|---|---|
|
|
162
|
-
| `{{title}}` `{{text}}` | per-frame content |
|
|
163
|
-
| `{{index}}` `{{total}}` | "scene N of M" — `{{total}}` is the LLM-decided scene count, don't hardcode |
|
|
164
|
-
| `{{layout}}` | `"full"` / `"blur-bg"` / `"letterbox"` — react via `body[data-layout="..."]` CSS to put title/subtitle in the matte zones when layout ≠ full |
|
|
165
|
-
| `{{subtitle_style}}` `{{subtitle_color}}` `{{subtitle_background}}` | subtitle preset + overrides |
|
|
166
|
-
| `{{brand_position}}` `{{brand_handle}}` `{{brand_slogan}}` `{{brand_logo}}` `{{brand_color}}` | brand-chrome inputs (use or ignore as you like) |
|
|
167
|
-
|
|
168
|
-
Inline HTML is hard-capped at 2 MB. The audio + motion + character-ref + scene-plan stages all keep working identically — only the overlay layer is yours.
|
|
169
|
-
|
|
170
|
-
**Publishing to short-video platforms (Douyin / TikTok / WeChat Channels)** — the default composition renders to the full 1080×1920 canvas, but those apps overlay UI on top/bottom/right and cover-crop ~96-180px on each side on taller phones. ReelForge does NOT bake platform-specific padding into the renderer. Look up reference safe-zone numbers + recommended `--media-anchor-y` values per platform:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
rf platform # overview table for all platforms
|
|
174
|
-
rf platform 抖音 # detail + anchor variants (alias of douyin)
|
|
175
|
-
rf platform tiktok
|
|
176
|
-
rf platform wechat # 视频号
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
## Examples
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
# 1. One-click out a video (45s default, AI writes the script)
|
|
183
|
-
rf create "为什么我们还没找到外星文明?"
|
|
184
|
-
|
|
185
|
-
# 2. Longer video with a slower visual rhythm
|
|
186
|
-
rf create "深夜便利店的灯光" -d 90 -p slow
|
|
187
|
-
|
|
188
|
-
# 3. Your own script — no narration-splitting on your side, the pipeline handles it
|
|
189
|
-
rf create --script @./my-script.txt
|
|
190
|
-
rf create --script "雨水缓缓滑落在玻璃窗上,像是无声的泪珠。"
|
|
191
|
-
|
|
192
|
-
# 4. Preview-first workflow: scrub the storyboard in the browser
|
|
193
|
-
# before paying for the MP4 render. Finalize with `rf render` when satisfied.
|
|
194
|
-
rf create "..." --preview-only # opens browser studio
|
|
195
|
-
rf render <task-id> # produce the MP4
|
|
196
|
-
|
|
197
|
-
# 5. Push the image square up to grow the bottom matte (抖音 long-description
|
|
198
|
-
# case); subtitle position follows the image automatically.
|
|
199
|
-
rf create "..." --layout blur-bg --media-anchor-y 0.40
|
|
200
|
-
# See `rf platform 抖音` for the safe range and per-scenario recommendations.
|
|
201
|
-
|
|
202
|
-
# 6. Encoder budget — pick a quality preset or set an exact bitrate.
|
|
203
|
-
rf create "..." --quality draft # ~1 Mbps, ~3-4× smaller than default
|
|
204
|
-
rf create "..." --video-bitrate 750k # exact bitrate
|
|
205
|
-
rf create "..." --crf 28 # fine-grained control
|
|
206
|
-
|
|
207
|
-
# 7. Pick a built-in visual style preset
|
|
208
|
-
rf create "美食教程" --style photorealistic
|
|
209
|
-
|
|
210
|
-
# 5. Pipeline form with explicit output path
|
|
211
|
-
rf pipelines standard \
|
|
212
|
-
--script @./script.txt \
|
|
213
|
-
--frame-template 1080x1920/image_default.html \
|
|
214
|
-
-p normal -o smoke.mp4
|
|
215
|
-
|
|
216
|
-
# 6. Inspect existing tasks & redownload a finished video
|
|
217
|
-
rf tasks list --limit 5
|
|
218
|
-
rf history get <task-id> --download recovered.mp4
|
|
219
|
-
|
|
220
|
-
# 7. Atomics for stand-alone use
|
|
221
|
-
rf content scene-plan -t "雨天的玻璃窗" -d 45 --json | jq .scenes
|
|
222
|
-
rf audio transcribe -f narration.mp3 --json | jq '.words[:5]'
|
|
223
|
-
rf subtitles split -t @./narration.txt --min 10 --hard-max 24
|
|
224
|
-
|
|
225
|
-
# 8. JSON pipe for automation
|
|
226
|
-
rf llm presets --json | jq '.[].defaultModel'
|
|
227
|
-
|
|
228
|
-
# 9. Use your own HTML template (no PR/release needed)
|
|
229
|
-
# Any --frame-template that points to a local .html file is read and sent
|
|
230
|
-
# inline. Declare size inside the file via
|
|
231
|
-
# <meta name="template:width" content="1080">
|
|
232
|
-
# <meta name="template:height" content="1920">
|
|
233
|
-
# or pass --frame-template-size 1080x1920.
|
|
234
|
-
rf templates show 1080x1920/image_default.html -o my-brand.html # copy a preset
|
|
235
|
-
# ...edit my-brand.html to suit your style...
|
|
236
|
-
rf templates preview ./my-brand.html --title "Hello" -o preview.png
|
|
237
|
-
rf frames render -t ./my-brand.html --values '{"author":"Alice"}' -o frame.png
|
|
238
|
-
rf pipelines standard -t "宠物" --frame-template ./my-brand.html -o final.mp4
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
### Custom HTML templates
|
|
242
|
-
|
|
243
|
-
Easiest way to start: grab a preset as a reference.
|
|
244
|
-
|
|
245
|
-
```bash
|
|
246
|
-
rf templates list # see all keys
|
|
247
|
-
rf templates show 1080x1920/static_default.html # print to stdout
|
|
248
|
-
rf templates show 1080x1920/image_default.html -o my-brand.html # save and edit
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
`{{title}}`, `{{text}}`, `{{image}}`, `{{index}}`, `{{total}}` are reserved built-ins auto-injected by the pipeline; everything else uses the `{{name:type=default}}` DSL (`type` ∈ `text|number|color|bool`). Pass extras through `--values '{"author":"Alice"}'` (or `template_params` on the pipeline API).
|
|
252
|
-
|
|
253
|
-
- `{{index}}` — current scene number, 1-based
|
|
254
|
-
- `{{total}}` — scene count the LLM actually produced (use this for "scene N of M" badges; don't hardcode in `template_params`, the scene count is decided at runtime)
|
|
255
|
-
|
|
256
|
-
#### Template type — does the pipeline generate an AI image per scene?
|
|
257
|
-
|
|
258
|
-
When you ship an inline template through `rf create` / `rf pipelines standard`, ReelForge needs to know whether each scene should kick off image generation. Resolution priority (high → low):
|
|
259
|
-
|
|
260
|
-
1. Explicit flag — `--frame-template-type image|static|asset` (or `frame_template_type` in the API body).
|
|
261
|
-
2. Inside the HTML — `<meta name="template:type" content="image">` (or `static` / `asset`).
|
|
262
|
-
3. **Default: `image`** — best practice for zero-config users. If your template doesn't reference scene imagery (pure-text card, etc.), declare `static` explicitly to skip image generation and its cost.
|
|
263
|
-
|
|
264
|
-
The placeholder `{{image}}` no longer doubles as a type signal — declare type explicitly.
|
|
265
|
-
|
|
266
|
-
Limits and safety:
|
|
267
|
-
|
|
268
|
-
- Max 2 MB per inline HTML.
|
|
269
|
-
- The render sandbox blocks `file://`, loopback / private / link-local IPs, CGNAT range, cloud-metadata, and `*.local` / `*.internal` hostnames. So your template can only reference public `https`/`http` resources or `data:` URIs.
|
|
270
|
-
- If the CLI is talking to a hosted server, local-path `--image` won't reach the server; either upload to `rf files upload` first or use an HTTPS URL / data: URI.
|
|
271
|
-
|
|
272
|
-
#### API field reference
|
|
273
|
-
|
|
274
|
-
| endpoint | inline HTML field | size field | type field |
|
|
275
|
-
|---|---|---|---|
|
|
276
|
-
| `POST /api/v1/frames/render` | `template_html` | `size` | — (n/a, no image generation) |
|
|
277
|
-
| `POST /api/v1/templates/preview` | `template_html` | `size` | — |
|
|
278
|
-
| `POST /api/v1/pipelines/standard` | `frame_template_inline` | `frame_template_size` | `frame_template_type` |
|
|
279
|
-
|
|
280
|
-
The pipeline endpoint uses the `frame_template_*` prefix because it already has a `frame_template` field (preset key). The single-frame endpoints use the shorter `template_html` because they don't.
|
|
281
|
-
|
|
282
|
-
## Tip — getting unstuck
|
|
283
|
-
|
|
284
|
-
Every level has `--help`:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
rf --help # top-level overview
|
|
288
|
-
rf pipelines --help # list of pipelines
|
|
289
|
-
rf pipelines standard --help # full option reference
|
|
290
|
-
rf tts edge --help # one specific command
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
## License
|
|
294
|
-
|
|
295
|
-
Apache-2.0
|
|
1
|
+
# reelforge
|
|
2
|
+
|
|
3
|
+
> Turn a topic or script into a finished vertical video — narration, visuals, and subtitles, assembled for you. Every capability is a command, with `--help` at every level.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g reelforge
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or use directly without install:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx reelforge <command>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
After install, two binaries are on your `PATH` — `reelforge` and the short alias `rf`. Both behave identically; the docs use `rf` from here on.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
rf --version # same as `reelforge --version`
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
The CLI ships pointing at the hosted service. Log in once, then call:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g reelforge
|
|
29
|
+
rf login # opens browser; headless? rf login <api_key>
|
|
30
|
+
rf whoami # balance + api_keys
|
|
31
|
+
rf create "为什么我们还没找到外星文明?" # auto-saves to ./<title>-<id>.mp4 in cwd
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
That's the whole story — no server to run.
|
|
35
|
+
|
|
36
|
+
### Output behavior
|
|
37
|
+
|
|
38
|
+
| invocation | result |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `rf create "..."` | Saves to `./<sanitized-title>-<task_id_short>.mp4`, prints the path |
|
|
41
|
+
| `rf create "..." -o ./videos/space.mp4` | Saves to that exact path (must include filename, not just a directory) |
|
|
42
|
+
| `rf create "..." --no-download` | Skips local save, prints JSON result with `video_url` |
|
|
43
|
+
| `rf create "..." \| jq .video_url` | When stdout is piped, download is skipped automatically |
|
|
44
|
+
|
|
45
|
+
## Global options
|
|
46
|
+
|
|
47
|
+
| flag | description |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `-s, --server <url>` | Server URL (overrides `$REELFORGE_SERVER`; defaults to the hosted service) |
|
|
50
|
+
| `-k, --api-key <key>` | API key (overrides `$REELFORGE_API_KEY` and `reelforge login` saved key) |
|
|
51
|
+
| `--json` | Output raw JSON instead of pretty text — pipe-friendly |
|
|
52
|
+
| `--quiet` | Suppress informational messages on stderr |
|
|
53
|
+
| `-v, --version` | Show CLI version |
|
|
54
|
+
| `-h, --help` | Show help (works on every sub-command) |
|
|
55
|
+
|
|
56
|
+
## Command map
|
|
57
|
+
|
|
58
|
+
Run `rf <command> --help` for full details on any of these.
|
|
59
|
+
|
|
60
|
+
### Core capabilities
|
|
61
|
+
|
|
62
|
+
| command | what it does |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `llm chat -p <text>` | Send one prompt to the configured model |
|
|
65
|
+
| `llm presets` | List built-in model presets |
|
|
66
|
+
| `tts ... -t <text> -o out.mp3` | Text-to-speech (free local + cloud voice options) |
|
|
67
|
+
| `tts voices [--locale zh]` | List supported voices |
|
|
68
|
+
| `images generate -p <prompt>` | Image generation |
|
|
69
|
+
|
|
70
|
+
### Content / audio / subtitle atomics
|
|
71
|
+
|
|
72
|
+
| command | what it does |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `content scene-plan -t <topic>` | Single LLM call: title + master script + per-scene image prompts (replaces the old narration / split / image-prompts / title trio) |
|
|
75
|
+
| `content scene-plan --script <text-or-@file>` | Same, but the user supplies the script verbatim — LLM only segments and writes image prompts |
|
|
76
|
+
| `audio transcribe -f <file>` / `--url <url>` | Speech-to-text with word + segment timestamps |
|
|
77
|
+
| `subtitles split -t <text-or-@file>` | Deterministic tiered-punctuation subtitle line splitter (pure function, zero billing) |
|
|
78
|
+
|
|
79
|
+
### Composition
|
|
80
|
+
|
|
81
|
+
| command | what it does |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `templates list [--size 1080x1920] [--type image]` | List HTML frame templates |
|
|
84
|
+
| `templates preview <keyOrPath> [-o out.png]` | Render a preview from a preset key **or your own local .html file** |
|
|
85
|
+
| `templates show <key> [-o file.html]` | Print or save the source HTML of any preset — copy it as a starting point for a custom template |
|
|
86
|
+
| `frames render -t <keyOrPath> --title ... --text ...` | Render a single composed frame to PNG. `-t` accepts a preset key **or a local .html path** |
|
|
87
|
+
| `compositions concat <v1> <v2> -o out.mp4` | FFmpeg concat (+ optional BGM) |
|
|
88
|
+
| `compositions bgm -i video.mp4 --bgm bgm.mp3 -o out.mp4` | Add background music |
|
|
89
|
+
| `compositions image-to-video -i img.png -a aud.mp3 -o out.mp4` | Build video from image + audio |
|
|
90
|
+
| `compositions overlay -v video.mp4 --overlay overlay.png -o out.mp4` | Overlay PNG on video |
|
|
91
|
+
|
|
92
|
+
### End-to-end pipelines
|
|
93
|
+
|
|
94
|
+
All `pipelines *` commands submit an **async task** and (by default) poll until it finishes with a live progress indicator on stderr. Use `--no-wait` to return immediately with a `task_id`, then `rf tasks wait <id>` later.
|
|
95
|
+
|
|
96
|
+
The standard pipeline turns a topic or script into a finished vertical video — narration, visuals, and subtitles are generated and assembled for you. One continuous narration track; visuals cut at scene boundaries; subtitles cut at line boundaries.
|
|
97
|
+
|
|
98
|
+
| command | what it does |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `pipelines standard -t <topic>` (or `--script <text>`) | Audio-first pipeline; `-d/--duration` and `-p/--pace` are the two main knobs |
|
|
101
|
+
|
|
102
|
+
#### Composition knobs
|
|
103
|
+
|
|
104
|
+
Three independent axes — mix and match as you like:
|
|
105
|
+
|
|
106
|
+
| flag | values | default | what changes |
|
|
107
|
+
|---|---|---|---|
|
|
108
|
+
| `--motion` | `off` / `lite` / `max` | `lite` | per-scene zoompan + crossfade intensity |
|
|
109
|
+
| `--layout` | `full` / `blur-bg` / `letterbox` | `full` | how the image sits in the canvas |
|
|
110
|
+
| `--subtitle-style` | `plate` / `stroke` / `cinema` | `plate` | subtitle look |
|
|
111
|
+
|
|
112
|
+
**Layout presets**:
|
|
113
|
+
- `full` — image fills the whole 1080×1920 canvas. Generates a 1080×1920 image. High-impact; best for human portraits, landscapes, 9:16-native content.
|
|
114
|
+
- `blur-bg` — image at 1080×1080 centered, top/bottom is a gaussian-blurred copy of the **same image** moving in sync with the foreground. Generates a 1080×1080 image (cheaper + no wasted pixels). Best for charts, screenshots, non-9:16 source content (小红书 / 抖音 style).
|
|
115
|
+
- `letterbox` — image at 1080×1080 centered, top/bottom is a solid matte (CSS color). Generates a 1080×1080 image. Cinematic / calm. Customize the matte with `--layout-matte-color "#1a1a1a"` (default `black`).
|
|
116
|
+
|
|
117
|
+
Examples:
|
|
118
|
+
```bash
|
|
119
|
+
rf create "财经日报" --layout blur-bg # 小红书 / 抖音
|
|
120
|
+
rf create "纪录片片段" --layout letterbox --motion max # 电影感
|
|
121
|
+
rf create "..." --layout letterbox --layout-matte-color "#1a1a1a" # 柔和黑
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Resources
|
|
125
|
+
|
|
126
|
+
| command | what it does |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `bgm list / upload <file> / delete <name>` | Manage background music |
|
|
129
|
+
| `files list / upload <file> / download <path> / delete <path>` | Manage user assets |
|
|
130
|
+
|
|
131
|
+
### System
|
|
132
|
+
|
|
133
|
+
| command | what it does |
|
|
134
|
+
|---|---|
|
|
135
|
+
| `config get` | Read server config (keys masked) |
|
|
136
|
+
| `config set <key> <value>` | Update a dotted-path setting (e.g. `llm.api_key sk-xxx`) |
|
|
137
|
+
| `config patch <file>` | Apply a JSON-merge patch |
|
|
138
|
+
| `tasks list [--status running]` | List recent tasks |
|
|
139
|
+
| `tasks get <id>` / `tasks wait <id>` / `tasks cancel <id>` | Task lifecycle |
|
|
140
|
+
| `history list / get <id> / delete <id>` | Browse / delete completed runs |
|
|
141
|
+
| `health` | Server health + capability check |
|
|
142
|
+
|
|
143
|
+
### Heavy brand customization (custom overlay templates)
|
|
144
|
+
|
|
145
|
+
`--motion` / `--layout` / `--subtitle-*` / `--brand-*` cover the common cases. For full visual identity ownership (custom path bar, accent decorations, light theme, footer block, etc.) pass a custom overlay HTML via `--frame-template <local.html | preset_key>`:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
rf templates show 1080x1920/default.html -o ./my-brand.html
|
|
149
|
+
# ...edit my-brand.html (change colors, add structure, etc.)...
|
|
150
|
+
rf create "我的视频" --frame-template ./my-brand.html
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Contract for custom HTML**:
|
|
154
|
+
|
|
155
|
+
- Canvas is **1080×1920** (pipeline-fixed; don't declare a different size in `<meta>`).
|
|
156
|
+
- Background must be **transparent** — the scene image is composited by the renderer outside the HTML layer.
|
|
157
|
+
- **`{{image}}` no longer exists.** Using `<img src="{{image}}">` is a hard error at submit time. The image is composited by the renderer.
|
|
158
|
+
- The pipeline injects these placeholders for you:
|
|
159
|
+
|
|
160
|
+
| Placeholder | What it is |
|
|
161
|
+
|---|---|
|
|
162
|
+
| `{{title}}` `{{text}}` | per-frame content |
|
|
163
|
+
| `{{index}}` `{{total}}` | "scene N of M" — `{{total}}` is the LLM-decided scene count, don't hardcode |
|
|
164
|
+
| `{{layout}}` | `"full"` / `"blur-bg"` / `"letterbox"` — react via `body[data-layout="..."]` CSS to put title/subtitle in the matte zones when layout ≠ full |
|
|
165
|
+
| `{{subtitle_style}}` `{{subtitle_color}}` `{{subtitle_background}}` | subtitle preset + overrides |
|
|
166
|
+
| `{{brand_position}}` `{{brand_handle}}` `{{brand_slogan}}` `{{brand_logo}}` `{{brand_color}}` | brand-chrome inputs (use or ignore as you like) |
|
|
167
|
+
|
|
168
|
+
Inline HTML is hard-capped at 2 MB. The audio + motion + character-ref + scene-plan stages all keep working identically — only the overlay layer is yours.
|
|
169
|
+
|
|
170
|
+
**Publishing to short-video platforms (Douyin / TikTok / WeChat Channels)** — the default composition renders to the full 1080×1920 canvas, but those apps overlay UI on top/bottom/right and cover-crop ~96-180px on each side on taller phones. ReelForge does NOT bake platform-specific padding into the renderer. Look up reference safe-zone numbers + recommended `--media-anchor-y` values per platform:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
rf platform # overview table for all platforms
|
|
174
|
+
rf platform 抖音 # detail + anchor variants (alias of douyin)
|
|
175
|
+
rf platform tiktok
|
|
176
|
+
rf platform wechat # 视频号
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Examples
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# 1. One-click out a video (45s default, AI writes the script)
|
|
183
|
+
rf create "为什么我们还没找到外星文明?"
|
|
184
|
+
|
|
185
|
+
# 2. Longer video with a slower visual rhythm
|
|
186
|
+
rf create "深夜便利店的灯光" -d 90 -p slow
|
|
187
|
+
|
|
188
|
+
# 3. Your own script — no narration-splitting on your side, the pipeline handles it
|
|
189
|
+
rf create --script @./my-script.txt
|
|
190
|
+
rf create --script "雨水缓缓滑落在玻璃窗上,像是无声的泪珠。"
|
|
191
|
+
|
|
192
|
+
# 4. Preview-first workflow: scrub the storyboard in the browser
|
|
193
|
+
# before paying for the MP4 render. Finalize with `rf render` when satisfied.
|
|
194
|
+
rf create "..." --preview-only # opens browser studio
|
|
195
|
+
rf render <task-id> # produce the MP4
|
|
196
|
+
|
|
197
|
+
# 5. Push the image square up to grow the bottom matte (抖音 long-description
|
|
198
|
+
# case); subtitle position follows the image automatically.
|
|
199
|
+
rf create "..." --layout blur-bg --media-anchor-y 0.40
|
|
200
|
+
# See `rf platform 抖音` for the safe range and per-scenario recommendations.
|
|
201
|
+
|
|
202
|
+
# 6. Encoder budget — pick a quality preset or set an exact bitrate.
|
|
203
|
+
rf create "..." --quality draft # ~1 Mbps, ~3-4× smaller than default
|
|
204
|
+
rf create "..." --video-bitrate 750k # exact bitrate
|
|
205
|
+
rf create "..." --crf 28 # fine-grained control
|
|
206
|
+
|
|
207
|
+
# 7. Pick a built-in visual style preset
|
|
208
|
+
rf create "美食教程" --style photorealistic
|
|
209
|
+
|
|
210
|
+
# 5. Pipeline form with explicit output path
|
|
211
|
+
rf pipelines standard \
|
|
212
|
+
--script @./script.txt \
|
|
213
|
+
--frame-template 1080x1920/image_default.html \
|
|
214
|
+
-p normal -o smoke.mp4
|
|
215
|
+
|
|
216
|
+
# 6. Inspect existing tasks & redownload a finished video
|
|
217
|
+
rf tasks list --limit 5
|
|
218
|
+
rf history get <task-id> --download recovered.mp4
|
|
219
|
+
|
|
220
|
+
# 7. Atomics for stand-alone use
|
|
221
|
+
rf content scene-plan -t "雨天的玻璃窗" -d 45 --json | jq .scenes
|
|
222
|
+
rf audio transcribe -f narration.mp3 --json | jq '.words[:5]'
|
|
223
|
+
rf subtitles split -t @./narration.txt --min 10 --hard-max 24
|
|
224
|
+
|
|
225
|
+
# 8. JSON pipe for automation
|
|
226
|
+
rf llm presets --json | jq '.[].defaultModel'
|
|
227
|
+
|
|
228
|
+
# 9. Use your own HTML template (no PR/release needed)
|
|
229
|
+
# Any --frame-template that points to a local .html file is read and sent
|
|
230
|
+
# inline. Declare size inside the file via
|
|
231
|
+
# <meta name="template:width" content="1080">
|
|
232
|
+
# <meta name="template:height" content="1920">
|
|
233
|
+
# or pass --frame-template-size 1080x1920.
|
|
234
|
+
rf templates show 1080x1920/image_default.html -o my-brand.html # copy a preset
|
|
235
|
+
# ...edit my-brand.html to suit your style...
|
|
236
|
+
rf templates preview ./my-brand.html --title "Hello" -o preview.png
|
|
237
|
+
rf frames render -t ./my-brand.html --values '{"author":"Alice"}' -o frame.png
|
|
238
|
+
rf pipelines standard -t "宠物" --frame-template ./my-brand.html -o final.mp4
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Custom HTML templates
|
|
242
|
+
|
|
243
|
+
Easiest way to start: grab a preset as a reference.
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
rf templates list # see all keys
|
|
247
|
+
rf templates show 1080x1920/static_default.html # print to stdout
|
|
248
|
+
rf templates show 1080x1920/image_default.html -o my-brand.html # save and edit
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
`{{title}}`, `{{text}}`, `{{image}}`, `{{index}}`, `{{total}}` are reserved built-ins auto-injected by the pipeline; everything else uses the `{{name:type=default}}` DSL (`type` ∈ `text|number|color|bool`). Pass extras through `--values '{"author":"Alice"}'` (or `template_params` on the pipeline API).
|
|
252
|
+
|
|
253
|
+
- `{{index}}` — current scene number, 1-based
|
|
254
|
+
- `{{total}}` — scene count the LLM actually produced (use this for "scene N of M" badges; don't hardcode in `template_params`, the scene count is decided at runtime)
|
|
255
|
+
|
|
256
|
+
#### Template type — does the pipeline generate an AI image per scene?
|
|
257
|
+
|
|
258
|
+
When you ship an inline template through `rf create` / `rf pipelines standard`, ReelForge needs to know whether each scene should kick off image generation. Resolution priority (high → low):
|
|
259
|
+
|
|
260
|
+
1. Explicit flag — `--frame-template-type image|static|asset` (or `frame_template_type` in the API body).
|
|
261
|
+
2. Inside the HTML — `<meta name="template:type" content="image">` (or `static` / `asset`).
|
|
262
|
+
3. **Default: `image`** — best practice for zero-config users. If your template doesn't reference scene imagery (pure-text card, etc.), declare `static` explicitly to skip image generation and its cost.
|
|
263
|
+
|
|
264
|
+
The placeholder `{{image}}` no longer doubles as a type signal — declare type explicitly.
|
|
265
|
+
|
|
266
|
+
Limits and safety:
|
|
267
|
+
|
|
268
|
+
- Max 2 MB per inline HTML.
|
|
269
|
+
- The render sandbox blocks `file://`, loopback / private / link-local IPs, CGNAT range, cloud-metadata, and `*.local` / `*.internal` hostnames. So your template can only reference public `https`/`http` resources or `data:` URIs.
|
|
270
|
+
- If the CLI is talking to a hosted server, local-path `--image` won't reach the server; either upload to `rf files upload` first or use an HTTPS URL / data: URI.
|
|
271
|
+
|
|
272
|
+
#### API field reference
|
|
273
|
+
|
|
274
|
+
| endpoint | inline HTML field | size field | type field |
|
|
275
|
+
|---|---|---|---|
|
|
276
|
+
| `POST /api/v1/frames/render` | `template_html` | `size` | — (n/a, no image generation) |
|
|
277
|
+
| `POST /api/v1/templates/preview` | `template_html` | `size` | — |
|
|
278
|
+
| `POST /api/v1/pipelines/standard` | `frame_template_inline` | `frame_template_size` | `frame_template_type` |
|
|
279
|
+
|
|
280
|
+
The pipeline endpoint uses the `frame_template_*` prefix because it already has a `frame_template` field (preset key). The single-frame endpoints use the shorter `template_html` because they don't.
|
|
281
|
+
|
|
282
|
+
## Tip — getting unstuck
|
|
283
|
+
|
|
284
|
+
Every level has `--help`:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
rf --help # top-level overview
|
|
288
|
+
rf pipelines --help # list of pipelines
|
|
289
|
+
rf pipelines standard --help # full option reference
|
|
290
|
+
rf tts edge --help # one specific command
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## License
|
|
294
|
+
|
|
295
|
+
Apache-2.0
|
package/bin/reelforge.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Thin shim so `reelforge` (alias `rf`) is invokable globally. The actual
|
|
3
|
-
// implementation is bundled to dist/ by `npm run build`.
|
|
4
|
-
import("../dist/index.js").catch((err) => {
|
|
5
|
-
// eslint-disable-next-line no-console
|
|
6
|
-
console.error(err?.stack || err);
|
|
7
|
-
process.exit(1);
|
|
8
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin shim so `reelforge` (alias `rf`) is invokable globally. The actual
|
|
3
|
+
// implementation is bundled to dist/ by `npm run build`.
|
|
4
|
+
import("../dist/index.js").catch((err) => {
|
|
5
|
+
// eslint-disable-next-line no-console
|
|
6
|
+
console.error(err?.stack || err);
|
|
7
|
+
process.exit(1);
|
|
8
|
+
});
|
package/dist/commands/compose.js
CHANGED
|
@@ -59,35 +59,35 @@ async function readAsDataUri(specPath, baseDir) {
|
|
|
59
59
|
const buf = await fs.readFile(abs);
|
|
60
60
|
return { dataUri: `data:${mime};base64,${buf.toString("base64")}`, bytes: buf.byteLength };
|
|
61
61
|
}
|
|
62
|
-
const EXAMPLE_SPEC_HINT = `{
|
|
63
|
-
"experimental": "compose.v2",
|
|
64
|
-
"audio": { "narration": "./narration.mp3" },
|
|
65
|
-
"scenes": [
|
|
66
|
-
{ "start_sec": 0, "end_sec": 5, "image": "./s1.png", "motion": "zoom-in" },
|
|
67
|
-
{ "start_sec": 5, "end_sec": 11, "video": "./clip.mp4", "muted": true }
|
|
68
|
-
],
|
|
69
|
-
"subtitles": [
|
|
70
|
-
{ "start_sec": 0, "end_sec": 5, "text": "为什么咖啡因让人精神" },
|
|
71
|
-
{ "start_sec": 5, "end_sec": 11, "text": "原来它跟睡眠物质是同一把钥匙" }
|
|
72
|
-
],
|
|
73
|
-
"title": "咖啡因的真相"
|
|
62
|
+
const EXAMPLE_SPEC_HINT = `{
|
|
63
|
+
"experimental": "compose.v2",
|
|
64
|
+
"audio": { "narration": "./narration.mp3" },
|
|
65
|
+
"scenes": [
|
|
66
|
+
{ "start_sec": 0, "end_sec": 5, "image": "./s1.png", "motion": "zoom-in" },
|
|
67
|
+
{ "start_sec": 5, "end_sec": 11, "video": "./clip.mp4", "muted": true }
|
|
68
|
+
],
|
|
69
|
+
"subtitles": [
|
|
70
|
+
{ "start_sec": 0, "end_sec": 5, "text": "为什么咖啡因让人精神" },
|
|
71
|
+
{ "start_sec": 5, "end_sec": 11, "text": "原来它跟睡眠物质是同一把钥匙" }
|
|
72
|
+
],
|
|
73
|
+
"title": "咖啡因的真相"
|
|
74
74
|
}`;
|
|
75
|
-
const EXAMPLE_SPEC_V3_HINT = `{
|
|
76
|
-
"experimental": "compose.v3",
|
|
77
|
-
"audio": { "tts_voice": "熊小二" },
|
|
78
|
-
"scenes": [
|
|
79
|
-
{
|
|
80
|
-
"video": "./s1.mp4", "muted": true,
|
|
81
|
-
"narration": ["今天热得不行", "我跑厕所睡觉"],
|
|
82
|
-
"intro_title": "热到躲厕所"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"image": "./splash.jpg",
|
|
86
|
-
"narration": ["主人你找拖鞋去吧"]
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
"subtitle_style": "stroke",
|
|
90
|
-
"title": "贼喵被抓现行"
|
|
75
|
+
const EXAMPLE_SPEC_V3_HINT = `{
|
|
76
|
+
"experimental": "compose.v3",
|
|
77
|
+
"audio": { "tts_voice": "熊小二" },
|
|
78
|
+
"scenes": [
|
|
79
|
+
{
|
|
80
|
+
"video": "./s1.mp4", "muted": true,
|
|
81
|
+
"narration": ["今天热得不行", "我跑厕所睡觉"],
|
|
82
|
+
"intro_title": "热到躲厕所"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"image": "./splash.jpg",
|
|
86
|
+
"narration": ["主人你找拖鞋去吧"]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"subtitle_style": "stroke",
|
|
90
|
+
"title": "贼喵被抓现行"
|
|
91
91
|
}`;
|
|
92
92
|
export function registerCompose(program) {
|
|
93
93
|
program
|
package/dist/commands/create.js
CHANGED
|
@@ -154,8 +154,6 @@ function optsToBody(opts) {
|
|
|
154
154
|
out.asr_model = opts.asrModel;
|
|
155
155
|
if (opts.imageModel !== undefined)
|
|
156
156
|
out.image_model = opts.imageModel;
|
|
157
|
-
if (opts.promptPrefix !== undefined)
|
|
158
|
-
out.prompt_prefix = opts.promptPrefix;
|
|
159
157
|
if (opts.style !== undefined)
|
|
160
158
|
out.style = opts.style;
|
|
161
159
|
if (opts.characterRef !== undefined)
|
|
@@ -168,8 +166,6 @@ function optsToBody(opts) {
|
|
|
168
166
|
out.video_fps = opts.videoFps;
|
|
169
167
|
if (opts.quality !== undefined)
|
|
170
168
|
out.quality = opts.quality;
|
|
171
|
-
if (opts.crf !== undefined && Number.isFinite(opts.crf))
|
|
172
|
-
out.crf = opts.crf;
|
|
173
169
|
if (opts.videoBitrate !== undefined)
|
|
174
170
|
out.video_bitrate = opts.videoBitrate;
|
|
175
171
|
if (opts.motion !== undefined)
|
|
@@ -188,10 +184,6 @@ function optsToBody(opts) {
|
|
|
188
184
|
out.bgm_volume = opts.bgmVolume;
|
|
189
185
|
if (opts.subtitleStyle !== undefined)
|
|
190
186
|
out.subtitle_style = opts.subtitleStyle;
|
|
191
|
-
if (opts.subtitleColor !== undefined)
|
|
192
|
-
out.subtitle_color = opts.subtitleColor;
|
|
193
|
-
if (opts.subtitleBackground !== undefined)
|
|
194
|
-
out.subtitle_background = opts.subtitleBackground;
|
|
195
187
|
if (opts.subtitleBottom !== undefined && Number.isFinite(opts.subtitleBottom))
|
|
196
188
|
out.subtitle_bottom_px = opts.subtitleBottom;
|
|
197
189
|
if (opts.profile !== undefined && opts.profile.trim())
|
|
@@ -230,10 +222,6 @@ function optsToBody(opts) {
|
|
|
230
222
|
cover.base = opts.coverBase;
|
|
231
223
|
if (Object.keys(cover).length > 0)
|
|
232
224
|
out.cover = cover;
|
|
233
|
-
if (opts.segmentMinChars !== undefined)
|
|
234
|
-
out.segment_min_chars = opts.segmentMinChars;
|
|
235
|
-
if (opts.segmentMaxChars !== undefined)
|
|
236
|
-
out.segment_max_chars = opts.segmentMaxChars;
|
|
237
225
|
if (opts.previewOnly)
|
|
238
226
|
out.preview_only = true;
|
|
239
227
|
return out;
|
|
@@ -283,7 +271,6 @@ export function registerCreate(program) {
|
|
|
283
271
|
.option("-d, --duration <sec>", "target video duration in seconds (generate mode only; default 45). LLM aims for ~duration × 5 chars of narration.", (v) => parseInt(v, 10))
|
|
284
272
|
.option("-p, --pace <pace>", "visual rhythm hint passed to the LLM: slow | normal | fast (default normal). LLM still decides the actual scene count from semantic structure.")
|
|
285
273
|
.option("--image-model <id>", "image model (rx-image-z | rx-image-flux | rx-image-qwen | rx-image-qwen-edit). Auto-switches to the edit-capable model when --character-ref is set.")
|
|
286
|
-
.option("--prompt-prefix <text>", "raw style prefix prepended to every image prompt (overrides --style)")
|
|
287
274
|
.option("--style <preset>", "image style preset id — server-expanded. 用户不知道选哪个时,agent 应该先跑 `rf styles list --json` 把每个风格的 preview_url(同一灯塔在 17 种风格下的对比图)给用户看,让用户照图选。仅看 id 列表用户和你都猜不准实际出图长啥样")
|
|
288
275
|
.option("--character-ref <urlOrPath>", "reference image of the main character — locks identity across scenes. URL, data: URI, or local png/jpg/webp path (auto-encoded). Auto-enables the edit-capable image model.")
|
|
289
276
|
.option("--motion <preset>", "per-scene image animation intensity. See 'Motion presets' below. Default: lite.")
|
|
@@ -294,8 +281,6 @@ export function registerCreate(program) {
|
|
|
294
281
|
.option("--bgm-volume <0..1>", "BGM mix volume (0=silent, 1=full). Default 0.15 keeps narration intelligible.", (v) => Number(v))
|
|
295
282
|
.option("--no-bgm", "disable background music for this render")
|
|
296
283
|
.option("--subtitle-style <preset>", "subtitle visual style. See 'Subtitle styles' below. Default: plate.")
|
|
297
|
-
.option("--subtitle-color <css>", "override subtitle text color, e.g. '#ffeb3b'. Omit for preset default.")
|
|
298
|
-
.option("--subtitle-background <css>", "override plate-preset background, e.g. 'rgba(20,30,80,0.75)'. Other presets ignore.")
|
|
299
284
|
.option("--subtitle-bottom <px>", "override the subtitle bottom offset in px (default 400, the lower-third position). blur-bg/letterbox images move up to clear it.", (v) => parseInt(v, 10))
|
|
300
285
|
.option("--profile <id>", "视频的「场景」(垂类):plain(默认,纯 AI 图,无组件)| finance(财经/金融,数据组件 + 鎏金深蓝)| mindset(财商认知,认知组件 + 暖纸黏土)| general(通用组件,中性皮)。选了 profile 即带出它的组件、配色、配图风、封面与字幕默认,可被其他 flag 覆盖。")
|
|
301
286
|
.option("--subtitle-translate <lang>", "双语字幕:把每条字幕翻译成指定语言,以小一号文字显示在主字幕下方,如 'en'(英文)/ 'ja'(日文)。开启后字幕分段自动变短(主字幕保持单行)。默认:开(en);传 'off' 关闭(也可覆盖 recipe 设置)")
|
|
@@ -317,12 +302,9 @@ export function registerCreate(program) {
|
|
|
317
302
|
.option("--llm-model <id>", "override the LLM model used for scene-plan")
|
|
318
303
|
.option("--tts-model <id>", "override the TTS model (defaults to the server's)")
|
|
319
304
|
.option("--asr-model <id>", "override the ASR model (defaults to the server's)")
|
|
320
|
-
.option("--segment-min-chars <N>", "subtitle SEGMENT (分段) min chars (default 10). A segment is one on-screen subtitle unit, not a visual line — visual wrapping is automatic.", (v) => parseInt(v, 10))
|
|
321
|
-
.option("--segment-max-chars <N>", "subtitle SEGMENT (分段) max chars (default 28 ≈ 2 visual lines at 820px safe width). HTML clamps display to 2 lines + ellipsis.", (v) => parseInt(v, 10))
|
|
322
305
|
.option("--video-fps <n>", "output video fps (default 24 — cinema-standard, ~20% faster render vs 30; pass 30 if you want smoother motion)", (v) => parseInt(v, 10))
|
|
323
|
-
.option("--quality <preset>", "encoder quality preset: draft | standard (default) | high. draft shrinks output ~3-4× vs standard (~3 Mbps)
|
|
324
|
-
.option("--
|
|
325
|
-
.option("--video-bitrate <rate>", "目标视频码率,如 '750k' / '1M' / '2M'。用于命中文件大小预算。和 --crf 二选一。")
|
|
306
|
+
.option("--quality <preset>", "encoder quality preset: draft | standard (default) | high. draft shrinks output ~3-4× vs standard (~3 Mbps); high is the opposite. Mutually exclusive with --video-bitrate.")
|
|
307
|
+
.option("--video-bitrate <rate>", "目标视频码率,如 '750k' / '1M' / '2M'。用于命中文件大小预算。")
|
|
326
308
|
.option("--recipe <file>", "load defaults from a JSON recipe file (CLI flags still override)")
|
|
327
309
|
.option("--redo", "replay last successful create from ~/.reelforge/last-create.json")
|
|
328
310
|
.option("--dry-run", "print the final request body + estimated units; do NOT submit")
|
|
@@ -385,8 +367,6 @@ export function registerCreate(program) {
|
|
|
385
367
|
" plate semi-transparent black plate + white text (CapCut default; safest readability)",
|
|
386
368
|
" stroke bold white text with black stroke + shadow, no plate (抖音网红风)",
|
|
387
369
|
" cinema bottom black gradient backdrop + lighter text (film / documentary look)",
|
|
388
|
-
" · use --subtitle-color / --subtitle-background to override the preset's colors",
|
|
389
|
-
" e.g. --subtitle-color '#ffeb3b' --subtitle-background 'rgba(20,30,80,0.75)'",
|
|
390
370
|
"",
|
|
391
371
|
"Brand chrome (--brand-* flags or config.video.default_brand):",
|
|
392
372
|
" Adds a constant @handle / slogan / logo block in a frame corner.",
|
|
@@ -402,8 +382,7 @@ export function registerCreate(program) {
|
|
|
402
382
|
"",
|
|
403
383
|
"Image style presets (--style <preset>) — server expands id → prompt prefix:",
|
|
404
384
|
formatStylePresetsList(),
|
|
405
|
-
" ·
|
|
406
|
-
" · Omit both to let the LLM pick a per-video style automatically.",
|
|
385
|
+
" · Omit --style to let the LLM pick a per-video style automatically.",
|
|
407
386
|
" · Run `rf styles list` to query the server's live catalog.",
|
|
408
387
|
"",
|
|
409
388
|
"Output behavior:",
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "reelforge",
|
|
3
|
-
"version": "1.20.
|
|
4
|
-
"description": "AI 视频生成 CLI。一句话主题或自己的脚本 → 自动出抖音/TikTok/视频号竖屏 MP4。安装即用:`reelforge` 或短别名 `rf`。",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"reelforge": "./bin/reelforge.js",
|
|
9
|
-
"rf": "./bin/reelforge.js"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"bin",
|
|
13
|
-
"dist",
|
|
14
|
-
"README.md"
|
|
15
|
-
],
|
|
16
|
-
"engines": {
|
|
17
|
-
"node": ">=22"
|
|
18
|
-
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc -p tsconfig.json && node scripts/copy-docs.mjs",
|
|
21
|
-
"dev": "tsc -p tsconfig.json --watch",
|
|
22
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
23
|
-
"clean": "rimraf dist",
|
|
24
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
25
|
-
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"commander": "^12.1.0",
|
|
28
|
-
"kleur": "^4.1.5"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/node": "^20.14.0",
|
|
32
|
-
"rimraf": "^6.0.1",
|
|
33
|
-
"typescript": "^5.5.0"
|
|
34
|
-
},
|
|
35
|
-
"keywords": [
|
|
36
|
-
"reelforge",
|
|
37
|
-
"ai-video",
|
|
38
|
-
"douyin",
|
|
39
|
-
"tiktok",
|
|
40
|
-
"shorts",
|
|
41
|
-
"vertical-video",
|
|
42
|
-
"cli"
|
|
43
|
-
]
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "reelforge",
|
|
3
|
+
"version": "1.20.2",
|
|
4
|
+
"description": "AI 视频生成 CLI。一句话主题或自己的脚本 → 自动出抖音/TikTok/视频号竖屏 MP4。安装即用:`reelforge` 或短别名 `rf`。",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"reelforge": "./bin/reelforge.js",
|
|
9
|
+
"rf": "./bin/reelforge.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin",
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=22"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc -p tsconfig.json && node scripts/copy-docs.mjs",
|
|
21
|
+
"dev": "tsc -p tsconfig.json --watch",
|
|
22
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
23
|
+
"clean": "rimraf dist",
|
|
24
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"commander": "^12.1.0",
|
|
28
|
+
"kleur": "^4.1.5"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^20.14.0",
|
|
32
|
+
"rimraf": "^6.0.1",
|
|
33
|
+
"typescript": "^5.5.0"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"reelforge",
|
|
37
|
+
"ai-video",
|
|
38
|
+
"douyin",
|
|
39
|
+
"tiktok",
|
|
40
|
+
"shorts",
|
|
41
|
+
"vertical-video",
|
|
42
|
+
"cli"
|
|
43
|
+
]
|
|
44
|
+
}
|