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.
Files changed (239) hide show
  1. package/README.md +42 -26
  2. package/bin/commands/capabilities.js +2 -2
  3. package/bin/commands/defaults.js +2 -2
  4. package/bin/commands/doctor.js +3 -3
  5. package/bin/commands/edit.js +1 -1
  6. package/bin/commands/gen.js +1 -1
  7. package/bin/commands/grok.js +16 -11
  8. package/bin/commands/multimode.js +1 -1
  9. package/bin/commands/observability.js +2 -2
  10. package/bin/commands/video.js +335 -13
  11. package/bin/ima2.js +23 -13
  12. package/bin/lib/error-hints.js +2 -2
  13. package/bin/lib/platform.js +34 -5
  14. package/docs/API.md +112 -3
  15. package/docs/CLI.md +61 -7
  16. package/docs/FAQ.ko.md +15 -20
  17. package/docs/FAQ.md +14 -19
  18. package/docs/NPX_QUICKSTART.md +40 -0
  19. package/docs/PROMPT_STUDIO.ko.md +1 -1
  20. package/docs/PROMPT_STUDIO.md +1 -1
  21. package/docs/README.ja.md +6 -16
  22. package/docs/README.ko.md +35 -14
  23. package/docs/README.zh-CN.md +7 -17
  24. package/docs/migration/runtime-test-inventory.md +8 -1
  25. package/lib/agentQueueWorker.js +6 -0
  26. package/lib/agentRuntime.js +20 -5
  27. package/lib/atomicWrite.js +14 -0
  28. package/lib/capabilities.js +1 -1
  29. package/lib/generationErrors.js +1 -1
  30. package/lib/grokProxyLauncher.js +31 -6
  31. package/lib/grokVideoAdapter.js +18 -89
  32. package/lib/grokVideoCanvas.js +25 -0
  33. package/lib/grokVideoDownload.js +58 -0
  34. package/lib/grokVideoPlannerPrompt.js +64 -0
  35. package/lib/historyList.js +7 -1
  36. package/lib/inflight.js +1 -1
  37. package/lib/oauthLauncher.js +26 -6
  38. package/lib/videoContinuity.js +149 -0
  39. package/lib/videoFrameExtract.js +80 -0
  40. package/node_modules/progrok/dist/index.js +187 -88
  41. package/node_modules/progrok/dist/index.js.map +1 -1
  42. package/node_modules/progrok/package.json +1 -1
  43. package/node_modules/progrok/skills/progrok/SKILL.md +33 -4
  44. package/package.json +6 -8
  45. package/routes/edit.js +2 -1
  46. package/routes/generate.js +4 -3
  47. package/routes/health.js +4 -3
  48. package/routes/index.js +4 -0
  49. package/routes/multimode.js +2 -1
  50. package/routes/quota.js +66 -0
  51. package/routes/video.js +80 -16
  52. package/routes/videoExtended.js +293 -0
  53. package/server.js +35 -4
  54. package/skills/ima2/SKILL.md +320 -7
  55. package/ui/dist/.vite/manifest.json +12 -12
  56. package/ui/dist/assets/{AgentWorkspace-DS8uvoLI.js → AgentWorkspace-COxQ5TjU.js} +2 -2
  57. package/ui/dist/assets/{CardNewsWorkspace-CYxMsE67.js → CardNewsWorkspace-B0OkcuVz.js} +1 -1
  58. package/ui/dist/assets/{NodeCanvas-DccIc347.js → NodeCanvas-BSsclEBh.js} +1 -1
  59. package/ui/dist/assets/{PromptBuilderPanel-BvxxwSJp.js → PromptBuilderPanel-DpC9A5Rz.js} +1 -1
  60. package/ui/dist/assets/{PromptImportDialog-u1_BFDRd.js → PromptImportDialog-CVwT0rLd.js} +2 -2
  61. package/ui/dist/assets/{PromptImportDiscoverySection-C5uvkVSz.js → PromptImportDiscoverySection-BDCkRCRs.js} +1 -1
  62. package/ui/dist/assets/{PromptImportFolderSection-D3E_O1SD.js → PromptImportFolderSection-QoKbZD83.js} +1 -1
  63. package/ui/dist/assets/{PromptLibraryPanel-4gyf9CB9.js → PromptLibraryPanel-BhFgeKnY.js} +2 -2
  64. package/ui/dist/assets/SettingsWorkspace-CfjrlH5R.js +1 -0
  65. package/ui/dist/assets/index-C-mur7pa.css +1 -0
  66. package/ui/dist/assets/index-CCP5nUOj.js +42 -0
  67. package/ui/dist/assets/{index-DoKtXbod.js → index-Cxhzi3bs.js} +1 -1
  68. package/ui/dist/index.html +2 -2
  69. package/vendor/progrok-0.2.0.tgz +0 -0
  70. package/bin/commands/annotate.ts +0 -119
  71. package/bin/commands/cancel.ts +0 -48
  72. package/bin/commands/canvas-versions.ts +0 -80
  73. package/bin/commands/capabilities.ts +0 -110
  74. package/bin/commands/cardnews.ts +0 -249
  75. package/bin/commands/comfy.ts +0 -54
  76. package/bin/commands/config.ts +0 -186
  77. package/bin/commands/defaults.ts +0 -192
  78. package/bin/commands/doctor.ts +0 -202
  79. package/bin/commands/edit.ts +0 -150
  80. package/bin/commands/gen.ts +0 -214
  81. package/bin/commands/grok.ts +0 -85
  82. package/bin/commands/history.ts +0 -146
  83. package/bin/commands/ls.ts +0 -64
  84. package/bin/commands/metadata.ts +0 -39
  85. package/bin/commands/multimode.ts +0 -196
  86. package/bin/commands/node.ts +0 -166
  87. package/bin/commands/observability.ts +0 -176
  88. package/bin/commands/ping.ts +0 -31
  89. package/bin/commands/prompt-sub/build.ts +0 -101
  90. package/bin/commands/prompt.ts +0 -492
  91. package/bin/commands/ps.ts +0 -81
  92. package/bin/commands/session.ts +0 -266
  93. package/bin/commands/show.ts +0 -72
  94. package/bin/commands/skill.ts +0 -70
  95. package/bin/commands/video.ts +0 -205
  96. package/bin/ima2.ts +0 -430
  97. package/bin/lib/args.ts +0 -92
  98. package/bin/lib/browser-id.ts +0 -16
  99. package/bin/lib/client.ts +0 -122
  100. package/bin/lib/config-store.ts +0 -120
  101. package/bin/lib/destructive-confirm.ts +0 -19
  102. package/bin/lib/doctor-checks.ts +0 -91
  103. package/bin/lib/error-hints.ts +0 -23
  104. package/bin/lib/files.ts +0 -39
  105. package/bin/lib/output.ts +0 -73
  106. package/bin/lib/platform.ts +0 -99
  107. package/bin/lib/recover-output.ts +0 -139
  108. package/bin/lib/sse.ts +0 -73
  109. package/bin/lib/star-prompt.ts +0 -97
  110. package/bin/lib/storage-doctor.ts +0 -39
  111. package/bin/lib/ui-build.ts +0 -85
  112. package/config.ts +0 -354
  113. package/lib/agentCommandParser.ts +0 -69
  114. package/lib/agentGenerationPlanner.ts +0 -273
  115. package/lib/agentQuestionResponder.ts +0 -266
  116. package/lib/agentQueueStore.ts +0 -270
  117. package/lib/agentQueueWorker.ts +0 -89
  118. package/lib/agentRuntime.ts +0 -592
  119. package/lib/agentSettings.ts +0 -72
  120. package/lib/agentStore.ts +0 -422
  121. package/lib/agentStoreRows.ts +0 -136
  122. package/lib/agentTypes.ts +0 -154
  123. package/lib/apiCachePolicy.ts +0 -11
  124. package/lib/assetLifecycle.ts +0 -146
  125. package/lib/canvasVersionStore.ts +0 -223
  126. package/lib/capabilities.ts +0 -126
  127. package/lib/cardNewsGenerator.ts +0 -271
  128. package/lib/cardNewsJobStore.ts +0 -142
  129. package/lib/cardNewsManifestStore.ts +0 -154
  130. package/lib/cardNewsPlanner.ts +0 -236
  131. package/lib/cardNewsPlannerClient.ts +0 -155
  132. package/lib/cardNewsPlannerPrompt.ts +0 -62
  133. package/lib/cardNewsPlannerSchema.ts +0 -321
  134. package/lib/cardNewsRoleTemplateStore.ts +0 -47
  135. package/lib/cardNewsTemplateStore.ts +0 -252
  136. package/lib/codexDetect.ts +0 -71
  137. package/lib/comfyBridge.ts +0 -235
  138. package/lib/composerSnapshot.ts +0 -33
  139. package/lib/configKeys.ts +0 -62
  140. package/lib/db.ts +0 -295
  141. package/lib/errInfo.ts +0 -43
  142. package/lib/errorClassify.ts +0 -100
  143. package/lib/generationCancel.ts +0 -28
  144. package/lib/generationErrors.ts +0 -238
  145. package/lib/grokImageAdapter.ts +0 -513
  146. package/lib/grokMultimodeAdapter.ts +0 -84
  147. package/lib/grokProxyLauncher.ts +0 -129
  148. package/lib/grokRuntime.ts +0 -23
  149. package/lib/grokSizeMapper.ts +0 -71
  150. package/lib/grokVideoAdapter.ts +0 -519
  151. package/lib/historyIndex.ts +0 -51
  152. package/lib/historyList.ts +0 -177
  153. package/lib/imageMetadata.ts +0 -113
  154. package/lib/imageMetadataStore.ts +0 -67
  155. package/lib/imageModels.ts +0 -165
  156. package/lib/inflight.ts +0 -281
  157. package/lib/localImportStore.ts +0 -114
  158. package/lib/logger.ts +0 -161
  159. package/lib/nodeStore.ts +0 -91
  160. package/lib/oauthLauncher.ts +0 -78
  161. package/lib/oauthNormalize.ts +0 -30
  162. package/lib/oauthProxy/errors.ts +0 -128
  163. package/lib/oauthProxy/generators.ts +0 -494
  164. package/lib/oauthProxy/index.ts +0 -28
  165. package/lib/oauthProxy/prompts.ts +0 -123
  166. package/lib/oauthProxy/references.ts +0 -45
  167. package/lib/oauthProxy/runtime.ts +0 -115
  168. package/lib/oauthProxy/streams.ts +0 -232
  169. package/lib/oauthProxy/types.ts +0 -9
  170. package/lib/oauthProxy.ts +0 -3
  171. package/lib/openDirectory.ts +0 -47
  172. package/lib/pngInfo.ts +0 -26
  173. package/lib/promptBuilder/attachments.ts +0 -74
  174. package/lib/promptBuilder/client.ts +0 -130
  175. package/lib/promptBuilder/constants.ts +0 -9
  176. package/lib/promptBuilder/context.ts +0 -36
  177. package/lib/promptBuilder/errors.ts +0 -12
  178. package/lib/promptBuilder/requestSchema.ts +0 -56
  179. package/lib/promptBuilder/responseParser.ts +0 -219
  180. package/lib/promptBuilder/systemPrompt.ts +0 -135
  181. package/lib/promptBuilder/transport.ts +0 -94
  182. package/lib/promptBuilder/types.ts +0 -109
  183. package/lib/promptImport/curatedSources.ts +0 -141
  184. package/lib/promptImport/discoveryRegistry.ts +0 -329
  185. package/lib/promptImport/errors.ts +0 -18
  186. package/lib/promptImport/githubDiscovery.ts +0 -309
  187. package/lib/promptImport/githubFolder.ts +0 -397
  188. package/lib/promptImport/githubSource.ts +0 -257
  189. package/lib/promptImport/gptImageHints.ts +0 -70
  190. package/lib/promptImport/parsePromptCandidates.ts +0 -179
  191. package/lib/promptImport/promptIndex.ts +0 -326
  192. package/lib/promptImport/rankPromptCandidates.ts +0 -65
  193. package/lib/promptImport/types.ts +0 -103
  194. package/lib/promptSafetyPolicy.ts +0 -5
  195. package/lib/providerOptions.ts +0 -56
  196. package/lib/referenceImageCompress.ts +0 -84
  197. package/lib/refs.ts +0 -133
  198. package/lib/requestLogger.ts +0 -49
  199. package/lib/responsesDoctor.ts +0 -456
  200. package/lib/responsesErrors.ts +0 -83
  201. package/lib/responsesFallback.ts +0 -114
  202. package/lib/responsesImageAdapter.ts +0 -466
  203. package/lib/responsesParse.ts +0 -452
  204. package/lib/responsesTools.ts +0 -28
  205. package/lib/runtimeContext.ts +0 -146
  206. package/lib/runtimePorts.ts +0 -105
  207. package/lib/sessionStore.ts +0 -308
  208. package/lib/storageMigration.ts +0 -310
  209. package/lib/styleSheet.ts +0 -139
  210. package/lib/systemTrash.ts +0 -20
  211. package/lib/videoSeriesChain.ts +0 -29
  212. package/lib/visibleTextLanguagePolicy.ts +0 -7
  213. package/routes/agent.ts +0 -308
  214. package/routes/annotations.ts +0 -118
  215. package/routes/canvasVersions.ts +0 -69
  216. package/routes/capabilities.ts +0 -18
  217. package/routes/cardNews.ts +0 -211
  218. package/routes/comfy.ts +0 -43
  219. package/routes/edit.ts +0 -352
  220. package/routes/generate.ts +0 -492
  221. package/routes/grok.ts +0 -24
  222. package/routes/health.ts +0 -123
  223. package/routes/history.ts +0 -221
  224. package/routes/imageImport.ts +0 -37
  225. package/routes/index.ts +0 -48
  226. package/routes/metadata.ts +0 -77
  227. package/routes/multimode.ts +0 -499
  228. package/routes/nodes.ts +0 -578
  229. package/routes/promptBuilder.ts +0 -37
  230. package/routes/promptImport.ts +0 -379
  231. package/routes/prompts.ts +0 -428
  232. package/routes/sessions.ts +0 -317
  233. package/routes/storage.ts +0 -47
  234. package/routes/video.ts +0 -232
  235. package/server.ts +0 -290
  236. package/ui/dist/assets/SettingsWorkspace-F3eNu3mJ.js +0 -1
  237. package/ui/dist/assets/index-B6tcw_UF.css +0 -1
  238. package/ui/dist/assets/index-DYOh6gQD.js +0 -32
  239. package/vendor/progrok-0.1.1.tgz +0 -0
