makaron-cli 0.17.28 → 0.17.30
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +12 -0
- package/bin/director.mjs +118 -0
- package/bin/makaron.mjs +22 -3
- package/bin/price.mjs +1 -0
- package/package.json +1 -1
- package/skills/makaron/SKILL.md +7 -0
package/README.md
CHANGED
|
@@ -423,6 +423,13 @@ npx makaron-cli edit --image photo.jpg --out result.jpg "make it dramatic"
|
|
|
423
423
|
npx makaron-cli edit --image-model gpt-image-2.6-flare --background transparent --out sticker.png "a magenta star sticker"
|
|
424
424
|
```
|
|
425
425
|
|
|
426
|
+
Select `z-image-turbo` for fast text-to-image or guided redraw. It returns one 1K image, WebP by default, with PNG/JPEG available through `--output-format`. For a redraw, pass one `--image` or one `--ref`. Redraw follows the source aspect ratio when the 1K canvas has a short edge of at least 512 pixels. For very wide or tall inputs, pass a supported aspect such as 16:9 or 9:16. For a current estimate, run `makaron price image --model z-image-turbo --resolution 1K --operation generate`.
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
npx makaron-cli edit --image-model z-image-turbo --out poster.webp "a screen-print illustration of an alpine railway"
|
|
430
|
+
npx makaron-cli edit --image poster.webp --image-model z-image-turbo --out variant.webp "redraw the poster in a two-color print style"
|
|
431
|
+
```
|
|
432
|
+
|
|
426
433
|
Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.6-flare|gpt-image-2.6-sunburst|wan2.7-image|mj-v8.2|seedream-5.5|kling-image-4.0`, `--ref <file>` (model-specific limit), `--aspect <ratio>`, `--background auto|opaque|transparent`, `--out <path>`. Nano Banana 2.1 (`gemini-2.1`) supports up to 14 total input images and `--image-resolution 1K|2K|4K` (default 1K); it uses OpenRouter and does not retry or switch models automatically. Qwen Spicy supports 0–3 input images; legacy `qwen` requests map to it. Pony and WAI are retired. Transparent output defaults to GPT Image 2.6 Flare; an explicitly selected GPT Image 2.6 variant is retained. Output is returned only when the provider supplies real alpha.
|
|
427
434
|
|
|
428
435
|
Midjourney V8.2 (`mj-v8.2`) accepts natural-language briefs and prepares the English prompt automatically. Fast returns up to 4 images, Draft up to 24 smaller drafts, and HD regenerates up to 4 higher-resolution images. Every returned image is saved; `--out scene.png` produces `scene-1.png`, `scene-2.png`, etc. A single result keeps the requested filename. Provider filtering can reduce the batch size.
|
|
@@ -794,3 +801,8 @@ quote stops before charging. Input video adds billable seconds; supplier credits
|
|
|
794
801
|
are different from Makaron credits. Native 4K uses EvoLink, never Eco enhancement.
|
|
795
802
|
|
|
796
803
|
Kling Image 4.0 (`--image-model kling-image-4.0`) generates or edits one native PNG at `--image-resolution 2K|4K|8K` (default 2K) on fal. You can include up to 10 ordered reference images, counting the source image. The CLI uploads local files automatically. Each input must be at most 30 MiB, at least 300 pixels on both sides, with an aspect ratio from 0.4 to 2.5. Refer to them as `@Image1`, `@Image2`. Keep the image request UUID printed by the CLI. If the response is uncertain, pass the same UUID with `--image-request-id <uuid>` to check the existing receipt without a second submission or charge. Hosted MCP requires `imageRequestId`. Pick a model with native transparency for cutouts. Kling Image 4.0 uses prompt-guided edits, so areas outside the requested edit can change.
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
### Director private preview
|
|
807
|
+
|
|
808
|
+
With an enrolled Makaron API key and the private service address in `MAKARON_DIRECTOR_URL`, use `makaron director start --prompt "A red train pulls into a station" --open` to open the live player. Live shows default to 480p. Pass `--resolution 768p` for higher resolution. Inside the player, use text or the microphone to direct the next scene. From another terminal use `makaron director direct <id> "A dragon arrives"`, `status <id>`, and `stop <id>` under the same `makaron director` command. Once status reports `recorded: true`, use `makaron director export <id> --output show.mp4` (WebM when requested by the CLI). `makaron director --help` lists opening image, format and composition options.
|
package/bin/director.mjs
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { parseArgs } from 'node:util';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import { createWriteStream } from 'node:fs';
|
|
5
|
+
import { link, rm } from 'node:fs/promises';
|
|
6
|
+
import { pipeline } from 'node:stream/promises';
|
|
7
|
+
import { Readable } from 'node:stream';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
|
|
10
|
+
export const directorHelp = `makaron director start --prompt <scene> [--image <file|https-url>] [--resolution 480p|768p] [--aspect-ratio 16:9|9:16|1:1] [--memory 1-50] [--seed n] [--story] [--open] [--json]
|
|
11
|
+
makaron director open <session>
|
|
12
|
+
makaron director direct <session> [--ready] <direction>
|
|
13
|
+
makaron director status <session>
|
|
14
|
+
makaron director stop <session>
|
|
15
|
+
makaron director export <session> --output <file>
|
|
16
|
+
Use the player for live voice or text, preview and recording. The player link is private.
|
|
17
|
+
Use --request-id <uuid> to recover the same start after a connection failure.
|
|
18
|
+
--story keeps the story moving on its own between your directions.
|
|
19
|
+
--ready sends a direction you already wrote as is, without the spoken-draft cleanup.`;
|
|
20
|
+
|
|
21
|
+
export async function runDirector(argv, getAuth, uploadImage) {
|
|
22
|
+
const { values, positionals } = parseArgs({
|
|
23
|
+
args: argv,
|
|
24
|
+
allowPositionals: true,
|
|
25
|
+
options: {
|
|
26
|
+
prompt: { type: 'string' },
|
|
27
|
+
image: { type: 'string' },
|
|
28
|
+
open: { type: 'boolean' },
|
|
29
|
+
json: { type: 'boolean' },
|
|
30
|
+
resolution: { type: 'string' },
|
|
31
|
+
'aspect-ratio': { type: 'string' },
|
|
32
|
+
memory: { type: 'string' },
|
|
33
|
+
seed: { type: 'string' },
|
|
34
|
+
host: { type: 'boolean' },
|
|
35
|
+
story: { type: 'boolean' },
|
|
36
|
+
ready: { type: 'boolean' },
|
|
37
|
+
'turn-id': { type: 'string' },
|
|
38
|
+
output: { type: 'string' },
|
|
39
|
+
'request-id': { type: 'string' },
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const [action, id, ...words] = positionals;
|
|
43
|
+
if (!['start', 'open', 'direct', 'status', 'stop', 'export'].includes(action))
|
|
44
|
+
throw Error(directorHelp);
|
|
45
|
+
if (action === 'start' ? !values.prompt?.trim() || id : !id || (action !== 'direct' && words.length))
|
|
46
|
+
throw Error(directorHelp);
|
|
47
|
+
if ((action === 'direct' && !words.join(' ').trim()) || (action === 'export' && !values.output))
|
|
48
|
+
throw Error(directorHelp);
|
|
49
|
+
const { baseUrl, headers } = getAuth();
|
|
50
|
+
const directorUrl = new URL(process.env.MAKARON_DIRECTOR_URL || baseUrl);
|
|
51
|
+
if (
|
|
52
|
+
directorUrl.protocol !== 'https:' &&
|
|
53
|
+
!(
|
|
54
|
+
directorUrl.protocol === 'http:' &&
|
|
55
|
+
['localhost', '127.0.0.1', '[::1]'].includes(directorUrl.hostname)
|
|
56
|
+
)
|
|
57
|
+
)
|
|
58
|
+
throw Error('Director requires HTTPS or loopback');
|
|
59
|
+
let image = values.image;
|
|
60
|
+
if (image && !/^https:\/\//i.test(image)) {
|
|
61
|
+
image = await uploadImage(directorUrl.origin, headers, image);
|
|
62
|
+
if (!image) throw Error('Opening image upload failed');
|
|
63
|
+
}
|
|
64
|
+
const payload =
|
|
65
|
+
action === 'start'
|
|
66
|
+
? {
|
|
67
|
+
action,
|
|
68
|
+
prompt: values.prompt,
|
|
69
|
+
image,
|
|
70
|
+
resolution: values.resolution,
|
|
71
|
+
aspectRatio: values['aspect-ratio'],
|
|
72
|
+
memory: values.memory,
|
|
73
|
+
seed: values.seed,
|
|
74
|
+
...(values.story ? { story: true } : {}),
|
|
75
|
+
requestId: values['request-id'] || randomUUID(),
|
|
76
|
+
}
|
|
77
|
+
: { action, id, text: words.join(' '), turnId: values['turn-id'], host: values.host, ready: values.ready };
|
|
78
|
+
if (action === 'start') process.stderr.write('Director request ID: ' + payload.requestId + '\n');
|
|
79
|
+
const res = await fetch(new URL('/api/director', directorUrl), {
|
|
80
|
+
method: 'POST',
|
|
81
|
+
redirect: 'error',
|
|
82
|
+
headers: { ...headers, 'content-type': 'application/json' },
|
|
83
|
+
body: JSON.stringify(payload),
|
|
84
|
+
});
|
|
85
|
+
if (!res.ok) {
|
|
86
|
+
const e = await res.json().catch(() => ({}));
|
|
87
|
+
throw Error(e.error || 'Director returned HTTP ' + res.status);
|
|
88
|
+
}
|
|
89
|
+
if (action === 'export') {
|
|
90
|
+
const ext = res.headers.get('content-type')?.includes('mp4') ? '.mp4' : '.webm';
|
|
91
|
+
if (path.extname(values.output).toLowerCase() !== ext)
|
|
92
|
+
throw Error('Use ' + ext + ' for this recording');
|
|
93
|
+
const tmp = values.output + '.' + randomUUID() + '.part';
|
|
94
|
+
try {
|
|
95
|
+
await pipeline(Readable.fromWeb(res.body), createWriteStream(tmp, { flags: 'wx', mode: 0o600 }));
|
|
96
|
+
await link(tmp, values.output);
|
|
97
|
+
} finally {
|
|
98
|
+
await rm(tmp, { force: true });
|
|
99
|
+
}
|
|
100
|
+
console.log(values.output);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const result = await res.json();
|
|
104
|
+
if ((action === 'open' || values.open) && result.playerPath) {
|
|
105
|
+
const url = new URL(result.playerPath, directorUrl);
|
|
106
|
+
if (url.origin !== directorUrl.origin) throw Error('Unexpected Director player origin');
|
|
107
|
+
const exe =
|
|
108
|
+
process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'rundll32' : 'xdg-open';
|
|
109
|
+
const args = process.platform === 'win32' ? ['url.dll,FileProtocolHandler', url.href] : [url.href];
|
|
110
|
+
const child = spawn(exe, args, { stdio: 'ignore', detached: true });
|
|
111
|
+
await new Promise((ok, fail) => {
|
|
112
|
+
child.once('spawn', ok);
|
|
113
|
+
child.once('error', fail);
|
|
114
|
+
});
|
|
115
|
+
child.unref();
|
|
116
|
+
}
|
|
117
|
+
console.log(JSON.stringify(result, null, values.json ? 0 : 2));
|
|
118
|
+
}
|
package/bin/makaron.mjs
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* npx makaron-cli list
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
import {directorHelp,runDirector} from './director.mjs';
|
|
14
15
|
import fs from 'fs';
|
|
15
16
|
import { randomUUID } from 'node:crypto';
|
|
16
17
|
import path from 'path';
|
|
@@ -2093,9 +2094,9 @@ Options:
|
|
|
2093
2094
|
--image <file|url> Base image to edit. Omit for text-to-image.
|
|
2094
2095
|
--ref <file|url> Additional reference image. Repeatable; model-specific limit (Nano Banana 2.1: 14 total inputs).
|
|
2095
2096
|
--image-request-id <uuid> Stable Kling Image 4.0 generation ID; reuse to inspect a repeated attempt.
|
|
2096
|
-
--image-model <id> gemini, gemini-2.1, gemini-lite, qwen-spicy, openai, gpt-image-2.6-flare, gpt-image-2.6-sunburst, wan2.7-image, mj-v8.2, seedream-5.5,
|
|
2097
|
+
--image-model <id> gemini, gemini-2.1, gemini-lite, qwen-spicy, openai, gpt-image-2.6-flare, gpt-image-2.6-sunburst, wan2.7-image, mj-v8.2, seedream-5.5, kling-image-4.0, or z-image-turbo. Legacy qwen maps to qwen-spicy.
|
|
2097
2098
|
--skill <id> enhance, creative, wild, or captions.
|
|
2098
|
-
--image-resolution <id> 1K, 2K, or 4K; Kling Image 4.0 supports 2K/4K/8K; Seedream 5.5 supports 1K, 1.5K and 2K. Auto remains Flare-first.
|
|
2099
|
+
--image-resolution <id> 1K, 2K, or 4K; Kling Image 4.0 supports 2K/4K/8K; Seedream 5.5 supports 1K, 1.5K and 2K. Z-Image Turbo supports 1K. Auto remains Flare-first.
|
|
2099
2100
|
--nsfw Route NSFW directly to Qwen Spicy.
|
|
2100
2101
|
--aspect <ratio> Output aspect ratio, for example 1:1, 16:9, or 9:16.
|
|
2101
2102
|
--background <mode> auto, opaque, or transparent.
|
|
@@ -2117,6 +2118,9 @@ Options:
|
|
|
2117
2118
|
--help, -h Show this help.
|
|
2118
2119
|
|
|
2119
2120
|
Notes:
|
|
2121
|
+
Z-Image Turbo supports fast 1K text-to-image and single-image redraw. Pass one
|
|
2122
|
+
--image or one --ref for redraw. The short edge must be at least 512 pixels
|
|
2123
|
+
on the 1K canvas. Default WebP. PNG and JPEG are also available.
|
|
2120
2124
|
GPT Image 2.6 defaults to low rendering quality + high reasoning.
|
|
2121
2125
|
New GIF art and animated memes: use makaron chat with GPT Image 2.6 Flare.
|
|
2122
2126
|
animated-gif is for existing-frame assembly or explicit timing/export controls.
|
|
@@ -2129,6 +2133,8 @@ Notes:
|
|
|
2129
2133
|
and fails instead of returning an opaque fallback.
|
|
2130
2134
|
|
|
2131
2135
|
Examples:
|
|
2136
|
+
makaron edit --image-model z-image-turbo --out poster.webp "a screen-print illustration of an alpine railway"
|
|
2137
|
+
makaron edit --image poster.webp --image-model z-image-turbo --out variant.webp "redraw the poster in a two-color print style"
|
|
2132
2138
|
makaron edit --image portrait.jpg --image-model qwen-spicy --out result.jpg "cinematic warm light"
|
|
2133
2139
|
makaron edit --image product.jpg --ref style.png --aspect 1:1 "use this visual style"
|
|
2134
2140
|
makaron edit --image-model gpt-image-2.6-flare --background transparent --out sticker.png "a magenta star sticker"
|
|
@@ -2321,6 +2327,7 @@ Commands:
|
|
|
2321
2327
|
Add an external image without uploading it
|
|
2322
2328
|
project media add <projectId> --type video --source-url <url> --start <n> --end <n>
|
|
2323
2329
|
Add an external video range without uploading it
|
|
2330
|
+
director --help Start, steer, watch and record a live show
|
|
2324
2331
|
create --image <file> Create project from local image
|
|
2325
2332
|
create --image-url <url> Create project from URL
|
|
2326
2333
|
create --title "name" Create empty project (text-to-image)
|
|
@@ -2420,6 +2427,7 @@ function setupMakaron(values = []) {
|
|
|
2420
2427
|
}
|
|
2421
2428
|
|
|
2422
2429
|
function printHelp(topic, subtopic) {
|
|
2430
|
+
if (topic === 'director') { console.log(directorHelp); return; }
|
|
2423
2431
|
if (topic === 'price') { printPriceHelp(); return; }
|
|
2424
2432
|
if (topic === 'layerize') { printLayerizeHelp(); return; }
|
|
2425
2433
|
if (topic === 'login') {
|
|
@@ -3404,7 +3412,11 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
|
|
|
3404
3412
|
editArgs.midjourney = mjArgs;
|
|
3405
3413
|
}
|
|
3406
3414
|
editArgs.editPrompt = promptParts.join(' ');
|
|
3407
|
-
if (!editArgs.editPrompt) { console.error('Usage: makaron edit [--image <file|url>] [--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|wan2.7-image|mj-v8.2|seedream-5.5|kling-image-4.0] [--ref <file>] [--aspect <ratio>] [--background auto|opaque|transparent] [--out <file>] "prompt"'); process.exit(1); }
|
|
3415
|
+
if (!editArgs.editPrompt) { console.error('Usage: makaron edit [--image <file|url>] [--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|wan2.7-image|mj-v8.2|seedream-5.5|kling-image-4.0|z-image-turbo] [--ref <file>] [--aspect <ratio>] [--background auto|opaque|transparent] [--out <file>] "prompt"'); process.exit(1); }
|
|
3416
|
+
if (editArgs.model === 'z-image-turbo' && Number(Boolean(editSourceFile)) + editReferenceFiles.length > 1) {
|
|
3417
|
+
console.error('Z-Image Turbo accepts one total input. Pass one --image or one --ref.');
|
|
3418
|
+
process.exit(1);
|
|
3419
|
+
}
|
|
3408
3420
|
if (editArgs.model === 'kling-image-4.0') {
|
|
3409
3421
|
editArgs.imageRequestId ||= randomUUID();
|
|
3410
3422
|
process.stderr.write(`Image request ID: ${editArgs.imageRequestId} (retain it; never repeat an uncertain paid submission with a new ID)\n`);
|
|
@@ -3433,6 +3445,13 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
|
|
|
3433
3445
|
}
|
|
3434
3446
|
await analyzeVideoCli(baseUrl, headers, video, questionParts);
|
|
3435
3447
|
|
|
3448
|
+
} else if (command === 'director') {
|
|
3449
|
+
try {
|
|
3450
|
+
await runDirector(args.slice(1),getAuth,(base,headers,file)=>{
|
|
3451
|
+
const image=validateImage(file);if(!image.ok)throw Error(image.error);
|
|
3452
|
+
return uploadFileViaSignedUrl(base,headers,undefined,file,image.mime);
|
|
3453
|
+
});
|
|
3454
|
+
} catch(error) {console.error(error.message);process.exitCode=1;}
|
|
3436
3455
|
} else if (command === 'video') {
|
|
3437
3456
|
const { headers, baseUrl } = getAuth();
|
|
3438
3457
|
const sub = args[1];
|
package/bin/price.mjs
CHANGED
|
@@ -48,6 +48,7 @@ Usage:
|
|
|
48
48
|
|
|
49
49
|
Examples:
|
|
50
50
|
makaron price video --model kling-4-flash --model seedance-2.5-native --duration 5 --resolution 720p
|
|
51
|
+
makaron price image --model z-image-turbo --resolution 1K --operation generate
|
|
51
52
|
makaron price image --model seedream-5.5 --resolution 2K --operation edit --image-count 3
|
|
52
53
|
makaron price audio --model evolink-seed-audio --duration 20
|
|
53
54
|
|
package/package.json
CHANGED
package/skills/makaron/SKILL.md
CHANGED
|
@@ -349,6 +349,13 @@ npx makaron-cli edit --image photo.jpg --out result.jpg "make it dramatic"
|
|
|
349
349
|
npx makaron-cli edit --image-model gpt-image-2.6-flare --background transparent --out sticker.png "a magenta star sticker"
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
+
Select `z-image-turbo` for fast text-to-image or guided redraw. It returns one 1K image, WebP by default, with PNG/JPEG available through `--output-format`. For a redraw, pass one `--image` or one `--ref`. Redraw follows the source aspect ratio when the 1K canvas has a short edge of at least 512 pixels. For very wide or tall inputs, pass a supported aspect such as 16:9 or 9:16. For a current estimate, run `makaron price image --model z-image-turbo --resolution 1K --operation generate`.
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
npx makaron-cli edit --image-model z-image-turbo --out poster.webp "a screen-print illustration of an alpine railway"
|
|
356
|
+
npx makaron-cli edit --image poster.webp --image-model z-image-turbo --out variant.webp "redraw the poster in a two-color print style"
|
|
357
|
+
```
|
|
358
|
+
|
|
352
359
|
Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.6-flare|gpt-image-2.6-sunburst|wan2.7-image|mj-v8.2|seedream-5.5|kling-image-4.0`, `--ref <file>` (model-specific limit), `--aspect <ratio>`, `--image-resolution 1K|2K|4K`, `--background auto|opaque|transparent`, `--nsfw`, `--out <path>`. Image Model Capability prefers matching requirements, then relaxes output conflicts to deliver an image: GPT Image 2.6 Flare → Nano Banana 2.1 → Qwen Spicy. Omit the model for Auto: an 8:1 banner or an explicit resolution tier selects Nano Banana 2.1. Native ratio presets do not promise exact mathematical ratios or user pixel dimensions. For Agent-assessed NSFW, pass `--nsfw` to route directly to Spicy; never probe another provider first. Unknown IDs use Flare-first Auto. Output conflicts relax before submission: transparent 8:1 normally keeps 8:1 with opaque output; NSFW always uses Spicy regardless of unsupported dimensions. Preserve input content first and explain actual adjustments. See current MCP tool descriptions for the generated capability table. Classic Nano Banana 2 (`gemini`), Lite, Sunburst and Wan are explicit routes; `openai` means Flare and legacy `qwen` means Spicy. Pony/WAI are retired. Transparent output prefers Flare or explicitly selected Sunburst, and may relax alpha when other requirements conflict. Supplier failures never trigger automatic image resubmission or model switching.
|
|
353
360
|
|
|
354
361
|
Midjourney V8.2 (`mj-v8.2`) accepts natural-language briefs and prepares the English prompt automatically. Fast returns up to 4 images, Draft up to 24 smaller drafts, and HD regenerates up to 4 higher-resolution images. Every returned image is saved; `--out scene.png` produces `scene-1.png`, `scene-2.png`, etc. A single result keeps the requested filename. Provider filtering can reduce the batch size.
|