@dorely13/ai-imagegen-cli 0.3.0 → 0.4.0
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/help.js +46 -20
- package/dist/index.js +805 -69
- package/dist/index.js.map +1 -1
- package/dist/usage-log.js +2 -1
- package/package.json +1 -1
- package/skill/SKILL.md +132 -22
package/dist/help.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
const PROFILE_HELP = `Named endpoint profiles:
|
|
2
|
-
imagegen providers add <name> --api <openrouter|openai-images>
|
|
3
|
-
[--model <id>] [--auth <bearer|none>]
|
|
2
|
+
imagegen providers add <name> --api <openrouter|openai-images|comfyui>
|
|
3
|
+
[--base-url <url>] [--model <id>] [--auth <bearer|none>]
|
|
4
|
+
[--start-command <text>] [--workflow <file>]
|
|
5
|
+
[--edit-workflow <file>]
|
|
4
6
|
imagegen providers show <name>
|
|
5
7
|
imagegen providers update <name> [--api <format>] [--base-url <url>]
|
|
6
8
|
[--model <id>] [--auth <bearer|none>]
|
|
9
|
+
[--start-command <text>] [--workflow <file>]
|
|
10
|
+
[--edit-workflow <file>]
|
|
7
11
|
imagegen providers remove <name>
|
|
8
12
|
imagegen auth <name> login [--key-stdin]
|
|
9
13
|
imagegen auth <name> status [--show-path]
|
|
@@ -11,8 +15,9 @@ const PROFILE_HELP = `Named endpoint profiles:
|
|
|
11
15
|
imagegen models --provider <name>
|
|
12
16
|
|
|
13
17
|
OpenRouter defaults to https://openrouter.ai/api/v1. openai-images requires
|
|
14
|
-
--base-url including the API prefix (e.g. https://api.openai.com/v1).
|
|
15
|
-
|
|
18
|
+
--base-url including the API prefix (e.g. https://api.openai.com/v1). comfyui
|
|
19
|
+
requires --base-url of its server (e.g. http://127.0.0.1:8188) and --model, and
|
|
20
|
+
uses no key. Keys use hidden terminal input or explicit --key-stdin and the existing vault/file
|
|
16
21
|
store. --auth none supports endpoints without keys. Config is saved in providers.json
|
|
17
22
|
alongside the credential file. Origin changes clear the saved key; removing a
|
|
18
23
|
profile removes its credentials. Logout preserves profile configuration.
|
|
@@ -21,13 +26,25 @@ Select named profiles with --provider. Model precedence: --model > profile defau
|
|
|
21
26
|
provide one if no default is saved. models explicitly discovers model metadata;
|
|
22
27
|
OpenAI-compatible model listings do not establish image capabilities.
|
|
23
28
|
|
|
24
|
-
Supported protocols: OpenRouter dedicated Images API
|
|
25
|
-
multipart endpoints,
|
|
29
|
+
Supported protocols: OpenRouter dedicated Images API, OpenAI Images JSON /
|
|
30
|
+
multipart endpoints, and local models through ComfyUI, not arbitrary HTTP
|
|
31
|
+
templates. Options vary by model.
|
|
26
32
|
OpenRouter accepts aspect ratios; openai-images needs pixels or presets:
|
|
27
33
|
square 1024x1024, portrait 1024x1536, landscape 1536x1024, wide 1536x864.
|
|
28
34
|
Auto options are omitted. Native masks require openai-images.
|
|
29
35
|
Outputs are measured and converted to PNG/JPEG/WebP without resizing. Count uses
|
|
30
36
|
separate single-image requests without automatic retries or model substitution.
|
|
37
|
+
|
|
38
|
+
comfyui profiles: --model names what the profile renders. Built in: flux3-klein
|
|
39
|
+
expands the prompt and reports the rendered caption as prompt; flux3-klein-raw
|
|
40
|
+
uses the prompt as the full caption; quality low, medium, and high run 4, 8, and
|
|
41
|
+
16 steps. Any other model needs --workflow (text-to-image) and/or --edit-workflow
|
|
42
|
+
(input images): ComfyUI API-format JSON using {{prompt}} and {{seed}}, optionally
|
|
43
|
+
{{width}} and {{height}}, and {{image1}}, {{image2}}, ... for inputs. Workflow
|
|
44
|
+
files set their own sampling, so only --quality auto applies.
|
|
45
|
+
Sizes accept pixels, presets, or aspect ratios, round to multiples of 16, and need
|
|
46
|
+
edges from 256 to 2048. Masks are rejected. The CLI does not start or stop ComfyUI;
|
|
47
|
+
--start-command records how to start it and is quoted when it is not reachable.
|
|
31
48
|
`;
|
|
32
49
|
const IMAGE_OPTIONS = `Image options (generate, edit):
|
|
33
50
|
--prompt <text> Prompt text (required)
|
|
@@ -55,34 +72,41 @@ Gemini provider:
|
|
|
55
72
|
Model precedence: --model > constructor imageModel > IMAGEGEN_GEMINI_IMAGE_MODEL
|
|
56
73
|
> gemini-nano-banana-2.1. Calls are independent; use prior output as --source.
|
|
57
74
|
|
|
58
|
-
|
|
59
|
-
gpt-image-2.
|
|
60
|
-
gpt-image-2.
|
|
61
|
-
gpt-image-2
|
|
75
|
+
Codex model requests (the backend chooses what actually runs):
|
|
76
|
+
gpt-image-2.6-flare Requested by default
|
|
77
|
+
gpt-image-2.6-sunburst Requested with --model
|
|
78
|
+
gpt-image-2.5-flare Requested with --model
|
|
79
|
+
gpt-image-2.5-sunburst Requested with --model
|
|
80
|
+
gpt-image-2 Requested with --model
|
|
62
81
|
|
|
63
|
-
|
|
82
|
+
Codex accepts any model ID, including made-up ones, and does not report what ran;
|
|
83
|
+
its Responses route rewrites these requests to gpt-image-2-codex. Use a named
|
|
84
|
+
profile such as OpenRouter when a specific model matters.
|
|
64
85
|
Model precedence: --model > constructor imageModel (library callers) >
|
|
65
|
-
IMAGEGEN_CODEX_IMAGE_MODEL > gpt-image-2.
|
|
66
|
-
|
|
67
|
-
|
|
86
|
+
IMAGEGEN_CODEX_IMAGE_MODEL > gpt-image-2.6-flare.
|
|
87
|
+
JSON results report requestedModel, and servedModel per image (null unless the
|
|
88
|
+
provider names one). Codex also reports served quality, size, and background, and
|
|
89
|
+
may override what was requested. A Codex --mask is sent as the last edit image with a fixed
|
|
90
|
+
instruction appended to the prompt; it steers the edit but does not guarantee
|
|
91
|
+
untouched pixels outside it. It must match the source size, and uses one of the
|
|
92
|
+
four edit-image slots.
|
|
68
93
|
IMAGEGEN_USAGE_LOG=<file> appends one prompt-free JSON usage line per result.
|
|
69
94
|
|
|
70
|
-
Codex quality: auto (default), low, medium, high; Flare/Sunburst also
|
|
71
|
-
xhigh and max. gpt-image-2 rejects xhigh/max.
|
|
95
|
+
Codex quality requests: auto (default), low, medium, high; Flare/Sunburst IDs also
|
|
96
|
+
accept xhigh and max. gpt-image-2 rejects xhigh/max. The backend may serve another.
|
|
72
97
|
`;
|
|
73
98
|
const GENERATE_EXAMPLES = `Examples:
|
|
74
99
|
imagegen generate --provider gemini --size 16:9 --prompt "a lighthouse at dawn" --out ./gemini.png
|
|
75
100
|
imagegen generate --prompt "a lighthouse at dawn" --out ./lighthouse.png
|
|
76
|
-
imagegen generate --model gpt-image-2 --prompt "a
|
|
77
|
-
imagegen generate --model gpt-image-2.5-sunburst --quality max --prompt "a product photo" --out ./product.png
|
|
101
|
+
imagegen generate --provider openrouter --model openai/gpt-image-2.6-sunburst --quality high --prompt "a product photo" --out ./product.png
|
|
78
102
|
`;
|
|
79
103
|
const EDIT_EXAMPLES = `Edit options:
|
|
80
104
|
--source <file> Source image (required)
|
|
81
|
-
--mask <file> Optional edit mask
|
|
105
|
+
--mask <file> Optional edit mask; transparent pixels mark the area to edit
|
|
82
106
|
|
|
83
107
|
Examples:
|
|
84
108
|
imagegen edit --format webp --source ./product.png --prompt "make the product blue" --out ./blue.webp
|
|
85
|
-
imagegen edit --model gpt-image-2.
|
|
109
|
+
imagegen edit --provider openrouter --model openai/gpt-image-2.6-sunburst --source ./product.png --prompt "add a ribbon" --out ./ribbon.png
|
|
86
110
|
`;
|
|
87
111
|
export const USAGE = `imagegen - provider-agnostic image generation CLI
|
|
88
112
|
|
|
@@ -100,6 +124,7 @@ Usage:
|
|
|
100
124
|
imagegen skill
|
|
101
125
|
imagegen skill install --target <claude|codex|skills-dir> [--target <...>] [--force]
|
|
102
126
|
imagegen help [command]
|
|
127
|
+
imagegen --version
|
|
103
128
|
|
|
104
129
|
${PROFILE_HELP}
|
|
105
130
|
${IMAGE_OPTIONS}
|
|
@@ -115,6 +140,7 @@ Auth options:
|
|
|
115
140
|
|
|
116
141
|
Global:
|
|
117
142
|
-h, --help Show help and exit 0
|
|
143
|
+
--version Print the CLI version and exit 0
|
|
118
144
|
`;
|
|
119
145
|
const COMMAND_HELP = {
|
|
120
146
|
auth: `imagegen auth - manage provider credentials (one namespace per provider)
|