package/docs/API.md CHANGED
@@ -234,6 +234,8 @@ Generate a video via the Grok video provider. Returns Server-Sent Events.
234
234
  "sourceImage": "<base64>",
235
235
  "referenceImages": ["<base64>", "<base64>"],
236
236
  "referenceFilenames": ["existing-file.png"],
237
+ "continueFromVideo": "1780226256355_50252101.mp4",
238
+ "continuityLineage": { "lineageId": "optional-client-hint", "entries": [] },
237
239
  "sessionId": "optional",
238
240
  "requestId": "optional-client-id"
239
241
  }
@@ -263,16 +265,67 @@ Generate a video via the Grok video provider. Returns Server-Sent Events.
263
265
  | `sourceFilename` | string | — | Existing generated file for image-to-video |
264
266
  | `referenceImages` | string[] | — | Base64 images for reference-to-video |
265
267
  | `referenceFilenames` | string[] | — | Existing generated files for reference-to-video |
268
+ | `continueFromVideo` | string | — | Generated `.mp4` parent; server extracts its last frame and rebuilds lineage from sidecar |
269
+ | `continuityLineage` | object | — | Optional client hint; used only when `continueFromVideo` is absent |
270
+
271
+ Blank prompts return `PROMPT_REQUIRED` with a `guidance` string. The active
272
+ prompt should describe visual flow, motion flow, sound/music/no-music,
273
+ dialogue/no-dialogue, ending frame, and duration pacing. The video planner uses
274
+ the selected duration as the full clip runtime and expands short requests into a
275
+ production-level sequence with opening composition, connected motion/emotion
276
+ change, and a stable ending frame suitable for continuation.
277
+
278
+ When `continueFromVideo` is present, the server treats the generated `.mp4`
279
+ sidecar as authoritative. Client `continuityLineage` cannot override it. The
280
+ saved child sidecar includes `videoContinuity`, a branch-local max-4 stack using
281
+ `keep-start-plus-latest-3` retention.
282
+
283
+ `videoContinuity` shape:
284
+
285
+ ```json
286
+ {
287
+ "lineageId": "lineage:parent",
288
+ "parentFilename": "parent.mp4",
289
+ "sourceFrame": "last",
290
+ "maxEntries": 4,
291
+ "retention": "keep-start-plus-latest-3",
292
+ "entries": [
293
+ {
294
+ "id": "clip:parent.mp4",
295
+ "ordinal": 1,
296
+ "role": "start",
297
+ "filename": "parent.mp4",
298
+ "userPrompt": "original user prompt",
299
+ "revisedPrompt": "planner prompt actually sent to Grok video",
300
+ "createdAt": 1780300000000
301
+ }
302
+ ]
303
+ }
304
+ ```
305
+
306
+ Entry `role` is `start`, `ancestor`, `parent`, or `current`. The first clip is
307
+ kept as the start anchor; later generations keep only the latest three entries.
308
+ `lineageId` uses the generated video basename without the `.mp4` extension.
309
+ This metadata is stored in the generated `.mp4.json` sidecar and returned in
310
+ history rows and video `done` events; `/generated/*.json` remains private.
311
+
312
+ Grok prompt surfaces used by video APIs:
313
+
314
+ | Surface | Model | Responsibility |
315
+ |---|---|---|
316
+ | Video planner | `grok-4.3` | Converts user prompt, search context, refs, and optional continuity lineage into the final English video prompt. It must structure core subject, action/motion, camera/composition, environment/style, dialogue/audio, ending-frame handoff, and constraints. |
317
+ | Video generation | xAI video model | Receives the planner prompt plus `sourceImage` or `referenceImages` when present. |
318
+ | Video analysis | `grok-4.3` | Reads first/last frame images from `/api/video/analyze` and returns recreation/continuation guidance. |
266
319
 
