makaron-cli 0.17.22 → 0.17.25
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 +17 -1
- package/bin/makaron.mjs +33 -9
- package/bin/price.mjs +157 -0
- package/package.json +1 -1
- package/skills/makaron/SKILL.md +17 -1
package/README.md
CHANGED
|
@@ -72,6 +72,20 @@ npx makaron-cli claim
|
|
|
72
72
|
```
|
|
73
73
|
Share the `claim_url` with a human. They log in and the API key gets linked to their account. Claim links are valid for 7 days. Run `claim` again anytime to get a new link.
|
|
74
74
|
|
|
75
|
+
|
|
76
|
+
## Check generation credits on demand
|
|
77
|
+
|
|
78
|
+
Use `makaron price` when the user asks about price, budget, or how models compare. For routine creation, go directly to the requested workflow. `price list` discovers model IDs and supported resolutions. The quote includes customer-facing credits and applicable billing factors. It does not start a run, upload media or read your balance.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
makaron price list --json
|
|
82
|
+
makaron price video --model kling-4-flash --model seedance-2.5-native --duration 5 --resolution 720p
|
|
83
|
+
makaron price image --model seedream-5.5 --operation edit --image-count 3 --resolution 2K --json
|
|
84
|
+
makaron price audio --model evolink-seed-audio --duration 20
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
For video references, pass both `--video-reference-count` and the total `--reference-video-seconds`. Count an edit's base image in `--image-count`. Use `--input <file|-> --json` for up to six requests with different parameters. The JSON body is `{"requests":[{"kind":"video","model":"kling-4-flash","duration_seconds":5,"image_count":0,"resolution":"720p"}]}`. Exit `2` means at least one quote is unavailable, unsupported or missing inputs. A `preflight_only` amount is an estimate that may differ from the final charge.
|
|
88
|
+
|
|
75
89
|
## Core Workflow
|
|
76
90
|
|
|
77
91
|
```bash
|
|
@@ -409,7 +423,7 @@ npx makaron-cli edit --image photo.jpg --out result.jpg "make it dramatic"
|
|
|
409
423
|
npx makaron-cli edit --image-model gpt-image-2.6-flare --background transparent --out sticker.png "a magenta star sticker"
|
|
410
424
|
```
|
|
411
425
|
|
|
412
|
-
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`, `--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.
|
|
426
|
+
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.
|
|
413
427
|
|
|
414
428
|
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.
|
|
415
429
|
|
|
@@ -778,3 +792,5 @@ Show the quoted total Makaron credits before repeating the identical request wit
|
|
|
778
792
|
`--max-credits <quoted-total>` and a stable `--request-id <uuid>`. A higher fresh
|
|
779
793
|
quote stops before charging. Input video adds billable seconds; supplier credits
|
|
780
794
|
are different from Makaron credits. Native 4K uses EvoLink, never Eco enhancement.
|
|
795
|
+
|
|
796
|
+
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.
|
package/bin/makaron.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import path from 'path';
|
|
|
17
17
|
import { createInterface } from 'readline';
|
|
18
18
|
import { execFileSync } from 'child_process';
|
|
19
19
|
import { fileURLToPath } from 'url';
|
|
20
|
+
import { printPriceHelp, runPrice } from './price.mjs';
|
|
20
21
|
|
|
21
22
|
// ─── Config ──────────────────────────────────────────────────────────────────
|
|
22
23
|
|
|
@@ -2020,10 +2021,10 @@ function validateVideoFileForAnalysis(videoPath) {
|
|
|
2020
2021
|
return { ok: true, mime };
|
|
2021
2022
|
}
|
|
2022
2023
|
|
|
2023
|
-
function saveMcpImage(result, outputPath) {
|
|
2024
|
+
async function saveMcpImage(result, outputPath) {
|
|
2024
2025
|
const content = result?.content || [];
|
|
2025
2026
|
const texts = content.filter(c => c.type === 'text');
|
|
2026
|
-
const images = content.filter(c => c.type === 'image');
|
|
2027
|
+
const images = content.filter(c => c.type === 'image' || (c.type === 'resource_link' && c.mimeType?.startsWith('image/')));
|
|
2027
2028
|
for (const text of texts) process.stderr.write(`${text.text}\n`);
|
|
2028
2029
|
if (result?.isError) { process.exitCode = 1; return null; }
|
|
2029
2030
|
const saved = [];
|
|
@@ -2037,7 +2038,15 @@ function saveMcpImage(result, outputPath) {
|
|
|
2037
2038
|
const suffix = images.length > 1 ? `-${index + 1}` : '';
|
|
2038
2039
|
const out = `${stem}${suffix}.${compatible ? requestedExtension : extension}`;
|
|
2039
2040
|
if (outputPath && !compatible) process.stderr.write(`Output is ${image.mimeType}; saving as ${out} so bytes and filename agree.\n`);
|
|
2040
|
-
|
|
2041
|
+
if (image.type === 'resource_link') {
|
|
2042
|
+
const url = new URL(image.uri);
|
|
2043
|
+
if (url.protocol !== 'https:' || url.username || url.password) throw new Error('Generated originals require a public HTTPS URL.');
|
|
2044
|
+
const response = await fetch(url, { signal: AbortSignal.timeout(180_000), redirect: 'error' });
|
|
2045
|
+
if (!response.ok) throw new Error(`Original download failed (${response.status}). Keep the image request ID; do not regenerate.`);
|
|
2046
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
2047
|
+
if (bytes.length > 200 * 1024 * 1024) throw new Error('Generated original exceeds 200MiB.');
|
|
2048
|
+
fs.writeFileSync(out, bytes);
|
|
2049
|
+
} else fs.writeFileSync(out, Buffer.from(image.data, 'base64'));
|
|
2041
2050
|
console.log(out);
|
|
2042
2051
|
saved.push(out);
|
|
2043
2052
|
}
|
|
@@ -2083,9 +2092,10 @@ Usage:
|
|
|
2083
2092
|
Options:
|
|
2084
2093
|
--image <file|url> Base image to edit. Omit for text-to-image.
|
|
2085
2094
|
--ref <file|url> Additional reference image. Repeatable; model-specific limit (Nano Banana 2.1: 14 total inputs).
|
|
2086
|
-
--image-
|
|
2095
|
+
--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, or kling-image-4.0. Legacy qwen maps to qwen-spicy.
|
|
2087
2097
|
--skill <id> enhance, creative, wild, or captions.
|
|
2088
|
-
--image-resolution <id> 1K, 2K, or 4K; Seedream 5.5 supports 1K, 1.5K and 2K. Auto remains Flare-first.
|
|
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.
|
|
2089
2099
|
--nsfw Route NSFW directly to Qwen Spicy.
|
|
2090
2100
|
--aspect <ratio> Output aspect ratio, for example 1:1, 16:9, or 9:16.
|
|
2091
2101
|
--background <mode> auto, opaque, or transparent.
|
|
@@ -2303,6 +2313,7 @@ Commands:
|
|
|
2303
2313
|
claim Get claim URL for human to link account
|
|
2304
2314
|
login Log in to Makaron (human interactive)
|
|
2305
2315
|
credits Show current credit balance
|
|
2316
|
+
price list|image|video|audio Estimate generation credits and compare models
|
|
2306
2317
|
usage [--run <id>] [--project <id>] Credit usage history (chat prints per-run usage)
|
|
2307
2318
|
list (ls) List all projects
|
|
2308
2319
|
project media <projectId> --json List timeline media for a project
|
|
@@ -2409,6 +2420,7 @@ function setupMakaron(values = []) {
|
|
|
2409
2420
|
}
|
|
2410
2421
|
|
|
2411
2422
|
function printHelp(topic, subtopic) {
|
|
2423
|
+
if (topic === 'price') { printPriceHelp(); return; }
|
|
2412
2424
|
if (topic === 'layerize') { printLayerizeHelp(); return; }
|
|
2413
2425
|
if (topic === 'login') {
|
|
2414
2426
|
console.log('Usage: makaron login');
|
|
@@ -2581,6 +2593,13 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
|
|
|
2581
2593
|
console.log('Subscription: none');
|
|
2582
2594
|
}
|
|
2583
2595
|
}
|
|
2596
|
+
} else if (command === 'price') {
|
|
2597
|
+
try {
|
|
2598
|
+
await runPrice(args.slice(1), getAuth);
|
|
2599
|
+
} catch (error) {
|
|
2600
|
+
console.error(error.message);
|
|
2601
|
+
process.exitCode = 1;
|
|
2602
|
+
}
|
|
2584
2603
|
} else if (command === 'usage') {
|
|
2585
2604
|
const { headers, baseUrl } = getAuth();
|
|
2586
2605
|
const params = new URLSearchParams();
|
|
@@ -3314,6 +3333,7 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
|
|
|
3314
3333
|
editSourceFile = args[++i];
|
|
3315
3334
|
editArgs.image = imageToArg(editSourceFile);
|
|
3316
3335
|
}
|
|
3336
|
+
else if (args[i] === '--image-request-id' && args[i + 1]) editArgs.imageRequestId = args[++i];
|
|
3317
3337
|
else if (args[i] === '--image-model' && args[i + 1]) editArgs.model = args[++i];
|
|
3318
3338
|
else if (args[i] === '--model' && args[i + 1]) {
|
|
3319
3339
|
warnLegacyModelFlag('--image-model');
|
|
@@ -3383,10 +3403,14 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
|
|
|
3383
3403
|
editArgs.midjourney = mjArgs;
|
|
3384
3404
|
}
|
|
3385
3405
|
editArgs.editPrompt = promptParts.join(' ');
|
|
3386
|
-
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] [--ref <file>] [--aspect <ratio>] [--background auto|opaque|transparent] [--out <file>] "prompt"'); process.exit(1); }
|
|
3387
|
-
if (editArgs.model === '
|
|
3406
|
+
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); }
|
|
3407
|
+
if (editArgs.model === 'kling-image-4.0') {
|
|
3408
|
+
editArgs.imageRequestId ||= randomUUID();
|
|
3409
|
+
process.stderr.write(`Image request ID: ${editArgs.imageRequestId} (retain it; never repeat an uncertain paid submission with a new ID)\n`);
|
|
3410
|
+
}
|
|
3411
|
+
if (['seedream-5.5', 'kling-image-4.0'].includes(editArgs.model)) {
|
|
3388
3412
|
const sources = [...(editSourceFile ? [editSourceFile] : []), ...editReferenceFiles];
|
|
3389
|
-
if (sources.length > 10) { console.error('
|
|
3413
|
+
if (sources.length > 10) { console.error('This model accepts at most 10 inputs including the base.'); process.exit(1); }
|
|
3390
3414
|
const localFiles = sources.filter(source => !isHttpUrl(source));
|
|
3391
3415
|
const uploaded = localFiles.length ? await uploadImageFilesViaSignedUrl(baseUrl, headers, undefined, localFiles) : [];
|
|
3392
3416
|
const byPath = new Map(localFiles.map((source, index) => [source, uploaded[index]]));
|
|
@@ -3396,7 +3420,7 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
|
|
|
3396
3420
|
}
|
|
3397
3421
|
process.stderr.write('🎨 Generating...\n');
|
|
3398
3422
|
const result = await callMcpTool(baseUrl, headers, 'makaron_edit_image', editArgs);
|
|
3399
|
-
saveMcpImage(result, outputPath);
|
|
3423
|
+
await saveMcpImage(result, outputPath);
|
|
3400
3424
|
|
|
3401
3425
|
} else if (command === 'analyze') {
|
|
3402
3426
|
const { headers, baseUrl } = getAuth();
|
package/bin/price.mjs
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { parseArgs } from 'node:util';
|
|
3
|
+
|
|
4
|
+
const quoteKinds = ['image', 'video', 'audio'];
|
|
5
|
+
const textFields = {
|
|
6
|
+
resolution: 'resolution', operation: 'operation', aspect: 'aspect_ratio', background: 'background',
|
|
7
|
+
quality: 'image_quality', 'image-reasoning': 'image_reasoning_effort', 'output-format': 'output_format',
|
|
8
|
+
};
|
|
9
|
+
const numberFields = {
|
|
10
|
+
duration: 'duration_seconds', 'image-count': 'image_count', 'video-reference-count': 'video_reference_count',
|
|
11
|
+
'reference-video-seconds': 'reference_video_seconds', 'reference-image-pixels': 'reference_image_pixels',
|
|
12
|
+
'audio-reference-count': 'audio_reference_count', 'reference-audio-seconds': 'reference_audio_seconds',
|
|
13
|
+
fps: 'output_fps', 'frame-count': 'frame_count',
|
|
14
|
+
};
|
|
15
|
+
const fields = [...Object.keys(textFields), ...Object.keys(numberFields)];
|
|
16
|
+
const options = {
|
|
17
|
+
json: { type: 'boolean' }, input: { type: 'string' }, model: { type: 'string', multiple: true },
|
|
18
|
+
'content-filter': { type: 'string' },
|
|
19
|
+
...Object.fromEntries(fields.map(name => [name, { type: 'string' }])),
|
|
20
|
+
};
|
|
21
|
+
const statuses = {
|
|
22
|
+
usage_only: 'Priced after generation', unknown: 'Price unavailable', needs_inputs: 'Missing inputs', unsupported: 'Unsupported request',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function printPriceHelp() {
|
|
26
|
+
console.log(`Makaron price — check media credits on demand
|
|
27
|
+
|
|
28
|
+
Usage:
|
|
29
|
+
makaron price list [--json]
|
|
30
|
+
makaron price <image|video|audio> --model <id> [--model <id>] [options]
|
|
31
|
+
makaron price --input <file|-> [--json]
|
|
32
|
+
|
|
33
|
+
--model <id> Repeat to compare up to six models with the same parameters
|
|
34
|
+
--duration <seconds> Requested output duration for video/audio
|
|
35
|
+
--resolution <tier> Output resolution (for example 720p or 2K)
|
|
36
|
+
--operation <mode> generate, edit or extend
|
|
37
|
+
--image-count <n> All input images, including the edit base (default 0)
|
|
38
|
+
--video-reference-count <n> --reference-video-seconds <seconds>
|
|
39
|
+
Count and total duration of video inputs
|
|
40
|
+
--reference-image-pixels <n> Total input pixels for usage-based video references
|
|
41
|
+
--audio-reference-count <n> --reference-audio-seconds <seconds>
|
|
42
|
+
Count and total duration of audio inputs
|
|
43
|
+
--fps <n> --content-filter <true|false>
|
|
44
|
+
--aspect <ratio> --background <mode> --quality <tier> --image-reasoning <level>
|
|
45
|
+
--output-format <format> --frame-count <n>
|
|
46
|
+
--input <file|-> JSON {"requests":[...]} for different parameters per quote
|
|
47
|
+
--json Machine-readable result with per-quote status
|
|
48
|
+
|
|
49
|
+
Examples:
|
|
50
|
+
makaron price video --model kling-4-flash --model seedance-2.5-native --duration 5 --resolution 720p
|
|
51
|
+
makaron price image --model seedream-5.5 --resolution 2K --operation edit --image-count 3
|
|
52
|
+
makaron price audio --model evolink-seed-audio --duration 20
|
|
53
|
+
|
|
54
|
+
Quotes are read-only and cover generation credits. Exit 2 if any requested quote is unavailable,
|
|
55
|
+
unsupported or missing inputs. Preflight estimates are labeled. API and usage errors exit 1.
|
|
56
|
+
`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function parsePriceRequest(args) {
|
|
60
|
+
const { positionals, values } = parseArgs({ args, options, allowPositionals: true });
|
|
61
|
+
const [kind] = positionals;
|
|
62
|
+
const quoteFlags = [...fields, 'content-filter', 'model'];
|
|
63
|
+
if (values.input != null) {
|
|
64
|
+
if (positionals.length || quoteFlags.some(flag => values[flag] !== undefined)) {
|
|
65
|
+
throw new Error('--input cannot be combined with quote flags or a media kind.');
|
|
66
|
+
}
|
|
67
|
+
let input;
|
|
68
|
+
try {
|
|
69
|
+
input = JSON.parse(readFileSync(values.input === '-' ? 0 : values.input, 'utf8'));
|
|
70
|
+
} catch {
|
|
71
|
+
throw new Error('Could not read pricing JSON. Pass a file path or - for stdin.');
|
|
72
|
+
}
|
|
73
|
+
if (!Array.isArray(input?.requests) || input.requests.length > 6) {
|
|
74
|
+
throw new Error('Pricing JSON must contain a requests array with at most six quotes.');
|
|
75
|
+
}
|
|
76
|
+
return { input, json: values.json };
|
|
77
|
+
}
|
|
78
|
+
if (positionals.length <= 1 && (!kind || kind === 'list') && quoteFlags.every(flag => values[flag] === undefined)) {
|
|
79
|
+
return { input: { requests: [] }, json: values.json };
|
|
80
|
+
}
|
|
81
|
+
if (positionals.length !== 1 || !quoteKinds.includes(kind) || !values.model?.length || values.model.length > 6 || values.model.some(model => !model.trim())) {
|
|
82
|
+
throw new Error('Choose image, video or audio and supply one to six --model IDs. See makaron price --help.');
|
|
83
|
+
}
|
|
84
|
+
const parameters = { kind, image_count: 0 };
|
|
85
|
+
for (const [flag, field] of Object.entries(textFields)) {
|
|
86
|
+
if (values[flag] !== undefined) parameters[field] = values[flag];
|
|
87
|
+
}
|
|
88
|
+
for (const [flag, field] of Object.entries(numberFields)) {
|
|
89
|
+
if (values[flag] === undefined) continue;
|
|
90
|
+
const raw = values[flag];
|
|
91
|
+
const number = Number(raw);
|
|
92
|
+
if (!raw.trim() || !Number.isFinite(number) || number < 0) throw new Error(`--${flag} requires a nonnegative number.`);
|
|
93
|
+
parameters[field] = number;
|
|
94
|
+
}
|
|
95
|
+
if (values['content-filter'] !== undefined) {
|
|
96
|
+
if (!['true', 'false'].includes(values['content-filter'])) throw new Error('--content-filter requires true or false.');
|
|
97
|
+
parameters.content_filter = values['content-filter'] === 'true';
|
|
98
|
+
}
|
|
99
|
+
return { input: { requests: values.model.map(model => ({ ...parameters, model })) }, json: values.json };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function printPrices(result) {
|
|
103
|
+
if (result.catalog) {
|
|
104
|
+
for (const [kind, models] of Object.entries(result.catalog)) {
|
|
105
|
+
console.log(`${kind}:`);
|
|
106
|
+
for (const model of models) {
|
|
107
|
+
const resolution = model.resolutions?.length ? ` (${model.resolutions.join(', ')})` : '';
|
|
108
|
+
const duration = model.maxSeconds ? ` · ${model.minSeconds ? `${model.minSeconds}–` : 'up to '}${model.maxSeconds}s` : '';
|
|
109
|
+
console.log(` ${model.model}${resolution}${duration}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
for (const row of result.estimates) {
|
|
115
|
+
const label = [row.request.model, row.resolution ?? row.request.resolution, row.request.duration_seconds ? `${row.request.duration_seconds}s` : null].filter(Boolean).join(' · ');
|
|
116
|
+
if (row.status === 'estimated' || row.status === 'preflight_only') {
|
|
117
|
+
console.log(`${label}: ${row.credits} credits${row.status === 'preflight_only' ? ' (preflight estimate; final charge may vary)' : ''}`);
|
|
118
|
+
if (row.details?.billableInputImages) console.log(` Includes ${row.details.billableInputImages} billable input image(s).`);
|
|
119
|
+
for (const item of row.billingBasis ?? []) {
|
|
120
|
+
if (item.billableReferenceVideoSeconds) console.log(` Includes ${item.billableReferenceVideoSeconds}s of billable reference video.`);
|
|
121
|
+
if (item.billableInputImages) console.log(` Includes ${item.billableInputImages} billable input image(s).`);
|
|
122
|
+
}
|
|
123
|
+
if (row.details?.settlement && row.status !== 'preflight_only') console.log(` ${row.details.settlement}`);
|
|
124
|
+
} else {
|
|
125
|
+
console.log(`${label}: ${statuses[row.status] ?? row.status}. ${row.reason ?? ''}${row.missing?.length ? ` (${row.missing.join(', ')})` : ''}`.trim());
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const ranked = result.comparison?.rows ?? [];
|
|
129
|
+
if (ranked.length > 1) {
|
|
130
|
+
console.log(`Lowest known estimate: ${result.comparison.lowestKnownCredits} credits among comparable requests.`);
|
|
131
|
+
if (ranked.length === 2) console.log(`Difference: ${Math.abs(ranked[0].credits - ranked[1].credits)} credits.`);
|
|
132
|
+
}
|
|
133
|
+
console.log(`Observed: ${result.observedAt}`);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export async function runPrice(args, getAuth) {
|
|
137
|
+
const { input, json } = parsePriceRequest(args);
|
|
138
|
+
const { headers, baseUrl } = getAuth();
|
|
139
|
+
const response = await fetch(`${baseUrl}/api/billing/model-prices`, {
|
|
140
|
+
method: 'POST', headers: { ...headers, 'Content-Type': 'application/json' },
|
|
141
|
+
body: JSON.stringify(input), signal: AbortSignal.timeout(30_000),
|
|
142
|
+
});
|
|
143
|
+
if (response.status === 401 || response.status === 403) throw new Error('Authentication failed. Check your Makaron login or API key.');
|
|
144
|
+
if (response.status === 404) throw new Error('This Makaron server does not support price quotes yet.');
|
|
145
|
+
const result = await response.json().catch(() => null);
|
|
146
|
+
if (!response.ok) {
|
|
147
|
+
const fields = Array.isArray(result?.invalidFields) ? ` (${result.invalidFields.join(', ')})` : '';
|
|
148
|
+
throw new Error(response.status === 400 ? `Invalid pricing request${fields}.` : `Pricing request failed (HTTP ${response.status}).`);
|
|
149
|
+
}
|
|
150
|
+
const rows = result?.estimates;
|
|
151
|
+
if (result?.currency !== 'credits' || (input.requests.length ? !Array.isArray(rows) || rows.length !== input.requests.length : !result.catalog)) {
|
|
152
|
+
throw new Error('Invalid Makaron price response.');
|
|
153
|
+
}
|
|
154
|
+
if (json) console.log(JSON.stringify(result));
|
|
155
|
+
else printPrices(result);
|
|
156
|
+
if (rows?.some(row => !['estimated', 'preflight_only'].includes(row.status))) process.exitCode = 2;
|
|
157
|
+
}
|
package/package.json
CHANGED
package/skills/makaron/SKILL.md
CHANGED
|
@@ -59,6 +59,20 @@ npx makaron-cli usage --run <runId> # per-tool breakdown
|
|
|
59
59
|
npx makaron-cli usage --limit 20 # recent usage rows (all sources)
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
|
|
63
|
+
## Check generation credits on demand
|
|
64
|
+
|
|
65
|
+
Use `makaron price` when the user asks about price, budget, or how models compare. For routine creation, go directly to the requested workflow. `price list` discovers model IDs and supported resolutions. The quote includes customer-facing credits and applicable billing factors. It does not start a run, upload media or read your balance.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
makaron price list --json
|
|
69
|
+
makaron price video --model kling-4-flash --model seedance-2.5-native --duration 5 --resolution 720p
|
|
70
|
+
makaron price image --model seedream-5.5 --operation edit --image-count 3 --resolution 2K --json
|
|
71
|
+
makaron price audio --model evolink-seed-audio --duration 20
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For video references, pass both `--video-reference-count` and the total `--reference-video-seconds`. Count an edit's base image in `--image-count`. Use `--input <file|-> --json` for up to six requests with different parameters. The JSON body is `{"requests":[{"kind":"video","model":"kling-4-flash","duration_seconds":5,"image_count":0,"resolution":"720p"}]}`. Exit `2` means at least one quote is unavailable, unsupported or missing inputs. A `preflight_only` amount is an estimate that may differ from the final charge.
|
|
75
|
+
|
|
62
76
|
## Core Workflow
|
|
63
77
|
|
|
64
78
|
```bash
|
|
@@ -334,7 +348,7 @@ npx makaron-cli edit --image photo.jpg --out result.jpg "make it dramatic"
|
|
|
334
348
|
npx makaron-cli edit --image-model gpt-image-2.6-flare --background transparent --out sticker.png "a magenta star sticker"
|
|
335
349
|
```
|
|
336
350
|
|
|
337
|
-
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`, `--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.
|
|
351
|
+
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.
|
|
338
352
|
|
|
339
353
|
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.
|
|
340
354
|
|
|
@@ -590,3 +604,5 @@ Both paths return a Makaron `projectUrl`. Open it to move/scale, reorder or dele
|
|
|
590
604
|
Use `--editable-text` only when the user explicitly requests native editable text fields. It makes recognized text editable using approximate fonts; edited wording can differ in typography, texture and styling. A request to split layers or change wording alone does not imply this option. Describe the default result as image layers, including lettering, rather than promising native editable text. The original image and PNG layers remain in the project/workspace.
|
|
591
605
|
|
|
592
606
|
`--project` reuses a project; otherwise the direct command creates a private project. `--max-outputs` is 2–100 including the background (default 8); quality is `auto|1K|1.5K|2K` (default `1K` for faster decomposition). One quality setting applies to the whole task; per-layer resolution controls are unavailable. Use an explicit higher tier or `auto` when preserving source resolution is required. The actual output count and pixel tiers determine one task charge. Failed or uncertain submissions are never replayed automatically; retain the printed job ID and query status. Repeated status reads preserve saved GUI edits and do not debit again. When the layers are ready, the edit link opens the resulting snapshot.
|
|
607
|
+
|
|
608
|
+
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.
|