climage 0.2.2 → 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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # climage
2
2
 
3
- Generate images from the terminal via multiple providers.
3
+ Generate images (and videos) from the terminal via multiple AI providers.
4
4
 
5
5
  ## Install / run
6
6
 
@@ -10,31 +10,85 @@ npx climage "make image of kitten"
10
10
 
11
11
  ## Providers
12
12
 
13
- ### xAI (grok-imagine-image)
13
+ ### Google (Nano Banana / Imagen / Veo)
14
+
15
+ **Default provider** with Gemini's native image generation (Nano Banana).
16
+
17
+ Also supports video generation via **Veo**.
14
18
 
15
19
  Set one of:
16
20
 
17
- - `XAI_API_KEY` (preferred)
18
- - `XAI_TOKEN`
19
- - `GROK_API_KEY`
21
+ - `GEMINI_API_KEY` (preferred)
22
+ - `GOOGLE_API_KEY`
23
+
24
+ **Models:**
25
+
26
+ | Model | Alias | Description |
27
+ | ------------------------------- | ----------------- | ------------------------------------------------------------------------------------- |
28
+ | `gemini-3-pro-image-preview` | `nano-banana-pro` | **Default.** State-of-the-art, professional asset production, up to 4K, thinking mode |
29
+ | `gemini-2.5-flash-image` | `nano-banana` | Fast & efficient, optimized for high-volume tasks |
30
+ | `imagen-4.0-generate-001` | - | Imagen 4 Standard |
31
+ | `imagen-4.0-ultra-generate-001` | - | Imagen 4 Ultra (best quality) |
32
+ | `imagen-4.0-fast-generate-001` | - | Imagen 4 Fast |
20
33
 
21
34
  Example:
22
35
 
23
36
  ```bash
24
- XAI_API_KEY=... npx climage "A cat in a tree" --provider xai
37
+ # Default (Nano Banana Pro)
38
+ GEMINI_API_KEY=... npx climage "A cat in a tree" --provider google
39
+
40
+ # Nano Banana (fast)
41
+ GEMINI_API_KEY=... npx climage "A cat in a tree" --model nano-banana
42
+
43
+ # Imagen 4
44
+ GEMINI_API_KEY=... npx climage "A cat in a tree" --model imagen-4.0-generate-001
45
+ ```
46
+
47
+ ### OpenAI (GPT Image / DALL-E)
48
+
49
+ Set:
50
+
51
+ - `OPENAI_API_KEY`
52
+
53
+ **Models:**
54
+
55
+ | Model | Description |
56
+ | ------------------ | --------------------------------------------------------------------- |
57
+ | `gpt-image-1.5` | **Default.** Latest and most advanced, superior instruction following |
58
+ | `gpt-image-1` | Previous generation, still excellent quality |
59
+ | `gpt-image-1-mini` | Cost-effective option |
60
+ | `dall-e-3` | DALL-E 3 (deprecated May 2026) |
61
+ | `dall-e-2` | DALL-E 2 (deprecated May 2026) |
62
+
63
+ Example:
64
+
65
+ ```bash
66
+ OPENAI_API_KEY=... npx climage "A cat in a tree" --provider openai
67
+
68
+ # Cost-effective
69
+ OPENAI_API_KEY=... npx climage "A cat in a tree" --provider openai --model gpt-image-1-mini
25
70
  ```
26
71
 
27
- ### Google (Imagen)
72
+ ### xAI (Grok Imagine)
73
+
74
+ Also supports video generation.
28
75
 
29
76
  Set one of:
30
77
 
31
- - `GEMINI_API_KEY` (preferred)
32
- - `GOOGLE_API_KEY`
78
+ - `XAI_API_KEY` (preferred)
79
+ - `XAI_TOKEN`
80
+ - `GROK_API_KEY`
81
+
82
+ **Models:**
83
+
84
+ | Model | Description |
85
+ | -------------------- | ------------------------------------ |
86
+ | `grok-imagine-image` | **Default.** Grok's image generation |
33
87
 
34
88
  Example:
35
89
 
36
90
  ```bash
37
- GEMINI_API_KEY=... npx climage "A cat in a tree" --provider google --model imagen-4.0-generate-001
91
+ XAI_API_KEY=... npx climage "A cat in a tree" --provider xai
38
92
  ```
39
93
 
40
94
  ### fal.ai
@@ -42,7 +96,15 @@ GEMINI_API_KEY=... npx climage "A cat in a tree" --provider google --model image
42
96
  Set one of:
43
97
 
44
98
  - `FAL_KEY` (preferred by fal docs)
45
- - `FAL_API_KEY` (also common)
99
+ - `FAL_API_KEY`
100
+
101
+ **Models:**
102
+
103
+ | Model | Description |
104
+ | --------------------- | -------------------------------------- |
105
+ | `fal-ai/flux/dev` | **Default.** Flux dev (fast & popular) |
106
+ | `fal-ai/flux/pro` | Flux pro (higher quality) |
107
+ | `fal-ai/flux-realism` | Photorealistic style |
46
108
 
47
109
  Example:
48
110
 
@@ -52,30 +114,117 @@ FAL_KEY=... npx climage "A cat in a tree" --provider fal
52
114
 
53
115
  ## Options
54
116
 
55
- - `--provider auto|xai|fal|google`
117
+ - `--provider auto|google|openai|xai|fal`
56
118
  - `--model <id>`