267
320
  **SSE events**:
268
321
 
269
322
  | Event | Data | Description |
270
323
  |---|---|---|
271
324
  | `planning` | `{ requestId }` | Preparing video generation |
272
- | `submitted` | `{ requestId, xaiVideoRequestId }` | Submitted to xAI |
325
+ | `submitted` | `{ requestId, xaiVideoRequestId, requestedModel, effectiveModel, modelFallback }` | Submitted to xAI |
273
326
  | `progress` | `{ requestId, progress, stalled }` | Progress 0.0–1.0 |
274
- | `done` | `{ requestId, filename, url, mediaType, revisedPrompt, elapsed, usage, video }` | Video ready |
275
- | `error` | `{ error, code, status, requestId }` | Generation failed |
327
+ | `done` | `{ requestId, filename, url, mediaType, revisedPrompt, elapsed, usage, requestedModel, effectiveModel, modelFallback, video, videoContinuity }` | Video ready |
328
+ | `error` | `{ error, code, status, requestId, guidance? }` | Generation failed |
276
329
 
277
330
  **Video error codes**:
278
331
 
@@ -286,6 +339,57 @@ Generate a video via the Grok video provider. Returns Server-Sent Events.
286
339
  | `INVALID_VIDEO_DURATION` | Duration not 1–15 integer |
287
340
  | `GROK_VIDEO_REF_TOO_MANY` | More than 7 reference images |
288
341
  | `GROK_VIDEO_FAILED` | Upstream xAI video generation failed |
