@mrgoonie/multix 0.0.2 → 0.0.5

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +136 -2
  3. package/dist/cli.js +3000 -580
  4. package/package.json +4 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.0.5] - 2026-05-05
9
+
10
+ ### Added
11
+ - `multix <provider> image-to-image` (alias `i2i`) for all five providers — BytePlus (Seedream multi-ref), Gemini (Nano Banana edit/compose), OpenRouter (chat-image with `image_url` parts), Leonardo (init image via existing imageId), MiniMax (subject_reference; CAVEAT: not free-form editing — preserves character identity in a new prompt).
12
+ - Promoted `src/core/image-input.ts` (URL / local-file resolver, base64 inlining with configurable size caps) so all providers share one resolver.
13
+
14
+ ## [0.0.4] - 2026-05-04
15
+
16
+ ### Added
17
+ - `--wait` / `--wait-timeout` / `--download` / `--output` / `--no-thumb` flags across all video commands (BytePlus, Gemini, Leonardo, MiniMax, OpenRouter) for unified poll-and-download UX.
18
+ - Auto-detection and download of video thumbnails (`cover_image_url`, `thumbnail_url`, `first_frame_url`, etc.) saved beside the video as `<base>_thumb.<ext>`.
19
+ - `multix leonardo status` now supports `--wait` / `--download`; `multix openrouter video-status` now polls properly instead of single GET.
20
+ - `.env.example` documenting all supported environment variables (provider keys, model overrides, CLI behavior).
21
+ - Core helper `src/core/video-thumb.ts` with `detectThumbUrl`, `downloadThumbBeside`, `maybeDownloadThumb`.
22
+
23
+ ## [0.0.3] - 2026-05-03
24
+
25
+ ### Added
26
+ - `multix gemini generate-speech` — Gemini 3.1 Flash TTS with single- and multi-speaker (max 2) modes, 30 prebuilt voices, WAV (default) or raw PCM output. Models: `gemini-3.1-flash-tts-preview` (default), `gemini-2.5-flash-preview-tts`, `gemini-2.5-pro-preview-tts`. Env: `GEMINI_TTS_MODEL` / `TTS_MODEL`.
27
+ - `multix byteplus` — BytePlus provider: Seedream 4.0 image generation (`generate`), Seedance 2.0 text-to-video (`video`), image-to-video (`image-to-video` / `i2v`), reference-to-video with up to 9 image + 3 video + 3 audio refs (`reference-to-video` / `r2v`), task polling (`status`). Env: `BYTEPLUS_API_KEY` (or `ARK_API_KEY`), plus model + base-url overrides.
28
+ - `multix check` now reports BytePlus key status alongside the other providers.
29
+
8
30
  ## [0.0.1] - 2026-05-02
9
31
 
10
32
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  AI multimodal CLI — generate images/video/speech/music, analyze and transcribe media files, convert documents to Markdown, and optimize media with ffmpeg/ImageMagick.
4
4
 
5
- Supports **Gemini** (analyze, transcribe, generate, Veo video), **MiniMax** (image, video, speech, music), and **OpenRouter** (image generation).
5
+ Supports **Gemini** (analyze, transcribe, generate, Veo video, Flash TTS), **MiniMax** (image, video, speech, music), **OpenRouter** (image generation), **Leonardo.Ai** (image, video, upscale), and **BytePlus** (Seedream image, Seedance video).
6
6
 
7
7
  ## Install
8
8
 
