@dorely13/ai-imagegen-cli 0.2.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 CHANGED
@@ -1,9 +1,13 @@
1
1
  const PROFILE_HELP = `Named endpoint profiles:
2
- imagegen providers add <name> --api <openrouter|openai-images> [--base-url <url>]
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
- Keys use hidden terminal input or explicit --key-stdin and the existing vault/file
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 and OpenAI Images JSON /
25
- multipart endpoints, not arbitrary HTTP templates. Options vary by model.
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
- Auto options are omitted. Native masks require openai-images or Codex.
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,32 +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
- Supported Codex models (account availability is determined by the provider):
59
- gpt-image-2.5-flare Default; fast image generation and editing
60
- gpt-image-2.5-sunburst Higher-precision image generation and editing
61
- gpt-image-2 Previous model; retained for compatibility
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
- Use full model IDs; other provider-supported IDs may also be supplied.
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.5-flare.
66
- IMAGEGEN_CODEX_MODEL configures orchestration separately; --model selects images.
67
-
68
- Codex quality: auto (default), low, medium, high; Flare/Sunburst also support
69
- xhigh and max. gpt-image-2 rejects xhigh/max.
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.
93
+ IMAGEGEN_USAGE_LOG=<file> appends one prompt-free JSON usage line per result.
94
+
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.
70
97
  `;
71
98
  const GENERATE_EXAMPLES = `Examples:
72
99
  imagegen generate --provider gemini --size 16:9 --prompt "a lighthouse at dawn" --out ./gemini.png
73
100
  imagegen generate --prompt "a lighthouse at dawn" --out ./lighthouse.png
74
- imagegen generate --model gpt-image-2 --prompt "a lighthouse" --out ./classic.png
75
- 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
76
102
  `;
77
103
  const EDIT_EXAMPLES = `Edit options:
78
104
  --source <file> Source image (required)
79
- --mask <file> Optional edit mask (Codex or openai-images)
105
+ --mask <file> Optional edit mask; transparent pixels mark the area to edit
80
106
 
81
107
  Examples:
82
108
  imagegen edit --format webp --source ./product.png --prompt "make the product blue" --out ./blue.webp
83
- imagegen edit --model gpt-image-2.5-sunburst --quality max --source ./product.png --prompt "add a ribbon" --out ./ribbon.png
109
+ imagegen edit --provider openrouter --model openai/gpt-image-2.6-sunburst --source ./product.png --prompt "add a ribbon" --out ./ribbon.png
84
110
  `;
85
111
  export const USAGE = `imagegen - provider-agnostic image generation CLI
86
112
 
@@ -98,6 +124,7 @@ Usage:
98
124
  imagegen skill
99
125
  imagegen skill install --target <claude|codex|skills-dir> [--target <...>] [--force]
100
126
  imagegen help [command]
127
+ imagegen --version
101
128
 
102
129
  ${PROFILE_HELP}
103
130
  ${IMAGE_OPTIONS}
@@ -113,6 +140,7 @@ Auth options:
113
140
 
114
141
  Global:
115
142
  -h, --help Show help and exit 0
143
+ --version Print the CLI version and exit 0
116
144
  `;
117
145
  const COMMAND_HELP = {
118
146
  auth: `imagegen auth - manage provider credentials (one namespace per provider)