342
+ | `GROK_VIDEO_FRAME_FAILED` | Server could not extract the parent video's last frame |
343
+
344
+ ### `POST /api/video/edit`
345
+
346
+ Edit an existing video via Grok V2V. This is a blocking JSON endpoint that starts the xAI edit job, polls it, downloads the final MP4, and saves it as a generated video artifact.
347
+
348
+ ```json
349
+ {
350
+ "prompt": "make it sunset",
351
+ "videoUrl": "https://vidgen.x.ai/.../clip.mp4",
352
+ "model": "grok-imagine-video"
353
+ }
354
+ ```
355
+
356
+ `videoUrl` may be an HTTPS video URL, xAI `file_id`, `data:video/*` URL, or generated `.mp4` filename. Generated-file inputs are restricted to real `.mp4` files under the generated directory.
357
+
358
+ ### `POST /api/video/extend`
359
+
360
+ Extend a video from its last frame. This is a blocking JSON endpoint that starts the xAI extension job, polls it, downloads the combined output MP4, and saves it as a generated video artifact.
361
+
362
+ ```json
363
+ {
364
+ "prompt": "camera pulls back",
365
+ "videoUrl": "1780226256355_50252101.mp4",
366
+ "duration": 6,
367
+ "model": "grok-imagine-video"
368
+ }
369
+ ```
370
+
371
+ `duration` must be an integer from 2 to 10 seconds. Edit and extension support `grok-imagine-video` only; `grok-imagine-video-1.5-preview` is not accepted for these endpoints.
372
+
373
+ ### `GET /api/video/frame`
374
+
375
+ Extract a PNG frame from a generated `.mp4` file.
376
+
377
+ | Query | Notes |
378
+ |---|---|
379
+ | `file` | Required generated `.mp4` filename or generated-dir absolute path |
380
+ | `position` | `last` (default) or non-negative seconds |
381
+
382
+ ### `POST /api/video/analyze`
383
+
384
+ Analyze first and last frames from a generated `.mp4` using Grok 4.3 image understanding. This does not upload the video as temporal video; it extracts two PNG frames and asks the vision model to infer likely motion.
385
+
386
+ ```json
387
+ {
388
+ "videoUrl": "1780226256355_50252101.mp4"
389
+ }
390
+ ```
391
+
392
+ Remote URLs and `data:` inputs are intentionally rejected to avoid server-side URL fetching through `ffmpeg`.
289
393
 
290
394
  ## History
291
395
 
@@ -368,6 +472,11 @@ Most server routes under `/api/*` have a CLI wrapper. The exception is **Agent M
368
472
  | `POST /api/edit` | `ima2 edit` |
369
473
  | `POST /api/generate/multimode` (SSE) | `ima2 multimode` |
370
474
  | `POST /api/video/generate` (SSE) | `ima2 video` |
475
+ | `POST /api/video/generate` with `continueFromVideo` | `ima2 video continue` |
476
+ | `POST /api/video/edit` | `ima2 video edit` |
477
+ | `POST /api/video/extend` | `ima2 video extend` |
478
+ | `GET /api/video/frame` | `ima2 video frame` |
479
+ | `POST /api/video/analyze` | `ima2 video analyze` |
371
480
  | `POST /api/node/generate` (SSE) / `GET /api/node/:id` | `ima2 node generate` / `ima2 node show` |
372
481
  | `GET /api/history` | `ima2 ls` |
373
482
  | `DELETE /api/history/:name` / `…/permanent` | `ima2 history rm [--permanent]` |
package/docs/CLI.md CHANGED
@@ -60,12 +60,13 @@ Provider override semantics:
60
60
  - `api` forces the API-key Responses path and requires a configured API key.
61
61
  - `oauth` forces the local OAuth proxy path.
62
62
  - `grok` uses the bundled progrok xAI proxy (`127.0.0.1:18645`). Classic generation first runs mandatory xAI Web Search through Responses API, then asks `grok-4.3` to call ima2's local `generate_image` tool, then ima2 executes xAI `/v1/images/generations`. If `--ref` images are attached, the final step uses xAI `/v1/images/edits` instead so image-to-image/reference context is preserved. Models: `grok-imagine-image`, `grok-imagine-image-quality`. Size is mapped to xAI `aspect_ratio` and `resolution`; the UI web-search toggle is OpenAI-provider-only because Grok search is always on in this path.
63
- - `auto` preserves route default behavior and currently resolves to OAuth unless server routing changes.
63
+ - `auto` preserves route default behavior and currently resolves to GPT OAuth unless server routing changes.
64
64
 
65
65
  `ima2 serve` starts the bundled Grok proxy automatically. No separate `progrok`
66
- install is required. Use `ima2 grok login` once to authorize xAI OAuth, or
67
- `ima2 grok login --device-code` on a remote shell. Set `IMA2_NO_GROK_PROXY=1`
68
- only if you want to manage the proxy yourself.
66
+ install is required. Use `ima2 grok login` once to authorize xAI OAuth. Login
67
+ defaults to `--manual-paste` so PowerShell, Terminal, and remote shells all use
68
+ the same copy/paste flow. Set `IMA2_NO_GROK_PROXY=1` only if you want to manage
69
+ the proxy yourself.
69
70
 
70
71
  Grok size mapping follows xAI's image API, not OpenAI's `size` field. ima2
71
72
  keeps the requested size in local metadata, but sends `aspect_ratio` such as