@@ -42,12 +42,23 @@ Set at least one provider key. Add to `.env` in your project root or `~/.multix/
42
42
  | `GEMINI_API_KEY` | For Gemini | [AI Studio](https://aistudio.google.com/apikey) |
43
43
  | `OPENROUTER_API_KEY` | For OpenRouter | [OpenRouter](https://openrouter.ai/settings/keys) |
44
44
  | `MINIMAX_API_KEY` | For MiniMax | [MiniMax](https://platform.minimax.io/user-center/basic-information/interface-key) |
45
+ | `LEONARDO_API_KEY` | For Leonardo | [Leonardo](https://app.leonardo.ai/settings/api-keys) |
46
+ | `LEONARDO_BASE_URL` | No | Override Leonardo API base (default `https://cloud.leonardo.ai/api/rest/v1`) |
47
+ | `LEONARDO_DEFAULT_MODEL` | No | Default Leonardo image model UUID |
48
+ | `LEONARDO_VIDEO_MODEL` | No | Default Leonardo video model (default `MOTION2`) |
49
+ | `BYTEPLUS_API_KEY` | For BytePlus | [BytePlus](https://console.byteplus.com/auth/api-keys) |
50
+ | `ARK_API_KEY` | No | Fallback for `BYTEPLUS_API_KEY` (Volcengine ARK shared name) |
51
+ | `BYTEPLUS_BASE_URL` | No | Override BytePlus base (default `https://ark.ap-southeast.bytepluses.com/api/v3`) |
52
+ | `BYTEPLUS_IMAGE_MODEL` | No | Default Seedream model (default `seedream-4-0-250828`) |
53
+ | `BYTEPLUS_VIDEO_MODEL` | No | Default Seedance model (default `seedance-2.0`) |
54
+ | `BYTEPLUS_VIDEO_PARAMS_MODE` | No | `flags` (default) or `structured` — how video params are encoded |
45
55
  | `MULTIX_OUTPUT_DIR` | No | Override default output dir (`./multix-output`) |
46
56
  | `OPENROUTER_IMAGE_MODEL` | No | Default OpenRouter model |
47
57
  | `OPENROUTER_FALLBACK_MODELS` | No | Comma-separated fallback model ids |
48
58
  | `IMAGE_GEN_MODEL` | No | Override Gemini image generation model |
49
59
  | `VIDEO_GEN_MODEL` | No | Override Gemini video generation model |
50
60
  | `MULTIMODAL_MODEL` | No | Override Gemini analysis model |
61
+ | `GEMINI_TTS_MODEL` / `TTS_MODEL` | No | Override Gemini TTS model (default `gemini-3.1-flash-tts-preview`) |
51
62
 
52
63
  Priority: `process.env` > `cwd/.env` > `~/.multix/.env`.
53
64
 
@@ -78,23 +89,43 @@ multix gemini extract --files report.pdf --prompt "Extract tables as JSON" [--fo
78
89
  # Generate images
79
90
  multix gemini generate --prompt "A mountain lake" [--model <id>] [--aspect-ratio 16:9] [--num-images 1] [--size 1K|2K|4K] [--output <path>] [-v]
80
91
 
92
+ # Image-to-image (Nano Banana — edit/compose from refs, alias: i2i)
93
+ multix gemini image-to-image --prompt "make it watercolor" --ref ./photo.jpg [--ref ./style.png] [--model gemini-2.5-flash-image] [--output <path>] [-v]
94
+
81
95
  # Generate video [EXPERIMENTAL — requires billing]
82
96
  multix gemini generate-video --prompt "Ocean waves" [--model veo-3.1-generate-preview] [--resolution 720p|1080p] [--aspect-ratio 16:9] [--reference-images first.png last.png] [-v]
97
+
98
+ # Image-to-video with Veo (alias: i2v) [EXPERIMENTAL]
99
+ multix gemini image-to-video <imagePath> --prompt "camera pans left" [--last-frame <path>] [--model veo-3.1-generate-preview] [--resolution 1080p] [--aspect-ratio 16:9] [--output <path>] [-v]
100
+
101
+ # Text-to-speech (Gemini 3.1 Flash TTS — single & multi-speaker)
102
+ multix gemini generate-speech (--text|--prompt) "Say cheerfully: Have a wonderful day!" [--model gemini-3.1-flash-tts-preview] [--voice Kore] [--output-format wav|pcm] [--output <path>] [-v]
103
+
104
+ # Multi-speaker (max 2): repeat --speaker name:voice; prompt should prefix lines with "<name>:"
105
+ multix gemini generate-speech --text "Joe: How's it going? Jane: Not too bad!" \
106
+ --speaker Joe:Kore --speaker Jane:Puck
83
107
  ```
84
108
 
85
109
  **Gemini models:**
86
110
  - Analysis: `gemini-2.5-flash` (default)
87
111
  - Image gen: `gemini-3.1-flash-image-preview` (Nano Banana 2, fastest), `gemini-3-pro-image-preview` (4K text), `imagen-4.0-generate-001` (production)
88
112
  - Video: `veo-3.1-generate-preview` (requires billing)
113
+ - TTS: `gemini-3.1-flash-tts-preview` (default), `gemini-2.5-flash-preview-tts`, `gemini-2.5-pro-preview-tts`
89
114
 
90
115
  **Aspect ratios:** `1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9`
91
116
 
117
+ **TTS voices (30 prebuilt):** Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede, Callirrhoe, Autonoe, Enceladus, Iapetus, Umbriel, Algieba, Despina, Erinome, Algenib, Rasalgethi, Laomedeia, Achernar, Alnilam, Schedar, Gacrux, Pulcherrima, Achird, Zubenelgenubi, Vindemiatrix, Sadachbia, Sadaltager, Sulafat. Audio is PCM s16le @ 24 kHz mono — saved as WAV (default) or raw PCM. Style is controlled via natural language in the prompt (`[whispers]`, `Say excitedly:`, etc.). No streaming; max 2 speakers; ~32k token context.
118
+
92
119
  ### `multix minimax`
93
120
 
94
121
  ```bash
95
122
  # Generate image
96
123
  multix minimax generate --prompt "A cat in space" [--model image-01] [--aspect-ratio 1:1] [--num-images 1] [-v]
97
124
 
125
+ # Image-to-image (alias: i2i) — CAVEAT: subject_reference only, NOT free-form editing
126
+ # Preserves a character/subject's identity in a NEW scene described by --prompt.
127
+ multix minimax image-to-image --prompt "the same character on a beach" --ref ./hero.jpg [--model image-01] [-v]
128
+
98
129
  # Generate video (async, polls until done)
99
130
  multix minimax generate-video --prompt "A dancer" [--model MiniMax-Hailuo-2.3] [--duration 6|10] [--resolution 720P|1080P] [--first-frame <url>] [-v]
100
131
 
@@ -111,9 +142,96 @@ multix minimax generate-music [--lyrics <str>] [--prompt <str>] [--model music-2
111
142
 
112
143
  ```bash
113
144
  multix openrouter generate --prompt "Retro robot" [--model google/gemini-3.1-flash-image-preview] [--aspect-ratio 1:1] [--image-size <sz>] [--num-images 1] [-v]
145
+
146
+ # Image-to-image (alias: i2i) — refs accept URL or local path
147
+ multix openrouter image-to-image --prompt "make it cyberpunk" --ref ./photo.jpg [--ref https://...] [--model google/gemini-2.5-flash-image] [--output <path>] [-v]
148
+
149
+ # Image-to-video (async — returns job id; image input is URL only)
150
+ multix openrouter image-to-video --prompt "camera pans left" --image-url https://... [--last-frame-url <url>] [--model google/veo-3.1] [--resolution 720p] [--aspect-ratio 16:9] [--duration <n>] [--seed <n>] [-v]
151
+ # alias: multix openrouter i2v --prompt "..." --image-url https://...
152
+
153
+ # Poll a video job (use --download to fetch when completed)
154
+ multix openrouter video-status <jobId> [--download] [--output <path>] [-v]
155
+
156
+ # List available video models
157
+ multix openrouter video-models
158
+ ```
159
+
160
+ Fallback models from `OPENROUTER_FALLBACK_MODELS` (CSV) are appended to the chat-image payload automatically. Override the default video model with `OPENROUTER_VIDEO_MODEL` (default `google/veo-3.1`).
161
+
162
+ ### `multix leonardo`
163
+
164
+ ```bash
165
+ # Account info / remaining credits
166
+ multix leonardo me
167
+
168
+ # List image platform models
169
+ multix leonardo models [--limit <n>]
170
+
171
+ # List video models (static enum)
172
+ multix leonardo video-models
173
+
174
+ # Generate images (polls until COMPLETE, downloads to MULTIX_OUTPUT_DIR)
175
+ multix leonardo generate "a cyberpunk cat" [-m <modelId>] [-w 1024] [-h 1024] [-n 1] [--alchemy] [--ultra] [--style <uuid>] [--seed <n>] [--negative <text>] [--enhance] [--quality HIGH] [--output <path>] [--no-download] [--wait-timeout 480000] [-v]
176
+
177
+ # Image-to-image (alias: i2i) — uses an existing Leonardo image id as init image
178
+ # Direct upload from local path is not yet supported; pass an existing imageId.
179
+ multix leonardo image-to-image --prompt "make it watercolor" --ref <imageId> [--image-type GENERATED|UPLOADED] [--init-strength 0.5] [-m <modelId>] [-w 1024] [-h 1024] [-n 1] [--seed <n>] [--negative <text>] [--output <path>] [--no-download] [-v]
180
+
181
+ # Generate text-to-video (async — returns generationId)
182
+ multix leonardo video "a dancer" [--model MOTION2|VEO3|kling-2.6|...] [--resolution RESOLUTION_720] [--enhance] [--frame-interpolation] [-v]
183
+
184
+ # Generate image-to-video (async — returns generationId)
185
+ multix leonardo image-to-video <imageId> --prompt "camera pans left" [--image-type GENERATED|UPLOADED] [--model MOTION2] [--resolution RESOLUTION_720] [--duration 6] [--seed <n>] [--negative <text>] [--enhance] [--frame-interpolation] [-v]
186
+ # alias: multix leonardo i2v <imageId> --prompt "..."
187
+
188
+ # Check a generation
189
+ multix leonardo status <generationId>
190
+
191
+ # Universal Upscaler (async)
192
+ multix leonardo upscale <generatedImageId> [--style GENERAL] [--strength 0.35] [--multiplier 1.5]
193
+ multix leonardo variation <variationId>
114
194
  ```
115
195
 
116
- Fallback models from `OPENROUTER_FALLBACK_MODELS` (CSV) are appended to the payload automatically.
196
+ GPT Image models (`gpt-image-*`) and v2 video models (kling/hailuo/ltxv/seedance) are dispatched to Leonardo's `/api/rest/v2` endpoint automatically.
197
+
198
+ ### `multix byteplus`
199
+
200
+ ```bash
201
+ # Image generation (Seedream 4.0, sync)
202
+ multix byteplus generate --prompt "a cyberpunk cat" [--model seedream-4-0-250828] [--size 2K|1024x1024] [--aspect-ratio 16:9] [-n 1] [--seed <n>] [--no-watermark] [--input-image <path|url>] [--output <path>] [-v]
203
+
204
+ # Image-to-image (alias: i2i) — Seedream with one or more reference images
205
+ multix byteplus image-to-image --prompt "make it cyberpunk" --ref ./photo.jpg [--ref https://...] [--model seedream-4-0-250828] [--size 2K] [--aspect-ratio 16:9] [-n 1] [--seed <n>] [--no-watermark] [--output <path>] [-v]
206
+
207
+ # Text-to-video (Seedance 2.0, async with auto-poll)
208
+ multix byteplus video --prompt "ocean waves" [--model seedance-2.0|seedance-2.0-fast|seedance-2.0-pro] [--resolution 1080p] [--duration 8] [--aspect-ratio 16:9] [--audio|--no-audio] [--seed <n>] [--negative <text>] [--camera-fixed] [--async] [--wait-timeout 600000] [--output <path>] [-v]
209
+
210
+ # Image-to-video (alias: i2v)
211
+ multix byteplus image-to-video <imagePath|url> --prompt "camera pans left" [--last-frame <path|url>] [--model ...] [video flags] [-v]
212
+ multix byteplus i2v ./photo.jpg --prompt "..."
213
+
214
+ # Reference-to-video (alias: r2v) — up to 9 images + 3 videos + 3 audio refs (total ≤12)
215
+ multix byteplus reference-to-video --prompt "..." \
216
+ --ref-image ./hero.jpg:subject \
217
+ --ref-image ./bg.jpg:environment \
218
+ --ref-video ./style.mp4:style \
219
+ --ref-audio ./music.mp3:audio \
220
+ [video flags] [-v]
221
+ # On Windows, escape literal colons in paths with `\:` or use URLs.
222
+
223
+ # Poll a task / download MP4
224
+ multix byteplus status <taskId> [--wait] [--wait-timeout 600000] [--download] [--output <path>] [-v]
225
+ ```
226
+
227
+ **BytePlus models:**
228
+ - Image: `seedream-4-0-250828`
229
+ - Video: `seedance-2.0-fast`, `seedance-2.0` (default), `seedance-2.0-pro`
230
+
231
+ **Notes:**
232
+ - Auth: `BYTEPLUS_API_KEY` is preferred; `ARK_API_KEY` is accepted as a fallback for compatibility with the Volcengine ARK SDK ecosystem.
233
+ - Video params can be encoded as flags inside the prompt text (default, e.g. `--rs 1080p --dur 8 --rt 16:9`) or as a top-level `parameters` object — set `BYTEPLUS_VIDEO_PARAMS_MODE=structured` to switch.
234
+ - **Task cancellation is not supported** — there is no verified DELETE endpoint on the ARK API. Submitted tasks must run to completion.
117
235
 
118
236
  ### `multix media`
119
237
 
@@ -148,6 +266,22 @@ Multiple inputs are concatenated with `---` separators into a single output.
148
266
 
149
267
  All generated files are saved to `./multix-output/` by default. Override with `MULTIX_OUTPUT_DIR`.
150
268
 
269
+ ### Polling and downloading videos
270
+
271
+ Every video-generating subcommand accepts a uniform set of polling/download flags:
272
+
273
+ | Flag | Description |
274
+ |------|-------------|
275
+ | `--wait` | Poll the provider until the job reaches a terminal status (skip with the provider's `--async` flag where present). |
276
+ | `--wait-timeout <ms>` | Polling timeout (default `600000` = 10 min). |
277
+ | `--download` | Stream the resulting MP4 to disk on success — implies `--wait`. |
278
+ | `--output <path>` | Copy the saved MP4 to a custom path. The thumbnail is copied beside it as `<base>_thumb.<ext>`. |
279
+ | `--no-thumb` | Skip thumbnail download. |
280
+
281
+ Thumbnail detection is automatic: if the provider response includes any of `cover_image_url`, `thumbnail_url`, `thumb_url`, `preview_url`, `first_frame_url`, `poster_url`, or `image_url` (and the value is an `https://…(.jpg|.png|.webp|.gif|.bmp)` URL), the file is downloaded next to the video as `<basename>_thumb.<ext>`. Providers that don't expose a thumbnail simply skip this step.
282
+
283
+ `leonardo video`, `leonardo image-to-video`, and `openrouter image-to-video` are async-by-default for backward compatibility — pass `--wait` (or `--download`) to opt into the synchronous flow.
284
+
151
285
  ## Troubleshooting
152
286
 
153
287
  **No API key found:** Run `multix check` — it prints setup instructions.