@todoforai/image-api 2.2.3 → 2.2.5
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 +7 -5
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -2129,8 +2129,8 @@ var require_commander = __commonJS((exports) => {
|
|
|
2129
2129
|
// package.json
|
|
2130
2130
|
var package_default = {
|
|
2131
2131
|
name: "@todoforai/image-api",
|
|
2132
|
-
version: "2.2.
|
|
2133
|
-
description: "AI image generation and editing through TODOforAI (gpt-image)",
|
|
2132
|
+
version: "2.2.5",
|
|
2133
|
+
description: "AI image generation and editing through TODOforAI (gpt-image, nano-banana, mai-image)",
|
|
2134
2134
|
type: "module",
|
|
2135
2135
|
bin: {
|
|
2136
2136
|
"tfa-imagegen": "dist/index.js"
|
|
@@ -2279,12 +2279,14 @@ async function runImageGen(content, opts) {
|
|
|
2279
2279
|
console.error(`Saved ${opts.output} (${buf.length} bytes)`);
|
|
2280
2280
|
if (result.revisedPrompt)
|
|
2281
2281
|
console.error(`Revised prompt: ${result.revisedPrompt}`);
|
|
2282
|
+
if (result.imageModel)
|
|
2283
|
+
console.error(`Image model: ${result.imageModel}`);
|
|
2282
2284
|
if (result.cost !== undefined)
|
|
2283
2285
|
console.error(`Cost: $${result.cost.toFixed(3)}`);
|
|
2284
2286
|
}
|
|
2285
2287
|
|
|
2286
2288
|
// src/commands/generate.ts
|
|
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; 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) => {
|
|
2289
|
+
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) => {
|
|
2288
2290
|
await runImageGen([{ type: "input_text", text: prompt }], opts);
|
|
2289
2291
|
});
|
|
2290
2292
|
|
|
@@ -2292,7 +2294,7 @@ var generateCommand = new Command2("generate").description("Generate an image vi
|
|
|
2292
2294
|
var editCommand = new Command2("edit").description(`Edit one or more images via TODOFORAI's image generation endpoint.
|
|
2293
2295
|
|
|
2294
2296
|
` + `Pass --image multiple times to provide reference / edit-target images.
|
|
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; 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) => {
|
|
2297
|
+
` + "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) => {
|
|
2296
2298
|
const imagePaths = opts.image ?? [];
|
|
2297
2299
|
if (imagePaths.length === 0) {
|
|
2298
2300
|
console.error("Error: at least one --image is required.");
|
|
@@ -2307,7 +2309,7 @@ var editCommand = new Command2("edit").description(`Edit one or more images via
|
|
|
2307
2309
|
|
|
2308
2310
|
// src/index.ts
|
|
2309
2311
|
program.name("tfa-imagegen").description(`Image generation & editing CLI via TODOFORAI backend.
|
|
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).").version(package_default.version);
|
|
2312
|
+
` + "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);
|
|
2311
2313
|
program.addCommand(generateCommand);
|
|
2312
2314
|
program.addCommand(editCommand);
|
|
2313
2315
|
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.5",
|
|
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"
|