@@ -111,8 +112,13 @@ Multimode-specific flags include `--max-images <1..8>`, `--ref <file>` (repeatab
111
112
  | Command | Description |
112
113
  |---|---|
113
114
  | `ima2 video <prompt>` | Generate a video via Grok (SSE streaming with progress) |
115
+ | `ima2 video edit <prompt> --video <value>` | Edit an existing video (V2V); saves the result as a generated video artifact |
116
+ | `ima2 video extend <prompt> --video <value> [--duration 6]` | Extend an existing video from its last frame |
117
+ | `ima2 video continue <prompt> --video <generated-file>` | Generate a new clip from a generated video's last frame with branch-local `revisedPrompt` lineage |
118
+ | `ima2 video frame <generated-file> [--last] [-o frame.png]` | Extract a PNG frame from a generated `.mp4` |
119
+ | `ima2 video analyze <generated-file>` | Analyze first/last frames from a generated `.mp4` with Grok 4.3 vision |
114
120
 
115
- Video flags:
121
+ Video generate flags:
116
122
 
117
123
  | Flag | Meaning |
118
124
  |---|---|
@@ -126,6 +132,34 @@ Video flags:
126
132
  | `--timeout <sec>` | Timeout in seconds (default: 600) |
127
133
  | `--session <id>` | Session ID |
128
134
 
135
+ Blank video prompts are rejected. Prompts should include visual flow, camera or
136
+ subject motion, sound/no-music intent, dialogue/no-dialogue intent, ending
137
+ frame, and duration pacing. The selected seconds should feel naturally filled:
138
+ opening composition, connected motion/emotion change, then a stable ending
139
+ frame. Example: `from the last frame, she turns toward camera, rain grows
140
+ louder, no background music, says "기다려", use the full duration for the turn
141
+ and rain build, end on a still close-up after the line finishes`.
142
+
143
+ Video edit/extend flags:
144
+
145
+ | Flag | Meaning |
146
+ |---|---|
147
+ | `--video <value>` | Source video HTTPS URL, xAI `file_id`, data URL, or generated filename |
148
+ | `--duration <2..10>` | Extension duration only (default: 6) |
149
+ | `-o, --out <file>` | Download the edited or extended video to a file |
150
+ | `--json` | Print JSON result |
151
+ | `--timeout <sec>` | Timeout in seconds (default: 600) |
152
+
153
+ Video continue flags:
154
+
155
+ | Flag | Meaning |
156
+ |---|---|
157
+ | `--video <generated-file>` | Parent generated `.mp4`; server extracts its last frame |
158
+ | `--duration <1..15>` | New clip duration (default: 5) |
159
+ | `--resolution <480p\|720p>` | New clip resolution (default: 720p) |
160
+ | `--aspect-ratio <ratio\|auto>` | New clip aspect ratio |
161
+ | `--model <name>` | Optional video generation model |
162
+
129
163
  Video mode is auto-detected from `--ref` count:
130
164
 
131
165
  | Refs | Mode |
@@ -134,15 +168,35 @@ Video mode is auto-detected from `--ref` count:
134
168
  | 1 | image-to-video |
135
169
  | 2–7 | reference-to-video (max 10s duration) |
136
170
 
171
+ `grok-imagine-video-1.5-preview` supports image-to-video, but not `reference_images` reference-to-video. Prompt-only 1.5 text-to-video uses an internal white-canvas image-to-video anchor. For 2+ refs, use `grok-imagine-video`; if ima2 auto-retries from 1.5-preview to the base model, read `video.effectiveModel` and `video.modelFallback` from CLI `--json`, or `effectiveModel` and `modelFallback` from SSE. Video edit and extension are also base-model only.
172
+
137
173
  SSE events: `planning` → `submitted` → `progress` (0–100%) → `done` or `error`.
138
174
 
139
175
  ```bash
140
176
  ima2 video "a cat playing piano"
141
177
  ima2 video "animate this" --ref photo.png --duration 10
142
178
  ima2 video "cinematic" --resolution 720p --aspect-ratio 16:9 -o out.mp4
143
- ima2 video "style transfer" --ref a.png --ref b.png --ref c.png --model grok-imagine-video-1.5-preview
179
+ ima2 video "style transfer" --ref a.png --ref b.png --ref c.png --model grok-imagine-video
180
+ ima2 video edit "make the lighting warm sunset" --video 1780226256355_50252101.mp4 -o edited.mp4
181
+ ima2 video extend "camera slowly pulls back" --video 1780226256355_50252101.mp4 --duration 6
182
+ ima2 video continue "from the last frame, the actor crosses the room, footsteps only, no dialogue, end on the door closing" --video 1780226256355_50252101.mp4
183
+ ima2 video frame 1780226256355_50252101.mp4 --last -o lastframe.png
184
+ ima2 video analyze 1780226256355_50252101.mp4 --json
144
185
  ```
145
186
 
187
+ Edit/extend accept HTTPS URLs, xAI `file_id`, `data:video/*` URLs, or generated `.mp4` filenames. Generated-file inputs are limited to real `.mp4` files under the generated directory. `ima2 video continue`, `ima2 video analyze`, and `ima2 video frame` intentionally accept generated `.mp4` files only; remote analysis URLs are rejected so the server does not fetch arbitrary URLs through `ffmpeg`.
188
+
189
+ `ima2 video continue` differs from `ima2 video extend`: `extend` calls xAI's
190
+ native extension endpoint and returns a combined original+extension video.
191
+ `continue` calls ima2 generation with the parent video's server-extracted last
192
+ frame and persists a `videoContinuity` stack of up to four `revisedPrompt`
193
+ entries (`keep-start-plus-latest-3`) for future continuations.
194
+
195
+ JSON output note: `ima2 video --json` wraps the final result with local
196
+ download fields such as `ok`, `path`, and `filename`. `ima2 video continue
197
+ --json` prints the server SSE `done` payload directly, including `filename`,
198
+ `url`, `video`, `revisedPrompt`, and `videoContinuity`.
199
+
146
200
  ## Diagnostics
147
201
 
148
202
  `ima2 doctor image-probe` runs live Responses probes that help classify image
@@ -164,7 +218,7 @@ codes, event counts, tool-call summaries, byte counts, provider/model labels,
164
218
  and probe statuses. It does not include prompt text, auth tokens, URLs with
165
219
  credentials, raw upstream responses, or base64 image data.
166
220
 
167
- For OAuth no-image reports, a useful support bundle is:
221
+ For GPT OAuth no-image reports, a useful support bundle is:
168
222
 
169
223
  ```bash
170
224
  ima2 doctor
package/docs/FAQ.ko.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  마지막 확인: 2026-05-26
4
4
 
5
- 이 문서는 설치, 업데이트, OAuth, 갤러리, 레퍼런스 이미지 관련 질문을 모아둔 FAQ입니다. README는 짧게 유지하고, 자세한 설명은 이곳에 둡니다.
5
+ 이 문서는 설치, 업데이트, GPT OAuth, 갤러리, 레퍼런스 이미지 관련 질문을 모아둔 FAQ입니다. README는 짧게 유지하고, 자세한 설명은 이곳에 둡니다.
6
6
 
7
7
  English version: [FAQ.md](FAQ.md)
8
8
 
@@ -11,8 +11,8 @@ English version: [FAQ.md](FAQ.md)
11
11
  | 증상 | 먼저 해볼 것 |
12
12
  |---|---|
13
13
  | 서버에 연결되지 않음 | `ima2 serve`를 켠 뒤 `ima2 ping`을 실행합니다. |
14
- | OAuth 로그인이 안 됨 | `npx @openai/codex login`을 실행하고 `ima2 serve`를 다시 시작합니다. |
15
- | API key provider가 `API_KEY_REQUIRED`를 반환함 | API 키를 설정하거나 OAuth 공급자로 다시 전환합니다. |
14
+ | GPT OAuth 로그인이 안 됨 | `ima2 setup`을 다시 실행하고(옵션 1) `ima2 serve`를 다시 시작합니다. |
15
+ | API key provider가 `API_KEY_REQUIRED`를 반환함 | API 키를 설정하거나 GPT OAuth 공급자로 다시 전환합니다. |
16
16
  | 업데이트 후 예전 이미지가 안 보임 | `ima2 doctor`를 실행한 뒤 [예전 이미지 복구 안내](RECOVER_OLD_IMAGES.md)를 확인합니다. |
17
17
  | `gpt-5.5`만 실패함 | Codex CLI를 업데이트하고, 안정 대안으로 `gpt-5.4`를 사용합니다. |
18
18
  | 레퍼런스 업로드 실패 | JPEG/PNG로 변환하고 해상도를 낮춰 보세요. 레퍼런스는 최대 5장입니다. |
@@ -27,22 +27,17 @@ English version: [FAQ.md](FAQ.md)
27
27
 
28
28
  Node.js 20 이상을 권장합니다. 패키지 요구사항은 Node `>=20`입니다.
29
29
 
30
- ### `npx`와 전역 설치 중 무엇을 쓰면 되나요?
30
+ ### 어떻게 설치하나요?
31
31
 
32
- 가능합니다.
33
-
34
- ```bash
35
- npx ima2-gen serve
36
- ```
37
-
38
- 또는:
32
+ npm 전역 설치를 권장합니다.
39
33
 
40
34
  ```bash
41
35
  npm install -g ima2-gen
36
+ ima2 setup
42
37
  ima2 serve
43
38
  ```
44
39
 
45
- 예전 전역 설치가 이상하게 동작하면 먼저 최신 버전으로 올려 주세요.
40
+ 예전 설치가 이상하게 동작하면 먼저 최신 버전으로 올려 주세요.
46
41
 
47
42
  ```bash
48
43
  npm install -g ima2-gen@latest
@@ -82,10 +77,10 @@ API 키를 설정하면 이미지 생성 엔드포인트도 `provider: "api"`로
82
77
 
83
78
  ### Codex CLI에 이미 로그인되어 있으면 자동으로 잡히나요?
84
79
 
85
- 네. `ima2-gen`은 기존 Codex 로그인 상태를 확인하고 로컬 OAuth 경로를 사용합니다. 감지에 실패하거나 토큰이 만료되면 다음을 실행하세요.
80
+ 네. `ima2-gen`은 기존 Codex 로그인 상태를 확인하고 로컬 GPT OAuth 경로를 사용합니다. 감지에 실패하거나 토큰이 만료되면 다음을 실행하세요.
86
81
 
87
82
  ```bash
88
- npx @openai/codex login
83
+ ima2 setup # 옵션 1 (GPT OAuth) 다시 실행
89
84
  ima2 doctor
90
85
  ```
91
86
 
@@ -96,7 +91,7 @@ ima2 doctor
96
91
  Codex/ChatGPT OAuth 세션을 다시 로그인해야 합니다.
97
92
 
98
93
  ```bash
99
- npx @openai/codex login
94
+ ima2 setup # 옵션 1 (GPT OAuth) 다시 실행
100
95
  ima2 serve
101
96
  ```
102
97
 
@@ -118,7 +113,7 @@ ima2 serve
118
113
 
119
114
  ### Plus/Pro는 몇 장까지 생성할 수 있나요?
120
115
 
121
- 커뮤니티에서 말하는 숫자를 보장으로 받아들이면 안 됩니다. OAuth 생성은 계정, 백엔드 capability, 트래픽, 정책 변경의 영향을 받을 수 있습니다. `ima2-gen` 문서에서는 고정된 Plus/Pro 생성 횟수를 약속하지 않습니다.
116
+ 커뮤니티에서 말하는 숫자를 보장으로 받아들이면 안 됩니다. GPT OAuth 생성은 계정, 백엔드 capability, 트래픽, 정책 변경의 영향을 받을 수 있습니다. `ima2-gen` 문서에서는 고정된 Plus/Pro 생성 횟수를 약속하지 않습니다.
122
117
 
123
118
  ## Prompt Studio와 멀티모드
124
119
 
@@ -258,7 +253,7 @@ ima2 ping
258
253
 
259
254
  필요하면 `ima2 serve`를 다시 시작합니다.
260
255
 
261
- ### OAuth 이미지 생성이 이미지 없이 끝나면 무엇을 공유해야 하나요?
256
+ ### GPT OAuth 이미지 생성이 이미지 없이 끝나면 무엇을 공유해야 하나요?
262
257
 
263
258
  먼저 moderation으로 단정하지 말고 image probe를 실행하세요. `EMPTY_RESPONSE`는
264
259
  Responses 경로에서 `ima2-gen`이 사용할 수 있는 이미지 데이터가 나오지 않았다는
@@ -312,7 +307,7 @@ generated base64는 공유하지 마세요.
312
307
  먼저 시도하세요.
313
308
 
314
309
  ```bash
315
- npx openai-oauth --port 10531
310
+ openai-oauth --port 10531
316
311
  ```
317
312
 
318
313
  프록시가 필요한 네트워크라면 터미널 프로세스도 프록시를 타도록 프록시 클라이언트의 TUN/TURN류 모드를 켜세요. Windows에서는 SecretDNS처럼 부팅 때 자동 실행되는 DNS/파편화 우회 프로그램도 잠시 끄고 재시도해 보세요. 그래도 안 되면 `openai-oauth` 또는 `ima2 serve`를 실행하는 같은 터미널에 프록시 환경 변수를 설정합니다.
@@ -326,7 +321,7 @@ export HTTPS_PROXY=http://127.0.0.1:7890
326
321
 
327
322
  ### 회사 컴퓨터에서는 무엇을 확인해야 하나요?
328
323
 
329
- OAuth는 OpenAI와 ChatGPT/Codex 관련 호스트 접근이 필요할 수 있습니다. 회사 방화벽, TLS 검사, VPN, 프록시가 흐름을 깨뜨릴 수 있습니다. 로그인 실패와 `failed to fetch`가 반복되면 다른 네트워크에서도 시도해 보세요.
324
+ GPT OAuth는 OpenAI와 ChatGPT/Codex 관련 호스트 접근이 필요할 수 있습니다. 회사 방화벽, TLS 검사, VPN, 프록시가 흐름을 깨뜨릴 수 있습니다. 로그인 실패와 `failed to fetch`가 반복되면 다른 네트워크에서도 시도해 보세요.
330
325
 
331
326
  ## CLI 점검 순서
332
327
 
@@ -337,7 +332,7 @@ ima2 doctor
337
332
  ima2 status
338
333
  ima2 ping
339
334
  ima2 ps
340
- npx @openai/codex login
335
+ ima2 setup
341
336
  npm install -g ima2-gen@latest
342
337
  ```
343
338
 
package/docs/FAQ.md CHANGED
@@ -11,8 +11,8 @@ For Korean, see [FAQ.ko.md](FAQ.ko.md).
11
11
  | Symptom | Try first |
12
12
  |---|---|
13
13
  | The server is unreachable | Run `ima2 serve`, then `ima2 ping`. |
14
- | OAuth login fails | Run `npx @openai/codex login`, then restart `ima2 serve`. |
15
- | API key provider says `API_KEY_REQUIRED` | Configure an API key, or switch back to the OAuth provider. |
14
+ | GPT OAuth login fails | Re-run `ima2 setup` (option 1), then restart `ima2 serve`. |
15
+ | API key provider says `API_KEY_REQUIRED` | Configure an API key, or switch back to the GPT OAuth provider. |
16
16
  | Old gallery images look missing | Run `ima2 doctor`, then see [Recover Old Generated Images](RECOVER_OLD_IMAGES.md). |
17
17
  | `gpt-5.5` fails | Update Codex CLI first, then try `gpt-5.4` as the stable fallback. |
18
18
  | Reference upload fails | Use JPEG/PNG, lower the resolution, and keep references to 5 images or fewer. |
@@ -27,22 +27,17 @@ For Korean, see [FAQ.ko.md](FAQ.ko.md).
27
27
 
28
28
  Use Node.js 20 or newer. The package declares Node `>=20`, and the README badge follows that requirement.
29
29
 
30
- ### Should I use `npx` or a global install?
30
+ ### How do I install?
31
31
 
32
- Both are supported.
33
-
34
- ```bash
35
- npx ima2-gen serve
36
- ```
37
-
38
- or:
32
+ Install globally with npm:
39
33
 
40
34
  ```bash
41
35
  npm install -g ima2-gen
36
+ ima2 setup
42
37
  ima2 serve
43
38
  ```
44
39
 
45
- If an old global install behaves strangely, update first:
40
+ If an old install behaves strangely, update first:
46
41
 
47
42
  ```bash
48
43
  npm install -g ima2-gen@latest
@@ -88,10 +83,10 @@ It means `ima2-gen` found a valid API key. API-key mode can generate, edit, run
88
83
 
89
84
  ### If Codex CLI is already logged in, does ima2-gen reuse it?
90
85
 
91
- Yes. `ima2-gen` checks for an existing Codex login and uses the local OAuth path. If detection fails or the token expires, run:
86
+ Yes. `ima2-gen` checks for an existing Codex login and uses the local GPT OAuth path. If detection fails or the token expires, run:
92
87
 
93
88
  ```bash
94
- npx @openai/codex login
89
+ ima2 setup # re-run option 1 (GPT OAuth)
95
90
  ima2 doctor
96
91
  ```
97
92
 
@@ -102,7 +97,7 @@ Then restart `ima2 serve`.
102
97
  Your Codex/ChatGPT OAuth session needs to be refreshed.
103
98
 
104
99
  ```bash
105
- npx @openai/codex login
100
+ ima2 setup # re-run option 1 (GPT OAuth)
106
101
  ima2 serve
107
102
  ```
108
103
 
@@ -124,7 +119,7 @@ Start with `gpt-5.4` for the safest balanced workflow.
124
119
 
125
120
  ### How many images can Plus or Pro generate?
126
121
 
127
- Do not treat any community number as a guarantee. OAuth generation can be limited by account, backend capability, traffic, and policy changes. `ima2-gen` does not publish a fixed Plus/Pro image count because that number is not stable enough to document as a promise.
122
+ Do not treat any community number as a guarantee. GPT OAuth generation can be limited by account, backend capability, traffic, and policy changes. `ima2-gen` does not publish a fixed Plus/Pro image count because that number is not stable enough to document as a promise.
128
123
 
129
124
  ## Prompt Studio and multimode
130
125
 
@@ -268,7 +263,7 @@ ima2 ping
268
263
 
269
264
  Then restart `ima2 serve` if needed.
270
265
 
271
- ### What should I share when OAuth image generation returns no image?
266
+ ### What should I share when GPT OAuth image generation returns no image?
272
267
 
273
268
  Use the image probe before assuming moderation. `EMPTY_RESPONSE` means the
274
269
  Responses path did not produce image data that `ima2-gen` could use; it can be
@@ -323,7 +318,7 @@ This usually means the local OAuth proxy cannot reach the upstream service throu
323
318
  Try:
324
319
 
325
320
  ```bash
326
- npx openai-oauth --port 10531
321
+ openai-oauth --port 10531
327
322
  ```
328
323
 
329
324
  If your network requires a proxy, enable your proxy client's TUN/TURN-style mode so terminal processes can use it. On Windows, also temporarily disable auto-start DNS or fragmentation bypass tools such as SecretDNS and retry. If that is not enough, set the proxy variables in the same terminal that runs `openai-oauth` or `ima2 serve`:
@@ -337,7 +332,7 @@ Use the host and port from your proxy client. If `ima2-gen` still fails after th
337
332
 
338
333
  ### What should I check on a company computer?
339
334
 
340
- OAuth may require access to OpenAI and ChatGPT/Codex-related hosts. A corporate firewall, TLS inspection, VPN, or proxy can break the flow. Try a different network if login and `failed to fetch` errors keep repeating.
335
+ GPT OAuth may require access to OpenAI and ChatGPT/Codex-related hosts. A corporate firewall, TLS inspection, VPN, or proxy can break the flow. Try a different network if login and `failed to fetch` errors keep repeating.
341
336
 
342
337
  ## CLI troubleshooting checklist
343
338
 
@@ -348,7 +343,7 @@ ima2 doctor
348
343
  ima2 status
349
344
  ima2 ping
350
345
  ima2 ps
351
- npx @openai/codex login
346
+ ima2 setup
352
347
  npm install -g ima2-gen@latest
353
348
  ```
354
349
 
@@ -0,0 +1,40 @@
1
+ # npx Quickstart
2
+
3
+ > The recommended install method is `npm install -g ima2-gen`. This page covers
4
+ > the alternative `npx` workflow for one-shot usage without a global install.
5
+
6
+ ## Run without installing
7
+
8
+ ```bash
9
+ npx ima2-gen serve
10
+ ```
11
+
12
+ Then open `http://localhost:3333`.
13
+
14
+ If ChatGPT OAuth is not logged in yet:
15
+
16
+ ```bash
17
+ npx @openai/codex login
18
+ npx ima2-gen serve
19
+ ```
20
+
21
+ ## Notes
22
+
23
+ - `npx` downloads the package to a temporary cache. Each run may re-download if
24
+ the cache is cold, which is slower than a global install.
25
+ - Generated images are stored in `~/.ima2/generated` regardless of install
26
+ method. They are not lost when the npx cache expires.
27
+ - `ima2 setup`, `ima2 grok login`, and other CLI commands still work after
28
+ `npx ima2-gen serve` starts the server, as long as the npx session is active.
29
+ - For a stable, faster experience, use the global install:
30
+
31
+ ```bash
32
+ npm install -g ima2-gen
33
+ ima2 setup
34
+ ima2 serve
35
+ ```
36
+
37
+ ## Recovering images from an old npx cache
38
+
39
+ If you used `npx` in earlier versions and your images were saved inside the npx
40
+ cache instead of `~/.ima2/generated`, see [Recover Old Images](RECOVER_OLD_IMAGES.md).
@@ -15,7 +15,7 @@ Prompt Studio는 이미지를 반복해서 뽑고 비교하는 Classic 작업공
15
15
  | 멀티모드 | 현재 프롬프트로 여러 개의 이미지 요청을 시작합니다. | 각 슬롯은 후보 이미지입니다. 콜라주 칸이나 보장된 연속 장면이 아닙니다. |
16
16
  | 1:1 Direct | 앱이 프롬프트를 덜 바꾸고 원문에 가깝게 전달합니다. | 정확한 문구 비교, 엄격한 템플릿, provider 쪽 prompt syntax 실험에 씁니다. |
17
17
  | 모델 빠른 메뉴 | 사이드바 상단에서 모델과 추론 강도를 바로 바꿉니다. | 자세한 설명과 전체 설정은 Settings 작업공간에 남아 있습니다. |
18
- | 최근 생성 | Prompt Studio에서 보이는 최근 생성 범위를 보여줍니다. | 화살표 이동은 화면에 보이는 최근 생성 범위와 맞아야 합니다. |
18
+ | 최근 생성 | Prompt Studio에서 보이는 최근 생성 범위를 보여줍니다. | 화살표 이동은 화면에 보이는 최근 생성 범위와 맞아야 합니다. 영상 항목은 비디오 썸네일로 표시됩니다. 썸네일을 작성창으로 드래그해 참조 이미지로 추가할 수 있습니다. |
19
19
  | 갤러리 | 로컬 저장 이미지, 전체/즐겨찾기 탭, 폴더를 봅니다. | 즐겨찾기 추가/제거는 보고 있던 갤러리 위치를 유지해야 합니다. |
20
20
  | 프롬프트 라이브러리 | 저장된 프롬프트를 의도적으로 작성창에 넣습니다. | 라이브러리 삽입/이어가기 같은 명시적 액션만 프롬프트를 가져옵니다. |
21
21
 
@@ -15,7 +15,7 @@ you want a reproducible way to report a workspace issue.
15
15
  | Multimode | Starts several separate image requests from the current prompt. | Each slot is a candidate output, not a collage panel or a guaranteed scene sequence. |
16
16
  | 1:1 Direct | Sends the prompt through with less rewriting by the app. | Use it for exact wording, strict prompt experiments, or provider-side prompt syntax. |
17
17
  | Model quick menu | Changes the image model and reasoning effort from the sidebar header. | The full Settings workspace remains the detailed configuration page. |
18
- | Recent generations | Shows the visible Prompt Studio history domain. | Arrow keys move inside the same visible recent domain instead of hidden older rows. |
18
+ | Recent generations | Shows the visible Prompt Studio history domain. | Arrow keys move inside the same visible recent domain instead of hidden older rows. Video items render as video thumbnails. Drag any thumbnail to the composer to add it as a reference image. |
19
19
  | Gallery | Browses saved local images, All/Favorites tabs, and folders. | Favorite toggles should preserve the gallery viewport you were browsing. |
20
20
  | Prompt library | Imports saved prompt text into the composer intentionally. | Library insert/continue actions are explicit prompt imports; passive image selection is not. |
21
21
 
package/docs/README.ja.md CHANGED
@@ -10,33 +10,23 @@
10
10
 
11
11
  `ima2-gen` は、無料の ChatGPT と SuperGrok だけで画像と動画を作れるローカル AI スタジオです。
12
12
 
13
- `npx` で起動し、ChatGPT または Grok OAuth でログインすれば、すぐに画像・動画生成を始められます。API キー不要で、ノード分岐、multimode batch、Grok Video、Canvas Mode まで全機能が使えます。
13
+ グローバルインストールし、ChatGPT または Grok OAuth でログインすれば、すぐに画像・動画生成を始められます。API キー不要で、ノード分岐、multimode batch、Grok Video、Canvas Mode まで全機能が使えます。
14
14
 
15
15
  ![プロンプト入力、生成画像、モデル表示、結果メタデータが見える ima2-gen classic 画面](../assets/screenshots/classic-generate-light.png)
16
16
 
17
17
  ## Quick Start
18
18
 
19
19
  ```bash
20
- npx ima2-gen serve
20
+ npm install -g ima2-gen
21
+ ima2 setup
22
+ ima2 serve
21
23
  ```
22
24
 
23
25
  その後、`http://localhost:3333` を開きます。
24
26
 
25
- Codex にまだログインしていない場合:
26
-
27
- ```bash
28
- npx @openai/codex login
29
- npx ima2-gen serve
30
- ```
31
-
32
27
  `3333` がすでに使われている場合、次に空いているポートで起動し、実際の URL は `~/.ima2/server.json` に書き込まれます。ポートを決め打ちせず、terminal に表示された URL または `ima2 open` を使ってください。
33
28
 
34
- グローバルインストールもできます。
35
-
36
- ```bash
37
- npm install -g ima2-gen
38
- ima2 serve
39
- ```
29
+ > **npx を使いたい場合は?** [NPX_QUICKSTART.md](NPX_QUICKSTART.md) を参照してください。
40
30
 
41
31
  ## できること
42
32
 
@@ -194,7 +184,7 @@ Endpoint 一覧は [API Reference](API.md) に分離しました。
194
184
  まず `ima2 serve` を起動し、`~/.ima2/server.json` を確認してください。`ima2 ping --server http://localhost:3333` も使えます。
195
185
 
196
186
  **OAuth login がうまくいかない**
197
- `npx @openai/codex login` を実行し、`ima2 status` を確認してから `ima2 serve` を再起動してください。
187
+ `ima2 setup` を再実行(オプション 1)し、`ima2 status` を確認してから `ima2 serve` を再起動してください。
198
188
 
199
189
  **画像生成が `API_KEY_REQUIRED` で失敗する**
200
190
  `provider: "api"` request に使う API key が設定されていません。API key を設定するか OAuth provider に切り替えてください。