ima2-gen 1.1.19 → 1.1.21
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 +24 -25
- package/bin/commands/capabilities.js +2 -2
- package/bin/commands/capabilities.ts +2 -2
- package/bin/commands/defaults.js +2 -2
- package/bin/commands/defaults.ts +2 -2
- package/bin/commands/doctor.js +3 -3
- package/bin/commands/doctor.ts +3 -3
- package/bin/commands/edit.js +1 -1
- package/bin/commands/edit.ts +1 -1
- package/bin/commands/gen.js +1 -1
- package/bin/commands/gen.ts +1 -1
- package/bin/commands/grok.js +25 -22
- package/bin/commands/grok.ts +26 -22
- package/bin/commands/multimode.js +1 -1
- package/bin/commands/multimode.ts +1 -1
- package/bin/commands/observability.js +2 -2
- package/bin/commands/observability.ts +2 -2
- package/bin/commands/video.js +335 -13
- package/bin/commands/video.ts +249 -12
- package/bin/ima2.js +9 -9
- package/bin/ima2.ts +9 -9
- package/bin/lib/error-hints.js +2 -2
- package/bin/lib/error-hints.ts +2 -2
- 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 +10 -20
- package/docs/README.zh-CN.md +7 -17
- package/docs/migration/runtime-test-inventory.md +9 -1
- package/lib/agentGenerationPlanner.js +20 -1
- package/lib/agentGenerationPlanner.ts +25 -1
- package/lib/agentRuntime.js +24 -8
- package/lib/agentRuntime.ts +23 -8
- package/lib/capabilities.js +1 -1
- package/lib/capabilities.ts +1 -1
- package/lib/generationErrors.js +1 -1
- package/lib/generationErrors.ts +1 -1
- package/lib/grokProxyLauncher.js +26 -3
- package/lib/grokProxyLauncher.ts +27 -3
- package/lib/grokVideoAdapter.js +18 -89
- package/lib/grokVideoAdapter.ts +27 -88
- package/lib/grokVideoCanvas.js +25 -0
- package/lib/grokVideoCanvas.ts +26 -0
- package/lib/grokVideoDownload.js +58 -0
- package/lib/grokVideoDownload.ts +59 -0
- package/lib/grokVideoPlannerPrompt.js +64 -0
- package/lib/grokVideoPlannerPrompt.ts +67 -0
- package/lib/historyList.js +7 -1
- package/lib/historyList.ts +5 -1
- package/lib/oauthLauncher.js +21 -6
- package/lib/oauthLauncher.ts +22 -6
- package/lib/videoContinuity.js +149 -0
- package/lib/videoContinuity.ts +180 -0
- package/lib/videoFrameExtract.js +80 -0
- package/lib/videoFrameExtract.ts +78 -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 +2 -2
- package/routes/index.js +4 -0
- package/routes/index.ts +4 -0
- package/routes/quota.js +66 -0
- package/routes/quota.ts +89 -0
- package/routes/video.js +77 -15
- package/routes/video.ts +82 -14
- package/routes/videoExtended.js +293 -0
- package/routes/videoExtended.ts +284 -0
- package/server.js +6 -2
- package/server.ts +5 -2
- package/skills/ima2/SKILL.md +381 -3
- package/ui/dist/.vite/manifest.json +12 -12
- package/ui/dist/assets/{AgentWorkspace-DE_wg90f.js → AgentWorkspace-B_hq9CLg.js} +2 -2
- package/ui/dist/assets/{CardNewsWorkspace--Myc5pAp.js → CardNewsWorkspace-wD12J7qk.js} +1 -1
- package/ui/dist/assets/{NodeCanvas-4U5oOT2y.js → NodeCanvas-CI_wuPMf.js} +1 -1
- package/ui/dist/assets/{PromptBuilderPanel-DNW1U8zI.js → PromptBuilderPanel-CUTujJUV.js} +1 -1
- package/ui/dist/assets/{PromptImportDialog-o-4Sqki1.js → PromptImportDialog-CUi66jPK.js} +2 -2
- package/ui/dist/assets/{PromptImportDiscoverySection-BAbrRP8B.js → PromptImportDiscoverySection-Cm3vrjY4.js} +1 -1
- package/ui/dist/assets/{PromptImportFolderSection-L-XI2noz.js → PromptImportFolderSection-DOtWTD9n.js} +1 -1
- package/ui/dist/assets/{PromptLibraryPanel-CrW9LYGD.js → PromptLibraryPanel-BMjQegRa.js} +2 -2
- package/ui/dist/assets/SettingsWorkspace-PiaVnsdA.js +1 -0
- package/ui/dist/assets/{index-BONbNNIi.js → index-31uVIdt4.js} +1 -1
- package/ui/dist/assets/index-CjgnNtgt.css +1 -0
- package/ui/dist/assets/index-Da2s4_-5.js +36 -0
- package/ui/dist/index.html +2 -2
- package/vendor/progrok-0.2.0.tgz +0 -0
- package/ui/dist/assets/SettingsWorkspace-Dn4SYTyZ.js +0 -1
- package/ui/dist/assets/index-B6tcw_UF.css +0 -1
- package/ui/dist/assets/index-CeSZ2L3-.js +0 -32
- package/vendor/progrok-0.1.1.tgz +0 -0
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
|
|
67
|
-
|
|
68
|
-
only if you want to manage
|
|
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
|
|
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 로그인이 안 됨 | `
|
|
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
|
-
###
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 |
|
|
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
|
-
###
|
|
30
|
+
### How do I install?
|
|
31
31
|
|
|
32
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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).
|
package/docs/PROMPT_STUDIO.ko.md
CHANGED
|
@@ -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
|
|
package/docs/PROMPT_STUDIO.md
CHANGED
|
@@ -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
|
-
|
|
13
|
+
グローバルインストールし、ChatGPT または Grok OAuth でログインすれば、すぐに画像・動画生成を始められます。API キー不要で、ノード分岐、multimode batch、Grok Video、Canvas Mode まで全機能が使えます。
|
|
14
14
|
|
|
15
15
|

|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
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
|
-
`
|
|
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 に切り替えてください。
|
package/docs/README.ko.md
CHANGED
|
@@ -12,33 +12,23 @@
|
|
|
12
12
|
|
|
13
13
|
`ima2-gen`은 무료 ChatGPT와 SuperGrok만으로 이미지와 영상을 만드는 로컬 AI 스튜디오입니다.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
전역 설치 후 ChatGPT 또는 Grok OAuth로 로그인하면 바로 시작됩니다. API 키 없이 이미지 생성, 비디오 생성, 노드 분기, 멀티모드 배치, Canvas 정리까지 전부 가능합니다.
|
|
16
16
|
|
|
17
17
|

