reelforge 0.3.2 → 0.4.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/dist/commands/create.js +135 -2
- package/package.json +52 -52
package/dist/commands/create.js
CHANGED
|
@@ -197,6 +197,115 @@ const DEFAULTS = {
|
|
|
197
197
|
tts_voice: "zh-CN-YunjianNeural",
|
|
198
198
|
tts_speed: 1.2,
|
|
199
199
|
};
|
|
200
|
+
const STYLE_PRESETS = {
|
|
201
|
+
matchstick: {
|
|
202
|
+
prefix: "Minimalist black-and-white matchstick figure style illustration, clean lines, simple sketch style",
|
|
203
|
+
label: "极简黑白火柴人",
|
|
204
|
+
scene: "知识科普 / 哲思 / 段子",
|
|
205
|
+
},
|
|
206
|
+
cinematic: {
|
|
207
|
+
prefix: "cinematic photography, soft natural lighting, shallow depth of field, 35mm film, color grading",
|
|
208
|
+
label: "电影感",
|
|
209
|
+
scene: "故事 / 旅行 / 通用百搭",
|
|
210
|
+
},
|
|
211
|
+
photorealistic: {
|
|
212
|
+
prefix: "photorealistic, professional studio lighting, sharp focus, high detail, 85mm portrait lens",
|
|
213
|
+
label: "写实棚拍",
|
|
214
|
+
scene: "产品 / 人像 / 美食",
|
|
215
|
+
},
|
|
216
|
+
documentary: {
|
|
217
|
+
prefix: "documentary photography, candid moment, natural available light, photojournalism, realistic colors",
|
|
218
|
+
label: "纪实新闻",
|
|
219
|
+
scene: "历史 / 人物 / 纪录",
|
|
220
|
+
},
|
|
221
|
+
flat: {
|
|
222
|
+
prefix: "flat vector illustration, modern editorial style, geometric shapes, limited color palette, clean composition",
|
|
223
|
+
label: "扁平商业插画",
|
|
224
|
+
scene: "财经 / 商业 / 数据科普",
|
|
225
|
+
},
|
|
226
|
+
anime: {
|
|
227
|
+
prefix: "anime illustration, cel-shaded, vibrant colors, detailed background, expressive characters, Makoto Shinkai aesthetic",
|
|
228
|
+
label: "日漫",
|
|
229
|
+
scene: "故事 / 二次元 / 年轻向",
|
|
230
|
+
},
|
|
231
|
+
comic: {
|
|
232
|
+
prefix: "comic book illustration, bold ink outlines, halftone shading, dynamic poses, Marvel style",
|
|
233
|
+
label: "美漫",
|
|
234
|
+
scene: "动作 / 英雄向 / 段子",
|
|
235
|
+
},
|
|
236
|
+
watercolor: {
|
|
237
|
+
prefix: "soft watercolor painting, gentle brush strokes, pastel color palette, dreamy atmosphere, hand-painted texture",
|
|
238
|
+
label: "水彩",
|
|
239
|
+
scene: "治愈 / 情感 / 小红书风",
|
|
240
|
+
},
|
|
241
|
+
"oil-painting": {
|
|
242
|
+
prefix: "oil painting, visible brushstrokes, rich saturated colors, classical composition, canvas texture",
|
|
243
|
+
label: "油画",
|
|
244
|
+
scene: "文艺 / 古典 / 艺术史",
|
|
245
|
+
},
|
|
246
|
+
ink: {
|
|
247
|
+
prefix: "traditional Chinese ink painting, sumi-e style, flowing brushwork, monochrome wash, minimalist composition with negative space",
|
|
248
|
+
label: "中国水墨",
|
|
249
|
+
scene: "中式叙事 / 古诗词 / 国风",
|
|
250
|
+
},
|
|
251
|
+
"3d-render": {
|
|
252
|
+
prefix: "3D render, octane render, smooth surfaces, soft global illumination, polished and clean",
|
|
253
|
+
label: "三维渲染",
|
|
254
|
+
scene: "科技 / 产品 / 未来 / 概念图",
|
|
255
|
+
},
|
|
256
|
+
claymation: {
|
|
257
|
+
prefix: "claymation style, handmade clay textures, soft diffused studio lighting, matte surfaces, pastel colors",
|
|
258
|
+
label: "黏土定格",
|
|
259
|
+
scene: "儿童 / 萌系 / 治愈段子",
|
|
260
|
+
},
|
|
261
|
+
"low-poly": {
|
|
262
|
+
prefix: "low poly 3D art, triangular faceted surfaces, gradient coloring, minimalist geometric, clean style",
|
|
263
|
+
label: "低多边形",
|
|
264
|
+
scene: "科技 / 概念 / 设计感",
|
|
265
|
+
},
|
|
266
|
+
pixel: {
|
|
267
|
+
prefix: "16-bit pixel art, retro game aesthetic, limited color palette, blocky shading, SNES style",
|
|
268
|
+
label: "像素",
|
|
269
|
+
scene: "游戏 / 怀旧 / 段子",
|
|
270
|
+
},
|
|
271
|
+
cyberpunk: {
|
|
272
|
+
prefix: "cyberpunk, neon-lit dystopian cityscape, rain-slicked streets, holographic signs, Blade Runner aesthetic",
|
|
273
|
+
label: "赛博朋克",
|
|
274
|
+
scene: "科技未来 / 都市夜景",
|
|
275
|
+
},
|
|
276
|
+
vaporwave: {
|
|
277
|
+
prefix: "vaporwave aesthetic, pink and purple gradient, retro 90s elements, glitch effects, dreamlike surreal",
|
|
278
|
+
label: "蒸汽波",
|
|
279
|
+
scene: "网络梗 / 怀旧 / 抽象审美",
|
|
280
|
+
},
|
|
281
|
+
"art-deco": {
|
|
282
|
+
prefix: "Art Deco style, geometric symmetric patterns, gold and black palette, 1920s glamour, luxury aesthetic",
|
|
283
|
+
label: "装饰艺术",
|
|
284
|
+
scene: "奢华品牌 / 复古优雅",
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
// CJK chars take 2 display columns in monospace terminals; pad accordingly.
|
|
288
|
+
function displayWidth(s) {
|
|
289
|
+
let w = 0;
|
|
290
|
+
for (const c of s)
|
|
291
|
+
w += c.charCodeAt(0) > 0x7f ? 2 : 1;
|
|
292
|
+
return w;
|
|
293
|
+
}
|
|
294
|
+
function padDisplay(s, width) {
|
|
295
|
+
const pad = Math.max(0, width - displayWidth(s));
|
|
296
|
+
return s + " ".repeat(pad);
|
|
297
|
+
}
|
|
298
|
+
function formatStylePresetsList() {
|
|
299
|
+
const keys = Object.keys(STYLE_PRESETS);
|
|
300
|
+
const keyW = Math.max(...keys.map((k) => k.length));
|
|
301
|
+
const labelW = Math.max(...keys.map((k) => displayWidth(STYLE_PRESETS[k].label)));
|
|
302
|
+
return keys
|
|
303
|
+
.map((k) => {
|
|
304
|
+
const p = STYLE_PRESETS[k];
|
|
305
|
+
return ` ${padDisplay(k, keyW)} ${padDisplay(p.label, labelW)} ${p.scene}`;
|
|
306
|
+
})
|
|
307
|
+
.join("\n");
|
|
308
|
+
}
|
|
200
309
|
// ── Command registration ────────────────────────────────────────
|
|
201
310
|
export function registerCreate(program) {
|
|
202
311
|
program
|
|
@@ -216,7 +325,8 @@ export function registerCreate(program) {
|
|
|
216
325
|
// --- Visual ---
|
|
217
326
|
.option("--frame-template <key>", "HTML frame template, e.g. 1080x1920/image_default.html")
|
|
218
327
|
.option("--media-workflow <key>", "AI image/video workflow, e.g. runninghub/image_flux.json")
|
|
219
|
-
.option("--prompt-prefix <text>", "style prefix prepended to every image prompt")
|
|
328
|
+
.option("--prompt-prefix <text>", "raw style prefix prepended to every image prompt (overrides --style)")
|
|
329
|
+
.option("--style <preset>", "image style preset — shortcut for --prompt-prefix; see 'Style presets' below for the full list")
|
|
220
330
|
// --- Audio (TTS) ---
|
|
221
331
|
.option("--tts-voice <id>", "Edge TTS voice id, e.g. zh-CN-YunjianNeural / en-US-AriaNeural")
|
|
222
332
|
.option("--tts-speed <n>", "speech speed 0.5..2", parseFloat)
|
|
@@ -255,12 +365,17 @@ export function registerCreate(program) {
|
|
|
255
365
|
"",
|
|
256
366
|
"Param groups:",
|
|
257
367
|
" Content : --mode --title -n --split-mode --min/max-narration-words --min/max-image-prompt-words",
|
|
258
|
-
" Visual : --frame-template --media-workflow --prompt-prefix",
|
|
368
|
+
" Visual : --frame-template --media-workflow --style --prompt-prefix",
|
|
259
369
|
" TTS : --tts-voice --tts-speed --tts-inference-mode --tts-workflow --voice-id --ref-audio",
|
|
260
370
|
" BGM : --bgm --bgm-volume --bgm-mode",
|
|
261
371
|
" Output : --video-fps --template-params -o --no-download --no-wait --poll-ms --timeout-ms",
|
|
262
372
|
" Workflow: --recipe --redo --dry-run",
|
|
263
373
|
"",
|
|
374
|
+
"Style presets (--style <preset>) — quick shortcut for --prompt-prefix:",
|
|
375
|
+
formatStylePresetsList(),
|
|
376
|
+
" · Pass --prompt-prefix to override (raw string always wins).",
|
|
377
|
+
" · Omit both to use the server's configured default style.",
|
|
378
|
+
"",
|
|
264
379
|
"Output behavior:",
|
|
265
380
|
" No flag → saves to ./<title>-<task_id>.mp4 in current directory, prints the path",
|
|
266
381
|
" -o <path> → saves to that exact path (must include filename, not just a directory)",
|
|
@@ -298,6 +413,13 @@ export function registerCreate(program) {
|
|
|
298
413
|
" # Change voice + speed",
|
|
299
414
|
' rf create "..." --tts-voice zh-CN-XiaoxiaoNeural --tts-speed 1.0',
|
|
300
415
|
"",
|
|
416
|
+
" # Pick a built-in style preset",
|
|
417
|
+
' rf create "..." --style cinematic',
|
|
418
|
+
' rf create "美食教程" --style photorealistic',
|
|
419
|
+
"",
|
|
420
|
+
" # Free-form style — write your own prefix from scratch",
|
|
421
|
+
' rf create "..." --prompt-prefix "Studio Ghibli, pastel, dreamy"',
|
|
422
|
+
"",
|
|
301
423
|
" # Full recipe in one file",
|
|
302
424
|
" rf create --recipe ./space.recipe.json",
|
|
303
425
|
"",
|
|
@@ -334,6 +456,17 @@ export function registerCreate(program) {
|
|
|
334
456
|
if (opts.output) {
|
|
335
457
|
await validateOutputPath(opts.output);
|
|
336
458
|
}
|
|
459
|
+
// Expand --style preset to --prompt-prefix unless an explicit
|
|
460
|
+
// --prompt-prefix is also given (the raw string always wins).
|
|
461
|
+
if (opts.style) {
|
|
462
|
+
const preset = STYLE_PRESETS[opts.style];
|
|
463
|
+
if (!preset) {
|
|
464
|
+
throw new Error(`Unknown --style: ${opts.style}\nAvailable presets:\n${formatStylePresetsList()}`);
|
|
465
|
+
}
|
|
466
|
+
if (opts.promptPrefix === undefined) {
|
|
467
|
+
opts.promptPrefix = preset.prefix;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
337
470
|
// 1. Layer defaults: --redo → --recipe → CLI opts → positional topic
|
|
338
471
|
let body = {};
|
|
339
472
|
if (opts.redo) {
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "reelforge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "CLI for ReelForge Studio — AI video engine. Installs as both `reelforge` and the short alias `rf`. Every REST API exposed as a command, with --help on every level.",
|
|
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": ">=18.17"
|
|
18
|
-
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc -p tsconfig.json",
|
|
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
|
-
"comfyui",
|
|
39
|
-
"runninghub",
|
|
40
|
-
"tts",
|
|
41
|
-
"edge-tts",
|
|
42
|
-
"ffmpeg",
|
|
43
|
-
"playwright",
|
|
44
|
-
"cli"
|
|
45
|
-
],
|
|
46
|
-
"repository": {
|
|
47
|
-
"type": "git",
|
|
48
|
-
"url": "https://github.com/puke3615/ReelForge.git",
|
|
49
|
-
"directory": "cli"
|
|
50
|
-
},
|
|
51
|
-
"homepage": "https://github.com/puke3615/ReelForge"
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "reelforge",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "CLI for ReelForge Studio — AI video engine. Installs as both `reelforge` and the short alias `rf`. Every REST API exposed as a command, with --help on every level.",
|
|
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": ">=18.17"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc -p tsconfig.json",
|
|
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
|
+
"comfyui",
|
|
39
|
+
"runninghub",
|
|
40
|
+
"tts",
|
|
41
|
+
"edge-tts",
|
|
42
|
+
"ffmpeg",
|
|
43
|
+
"playwright",
|
|
44
|
+
"cli"
|
|
45
|
+
],
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/puke3615/ReelForge.git",
|
|
49
|
+
"directory": "cli"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://github.com/puke3615/ReelForge"
|
|
52
|
+
}
|