climage 0.2.2 → 0.3.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
25
45
  ```
26
46
 
27
- ### Google (Imagen)
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
70
+ ```
71
+
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,110 @@ 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`)
63
127
  - `--json`
64
128
 
129
+ ### Input Images
130
+
131
+ - `--input <path>` Input image for editing or reference (can be used multiple times)
132
+ - `--start-frame <path>` First frame image for video generation
133
+ - `--end-frame <path>` Last frame image for video interpolation
134
+ - `--duration <seconds>` Video duration in seconds
135
+
136
+ ## Image Editing
137
+
138
+ Edit existing images by providing an input image:
139
+
140
+ ```bash
141
+ # Edit with xAI
142
+ npx climage "make the cat orange" --provider xai --input photo.jpg
143
+
144
+ # Edit with Google Gemini
145
+ npx climage "add a sunset background" --provider google --input photo.png
146
+
147
+ # Edit with OpenAI (supports optional mask as second input)
148
+ npx climage "replace the sky" --provider openai --input photo.png --input mask.png
149
+ ```
150
+
151
+ ## Image-to-Video
152
+
153
+ Generate videos from images:
154
+
155
+ ```bash
156
+ # Image-to-video with Google Veo
157
+ npx climage "the scene comes to life" --video --provider google --start-frame scene.png --duration 8
158
+
159
+ # Image-to-video with fal.ai
160
+ npx climage "dramatic camera zoom" --video --provider fal --start-frame photo.jpg
161
+
162
+ # Image-to-video with xAI
163
+ npx climage "animate this scene" --video --provider xai --start-frame cat.png
164
+ ```
165
+
166
+ ## Video Interpolation
167
+
168
+ Create smooth transitions between two images (supported by Google Veo 3.1 and fal.ai):
169
+
170
+ ```bash
171
+ # Interpolation with fal.ai Vidu
172
+ npx climage "morphing transition" --video --provider fal --start-frame before.png --end-frame after.png
173
+
174
+ # Interpolation with Google Veo 3.1
175
+ npx climage "smooth transition" --video --provider google --start-frame a.png --end-frame b.png
176
+ ```
177
+
178
+ ## Reference Images
179
+
180
+ Use multiple images as style/content references:
181
+
182
+ ```bash
183
+ # Reference-guided video with Google Veo 3.1 (up to 3 images)
184
+ npx climage "person walking in this style" --video --provider google --input style1.png --input style2.png
185
+
186
+ # Reference-guided video with fal.ai Vidu (up to 7 images)
187
+ npx climage "character in motion" --video --provider fal --input ref1.png --input ref2.png --input ref3.png
188
+ ```
189
+
190
+ ## Provider Capabilities
191
+
192
+ | Feature | Google | xAI | fal.ai | OpenAI |
193
+ | ------------------------ | ------ | ---- | ------ | ------ |
194
+ | Image Generation | Yes | Yes | Yes | Yes |
195
+ | Image Editing | Yes | Yes | Yes | Yes |
196
+ | Video Generation | Yes | Yes | Yes | No |
197
+ | Image-to-Video | Yes | Yes | Yes | No |
198
+ | Video Interpolation | Yes | No | Yes | No |
199
+ | Max Input Images | 3 | 1 | 7 | 2 |
200
+ | Video Duration (seconds) | 4-8 | 1-15 | 2-8 | N/A |
201
+
65
202
  ## Library API
66
203
 
67
204
  ```ts
68
205
  import { generateImage } from 'climage';
69
206
 
70
207
  const images = await generateImage('make image of kitten', {
71
- provider: 'xai',
208
+ provider: 'google',
209
+ model: 'nano-banana-pro',
72
210
  n: 2,
73
211
  });
74
212
 
75
213
  console.log(images.map((i) => i.filePath));
76
214
  ```
77
215
 
78
- ## Notes
216
+ ## Provider Selection
217
+
218
+ Auto-detection picks the first available provider in this order:
79
219
 
80
- - v0.1 ships xAI provider first.
81
- - `google` and `fal` providers are planned next.
220
+ 1. Google (if `GEMINI_API_KEY` is set)
221
+ 2. xAI (if `XAI_API_KEY` is set)
222
+ 3. fal.ai (if `FAL_KEY` is set)
223
+ 4. OpenAI (if `OPENAI_API_KEY` is set)