|
|
18
18
|
|
|
19
19
|
## 빠른 시작
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
|
|
22
|
+
npm install -g ima2-gen
|
|
23
|
+
ima2 setup
|
|
24
|
+
ima2 serve
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
그다음 `http://localhost:3333`을 엽니다.
|
|
26
28
|
|
|
27
|
-
Codex 로그인이 아직 없다면:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npx @openai/codex login
|
|
31
|
-
npx ima2-gen serve
|
|
32
|
-
```
|
|
33
|
-
|
|
34
29
|
`3333`이 이미 사용 중이면 다음 사용 가능한 포트로 열리고 실제 URL은 `~/.ima2/server.json`에 기록됩니다. 포트를 추측하지 말고 터미널에 출력된 URL이나 `ima2 open`을 사용하세요.
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npm install -g ima2-gen
|
|
40
|
-
ima2 serve
|
|
41
|
-
```
|
|
31
|
+
> **npx로 실행하고 싶다면?** [NPX_QUICKSTART.md](NPX_QUICKSTART.md)를 참고하세요.
|
|
42
32
|
|
|
43
33
|
### 설정
|
|
44
34
|
|
|
@@ -78,7 +68,7 @@ Grok video 생성(T2V/I2V/ref2v)은 v1.1.16부터 사용 가능합니다. 텍스
|
|
|
78
68
|
|
|
79
69
|
설정 화면에 **API key provider available**이나 **Grok provider available**이 보이면 해당 공급자가 감지됐고 생성 요청에 사용할 수 있다는 뜻입니다.
|
|
80
70
|
|
|
81
|
-