57
119
  - `--n <1..10>`
58
- - `--format png|jpg|webp`
59
- - `--out <path>` (only for single image)
120
+ - `--type image|video` (default: `image`)
121
+ - `--video` (shortcut for `--type video`)
122
+ - `--format png|jpg|webp|mp4|webm|gif`
123
+ - `--out <path>` (only when `n=1`)
60
124
  - `--outDir <dir>` (default: current directory)
61
125
  - `--name <text>` base name override
62
- - `--aspect-ratio <w:h>` (xAI supports e.g. `4:3`)
126
+ - `--aspect-ratio <w:h>` (e.g. `16:9`, `4:3`, `1:1`)
127
+
128
+ ### Aspect ratio support (by provider)
129
+
130
+ - **Google (Imagen/Veo):** `1:1`, `4:3`, `3:4`, `16:9`, `9:16`
131
+ - **OpenAI (gpt-image-_/dall-e-_):** limited set (depends on model). Custom ratios are **not** supported.
132
+ - **xAI:** accepts `aspect_ratio: "w:h"` (docs show `4:3`).
133
+ - **fal.ai:** provider/model-specific; common ratios are supported and arbitrary `w:h` is passed through for models that accept it.
63
134
  - `--json`
64
135
 
136
+ ### Input Images
137
+
138
+ - `--input <path>` Input image for editing or reference (can be used multiple times; provider-specific limits apply)
139
+ - `--start-frame <path>` First frame image for video generation
140
+ - `--end-frame <path>` Last frame image for video interpolation
141
+ - `--duration <seconds>` Video duration in seconds
142
+
143
+ ## Image Editing
144
+
145
+ Edit existing images by providing an input image:
146
+
147
+ ```bash
148
+ # Edit with xAI (exactly one input image supported)
149
+ npx climage "make the cat orange" --provider xai --input photo.jpg
150
+
151
+ # Edit with Google Gemini
152
+ npx climage "add a sunset background" --provider google --input photo.png
153
+
154
+ # Edit with OpenAI (supports optional mask as second input)
155
+ npx climage "replace the sky" --provider openai --input photo.png --input mask.png
156
+ ```
157
+
158
+ ## Image-to-Video
159
+
160
+ Generate videos from images:
161
+
162
+ ```bash
163
+ # Image-to-video with Google Veo
164
+ npx climage "the scene comes to life" --video --provider google --start-frame scene.png --duration 8
165
+
166
+ # Image-to-video with fal.ai
167
+ npx climage "dramatic camera zoom" --video --provider fal --start-frame photo.jpg
168
+
169
+ # Image-to-video with xAI
170
+ npx climage "animate this scene" --video --provider xai --start-frame cat.png
171
+ ```
172
+
173
+ ## Video Interpolation
174
+
175
+ Create smooth transitions between two images (supported by Google Veo 3.1 and fal.ai):
176
+
177
+ ```bash
178
+ # Interpolation with fal.ai Vidu
179
+ npx climage "morphing transition" --video --provider fal --start-frame before.png --end-frame after.png
180
+
181
+ # Interpolation with Google Veo 3.1
182
+ npx climage "smooth transition" --video --provider google --start-frame a.png --end-frame b.png
183
+ ```
184
+
185
+ ## Reference Images
186
+
187
+ Use multiple images as style/content references:
188
+
189
+ ```bash
190
+ # Reference-guided video with Google Veo 3.1 (up to 3 images)
191
+ npx climage "person walking in this style" --video --provider google --input style1.png --input style2.png
192
+
193
+ # Reference-guided video with fal.ai Vidu (up to 7 images)
194
+ npx climage "character in motion" --video --provider fal --input ref1.png --input ref2.png --input ref3.png
195
+ ```
196
+
197
+ ## Provider Capabilities
198
+
199
+ | Feature | Google | xAI | fal.ai | OpenAI |
200
+ | ------------------------ | ------ | ---- | ------ | ------ |
201
+ | Image Generation | Yes | Yes | Yes | Yes |
202
+ | Image Editing | Yes | Yes | Yes | Yes |
203
+ | Video Generation | Yes | Yes | Yes | No |
204
+ | Image-to-Video | Yes | Yes | Yes | No |
205
+ | Video Interpolation | Yes | No | Yes | No |
206
+ | Max Input Images | 3 | 1 | 7 | 2 |
207
+ | Video Duration (seconds) | 4-8 | 1-15 | 2-8 | N/A |
208
+
65
209
  ## Library API
66
210
 
67
211
  ```ts
68
212
  import { generateImage } from 'climage';
69
213
 
70
214
  const images = await generateImage('make image of kitten', {
71
- provider: 'xai',
215
+ provider: 'google',
216
+ model: 'nano-banana-pro',
72
217
  n: 2,
73
218
  });
74
219
 
75
220
  console.log(images.map((i) => i.filePath));
76
221
  ```
77
222
 
78
- ## Notes
223
+ ## Provider Selection
224
+
225
+ Auto-detection picks the first available provider in this order:
79
226
 
80
- - v0.1 ships xAI provider first.
81
- - `google` and `fal` providers are planned next.
227
+ 1. Google (if `GEMINI_API_KEY` is set)
228
+ 2. xAI (if `XAI_API_KEY` is set)
229
+ 3. fal.ai (if `FAL_KEY` is set)
230
+ 4. OpenAI (if `OPENAI_API_KEY` is set)