@todoforai/image-api 2.2.2 → 2.2.4
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 +1 -1
- package/dist/index.js +23 -3
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -2126,6 +2126,26 @@ var require_commander = __commonJS((exports) => {
|
|
|
2126
2126
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
2127
2127
|
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
2128
2128
|
});
|
|
2129
|
+
// package.json
|
|
2130
|
+
var package_default = {
|
|
2131
|
+
name: "@todoforai/image-api",
|
|
2132
|
+
version: "2.2.4",
|
|
2133
|
+
description: "AI image generation and editing through TODOforAI (gpt-image, nano-banana, mai-image)",
|
|
2134
|
+
type: "module",
|
|
2135
|
+
bin: {
|
|
2136
|
+
"tfa-imagegen": "dist/index.js"
|
|
2137
|
+
},
|
|
2138
|
+
dependencies: {
|
|
2139
|
+
commander: "^14.0.3"
|
|
2140
|
+
},
|
|
2141
|
+
files: [
|
|
2142
|
+
"dist"
|
|
2143
|
+
],
|
|
2144
|
+
scripts: {
|
|
2145
|
+
build: "bun build src/index.ts --outdir dist --target node --format esm && sed -i '' -e '1s|#!/usr/bin/env bun|#!/usr/bin/env node|' dist/index.js 2>/dev/null || sed -i '1s|#!/usr/bin/env bun|#!/usr/bin/env node|' dist/index.js",
|
|
2146
|
+
prepublishOnly: "bun run build"
|
|
2147
|
+
}
|
|
2148
|
+
};
|
|
2129
2149
|
|
|
2130
2150
|
// ../node_modules/.bun/commander@14.0.3/node_modules/commander/esm.mjs
|
|
2131
2151
|
var import__ = __toESM(require_commander(), 1);
|
|
@@ -2264,7 +2284,7 @@ async function runImageGen(content, opts) {
|
|
|
2264
2284
|
}
|
|
2265
2285
|
|
|
2266
2286
|
// src/commands/generate.ts
|
|
2267
|
-
var generateCommand = new Command2("generate").description("Generate an image via TODOFORAI's image generation endpoint.").argument("<prompt>", "Image prompt").option("-o, --output <file>", "Output PNG file", "out.png").option("--model <model>", "nano-banana | gpt-image-2 | nano-banana-pro; also: nano-banana-lite", "nano-banana").option("--size <size>", "1024x1024 | 1536x1024 | 1024x1536 | 2048x2048 | 4096x4096", "1024x1024").option("--quality <quality>", "low | medium | high").option("--background <bg>", "auto | transparent | opaque").option("--output_format <fmt>", "png | webp | jpeg", "png").option("--instructions <text>", "System instructions").option("--api-url <url>", "TODOFORAI API URL (default: $TODOFORAI_API_URL or https://api.todofor.ai)").option("--api-key <key>", "TODOFORAI API key").action(async (prompt, opts) => {
|
|
2287
|
+
var generateCommand = new Command2("generate").description("Generate an image via TODOFORAI's image generation endpoint.").argument("<prompt>", "Image prompt").option("-o, --output <file>", "Output PNG file", "out.png").option("--model <model>", "nano-banana | gpt-image-2 | nano-banana-pro | mai-image-2.6 | mai-image-2.6-flash; also: nano-banana-lite, mai-image-2.5", "nano-banana").option("--size <size>", "1024x1024 | 1536x1024 | 1024x1536 | 2048x2048 | 4096x4096", "1024x1024").option("--quality <quality>", "low | medium | high").option("--background <bg>", "auto | transparent | opaque").option("--output_format <fmt>", "png | webp | jpeg", "png").option("--instructions <text>", "System instructions").option("--api-url <url>", "TODOFORAI API URL (default: $TODOFORAI_API_URL or https://api.todofor.ai)").option("--api-key <key>", "TODOFORAI API key").action(async (prompt, opts) => {
|
|
2268
2288
|
await runImageGen([{ type: "input_text", text: prompt }], opts);
|
|
2269
2289
|
});
|
|
2270
2290
|
|
|
@@ -2272,7 +2292,7 @@ var generateCommand = new Command2("generate").description("Generate an image vi
|
|
|
2272
2292
|
var editCommand = new Command2("edit").description(`Edit one or more images via TODOFORAI's image generation endpoint.
|
|
2273
2293
|
|
|
2274
2294
|
` + `Pass --image multiple times to provide reference / edit-target images.
|
|
2275
|
-
` + "Tip: state invariants in the prompt (e.g. 'change only X; keep Y unchanged').").argument("<prompt>", "Edit instruction").requiredOption("-i, --image <path>", "Input image; repeat for multiple images", (v, prev = []) => [...prev, v], []).option("-o, --output <file>", "Output PNG file", "edited.png").option("--model <model>", "nano-banana | gpt-image-2 | nano-banana-pro; also: nano-banana-lite", "nano-banana").option("--size <size>", "1024x1024 | 1536x1024 | 1024x1536 | 2048x2048 | 4096x4096", "1024x1024").option("--quality <quality>", "low | medium | high").option("--background <bg>", "auto | transparent | opaque").option("--output_format <fmt>", "png | webp | jpeg", "png").option("--instructions <text>", "System instructions").option("--api-url <url>", "TODOFORAI API URL").option("--api-key <key>", "TODOFORAI API key").action(async (prompt, opts) => {
|
|
2295
|
+
` + "Tip: state invariants in the prompt (e.g. 'change only X; keep Y unchanged').").argument("<prompt>", "Edit instruction").requiredOption("-i, --image <path>", "Input image; repeat for multiple images", (v, prev = []) => [...prev, v], []).option("-o, --output <file>", "Output PNG file", "edited.png").option("--model <model>", "nano-banana | gpt-image-2 | nano-banana-pro | mai-image-2.6 | mai-image-2.6-flash; also: nano-banana-lite, mai-image-2.5", "nano-banana").option("--size <size>", "1024x1024 | 1536x1024 | 1024x1536 | 2048x2048 | 4096x4096", "1024x1024").option("--quality <quality>", "low | medium | high").option("--background <bg>", "auto | transparent | opaque").option("--output_format <fmt>", "png | webp | jpeg", "png").option("--instructions <text>", "System instructions").option("--api-url <url>", "TODOFORAI API URL").option("--api-key <key>", "TODOFORAI API key").action(async (prompt, opts) => {
|
|
2276
2296
|
const imagePaths = opts.image ?? [];
|
|
2277
2297
|
if (imagePaths.length === 0) {
|
|
2278
2298
|
console.error("Error: at least one --image is required.");
|
|
@@ -2287,7 +2307,7 @@ var editCommand = new Command2("edit").description(`Edit one or more images via
|
|
|
2287
2307
|
|
|
2288
2308
|
// src/index.ts
|
|
2289
2309
|
program.name("tfa-imagegen").description(`Image generation & editing CLI via TODOFORAI backend.
|
|
2290
|
-
` + "Models (--model): nano-banana (default, $0.02, general), gpt-image-2 (best for infographics/text-heavy), nano-banana-pro ($0.15, complex composition). Also: nano-banana-lite ($0.04, fastest, 1K only).").version(
|
|
2310
|
+
` + "Models (--model): nano-banana (default, $0.02, general), gpt-image-2 (best for infographics/text-heavy), nano-banana-pro ($0.15, complex composition). Also: nano-banana-lite ($0.04, fastest, 1K only), mai-image-2.6 ($0.02, Microsoft MAI, fixed 1536\xB2, ~60s; -flash 1024\xB2, ~20s; no size/quality control).").version(package_default.version);
|
|
2291
2311
|
program.addCommand(generateCommand);
|
|
2292
2312
|
program.addCommand(editCommand);
|
|
2293
2313
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@todoforai/image-api",
|
|
3
|
-
"version": "2.2.
|
|
4
|
-
"description": "AI image generation and editing through TODOforAI (gpt-image)",
|
|
3
|
+
"version": "2.2.4",
|
|
4
|
+
"description": "AI image generation and editing through TODOforAI (gpt-image, nano-banana, mai-image)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"tfa-imagegen": "dist/index.js"
|