|
|
71
|
+

|
|
82
72
|
|
|
83
73
|
## 모델 안내
|
|
84
74
|
|
|
@@ -225,14 +215,14 @@ environment variables > ~/.ima2/config.json > built-in defaults
|
|
|
225
215
|
**`ima2 ping`이 서버에 연결하지 못한다고 나와요**
|
|
226
216
|
`ima2 serve`를 먼저 실행하고 `~/.ima2/server.json`을 확인하세요. `ima2 ping --server http://localhost:3333`도 사용할 수 있습니다.
|
|
227
217
|
|
|
228
|
-
**OAuth 로그인이 안 돼요**
|
|
229
|
-
`
|
|
218
|
+
**GPT OAuth 로그인이 안 돼요**
|
|
219
|
+
`ima2 setup`을 다시 실행하고(옵션 1), `ima2 status`를 확인한 뒤 `ima2 serve`를 다시 시작하세요.
|
|
230
220
|
|
|
231
221
|
**프록시/VPN 환경에서 `fetch failed`가 반복돼요**
|
|
232
|
-
로컬 OAuth 프록시가 접근 가능한지 확인하세요. 프록시가 필요한 네트워크라면 프록시 클라이언트의 TUN/TURN류 모드를 켠 뒤 `
|
|
222
|
+
로컬 OAuth 프록시가 접근 가능한지 확인하세요. 프록시가 필요한 네트워크라면 프록시 클라이언트의 TUN/TURN류 모드를 켠 뒤 `openai-oauth --port 10531`을 다시 시도하세요. 그래도 실패하면 `ima2 serve` 또는 `openai-oauth`를 실행하는 같은 터미널에 `HTTP_PROXY`와 `HTTPS_PROXY`를 설정하세요.
|
|
233
223
|
|
|
234
224
|
**이미지 생성이 `API_KEY_REQUIRED`로 실패해요**
|
|
235
|
-
`provider: "api"` 요청에 사용할 API 키가 설정되어 있지 않다는 뜻입니다. API 키를 설정하거나 OAuth 공급자로 전환하세요.
|
|
225
|
+
`provider: "api"` 요청에 사용할 API 키가 설정되어 있지 않다는 뜻입니다. API 키를 설정하거나 GPT OAuth 공급자로 전환하세요.
|
|
236
226
|
|
|
237
227
|
**큰 레퍼런스 이미지가 실패해요**
|
|
238
228
|
JPEG/PNG는 업로드 전에 자동 압축됩니다. 그래도 실패하면 해상도를 낮춘 JPEG/PNG로 바꿔 다시 시도하세요. HEIC/HEIF는 브라우저 경로에서 지원하지 않습니다.
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -10,33 +10,23 @@
|
|
|
10
10
|
|
|
11
11
|
`ima2-gen` 是一个本地 AI 工作室,只需免费 ChatGPT 和 SuperGrok 即可生成图像和视频。
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
全局安装后,通过 ChatGPT 或 Grok OAuth 登录即可开始生成图像和视频。无需 API 密钥,节点分支、multimode 批量、Grok Video、Canvas Mode 全部可用。
|
|
14
14
|
|
|
15
15
|

