@genex-ai/cli-demo 1.10.3-dev.535 → 1.10.4-dev.536
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/index.js
CHANGED
|
@@ -7397,6 +7397,7 @@ function buildGenOptions(kind, opts) {
|
|
|
7397
7397
|
if (opts.frameUrl) options.frameUrl = opts.frameUrl;
|
|
7398
7398
|
if (opts.firstFrameUrl) options.firstFrameUrl = opts.firstFrameUrl;
|
|
7399
7399
|
if (opts.lastFrameUrl) options.lastFrameUrl = opts.lastFrameUrl;
|
|
7400
|
+
if (opts.refs?.length) options.referenceImageUrls = opts.refs;
|
|
7400
7401
|
}
|
|
7401
7402
|
return options;
|
|
7402
7403
|
}
|
|
@@ -7475,6 +7476,23 @@ async function runGenerate(kind, opts) {
|
|
|
7475
7476
|
}
|
|
7476
7477
|
opts = { ...opts, frameUrl: inlined.dataUri };
|
|
7477
7478
|
}
|
|
7479
|
+
if (kind === "video" && opts.refs?.length) {
|
|
7480
|
+
const refs = [];
|
|
7481
|
+
for (const ref of opts.refs) {
|
|
7482
|
+
if (isRemoteRef(ref)) {
|
|
7483
|
+
refs.push(ref);
|
|
7484
|
+
continue;
|
|
7485
|
+
}
|
|
7486
|
+
const inlined = await inlineLocalImage(ref, "--ref");
|
|
7487
|
+
if (!inlined.ok) {
|
|
7488
|
+
log.error(inlined.error);
|
|
7489
|
+
process.exitCode = 1;
|
|
7490
|
+
return;
|
|
7491
|
+
}
|
|
7492
|
+
refs.push(inlined.dataUri);
|
|
7493
|
+
}
|
|
7494
|
+
opts = { ...opts, refs };
|
|
7495
|
+
}
|
|
7478
7496
|
if (kind === "model" && opts.imageUrl && !isRemoteRef(opts.imageUrl)) {
|
|
7479
7497
|
const inlined = await inlineLocalImage(opts.imageUrl, "--image");
|
|
7480
7498
|
if (!inlined.ok) {
|
|
@@ -21725,13 +21743,18 @@ ${c.bold("Options for the generators (`model` `sfx` `music` `voice` `texture` `i
|
|
|
21725
21743
|
--bg-mode <mode> (image) background-removal model: sprite | glyph | sheet |
|
|
21726
21744
|
matte (BiRefNet soft alpha \u2014 hair/glow/smoke edges).
|
|
21727
21745
|
--loop (video) generate a seamless loop.
|
|
21728
|
-
--resolution <r> (video)
|
|
21729
|
-
|
|
21730
|
-
|
|
21746
|
+
--resolution <r> (video) 480p | 768p | 2k | 4k (default 768p \u2014 the top
|
|
21747
|
+
native mode; 2k/4k are upscales of the same base and
|
|
21748
|
+
cost more; 480p is the cost opt-down; loop clips ignore
|
|
21749
|
+
it, model default).
|
|
21731
21750
|
--frame <url|file> (video) animate from THIS frame back to itself (seamless
|
|
21732
21751
|
loop) \u2014 an asset URL or a local image file (\u22644 MB).
|
|
21733
21752
|
--first-frame <url> (video) start frame for a two-frame motion \u2026
|
|
21734
21753
|
--last-frame <url> (video) \u2026 and its end frame.
|
|
21754
|
+
--ref <url|file> (video, repeatable \xD79) subject/style reference images \u2014
|
|
21755
|
+
cite them in the prompt as "Image 1"\u2026"Image N"; keeps
|
|
21756
|
+
the same character/style across many clips. Cannot be
|
|
21757
|
+
combined with --frame/--loop.
|
|
21735
21758
|
--no-wait Enqueue only; don't block waiting for the asset. Prints
|
|
21736
21759
|
the id that "genex wait <id>" picks the result up with.
|
|
21737
21760
|
--no-download (Genex Tools workspaces) print the asset URL only instead
|
|
@@ -22025,6 +22048,7 @@ function parseArgs(argv) {
|
|
|
22025
22048
|
"--frame",
|
|
22026
22049
|
"--first-frame",
|
|
22027
22050
|
"--last-frame",
|
|
22051
|
+
"--ref",
|
|
22028
22052
|
"--resolution",
|
|
22029
22053
|
// `genex model` mesh-lane value flags (AG-908).
|
|
22030
22054
|
"--image",
|
|
@@ -22530,14 +22554,17 @@ function applyValueFlag(options, flag, value) {
|
|
|
22530
22554
|
options.bgMode = value;
|
|
22531
22555
|
break;
|
|
22532
22556
|
case "--resolution":
|
|
22533
|
-
if (!["720p", "1080p"].includes(value)) {
|
|
22534
|
-
throw new Error(`Invalid --resolution value: ${value} (expected
|
|
22557
|
+
if (!["480p", "768p", "2k", "4k", "720p", "1080p"].includes(value)) {
|
|
22558
|
+
throw new Error(`Invalid --resolution value: ${value} (expected 480p|768p|2k|4k)`);
|
|
22535
22559
|
}
|
|
22536
22560
|
options.resolution = value;
|
|
22537
22561
|
break;
|
|
22538
22562
|
case "--frame":
|
|
22539
22563
|
options.frameUrl = value;
|
|
22540
22564
|
break;
|
|
22565
|
+
case "--ref":
|
|
22566
|
+
options.refs = [...options.refs ?? [], value];
|
|
22567
|
+
break;
|
|
22541
22568
|
case "--image":
|
|
22542
22569
|
options.imageUrl = value;
|
|
22543
22570
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/cli-demo",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4-dev.536",
|
|
4
4
|
"description": "Set up your project's agent workspace (.claude/.codex/.cursor in the game folder), authorize, create a game project, generate AI assets, and publish (genex CLI).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -406,12 +406,15 @@ fight — the title in the display font is a finished title, not a stand-in:
|
|
|
406
406
|
re-prompt the still against the new direction (or `--edit` it against the
|
|
407
407
|
new reference) and re-run the video from the new still. Agent-initiated
|
|
408
408
|
polish never does.
|
|
409
|
-
- **The menu video renders
|
|
409
|
+
- **The menu video renders 768p by default — leave it alone.** Every video
|
|
410
410
|
path, the frame-conditioned (`--frame`) menu route included, defaults to
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
incidental — never the main menu.
|
|
411
|
+
768p — the model's top NATIVE mode; `--resolution 2k` is an upscale of the
|
|
412
|
+
same base at ~2× the cost, worth it only if the menu still reads soft on a
|
|
413
|
+
large desktop. Don't opt DOWN: `--resolution 480p` exists for clips that are
|
|
414
|
+
genuinely incidental — never the main menu.
|
|
415
|
+
- **The clip ships with a native audio track — keep the menu `<video>` muted.**
|
|
416
|
+
Autoplay requires `muted` anyway; menu music stays the `npx genex music`
|
|
417
|
+
track under the Music volume slider, not the clip's baked-in audio.
|
|
415
418
|
- **Pause/victory/defeat variants reuse the same video — as GRADES.** Same
|
|
416
419
|
`<video>` element or URL, different emotion via CSS `filter` on the
|
|
417
420
|
background: pause = a plain dark overlay (`rgba(0,0,0,0.55)`); defeat =
|
|
@@ -439,12 +442,13 @@ fight — the title in the display font is a finished title, not a stand-in:
|
|
|
439
442
|
frame: the seamless-loop mode. The URL must be one printed by `npx genex image`.
|
|
440
443
|
- `--first-frame <url>` / `--last-frame <url>` (video) — two-frame mode for a
|
|
441
444
|
genuine state change; expect a loop seam.
|
|
442
|
-
- `--duration <sec>` (video) —
|
|
443
|
-
|
|
444
|
-
- `--resolution <
|
|
445
|
-
`--frame` menu route included. `
|
|
446
|
-
|
|
447
|
-
(`--loop`) ignore it (that model has no resolution
|
|
445
|
+
- `--duration <sec>` (video) — 5–15 for frame-conditioned clips; default 8
|
|
446
|
+
(menu loops read better long).
|
|
447
|
+
- `--resolution <480p|768p|2k|4k>` (video) — every path defaults to **768p**
|
|
448
|
+
(the top native mode), the `--frame` menu route included. `2k` upscales for
|
|
449
|
+
~2× the cost; `480p` is the cost opt-down for incidental clips — not for the
|
|
450
|
+
menu. Loop clips (`--loop`) ignore it (that model has no resolution
|
|
451
|
+
parameter).
|
|
448
452
|
- `--aspect 16:9 --quality high` (image) — the right settings for a menu frame.
|
|
449
453
|
- `--no-wait` — enqueue and return immediately with the generation id; pick
|
|
450
454
|
the result up later with `npx genex wait <id>` (safe to re-run — it attaches
|
|
@@ -37,13 +37,17 @@ The clip lives in Genex storage (R2) and loads straight from that URL — you do
|
|
|
37
37
|
download it and nothing is committed to your repo. The URL is permanent (local dev,
|
|
38
38
|
published game, and remixes alike).
|
|
39
39
|
|
|
40
|
-
> **Cost & length:** the default is a **5-second,
|
|
41
|
-
> for anything the player looks at directly.
|
|
42
|
-
> genuinely needs to be longer (
|
|
43
|
-
>
|
|
44
|
-
>
|
|
45
|
-
>
|
|
46
|
-
>
|
|
40
|
+
> **Cost & length:** the default is a **5-second, 768p** clip (MiniMax H3's top
|
|
41
|
+
> native mode) — the right default for anything the player looks at directly.
|
|
42
|
+
> Only pass `--duration` when the content genuinely needs to be longer (5–15s;
|
|
43
|
+
> a cutscene), `--resolution 2k`/`4k` only for hero shots (they upscale the
|
|
44
|
+
> same native base and cost roughly 2–3×), and `--resolution 480p` only when
|
|
45
|
+
> the clip is genuinely incidental (a small in-world screen seen from a
|
|
46
|
+
> distance). Every clip carries a **native stereo audio track** (score, foley,
|
|
47
|
+
> even dialogue) — in-game `<video>` elements autoplay muted, so unmute it only
|
|
48
|
+
> when the sound is the point (a cutscene) and route it through the SFX volume
|
|
49
|
+
> slider. mp4 has **no alpha channel**, so a video is always a full rectangle
|
|
50
|
+
> (there are no transparent video decals).
|
|
47
51
|
|
|
48
52
|
## Play it in Three.js
|
|
49
53
|
|
|
@@ -133,15 +137,21 @@ See `$genex-threejs-multiplayer` for the `shared` channel rules and the room API
|
|
|
133
137
|
## Options
|
|
134
138
|
|
|
135
139
|
- `--loop` — a seamless loop (for screens, ambient backdrops, video decals).
|
|
136
|
-
- `--duration <sec>` — clip length
|
|
137
|
-
genuinely needs more —
|
|
138
|
-
- `--resolution
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
- `--duration <sec>` — clip length 5–15; default 5. Only raise it when the content
|
|
141
|
+
genuinely needs more — clips bill per second.
|
|
142
|
+
- `--resolution 480p|768p|2k|4k` — output resolution (default **768p**, the top
|
|
143
|
+
native mode). `2k`/`4k` upscale the same base for hero shots at ~2–3× the
|
|
144
|
+
cost; `480p` is the cost opt-down for genuinely incidental clips. `--loop`
|
|
145
|
+
clips ignore it (model default).
|
|
146
|
+
- `--frame <url|file>` — one generated image (or a local file ≤4 MB) as BOTH
|
|
147
|
+
first and last frame — the seamless-loop mode (motion must return to its
|
|
148
|
+
start; the seam is mathematically exact).
|
|
143
149
|
- `--first-frame <url>` / `--last-frame <url>` — two-frame motion between two
|
|
144
|
-
stills (a genuine state change
|
|
150
|
+
stills (a genuine state change — a door opens, day turns to night).
|
|
151
|
+
- `--ref <url|file>` — repeatable, up to 9 subject/style reference images.
|
|
152
|
+
Cite each in the prompt by its order: "Image 1 is the hero — she walks into
|
|
153
|
+
frame…". This is how the SAME character or art style holds across many clips
|
|
154
|
+
(a cutscene series, an episodic story). Cannot combine with `--frame`/`--loop`.
|
|
145
155
|
- `--no-wait` — enqueue and return immediately, without the URL. Fire-and-forget
|
|
146
156
|
only: re-running the command creates (and bills) a NEW video.
|
|
147
157
|
- `--api-url <url>` — override the API base (local dev).
|
|
@@ -149,6 +159,23 @@ See `$genex-threejs-multiplayer` for the `shared` channel rules and the room API
|
|
|
149
159
|
Menu backdrops belong to `$genex-ai-menu`; a cohesive art-directed HUD sprite
|
|
150
160
|
set belongs to `$genex-ai-hud` — both build on `npx genex image`/`video`.
|
|
151
161
|
|
|
162
|
+
## Interactive video games
|
|
163
|
+
|
|
164
|
+
Clips are cheap and fast enough to be a game's PRIMARY content, not just set
|
|
165
|
+
dressing — an interactive movie (Detroit-style branching story), a generated-
|
|
166
|
+
evidence detective game, a video-book. The pattern that makes it hold together:
|
|
167
|
+
|
|
168
|
+
- **Branching scenes**: generate one clip per story node at build time, ship
|
|
169
|
+
the mp4 URLs in a scene-graph JSON, play them full-screen with DOM choice
|
|
170
|
+
buttons; preload the clips reachable from the current node while it plays.
|
|
171
|
+
- **Visual continuity**: chain scenes with `--frame`/`--first-frame` so each
|
|
172
|
+
clip opens where the last one ended.
|
|
173
|
+
- **Cast consistency**: give every scene the same `--ref` images of your
|
|
174
|
+
protagonist and key locations — the single biggest quality lever for any
|
|
175
|
+
multi-clip story.
|
|
176
|
+
- Keep hard facts (dialogue you must control, exact text) in subtitles and
|
|
177
|
+
`npx genex voice` lines layered on top; the clip's own audio is atmosphere.
|
|
178
|
+
|
|
152
179
|
## Troubleshooting
|
|
153
180
|
|
|
154
181
|
- **"Not authorized"** — run `npx @genex-ai/cli-demo@dev init` first (it writes your `GENEX_TOKEN`).
|
|
@@ -18,6 +18,10 @@ npx genex video "candle flame flickering in the dark" --loop
|
|
|
18
18
|
Blocks until ready, saves the mp4 into `./assets`, and prints the path. Wire the
|
|
19
19
|
local path — a shipped build must never fetch the URL at runtime.
|
|
20
20
|
|
|
21
|
+
Every clip carries a **native stereo audio track** (score, foley, ambience).
|
|
22
|
+
Browsers only autoplay muted video, so keep the `<video>` element muted unless
|
|
23
|
+
the sound is the point — and route it through your game's volume control.
|
|
24
|
+
|
|
21
25
|
## Animating a still
|
|
22
26
|
|
|
23
27
|
The strongest results come from conditioning on an image you already approved,
|
|
@@ -33,9 +37,11 @@ npx genex video "camera drifts slowly forward, banners stirring" --frame ./asset
|
|
|
33
37
|
|
|
34
38
|
## Options
|
|
35
39
|
|
|
36
|
-
- `--duration <sec>` — target clip length
|
|
40
|
+
- `--duration <sec>` — target clip length, 5–15 seconds (default 5; clips bill
|
|
41
|
+
per second).
|
|
37
42
|
- `--loop` — a seamless loop.
|
|
38
|
-
- `--resolution <
|
|
43
|
+
- `--resolution <480p|768p|2k|4k>` — default 768p (the top native mode). `2k`/`4k` upscale the same base at ~2–3× the cost; `480p` is the opt-down for clips where fidelity genuinely does not matter. Loop clips ignore it.
|
|
44
|
+
- `--ref <path|url>` — repeatable, up to 9 subject/style reference images, cited in the prompt as "Image 1"…"Image N" — the way one character or art style holds across many clips. Cannot combine with `--frame`/`--loop`.
|
|
39
45
|
- `--open` — also open it in a browser, for something the user must approve.
|
|
40
46
|
- `--out-dir <dir>` — where the file lands (default `./assets`).
|
|
41
47
|
- `--no-download` — print the URL only.
|