ima2-gen 1.1.20 → 1.1.22
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 +42 -26
- package/bin/commands/capabilities.js +2 -2
- package/bin/commands/defaults.js +2 -2
- package/bin/commands/doctor.js +3 -3
- package/bin/commands/edit.js +1 -1
- package/bin/commands/gen.js +1 -1
- package/bin/commands/grok.js +16 -11
- package/bin/commands/multimode.js +1 -1
- package/bin/commands/observability.js +2 -2
- package/bin/commands/video.js +335 -13
- package/bin/ima2.js +23 -13
- package/bin/lib/error-hints.js +2 -2
- package/bin/lib/platform.js +34 -5
- package/docs/API.md +112 -3
- package/docs/CLI.md +61 -7
- package/docs/FAQ.ko.md +15 -20
- package/docs/FAQ.md +14 -19
- package/docs/NPX_QUICKSTART.md +40 -0
- package/docs/PROMPT_STUDIO.ko.md +1 -1
- package/docs/PROMPT_STUDIO.md +1 -1
- package/docs/README.ja.md +6 -16
- package/docs/README.ko.md +35 -14
- package/docs/README.zh-CN.md +7 -17
- package/docs/migration/runtime-test-inventory.md +8 -1
- package/lib/agentQueueWorker.js +6 -0
- package/lib/agentRuntime.js +20 -5
- package/lib/atomicWrite.js +14 -0
- package/lib/capabilities.js +1 -1
- package/lib/generationErrors.js +1 -1
- package/lib/grokProxyLauncher.js +31 -6
- package/lib/grokVideoAdapter.js +18 -89
- package/lib/grokVideoCanvas.js +25 -0
- package/lib/grokVideoDownload.js +58 -0
- package/lib/grokVideoPlannerPrompt.js +64 -0
- package/lib/historyList.js +7 -1
- package/lib/inflight.js +1 -1
- package/lib/oauthLauncher.js +26 -6
- package/lib/videoContinuity.js +149 -0
- package/lib/videoFrameExtract.js +80 -0
- package/node_modules/progrok/dist/index.js +187 -88
- package/node_modules/progrok/dist/index.js.map +1 -1
- package/node_modules/progrok/package.json +1 -1
- package/node_modules/progrok/skills/progrok/SKILL.md +33 -4
- package/package.json +6 -8
- package/routes/edit.js +2 -1
- package/routes/generate.js +4 -3
- package/routes/health.js +4 -3
- package/routes/index.js +4 -0
- package/routes/multimode.js +2 -1
- package/routes/quota.js +66 -0
- package/routes/video.js +80 -16
- package/routes/videoExtended.js +293 -0
- package/server.js +35 -4
- package/skills/ima2/SKILL.md +320 -7
- package/ui/dist/.vite/manifest.json +12 -12
- package/ui/dist/assets/{AgentWorkspace-DS8uvoLI.js → AgentWorkspace-COxQ5TjU.js} +2 -2
- package/ui/dist/assets/{CardNewsWorkspace-CYxMsE67.js → CardNewsWorkspace-B0OkcuVz.js} +1 -1
- package/ui/dist/assets/{NodeCanvas-DccIc347.js → NodeCanvas-BSsclEBh.js} +1 -1
- package/ui/dist/assets/{PromptBuilderPanel-BvxxwSJp.js → PromptBuilderPanel-DpC9A5Rz.js} +1 -1
- package/ui/dist/assets/{PromptImportDialog-u1_BFDRd.js → PromptImportDialog-CVwT0rLd.js} +2 -2
- package/ui/dist/assets/{PromptImportDiscoverySection-C5uvkVSz.js → PromptImportDiscoverySection-BDCkRCRs.js} +1 -1
- package/ui/dist/assets/{PromptImportFolderSection-D3E_O1SD.js → PromptImportFolderSection-QoKbZD83.js} +1 -1
- package/ui/dist/assets/{PromptLibraryPanel-4gyf9CB9.js → PromptLibraryPanel-BhFgeKnY.js} +2 -2
- package/ui/dist/assets/SettingsWorkspace-CfjrlH5R.js +1 -0
- package/ui/dist/assets/index-C-mur7pa.css +1 -0
- package/ui/dist/assets/index-CCP5nUOj.js +42 -0
- package/ui/dist/assets/{index-DoKtXbod.js → index-Cxhzi3bs.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/vendor/progrok-0.2.0.tgz +0 -0
- package/bin/commands/annotate.ts +0 -119
- package/bin/commands/cancel.ts +0 -48
- package/bin/commands/canvas-versions.ts +0 -80
- package/bin/commands/capabilities.ts +0 -110
- package/bin/commands/cardnews.ts +0 -249
- package/bin/commands/comfy.ts +0 -54
- package/bin/commands/config.ts +0 -186
- package/bin/commands/defaults.ts +0 -192
- package/bin/commands/doctor.ts +0 -202
- package/bin/commands/edit.ts +0 -150
- package/bin/commands/gen.ts +0 -214
- package/bin/commands/grok.ts +0 -85
- package/bin/commands/history.ts +0 -146
- package/bin/commands/ls.ts +0 -64
- package/bin/commands/metadata.ts +0 -39
- package/bin/commands/multimode.ts +0 -196
- package/bin/commands/node.ts +0 -166
- package/bin/commands/observability.ts +0 -176
- package/bin/commands/ping.ts +0 -31
- package/bin/commands/prompt-sub/build.ts +0 -101
- package/bin/commands/prompt.ts +0 -492
- package/bin/commands/ps.ts +0 -81
- package/bin/commands/session.ts +0 -266
- package/bin/commands/show.ts +0 -72
- package/bin/commands/skill.ts +0 -70
- package/bin/commands/video.ts +0 -205
- package/bin/ima2.ts +0 -430
- package/bin/lib/args.ts +0 -92
- package/bin/lib/browser-id.ts +0 -16
- package/bin/lib/client.ts +0 -122
- package/bin/lib/config-store.ts +0 -120
- package/bin/lib/destructive-confirm.ts +0 -19
- package/bin/lib/doctor-checks.ts +0 -91
- package/bin/lib/error-hints.ts +0 -23
- package/bin/lib/files.ts +0 -39
- package/bin/lib/output.ts +0 -73
- package/bin/lib/platform.ts +0 -99
- package/bin/lib/recover-output.ts +0 -139
- package/bin/lib/sse.ts +0 -73
- package/bin/lib/star-prompt.ts +0 -97
- package/bin/lib/storage-doctor.ts +0 -39
- package/bin/lib/ui-build.ts +0 -85
- package/config.ts +0 -354
- package/lib/agentCommandParser.ts +0 -69
- package/lib/agentGenerationPlanner.ts +0 -273
- package/lib/agentQuestionResponder.ts +0 -266
- package/lib/agentQueueStore.ts +0 -270
- package/lib/agentQueueWorker.ts +0 -89
- package/lib/agentRuntime.ts +0 -592
- package/lib/agentSettings.ts +0 -72
- package/lib/agentStore.ts +0 -422
- package/lib/agentStoreRows.ts +0 -136
- package/lib/agentTypes.ts +0 -154
- package/lib/apiCachePolicy.ts +0 -11
- package/lib/assetLifecycle.ts +0 -146
- package/lib/canvasVersionStore.ts +0 -223
- package/lib/capabilities.ts +0 -126
- package/lib/cardNewsGenerator.ts +0 -271
- package/lib/cardNewsJobStore.ts +0 -142
- package/lib/cardNewsManifestStore.ts +0 -154
- package/lib/cardNewsPlanner.ts +0 -236
- package/lib/cardNewsPlannerClient.ts +0 -155
- package/lib/cardNewsPlannerPrompt.ts +0 -62
- package/lib/cardNewsPlannerSchema.ts +0 -321
- package/lib/cardNewsRoleTemplateStore.ts +0 -47
- package/lib/cardNewsTemplateStore.ts +0 -252
- package/lib/codexDetect.ts +0 -71
- package/lib/comfyBridge.ts +0 -235
- package/lib/composerSnapshot.ts +0 -33
- package/lib/configKeys.ts +0 -62
- package/lib/db.ts +0 -295
- package/lib/errInfo.ts +0 -43
- package/lib/errorClassify.ts +0 -100
- package/lib/generationCancel.ts +0 -28
- package/lib/generationErrors.ts +0 -238
- package/lib/grokImageAdapter.ts +0 -513
- package/lib/grokMultimodeAdapter.ts +0 -84
- package/lib/grokProxyLauncher.ts +0 -129
- package/lib/grokRuntime.ts +0 -23
- package/lib/grokSizeMapper.ts +0 -71
- package/lib/grokVideoAdapter.ts +0 -519
- package/lib/historyIndex.ts +0 -51
- package/lib/historyList.ts +0 -177
- package/lib/imageMetadata.ts +0 -113
- package/lib/imageMetadataStore.ts +0 -67
- package/lib/imageModels.ts +0 -165
- package/lib/inflight.ts +0 -281
- package/lib/localImportStore.ts +0 -114
- package/lib/logger.ts +0 -161
- package/lib/nodeStore.ts +0 -91
- package/lib/oauthLauncher.ts +0 -78
- package/lib/oauthNormalize.ts +0 -30
- package/lib/oauthProxy/errors.ts +0 -128
- package/lib/oauthProxy/generators.ts +0 -494
- package/lib/oauthProxy/index.ts +0 -28
- package/lib/oauthProxy/prompts.ts +0 -123
- package/lib/oauthProxy/references.ts +0 -45
- package/lib/oauthProxy/runtime.ts +0 -115
- package/lib/oauthProxy/streams.ts +0 -232
- package/lib/oauthProxy/types.ts +0 -9
- package/lib/oauthProxy.ts +0 -3
- package/lib/openDirectory.ts +0 -47
- package/lib/pngInfo.ts +0 -26
- package/lib/promptBuilder/attachments.ts +0 -74
- package/lib/promptBuilder/client.ts +0 -130
- package/lib/promptBuilder/constants.ts +0 -9
- package/lib/promptBuilder/context.ts +0 -36
- package/lib/promptBuilder/errors.ts +0 -12
- package/lib/promptBuilder/requestSchema.ts +0 -56
- package/lib/promptBuilder/responseParser.ts +0 -219
- package/lib/promptBuilder/systemPrompt.ts +0 -135
- package/lib/promptBuilder/transport.ts +0 -94
- package/lib/promptBuilder/types.ts +0 -109
- package/lib/promptImport/curatedSources.ts +0 -141
- package/lib/promptImport/discoveryRegistry.ts +0 -329
- package/lib/promptImport/errors.ts +0 -18
- package/lib/promptImport/githubDiscovery.ts +0 -309
- package/lib/promptImport/githubFolder.ts +0 -397
- package/lib/promptImport/githubSource.ts +0 -257
- package/lib/promptImport/gptImageHints.ts +0 -70
- package/lib/promptImport/parsePromptCandidates.ts +0 -179
- package/lib/promptImport/promptIndex.ts +0 -326
- package/lib/promptImport/rankPromptCandidates.ts +0 -65
- package/lib/promptImport/types.ts +0 -103
- package/lib/promptSafetyPolicy.ts +0 -5
- package/lib/providerOptions.ts +0 -56
- package/lib/referenceImageCompress.ts +0 -84
- package/lib/refs.ts +0 -133
- package/lib/requestLogger.ts +0 -49
- package/lib/responsesDoctor.ts +0 -456
- package/lib/responsesErrors.ts +0 -83
- package/lib/responsesFallback.ts +0 -114
- package/lib/responsesImageAdapter.ts +0 -466
- package/lib/responsesParse.ts +0 -452
- package/lib/responsesTools.ts +0 -28
- package/lib/runtimeContext.ts +0 -146
- package/lib/runtimePorts.ts +0 -105
- package/lib/sessionStore.ts +0 -308
- package/lib/storageMigration.ts +0 -310
- package/lib/styleSheet.ts +0 -139
- package/lib/systemTrash.ts +0 -20
- package/lib/videoSeriesChain.ts +0 -29
- package/lib/visibleTextLanguagePolicy.ts +0 -7
- package/routes/agent.ts +0 -308
- package/routes/annotations.ts +0 -118
- package/routes/canvasVersions.ts +0 -69
- package/routes/capabilities.ts +0 -18
- package/routes/cardNews.ts +0 -211
- package/routes/comfy.ts +0 -43
- package/routes/edit.ts +0 -352
- package/routes/generate.ts +0 -492
- package/routes/grok.ts +0 -24
- package/routes/health.ts +0 -123
- package/routes/history.ts +0 -221
- package/routes/imageImport.ts +0 -37
- package/routes/index.ts +0 -48
- package/routes/metadata.ts +0 -77
- package/routes/multimode.ts +0 -499
- package/routes/nodes.ts +0 -578
- package/routes/promptBuilder.ts +0 -37
- package/routes/promptImport.ts +0 -379
- package/routes/prompts.ts +0 -428
- package/routes/sessions.ts +0 -317
- package/routes/storage.ts +0 -47
- package/routes/video.ts +0 -232
- package/server.ts +0 -290
- package/ui/dist/assets/SettingsWorkspace-F3eNu3mJ.js +0 -1
- package/ui/dist/assets/index-B6tcw_UF.css +0 -1
- package/ui/dist/assets/index-DYOh6gQD.js +0 -32
- package/vendor/progrok-0.1.1.tgz +0 -0
package/README.md
CHANGED
|
@@ -16,25 +16,20 @@
|
|
|
16
16
|
|
|
17
17
|
`ima2-gen` is a local image generation studio for people who want the ChatGPT/Codex image workflow in a small desktop-like web app.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Install globally, sign in with ChatGPT OAuth or Grok OAuth, and start generating images and videos. Iterate with history, references, node branches, multimode batches, Canvas Mode cleanup, and Grok Video generation. No API key required — free ChatGPT OAuth and SuperGrok subscription cover everything.
|
|
20
20
|
|
|
21
21
|

|
|
22
22
|
|
|
23
23
|
## Quick Start
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
npm install -g ima2-gen
|
|
27
|
+
ima2 setup
|
|
28
|
+
ima2 serve
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
Then open `http://localhost:3333`.
|
|
30
32
|
|
|
31
|
-
If Codex is not logged in yet:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npx @openai/codex login
|
|
35
|
-
npx ima2-gen serve
|
|
36
|
-
```
|
|
37
|
-
|
|
38
33
|
To generate a video from the CLI:
|
|
39
34
|
|
|
40
35
|
```bash
|
|
@@ -44,13 +39,29 @@ ima2 video "animate this scene" --ref photo.png --duration 10
|
|
|
44
39
|
|
|
45
40
|
If `3333` is already occupied, `ima2-gen` binds the next available port and writes the actual URL to `~/.ima2/server.json`. Use `ima2 open` or the URL printed in the terminal instead of assuming the port.
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
> **Using npx?** See [docs/NPX_QUICKSTART.md](docs/NPX_QUICKSTART.md) for the `npx ima2-gen serve` workflow.
|
|
48
43
|
|
|
44
|
+
### One-Click Install (no npm required)
|
|
45
|
+
|
|
46
|
+
Don't have Node.js or npm? Use the platform install script — it detects your environment, installs Node LTS if needed, then installs ima2-gen.
|
|
47
|
+
|
|
48
|
+
**macOS:**
|
|
49
49
|
```bash
|
|
50
|
-
|
|
51
|
-
ima2 serve
|
|
50
|
+
curl -fsSL https://lidge-jun.github.io/ima2-gen/install-mac.sh | bash
|
|
52
51
|
```
|
|
53
52
|
|
|
53
|
+
**Windows (PowerShell):**
|
|
54
|
+
```powershell
|
|
55
|
+
irm https://lidge-jun.github.io/ima2-gen/install-windows.ps1 | iex
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Linux / WSL:**
|
|
59
|
+
```bash
|
|
60
|
+
curl -fsSL https://lidge-jun.github.io/ima2-gen/install-linux.sh | bash
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Each script checks for nvm/fnm/brew/winget, installs Node LTS through the best available method, and handles stale process cleanup automatically.
|
|
64
|
+
|
|
54
65
|
### Setup
|
|
55
66
|
|
|
56
67
|
`ima2 setup` offers four authentication choices:
|
|
@@ -60,12 +71,17 @@ ima2 serve
|
|
|
60
71
|
3. **Both** — GPT OAuth + Grok OAuth (full feature access)
|
|
61
72
|
4. **API Key** — paste your OpenAI API key (paid)
|
|
62
73
|
|
|
63
|
-
Video generation requires Grok OAuth (option 2 or 3). Run `ima2 grok login` separately if you already have GPT OAuth configured and want to add video support.
|
|
74
|
+
Video generation requires Grok OAuth (option 2 or 3). Run `ima2 grok login` separately if you already have GPT OAuth configured and want to add video support; it defaults to the manual-paste flow.
|
|
75
|
+
|
|
76
|
+
### Updating
|
|
77
|
+
|
|
78
|
+
Stop the running server with Ctrl+C, then:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm install -g ima2-gen@latest
|
|
82
|
+
```
|
|
64
83
|
|
|
65
|
-
|
|
66
|
-
process. If npm reports `EBUSY` or `resource busy or locked`, close ima2
|
|
67
|
-
terminals, end stale `node.exe` processes if needed, and retry. If the lock
|
|
68
|
-
persists, reboot and run the update before starting ima2 again.
|
|
84
|
+
Ctrl+C now performs a clean shutdown — closing the database, stopping child processes, and releasing file locks. On older versions (< 1.1.22) or if you see `EBUSY` on Windows, use the install script which handles stale process cleanup automatically.
|
|
69
85
|
|
|
70
86
|
## What It Does
|
|
71
87
|
|
|
@@ -90,11 +106,11 @@ Image generation can run through the local Codex/ChatGPT OAuth path, a configure
|
|
|
90
106
|
- API-key generation supports classic generate, edit, mask-guided edit, multimode, and node generation.
|
|
91
107
|
- Grok generation supports Classic, Node, and Agent flows. If a Classic reference, Node parent image, or Agent current image is present, ima2 switches the final Grok call to xAI image edit so image-to-image context is preserved.
|
|
92
108
|
|
|
93
|
-
If no provider is specified, the app keeps the current OAuth/default behavior. API-key generation defaults to `gpt-5.4-mini`, `low` reasoning, and `1024x1024` unless the request passes validated model, reasoning, size, or web-search options. Grok defaults to `grok-imagine-image`; `quality: "high"` promotes the final image call to `grok-imagine-image-quality`.
|
|
109
|
+
If no provider is specified, the app keeps the current GPT OAuth/default behavior. API-key generation defaults to `gpt-5.4-mini`, `low` reasoning, and `1024x1024` unless the request passes validated model, reasoning, size, or web-search options. Grok defaults to `grok-imagine-image`; `quality: "high"` promotes the final image call to `grok-imagine-image-quality`.
|
|
94
110
|
|
|
95
|
-
Grok video generation uses `grok-imagine-video` (default) or `grok-imagine-video-1.5-preview`. Three modes are auto-detected from reference count: text-to-video (0 refs), image-to-video (1 ref), and reference-to-video (2–7 refs, max 10s duration). Video controls include duration (1–15s), resolution (480p, 720p), and aspect ratio (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, auto).
|
|
111
|
+
Grok video generation uses `grok-imagine-video` (default) or `grok-imagine-video-1.5-preview`. Three modes are auto-detected from reference count: text-to-video (0 refs), image-to-video (1 ref), and reference-to-video (2–7 refs, max 10s duration). `grok-imagine-video-1.5-preview` supports image-to-video but not `reference_images` Ref2V, so 2+ refs use `grok-imagine-video` as the effective model. Video edit and extension are also base-model only. Video controls include duration (1–15s), resolution (480p, 720p), and aspect ratio (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, auto).
|
|
96
112
|
|
|
97
|
-

|
|
113
|
+

|
|
98
114
|
|
|
99
115
|
## Model Guidance
|
|
100
116
|
|
|
@@ -225,7 +241,7 @@ environment variables > ~/.ima2/config.json > built-in defaults
|
|
|
225
241
|
| `IMA2_ADVERTISE_FILE` | `~/.ima2/server.json` | Runtime discovery file |
|
|
226
242
|
| `IMA2_GENERATED_DIR` | `~/.ima2/generated` | Generated image directory |
|
|
227
243
|
| `IMA2_IMAGE_MODEL_DEFAULT` | `gpt-5.4-mini` | Server fallback image model |
|
|
228
|
-
| `IMA2_REASONING_EFFORT` | `medium` | Default reasoning effort for the default (OAuth) path; one of `none`, `low`, `medium`, `high`, `xhigh` |
|
|
244
|
+
| `IMA2_REASONING_EFFORT` | `medium` | Default reasoning effort for the default (GPT OAuth) path; one of `none`, `low`, `medium`, `high`, `xhigh` |
|
|
229
245
|
| `IMA2_NO_OAUTH_PROXY` | — | Set `1` to disable the auto-started OAuth proxy |
|
|
230
246
|
| `IMA2_LOG_LEVEL` | `info` | Normal serve defaults to `info`; dev mode defaults to `debug`; supports `debug`, `info`, `warn`, `error`, or `silent` |
|
|
231
247
|
| `IMA2_INFLIGHT_TERMINAL_TTL_MS` | `300000` | Recent terminal job retention for debug views |
|
|
@@ -270,17 +286,17 @@ Useful references:
|
|
|
270
286
|
**`ima2 ping` says the server is unreachable**
|
|
271
287
|
Start `ima2 serve`, then check `~/.ima2/server.json`. You can also run `ima2 ping --server http://localhost:3333`.
|
|
272
288
|
|
|
273
|
-
**OAuth login does not work**
|
|
274
|
-
|
|
289
|
+
**GPT OAuth login does not work**
|
|
290
|
+
Re-run `ima2 setup` (option 1), confirm `ima2 status`, then restart `ima2 serve`.
|
|
275
291
|
|
|
276
292
|
**`fetch failed` repeats on a proxy/VPN network**
|
|
277
|
-
Check that the local OAuth proxy is reachable. On networks that require a proxy, enable your proxy client's TUN/TURN-style mode, then retry `
|
|
293
|
+
Check that the local OAuth proxy is reachable. On networks that require a proxy, enable your proxy client's TUN/TURN-style mode, then retry `openai-oauth --port 10531`. If it still fails, set `HTTP_PROXY` and `HTTPS_PROXY` in the same terminal that runs `ima2 serve` or `openai-oauth`. On Windows, also check for auto-start network interception tools, including DNS/fragmentation bypass tools such as SecretDNS, because they can break OAuth or streaming image responses even when the browser appears connected.
|
|
278
294
|
|
|
279
295
|
**Images fail with `API_KEY_REQUIRED`**
|
|
280
|
-
Set `OPENAI_API_KEY` or configure an API key before using `provider: "api"`. The default OAuth path still works without an API key.
|
|
296
|
+
Set `OPENAI_API_KEY` or configure an API key before using `provider: "api"`. The default GPT OAuth path still works without an API key.
|
|
281
297
|
|
|
282
298
|
**Image generation returns `EMPTY_RESPONSE` or no image data**
|
|
283
|
-
Run `ima2 doctor image-probe --json > ima2-image-probe.json` and attach the safe JSON when opening an issue. For OAuth cases, also capture `ima2 gen "고양이" --no-web-search --json` and `ima2 gen "고양이" --json` while `ima2 serve` is running. Do not share ChatGPT cookies, OAuth token files, API keys, raw upstream responses, prompt history, or generated base64. See the [FAQ support bundle](docs/FAQ.md#what-should-i-share-when-oauth-image-generation-returns-no-image).
|
|
299
|
+
Run `ima2 doctor image-probe --json > ima2-image-probe.json` and attach the safe JSON when opening an issue. For GPT OAuth cases, also capture `ima2 gen "고양이" --no-web-search --json` and `ima2 gen "고양이" --json` while `ima2 serve` is running. Do not share ChatGPT cookies, OAuth token files, API keys, raw upstream responses, prompt history, or generated base64. See the [FAQ support bundle](docs/FAQ.md#what-should-i-share-when-oauth-image-generation-returns-no-image).
|
|
284
300
|
|
|
285
301
|
**A large reference image fails**
|
|
286
302
|
The app compresses large JPEG/PNG references before upload. If a file still fails, convert it to JPEG or PNG at a lower resolution and try again. HEIC/HEIF files are not supported by the browser path.
|
|
@@ -58,8 +58,8 @@ function printText(capabilities) {
|
|
|
58
58
|
out(`server: ${capabilities.server || "none"}`);
|
|
59
59
|
out("");
|
|
60
60
|
out("defaults:");
|
|
61
|
-
out(` oauth model: ${capabilities.defaults?.oauth?.model}`);
|
|
62
|
-
out(` oauth reasoning: ${capabilities.defaults?.oauth?.reasoningEffort}`);
|
|
61
|
+
out(` gpt-oauth model: ${capabilities.defaults?.oauth?.model}`);
|
|
62
|
+
out(` gpt-oauth reasoning: ${capabilities.defaults?.oauth?.reasoningEffort}`);
|
|
63
63
|
out(` api model: ${capabilities.defaults?.api?.model}`);
|
|
64
64
|
out(` api reasoning: ${capabilities.defaults?.api?.reasoningEffort}`);
|
|
65
65
|
out(` grok model: ${capabilities.defaults?.grok?.model}`);
|
package/bin/commands/defaults.js
CHANGED
|
@@ -12,8 +12,8 @@ const HELP = `
|
|
|
12
12
|
|
|
13
13
|
Subcommands:
|
|
14
14
|
ls Show effective defaults
|
|
15
|
-
set model <model> Persist default model for OAuth and API paths
|
|
16
|
-
set reasoning <effort> Persist default reasoning effort for OAuth and API paths
|
|
15
|
+
set model <model> Persist default model for GPT OAuth and API paths
|
|
16
|
+
set reasoning <effort> Persist default reasoning effort for GPT OAuth and API paths
|
|
17
17
|
reset model Remove persisted model defaults
|
|
18
18
|
reset reasoning Remove persisted reasoning defaults
|
|
19
19
|
|
package/bin/commands/doctor.js
CHANGED
|
@@ -63,7 +63,7 @@ function showImageProbeHelp() {
|
|
|
63
63
|
--quality <quality> Default: low
|
|
64
64
|
--moderation <value> Default: low
|
|
65
65
|
--prompt <text> Override built-in cat prompt
|
|
66
|
-
--oauth-url <url> Override OAuth proxy URL
|
|
66
|
+
--oauth-url <url> Override GPT OAuth proxy URL
|
|
67
67
|
--timeout-ms <ms> Per-probe timeout
|
|
68
68
|
`);
|
|
69
69
|
}
|
|
@@ -155,7 +155,7 @@ async function standardDoctor() {
|
|
|
155
155
|
if (adv?.backend || adv?.port) {
|
|
156
156
|
console.log(` ℹ Backend actual URL: ${adv?.backend?.url || adv?.url || `http://localhost:${adv.port}`}`);
|
|
157
157
|
if (adv?.oauth)
|
|
158
|
-
console.log(` ℹ OAuth actual URL: ${adv.oauth.url} (${adv.oauth.status || "unknown"})`);
|
|
158
|
+
console.log(` ℹ GPT OAuth actual URL: ${adv.oauth.url} (${adv.oauth.status || "unknown"})`);
|
|
159
159
|
}
|
|
160
160
|
const hardeningLines = await buildHardeningDoctorLines({
|
|
161
161
|
root: ROOT,
|
|
@@ -182,7 +182,7 @@ async function standardDoctor() {
|
|
|
182
182
|
console.log(line);
|
|
183
183
|
const auth = detectCodexAuth();
|
|
184
184
|
if (auth.platform === "win32")
|
|
185
|
-
console.log(" ℹ Windows OAuth note: use WSL2 for Codex login.");
|
|
185
|
+
console.log(" ℹ Windows GPT OAuth note: use WSL2 for Codex login.");
|
|
186
186
|
console.log(`\n ${ok} passed, ${fail} failed\n`);
|
|
187
187
|
process.exit(fail > 0 ? 1 : 0);
|
|
188
188
|
}
|
package/bin/commands/edit.js
CHANGED
|
@@ -41,7 +41,7 @@ const HELP = `
|
|
|
41
41
|
-o, --out <file>
|
|
42
42
|
--json
|
|
43
43
|
--model <gpt-5.5|gpt-5.4|gpt-5.4-mini|grok-imagine-image|grok-imagine-image-quality>
|
|
44
|
-
--provider <auto|oauth|api|grok> Provider
|
|
44
|
+
--provider <auto|oauth|api|grok> Provider (oauth = GPT OAuth; grok = xAI Grok)
|
|
45
45
|
--mode <auto|direct> Prompt handling mode. Default: auto
|
|
46
46
|
--moderation <auto|low> Default: low
|
|
47
47
|
--session <id> Apply session style sheet if enabled
|
package/bin/commands/gen.js
CHANGED
|
@@ -52,7 +52,7 @@ const HELP = `
|
|
|
52
52
|
--timeout <sec> Default: 180
|
|
53
53
|
--server <url> Override server URL
|
|
54
54
|
--model <gpt-5.5|gpt-5.4|gpt-5.4-mini|grok-imagine-image|grok-imagine-image-quality>
|
|
55
|
-
--provider <auto|oauth|api|grok> Provider
|
|
55
|
+
--provider <auto|oauth|api|grok> Provider (oauth = GPT OAuth; grok = xAI Grok)
|
|
56
56
|
--mode <auto|direct> Prompt handling mode. Default: auto
|
|
57
57
|
--moderation <auto|low> Default: low
|
|
58
58
|
--session <id> Apply session style sheet if enabled
|
package/bin/commands/grok.js
CHANGED
|
@@ -20,8 +20,11 @@ const HELP = `
|
|
|
20
20
|
|
|
21
21
|
Notes:
|
|
22
22
|
ima2 serve auto-starts the bundled proxy on 127.0.0.1:18645 by default.
|
|
23
|
+
ima2 grok login defaults to --manual-paste for reliable copy/paste auth.
|
|
23
24
|
Use IMA2_NO_GROK_PROXY=1 to disable automatic proxy startup.
|
|
24
25
|
`;
|
|
26
|
+
const MANUAL_PASTE_FLAG = "--manual-paste";
|
|
27
|
+
const NON_MANUAL_LOGIN_FLOW_FLAGS = new Set(["--device-code", "--browser"]);
|
|
25
28
|
function localBinPath() {
|
|
26
29
|
return join(ROOT, "node_modules", ".bin");
|
|
27
30
|
}
|
|
@@ -39,6 +42,15 @@ function spawnProgrok(argv, env) {
|
|
|
39
42
|
child.on("close", resolve);
|
|
40
43
|
});
|
|
41
44
|
}
|
|
45
|
+
export function normalizeGrokLoginArgs(argv) {
|
|
46
|
+
const sub = argv[0];
|
|
47
|
+
if (sub !== "login")
|
|
48
|
+
return argv;
|
|
49
|
+
const normalized = argv.filter((arg) => !NON_MANUAL_LOGIN_FLOW_FLAGS.has(arg));
|
|
50
|
+
if (normalized.includes(MANUAL_PASTE_FLAG))
|
|
51
|
+
return normalized;
|
|
52
|
+
return [...normalized, MANUAL_PASTE_FLAG];
|
|
53
|
+
}
|
|
42
54
|
export default async function grokCmd(argv) {
|
|
43
55
|
const sub = argv[0];
|
|
44
56
|
if (!sub || sub === "--help" || sub === "-h") {
|
|
@@ -50,20 +62,13 @@ export default async function grokCmd(argv) {
|
|
|
50
62
|
PATH: `${localBinPath()}${delimiter}${process.env.PATH || ""}`,
|
|
51
63
|
};
|
|
52
64
|
try {
|
|
53
|
-
|
|
54
|
-
// Users can still pass --device-code or --browser explicitly.
|
|
55
|
-
if (sub === "login" && !argv.includes("--device-code") && !argv.includes("--browser") && !argv.includes("--manual-paste")) {
|
|
56
|
-
argv = [...argv, "--manual-paste"];
|
|
57
|
-
}
|
|
65
|
+
argv = normalizeGrokLoginArgs(argv);
|
|
58
66
|
const code = await spawnProgrok(argv, env);
|
|
59
67
|
if (code && code !== 0) {
|
|
60
|
-
|
|
61
|
-
// Do NOT auto-retry with --device-code — it issues a NEW code that
|
|
62
|
-
// invalidates the one the user may already be looking at in their browser.
|
|
63
|
-
if (sub === "login" && !argv.includes("--device-code")) {
|
|
68
|
+
if (sub === "login") {
|
|
64
69
|
out(color.yellow("⚠ ") + "Login failed. Try again with:\n");
|
|
65
|
-
out(" ima2 grok login
|
|
66
|
-
die(code, "bundled
|
|
70
|
+
out(" ima2 grok login\n");
|
|
71
|
+
die(code, "bundled Grok OAuth login failed");
|
|
67
72
|
}
|
|
68
73
|
else {
|
|
69
74
|
die(code, `bundled progrok exited with code ${code}`);
|
|
@@ -41,7 +41,7 @@ const HELP = `
|
|
|
41
41
|
-d, --out-dir <dir> Output dir for multiple images
|
|
42
42
|
--json
|
|
43
43
|
--model <gpt-5.5|gpt-5.4|gpt-5.4-mini>
|
|
44
|
-
--provider <auto|oauth|api|grok> Provider
|
|
44
|
+
--provider <auto|oauth|api|grok> Provider (oauth = GPT OAuth; grok = xAI Grok)
|
|
45
45
|
--mode <auto|direct> Prompt handling mode. Default: auto
|
|
46
46
|
--ref <file> Attach reference image (repeatable, max 5)
|
|
47
47
|
--reasoning-effort <none|low|medium|high|xhigh>
|
|
@@ -8,10 +8,10 @@ const HELP = `
|
|
|
8
8
|
storage status [--json] Storage inspection
|
|
9
9
|
storage open Open generated-dir in OS file manager
|
|
10
10
|
|
|
11
|
-
Billing / Providers / OAuth:
|
|
11
|
+
Billing / Providers / GPT OAuth:
|
|
12
12
|
billing [--json] API usage / quota
|
|
13
13
|
providers [--json] Configured providers
|
|
14
|
-
oauth status [--json] OAuth proxy state
|
|
14
|
+
oauth status [--json] GPT OAuth proxy state
|
|
15
15
|
|
|
16
16
|
Inflight jobs:
|
|
17
17
|
inflight ls [--kind classic|node|multimode] [--session <id>] [--terminal] [--json]
|