|
|
16
16
|
|
|
17
17
|
## 快速开始
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
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` 已经被占用,server 会绑定下一个可用端口,并把实际 URL 写入 `~/.ima2/server.json`。不要假设端口固定,请使用终端输出的 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,10 +184,10 @@ environment variables > ~/.ima2/config.json > built-in defaults
|
|
|
194
184
|
先启动 `ima2 serve`,再检查 `~/.ima2/server.json`。也可以运行 `ima2 ping --server http://localhost:3333`。
|
|
195
185
|
|
|
196
186
|
**OAuth 登录失败**
|
|
197
|
-
|
|
187
|
+
重新运行 `ima2 setup`(选项 1),用 `ima2 status` 确认状态,然后重启 `ima2 serve`。
|
|
198
188
|
|
|
199
189
|
**在代理/VPN 网络下反复出现 `fetch failed`**
|
|
200
|
-
请先确认本地 OAuth proxy 可以访问。如果你的网络需要代理,请在代理客户端里开启 TUN/TURN 类似的转发模式,然后重试 `
|
|
190
|
+
请先确认本地 OAuth proxy 可以访问。如果你的网络需要代理,请在代理客户端里开启 TUN/TURN 类似的转发模式,然后重试 `openai-oauth --port 10531`。如果仍然失败,请在运行 `ima2 serve` 或 `openai-oauth` 的同一个终端里设置 `HTTP_PROXY` 和 `HTTPS_PROXY`。
|
|
201
191
|
|
|
202
192
|
**生成图片时返回 `API_KEY_REQUIRED`**
|
|
203
193
|
`provider: "api"` 请求没有可用 API key。请配置 API key,或切换到 OAuth provider。
|
|
@@ -4,7 +4,7 @@ Generated by `npm run test:inventory` (script: `scripts/classify-tests.mjs`).
|
|
|
4
4
|
|
|
5
5
|
_Tests considered "runtime-importing" if they import from `../lib/`, `../routes/`, `../bin/`, `../server`, or `../config`._
|
|
6
6
|
|
|
7
|
-
Total:
|
|
7
|
+
Total: 175 (runtime: 60, contract: 115)
|
|
8
8
|
|
|
9
9
|
## Runtime-importing tests
|
|
10
10
|
- `tests/agent-mode-auto-planner-contract.test.ts`
|
|
@@ -13,6 +13,7 @@ Total: 167 (runtime: 54, contract: 113)
|
|
|
13
13
|
- `tests/agent-mode-queue-migration-contract.test.ts`
|
|
14
14
|
- `tests/agent-mode-runtime-contract.test.ts`
|
|
15
15
|
- `tests/agent-mode-slash-command-contract.test.ts`
|
|
16
|
+
- `tests/agent-video-intent.test.ts`
|
|
16
17
|
- `tests/api-cache-policy.test.ts`
|
|
17
18
|
- `tests/api-provider-parity.test.ts`
|
|
18
19
|
- `tests/billing-source.test.ts`
|
|
@@ -22,8 +23,11 @@ Total: 167 (runtime: 54, contract: 113)
|
|
|
22
23
|
- `tests/comfy-bridge-contract.test.ts`
|
|
23
24
|
- `tests/error-classify.test.ts`
|
|
24
25
|
- `tests/generate-route-validation-error.test.ts`
|
|
26
|
+
- `tests/generated-static-privacy.test.ts`
|
|
25
27
|
- `tests/generation-errors.test.ts`
|
|
28
|
+
- `tests/grok-command-login-contract.test.ts`
|
|
26
29
|
- `tests/grok-planner-adapter.test.ts`
|
|
30
|
+
- `tests/grok-proxy-launcher.test.ts`
|
|
27
31
|
- `tests/grok-size-mapper.test.ts`
|
|
28
32
|
- `tests/grokVideoAdapter.test.ts`
|
|
29
33
|
- `tests/history-metadata-fallback.test.ts`
|
|
@@ -60,6 +64,8 @@ Total: 167 (runtime: 54, contract: 113)
|
|
|
60
64
|
- `tests/star-prompt.test.ts`
|
|
61
65
|
- `tests/storage-migration.test.ts`
|
|
62
66
|
- `tests/style-sheet.test.ts`
|
|
67
|
+
- `tests/videoContinuity.test.ts`
|
|
68
|
+
- `tests/videoExtendedRoute.test.ts`
|
|
63
69
|
- `tests/videoRoute.test.ts`
|
|
64
70
|
|
|
65
71
|
## Contract-only tests
|
|
@@ -109,6 +115,7 @@ Total: 167 (runtime: 54, contract: 113)
|
|
|
109
115
|
- `tests/cli-prompt-builder-contract.test.js`
|
|
110
116
|
- `tests/cli-prompt-import-contract.test.js`
|
|
111
117
|
- `tests/cli-skill-command-contract.test.js`
|
|
118
|
+
- `tests/cli-video-command-contract.test.js`
|
|
112
119
|
- `tests/comfy-export-ui-contract.test.js`
|
|
113
120
|
- `tests/comfyui-custom-node-contract.test.js`
|
|
114
121
|
- `tests/config.test.js`
|
|
@@ -174,5 +181,6 @@ Total: 167 (runtime: 54, contract: 113)
|
|
|
174
181
|
- `tests/style-feature-removal-contract.test.js`
|
|
175
182
|
- `tests/toast-stack-contract.test.js`
|
|
176
183
|
- `tests/ui-error-code-contract.test.js`
|
|
184
|
+
- `tests/video-continuity-ui-contract.test.js`
|
|
177
185
|
- `tests/vite-dev-port-contract.test.js`
|
|
178
186
|
- `tests/web-search-toggle-contract.test.js`
|
|
@@ -196,7 +196,26 @@ function cleanCount(value, fallback, min, max) {
|
|
|
196
196
|
function clampCount(value, max) {
|
|
197
197
|
return Math.max(1, Math.min(max, Math.round(value)));
|
|
198
198
|
}
|
|
199
|
-
const VIDEO_INTENT_PATTERN =
|
|
199
|
+
const VIDEO_INTENT_PATTERN = /(?:^|\s|[^\p{L}])(?:video|animate|animation)(?:\s|[^\p{L}]|$)|(?:동영상|비디오|영상|애니메이트|움직이|클립)/iu;
|
|
200
200
|
function isVideoIntent(prompt) {
|
|
201
201
|
return VIDEO_INTENT_PATTERN.test(prompt);
|
|
202
202
|
}
|
|
203
|
+
const DURATION_PATTERN = /(\d{1,2})\s*(?:s|sec|seconds?|초)/i;
|
|
204
|
+
const RESOLUTION_PATTERN = /(720p|480p)/i;
|
|
205
|
+
const ASPECT_PATTERN = /(16:9|9:16|4:3|3:4|3:2|2:3|1:1)/;
|
|
206
|
+
export function parseVideoParams(prompt) {
|
|
207
|
+
const params = {};
|
|
208
|
+
const durMatch = DURATION_PATTERN.exec(prompt);
|
|
209
|
+
if (durMatch) {
|
|
210
|
+
const d = parseInt(durMatch[1]);
|
|
211
|
+
if (d >= 1 && d <= 15)
|
|
212
|
+
params.duration = d;
|
|
213
|
+
}
|
|
214
|
+
const resMatch = RESOLUTION_PATTERN.exec(prompt);
|
|
215
|
+
if (resMatch)
|
|
216
|
+
params.resolution = resMatch[1].toLowerCase();
|
|
217
|
+
const aspMatch = ASPECT_PATTERN.exec(prompt);
|
|
218
|
+
if (aspMatch)
|
|
219
|
+
params.aspectRatio = aspMatch[1];
|
|
220
|
+
return params;
|
|
221
|
+
}
|