ai-img 0.2.1 → 0.2.2

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.
@@ -27,7 +27,7 @@ const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
27
27
  name: 'batch',
28
28
  description: 'Batch generate images from a JSONL file',
29
29
  options: {
30
- 'input': { type: 'z.string.min', required: true, hasDefault: false, description: 'Input JSONL file path (one job per line)', short: 'i', min: 1, minLength: 1, fileType: 'file', schema: {"type":"zod","method":"min","args":[{"type":"unknown","raw":{"type":"NumericLiteral","start":729,"end":730,"loc":{"start":{"line":29,"column":33,"index":729},"end":{"line":29,"column":34,"index":730}},"extra":{"rawValue":1,"raw":"1"},"value":1}}]}, validator: '(val) => true' },
30
+ 'input': { type: 'z.string.min', required: true, hasDefault: false, description: 'Input JSONL file path (one job per line)', short: 'i', min: 1, minLength: 1, fileType: 'file', schema: {"type":"zod","method":"min","args":[{"type":"unknown","raw":{"type":"NumericLiteral","start":801,"end":802,"loc":{"start":{"line":32,"column":33,"index":801},"end":{"line":32,"column":34,"index":802}},"extra":{"rawValue":1,"raw":"1"},"value":1}}]}, validator: '(val) => true' },
31
31
  'outDir': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Output directory', short: 'o', fileType: 'directory', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
32
32
  'concurrency': { type: 'z.coerce.number.min.max.optional', required: false, hasDefault: false, description: 'Concurrent API calls', short: 'c', min: 1, max: 25, minLength: 1, maxLength: 25, schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
33
33
  'model': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Model ID to use (default varies by provider)', short: 'm', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
@@ -81,12 +81,13 @@ const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
81
81
  name: 'edit',
82
82
  description: 'Edit an existing image with AI',
83
83
  options: {
84
- 'prompt': { type: 'z.string.min', required: true, hasDefault: false, description: 'Text prompt for editing', short: 'p', min: 1, minLength: 1, schema: {"type":"zod","method":"min","args":[{"type":"unknown","raw":{"type":"NumericLiteral","start":712,"end":713,"loc":{"start":{"line":24,"column":34,"index":712},"end":{"line":24,"column":35,"index":713}},"extra":{"rawValue":1,"raw":"1"},"value":1}}]}, validator: '(val) => true' },
85
- 'input': { type: 'z.string.min', required: true, hasDefault: false, description: 'Input image path(s) - first image is primary', short: 'i', min: 1, minLength: 1, fileType: 'path', schema: {"type":"zod","method":"min","args":[{"type":"unknown","raw":{"type":"NumericLiteral","start":823,"end":824,"loc":{"start":{"line":28,"column":33,"index":823},"end":{"line":28,"column":34,"index":824}},"extra":{"rawValue":1,"raw":"1"},"value":1}}]}, validator: '(val) => true' },
84
+ 'prompt': { type: 'z.string.min', required: true, hasDefault: false, description: 'Text prompt for editing', short: 'p', min: 1, minLength: 1, schema: {"type":"zod","method":"min","args":[{"type":"unknown","raw":{"type":"NumericLiteral","start":760,"end":761,"loc":{"start":{"line":26,"column":34,"index":760},"end":{"line":26,"column":35,"index":761}},"extra":{"rawValue":1,"raw":"1"},"value":1}}]}, validator: '(val) => true' },
85
+ 'input': { type: 'z.string.min', required: true, hasDefault: false, description: 'Input image path(s) - first image is primary', short: 'i', min: 1, minLength: 1, fileType: 'path', schema: {"type":"zod","method":"min","args":[{"type":"unknown","raw":{"type":"NumericLiteral","start":871,"end":872,"loc":{"start":{"line":30,"column":33,"index":871},"end":{"line":30,"column":34,"index":872}},"extra":{"rawValue":1,"raw":"1"},"value":1}}]}, validator: '(val) => true' },
86
86
  'mask': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Mask image path (for partial edits)', short: 'm', fileType: 'path', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
87
87
  'model': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Model ID to use (default varies by provider)', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
88
88
  'provider': { type: 'z.string.optional', required: false, hasDefault: false, description: 'AI provider: openai, google, fal (auto-detected if omitted)', short: 'P', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
89
89
  'size': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Image size', short: 's', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
90
+ 'aspectRatio': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Aspect ratio (e.g., 16:9, 4:3, 1:1)', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
90
91
  'count': { type: 'z.coerce.number.min.max.optional', required: false, hasDefault: false, description: 'Number of images to generate', short: 'c', min: 1, max: 10, minLength: 1, maxLength: 10, schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
91
92
  'output': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Output file path', short: 'o', fileType: 'file', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
92
93
  'outDir': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Output directory', fileType: 'directory', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
@@ -98,7 +99,7 @@ const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
98
99
  name: 'generate',
99
100
  description: 'Generate new images from a text prompt',
100
101
  options: {
101
- 'prompt': { type: 'z.string.min', required: true, hasDefault: false, description: 'Text prompt for image generation', short: 'p', min: 1, minLength: 1, schema: {"type":"zod","method":"min","args":[{"type":"unknown","raw":{"type":"NumericLiteral","start":718,"end":719,"loc":{"start":{"line":24,"column":34,"index":718},"end":{"line":24,"column":35,"index":719}},"extra":{"rawValue":1,"raw":"1"},"value":1}}]}, validator: '(val) => true' },
102
+ 'prompt': { type: 'z.string.min', required: true, hasDefault: false, description: 'Text prompt for image generation', short: 'p', min: 1, minLength: 1, schema: {"type":"zod","method":"min","args":[{"type":"unknown","raw":{"type":"NumericLiteral","start":766,"end":767,"loc":{"start":{"line":26,"column":34,"index":766},"end":{"line":26,"column":35,"index":767}},"extra":{"rawValue":1,"raw":"1"},"value":1}}]}, validator: '(val) => true' },
102
103
  'model': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Model ID to use (default varies by provider)', short: 'm', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
103
104
  'provider': { type: 'z.string.optional', required: false, hasDefault: false, description: 'AI provider: openai, google, fal (auto-detected if omitted)', short: 'P', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
104
105
  'size': { type: 'z.string.optional', required: false, hasDefault: false, description: 'Image size (e.g., 1024x1024, 1536x1024)', short: 's', schema: {"type":"zod","method":"optional","args":[]}, validator: '(val) => true' },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "packageName": "ai-img",
3
- "targetVersion": "0.2.1",
4
- "tag": "v0.2.1",
3
+ "targetVersion": "0.2.2",
4
+ "tag": "v0.2.2",
5
5
  "options": {
6
6
  "publishNpm": true,
7
7
  "publishGitHub": true,
@@ -15,12 +15,7 @@
15
15
  "build-project",
16
16
  "create-git-tag"
17
17
  ],
18
- "createdAt": "2026-03-06T08:17:38.158Z",
19
- "updatedAt": "2026-03-06T08:21:06.876Z",
20
- "currentStep": "publish-npm",
21
- "lastError": {
22
- "step": "publish-npm",
23
- "message": "npm publish failed (exit code 1)",
24
- "at": "2026-03-06T08:19:51.285Z"
25
- }
18
+ "createdAt": "2026-03-07T19:33:42.759Z",
19
+ "updatedAt": "2026-03-07T19:33:53.002Z",
20
+ "currentStep": "publish-npm"
26
21
  }
package/README.md CHANGED
@@ -123,6 +123,12 @@ Runtime precedence is:
123
123
 
124
124
  `config init/set/unset` defaults to `--target user`. Use `--target project` to write local project config.
125
125
 
126
+ Image dimensions are model-aware:
127
+ - Set `aiImg.defaults.size` for size-based models.
128
+ - Set `aiImg.defaults.aspectRatio` for aspect-ratio-based models.
129
+ - If neither is configured, `ai-img` uses a blessed model preset when known, otherwise it leaves dimensions unset and uses the provider/model default.
130
+ - Existing `size` defaults are automatically converted for blessed Google image models when possible.
131
+
126
132
  For preview mode specifically, precedence is:
127
133
  1. `--image-mode` flag
128
134
  2. `aiImg.preview.mode` config
@@ -138,6 +144,7 @@ For preview mode specifically, precedence is:
138
144
  "provider": "openai",
139
145
  "model": "gpt-image-1.5",
140
146
  "size": "1024x1024",
147
+ "aspectRatio": "1:1",
141
148
  "output": "output.png",
142
149
  "outDir": "./output"
143
150
  },
@@ -166,6 +173,14 @@ For preview mode specifically, precedence is:
166
173
  }
167
174
  ```
168
175
 
176
+ Set either `size` or `aspectRatio` for a given workflow. If both exist in config, `ai-img` prefers the model-native option for the selected blessed model.
177
+
178
+ Batch JSONL jobs can also override dimensions per job with either field:
179
+
180
+ ```json
181
+ {"prompt":"Green terminal UI", "aspectRatio":"16:9"}
182
+ ```
183
+
169
184
  ### Terminal Preview Notes
170
185
 
171
186
  - Preview mode values: `off`, `auto`, `on`
@@ -24,6 +24,10 @@
24
24
  "type": "string",
25
25
  "pattern": "^\\d+x\\d+$"
26
26
  },
27
+ "aspectRatio": {
28
+ "type": "string",
29
+ "pattern": "^\\d+:\\d+$"
30
+ },
27
31
  "output": {
28
32
  "type": "string",
29
33
  "minLength": 1