quickmagic-cli 1.5.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -127,7 +127,8 @@ Ghi chú chung trước khi xem bảng:
127
127
  | Lệnh | Mô tả | Credit |
128
128
  |---|---|---|
129
129
  | `qm cutout` | Tách nền / PNG trong suốt / remix scene | Có |
130
- | `qm edit <image> --tool <t>` | restore / upscale (2k,4k) / beauty / muscle / color_boost | Có |
130
+ | `qm edit <image> --tool <t>` | restore / beauty / muscle / color_boost (upscale → dùng `qm upscale`) | Có |
131
+ | `qm upscale <file...> [--video]` | Upscale ảnh (2k/4k/8k) hoặc video (nâng nét/tăng fps) — 1 lệnh nhiều file = mỗi file 1 job | Có |
131
132
 
132
133
  ### Video quảng cáo / Marketing
133
134
 
@@ -147,7 +148,7 @@ Ghi chú chung trước khi xem bảng:
147
148
  | `qm subtitle <video_url>` | Thêm phụ đề (+ lồng tiếng, dịch) | Có |
148
149
  | `qm split <video_url>` | Cắt video dài → clip ngắn | Có |
149
150
  | `qm motion <video_url> --image <url...>` | Áp chuyển động video vào ảnh (Kling) | Có |
150
- | `qm tts (--text <t>\|--file <path>) --voice <v>` | Chuyển văn bản → giọng nói (5 model qimi_1.5/2.5/3/5/5.5) | Có |
151
+ | `qm tts (--text <t>\|--file <path>) --voice <v>` | Chuyển văn bản → giọng nói (6 model qimi_1.5/2.5/3/3.5/5/5.5; qimi_3.5 có kiểu đọc `--style`) | Có |
151
152
  | `qm voices list --model <m>` | Liệt kê giọng theo model + giá (`pricing`) | — |
152
153
  | `qm voices clone --audio <file\|url> --name <n>` | Nhân bản giọng riêng (dùng cho qimi_5/5.5) | Có |
153
154
  | `qm voices delete <id>` | Xoá giọng đã clone | — |
@@ -164,6 +165,21 @@ Ghi chú chung trước khi xem bảng:
164
165
  | `qm import <url>` | Nhập ảnh/video từ link TikTok/Instagram | — |
165
166
  | `qm assets <kind>` | Liệt kê tài sản đã lưu: `products`\|`outfits`\|`kols` | — |
166
167
 
168
+ ### Ứng dụng web (React SSR trên `<slug>.quickmagic.app`)
169
+
170
+ | Lệnh | Mô tả | Credit |
171
+ |---|---|---|
172
+ | `qm apps create --title "…" [--subdomain s] [--from <app_id>]` | Tạo app mới từ template (`--from` = remix app công khai đã duyệt) | — |
173
+ | `qm apps list` | App của tôi | — |
174
+ | `qm apps status <app_id> [--json]` | Trạng thái deploy/duyệt/build | — |
175
+ | `qm apps repo-access <app_id>` | URL git clone có token 15 phút (push code) | — |
176
+ | `qm apps deploy <app_id> [--wait]` | Build + deploy nhánh main | — |
177
+ | `qm apps publish <app_id> [--unlist]` | Lên feed (cần cover; tự kiểm duyệt; app đầu tiên duyệt tay) | — |
178
+ | `qm apps remove <app_id> --yes` | Xoá vĩnh viễn (subdomain khoá mãi) | — |
179
+
180
+ Người dùng app trả credit của **chính họ** khi tạo ảnh/video trong app; bạn (creator) nhận 5% trên mỗi lượt.
181
+ Không có `apps db` / `apps secrets` trên CLI (chỉ agent dùng qua MCP).
182
+
167
183
  ## Tạo ảnh
168
184
 
169
185
  ```bash
@@ -267,6 +283,13 @@ qm voices list --model qimi_1.5 --language "Tiếng Việt"
267
283
  qm tts --text "Xin chào Quick Magic" --voice <voice_id> --model qimi_3 --wait --out ./out
268
284
  qm voices clone --audio ./sample.wav --name "Giọng của tôi" --wait
269
285
 
286
+ # Qimi 3.5 — giọng của qimi_3, giá cố định mỗi lần (xem dòng "Giá:" của qm voices list --model qimi_3.5), tối đa 30.000 ký tự, chọn kiểu đọc:
287
+ # --style: tối đa 1 tốc độ (fast|default|slow) + 1 cảm xúc (cheerful|sad|storytelling|emotional), nối bằng "+"
288
+ # hoặc tự mô tả tiếng Việt "custom:<mô tả ≤200 ký tự>"; bỏ trống = đọc tự nhiên
289
+ qm voices list --model qimi_3.5
290
+ qm tts --file ./truyen.txt --voice <voice_id> --model qimi_3.5 --style "slow+storytelling" --wait --out ./out
291
+ qm tts --text "Ngày xửa ngày xưa..." --voice <voice_id> --model qimi_3.5 --style "custom:giọng trầm ấm, chậm rãi như kể chuyện đêm khuya" --wait --out ./out
292
+
270
293
  # Tạo nhạc AI — xem giá trước khi chạy (thường miễn phí giai đoạn ra mắt)
271
294
  qm music models
272
295
  qm music lyrics --desc "bài hát vui về buổi sáng cà phê Sài Gòn"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quickmagic-cli",
3
- "version": "1.5.0",
4
- "description": "Quick Magic CLI — generate AI images/videos, product photoshoots, virtual try-on, hook ad videos, subtitles, text-to-speech/voice cloning, AI song generation and more via the Quick Magic REST API, with browser-based OAuth PKCE login (no API keys to manage). Ships with 10 Claude Agent Skills and an MCP server integration.",
3
+ "version": "1.9.0",
4
+ "description": "Quick Magic CLI — generate AI images/videos, product photoshoots, virtual try-on, hook ad videos, subtitles, text-to-speech/voice cloning, AI song generation, image upscaling and more via the Quick Magic REST API, with browser-based OAuth PKCE login (no API keys to manage). Ships with 11 Claude Agent Skills and an MCP server integration.",
5
5
  "bin": {
6
6
  "quickmagic": "src/index.js",
7
7
  "qm": "src/index.js"
package/skills/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Quick Magic CLI — Agent Skills
2
2
 
3
- 10 Agent Skills that wrap the `quickmagic` / `qm` CLI so a coding agent (Claude
3
+ 11 Agent Skills that wrap the `quickmagic` / `qm` CLI so a coding agent (Claude
4
4
  Code and compatible tools) can drive Quick Magic directly from the terminal —
5
5
  mirroring the `npx skills add higgsfield-ai/skills` pattern (`/higgsfield:generate`
6
6
  etc.), tailored to Quick Magic's own REST API and CLI.
@@ -18,7 +18,7 @@ when to load the skill).
18
18
  Option 1 — `npx skills` (if this repo is published as a skills package):
19
19
 
20
20
  ```bash
21
- npx skills add Tungbillee/cli-quickmagic --skills quickmagic-account,quickmagic-generate,quickmagic-product-photoshoot,quickmagic-fashion,quickmagic-cutout,quickmagic-hook-video,quickmagic-edit-image,quickmagic-subtitle-split,quickmagic-tts,quickmagic-music
21
+ npx skills add Tungbillee/cli-quickmagic --skills quickmagic-account,quickmagic-generate,quickmagic-product-photoshoot,quickmagic-fashion,quickmagic-cutout,quickmagic-hook-video,quickmagic-edit-image,quickmagic-upscale,quickmagic-subtitle-split,quickmagic-tts,quickmagic-music
22
22
  ```
23
23
 
24
24
  Option 2 — copy directly into a project's or your user's Claude skills folder:
@@ -41,12 +41,13 @@ mkdir -p ~/.claude/skills && cp -r cli-quickmagic/skills/quickmagic-* ~/.claude/
41
41
  | `quickmagic-fashion` | `fashion`, `tryon` | outfit lookbook shoots vs. virtual try-on on a specific person photo |
42
42
  | `quickmagic-cutout` | `cutout` | transparent PNG cutouts / scene remix |
43
43
  | `quickmagic-hook-video` | `hook presets`, `hook video` | ~10s comedy ad video from a character + product photo (18 presets) |
44
- | `quickmagic-edit-image` | `edit` | restore / upscale (2k/4k) / beauty / muscle / color_boost on an existing image |
44
+ | `quickmagic-edit-image` | `edit` | restore / beauty / muscle / color_boost on an existing image |
45
+ | `quickmagic-upscale` | `upscale` | upscale images to 2K/4K/8K (crisp/standard/seedvr2/ultra) or videos (standard/pro/seedvr2/fps) |
45
46
  | `quickmagic-subtitle-split` | `subtitle`, `split` | auto subtitles/dubbing, long-video → short clips |
46
- | `quickmagic-tts` | `tts`, `voices list/clone/delete` | text-to-speech (5 models) + custom voice cloning |
47
+ | `quickmagic-tts` | `tts`, `voices list/clone/delete` | text-to-speech (6 models; `qimi_3.5` adds reading styles — presets or your own Vietnamese description — at a flat price per call) + custom voice cloning |
47
48
  | `quickmagic-music` | `music create/lyrics/models/get` | AI song generation (vocals or instrumental) from a description or your own lyrics |
48
49
 
49
- ## Shared conventions (all 10 skills)
50
+ ## Shared conventions (all 11 skills)
50
51
 
51
52
  - Check `qm auth status` first; if not logged in, tell the user to run
52
53
  `qm auth login`.
@@ -61,7 +62,7 @@ mkdir -p ~/.claude/skills && cp -r cli-quickmagic/skills/quickmagic-* ~/.claude/
61
62
  shortfall and a link to top up (https://quickmagic.vn/pricing).
62
63
  - Never poll `jobs get` manually — use `qm jobs wait <id> [--out dir]`. Note that
63
64
  `--out` only auto-downloads for job types with a single `result_url`
64
- (image/video/tryon/edit/hook/subtitle/tts/music); product/fashion/cutout/split
65
+ (image/video/tryon/edit/upscale/hook/subtitle/tts/music); product/fashion/cutout/split
65
66
  return arrays and must be read back with `qm jobs get <id>` after
66
67
  completion, and voice-clone jobs (`voc_`) have no `result_url` at all (read
67
68
  `voice`/`sample_url`/`status` instead). See `quickmagic-account` for the
@@ -108,13 +108,16 @@ generating command's own `--wait` flag, where available).
108
108
  | `stt_` | `stt` | text result (no dedicated skill) |
109
109
  | `tts_` | `tts` | single `result_url` (mp3) + `model`/`voice`/`character` — see `quickmagic-tts` |
110
110
  | `voc_` | `voices clone` | **no** `result_url`: `voice` (name to use with `--voice`), `sample_url`, `is_free` — see `quickmagic-tts` |
111
+ | `mus_` | `music create` | single `result_url` (mp3) + `title`/`duration_ms` — see `quickmagic-music` |
112
+ | `ups_` | `upscale` (image) | single `result_url` — see `quickmagic-upscale` |
113
+ | `vup_` | `upscale` (video, `--video`/auto-detected) | single `result_url` + `duration_sec` — see `quickmagic-upscale` |
111
114
 
112
115
  **Important caveat**: `jobs wait --out <dir>` only **auto-downloads** for the
113
- single-`result_url` types (`img_`/`vid_`/`vto_`/`edt_`/`hok_`/`sub_`/`tts_`). For the
114
- array types (`pai_`/`fsh_`/`cut_`/`spl_`) and `voc_` (voice clone — no file, read
115
- `voice`/`sample_url` via `qm jobs get`), `--out` still polls status correctly
116
- but downloads nothing — after status is `completed`, call `qm jobs get <id>` and
117
- read the array field yourself, then report each URL to the user.
116
+ single-`result_url` types (`img_`/`vid_`/`vto_`/`edt_`/`hok_`/`sub_`/`tts_`/`mus_`/
117
+ `ups_`/`vup_`). For the array types (`pai_`/`fsh_`/`cut_`/`spl_`) and `voc_` (voice
118
+ clone — no file, read `voice`/`sample_url` via `qm jobs get`), `--out` still polls
119
+ status correctly but downloads nothing — after status is `completed`, call
120
+ `qm jobs get <id>` and read the array field yourself, then report each URL to the user.
118
121
 
119
122
  Statuses: `queued` → `in_progress` → `completed` (success) or `failed` (relay the
120
123
  job's `error` field). A `queued` status stuck past ~15 minutes is reported as
@@ -1,14 +1,16 @@
1
1
  ---
2
2
  name: quickmagic-edit-image
3
3
  description: >-
4
- Restore, upscale (2k/4k), beauty-retouch, muscle-enhance, or color-boost a
5
- single existing image via `qm edit`. Use for enhancing an existing photo,
6
- not generating a new one. Triggers: "upscale ảnh lên 4k", "phục hồi ảnh cũ",
7
- "làm đẹp da trong ảnh", "chỉnh màu ảnh", "restore old photo", "upscale
8
- image resolution".
4
+ Restore, beauty-retouch, muscle-enhance, or color-boost a single existing
5
+ image via `qm edit`. Use for enhancing an existing photo, not generating a new
6
+ one. For enlarging / sharpening (2k/4k/8k) use the `quickmagic-upscale` skill
7
+ (`qm upscale`) instead. Triggers: "phục hồi ảnh cũ", "làm đẹp da trong ảnh",
8
+ "chỉnh màu ảnh", "restore old photo", "retouch skin".
9
9
  ---
10
10
 
11
- # quickmagic-edit-image — Photo Restore / Upscale / Retouch
11
+ # quickmagic-edit-image — Photo Restore / Retouch
12
+
13
+ > Phóng to & làm nét ảnh đã tách sang skill `quickmagic-upscale` (`qm upscale`).
12
14
 
13
15
  Wraps `qm edit <image>`. Edits **one existing image** in place — restoring
14
16
  damage, upscaling resolution, beauty retouch, muscle enhancement, or color
@@ -18,22 +20,21 @@ grading. Not for generating a new image from a text prompt (use
18
20
  ## Command
19
21
 
20
22
  ```
21
- qm edit <image> --tool <t> [--model qimi_2.5|qimi_3] [--upscale-target 2k|4k] [--style <s...>] [--crid <id>]
23
+ qm edit <image> --tool <t> [--model qimi_2.5|qimi_3] [--style <s...>] [--crid <id>]
22
24
  ```
23
25
 
24
26
  | Flag | Notes |
25
27
  |---|---|
26
28
  | `<image>` **required** (positional) | URL or local file path |
27
- | `--tool <t>` **required** | one of `restore` \| `upscale` \| `beauty` \| `muscle` \| `color_boost` |
29
+ | `--tool <t>` **required** | one of `restore` \| `beauty` \| `muscle` \| `color_boost` |
28
30
  | `--model` | `qimi_2.5` or `qimi_3` (default `qimi_3`) |
29
- | `--upscale-target` | **required when `--tool upscale`** — `2k` or `4k` |
30
31
  | `--style <s...>` | **required when `--tool beauty`** — up to 3 style keywords, repeatable flag |
31
32
  | `--crid <id>` | idempotency key |
32
33
 
33
- Map the user's request to a tool: "ảnh cũ/rách/mờ" → `restore`; "phóng to/nét
34
- hơn/4K" → `upscale` (ask 2k or 4k if not specified); "làm đẹp da/mặt" → `beauty`
35
- (ask for up to 3 style keywords); "cơ bắp săn chắc hơn" → `muscle`; "màu sắc rực
36
- rỡ hơn" → `color_boost`.
34
+ Map the user's request to a tool: "ảnh cũ/rách/mờ" → `restore`; "làm đẹp da/mặt"
35
+ → `beauty` (ask for up to 3 style keywords); "cơ bắp săn chắc hơn" → `muscle`;
36
+ "màu sắc rực rỡ hơn" → `color_boost`. "Phóng to / nét hơn / 4K / 8K" KHÔNG thuộc
37
+ lệnh này — dùng skill `quickmagic-upscale` (`qm upscale`).
37
38
 
38
39
  ## Before running
39
40
 
@@ -55,15 +56,14 @@ No `--wait` flag. Copy the job id from the hint
55
56
  ## Errors
56
57
 
57
58
  `Không đủ credit: ...` → state shortfall + https://quickmagic.vn/pricing.
58
- Missing `--upscale-target` on `upscale`, or missing `--style` on `beauty` →
59
- plain `Lỗi: <message>`; add the missing flag and retry. Full reference:
59
+ Missing `--style` on `beauty` → plain `Lỗi: <message>`; add the flag and retry.
60
+ `tool_moved` → tool `upscale` đã dời sang `qm upscale` (skill `quickmagic-upscale`). Full reference:
60
61
  `quickmagic-account` skill.
61
62
 
62
63
  ## Example
63
64
 
64
65
  ```bash
65
66
  qm edit ./old-photo.jpg --tool restore --model qimi_3
66
- qm edit ./portrait.jpg --tool upscale --upscale-target 4k
67
67
  qm edit ./selfie.jpg --tool beauty --style smooth-skin soft-light
68
68
  qm jobs wait edt_3 --out ./out
69
69
  ```
@@ -2,12 +2,15 @@
2
2
  name: quickmagic-tts
3
3
  description: >-
4
4
  Convert text to speech, or clone a custom voice, via the Quick Magic CLI
5
- (`qm tts`, `qm voices list/clone/delete`). Covers 5 TTS engines (qimi_1.5,
6
- qimi_2.5, qimi_3, qimi_5, qimi_5.5) — the last two add 310 built-in system
7
- voices across 16 languages plus optional user voice cloning. Triggers:
8
- "đọc văn bản thành giọng nói", "chuyển text thành giọng nói", "clone giọng",
9
- "tạo giọng riêng", "nhân bản giọng nói", "text to speech", "voice clone",
10
- "TTS", "read this text aloud", "convert text to audio".
5
+ (`qm tts`, `qm voices list/clone/delete`). Covers 6 TTS engines (qimi_1.5,
6
+ qimi_2.5, qimi_3, qimi_3.5, qimi_5, qimi_5.5) — qimi_3.5 reads the qimi_3
7
+ voices with a chosen reading style (speed/emotion presets or your own
8
+ Vietnamese description), at a flat price per call; qimi_5/qimi_5.5 add 310
9
+ built-in system voices across 16 languages plus optional user voice
10
+ cloning. Triggers: "đọc văn bản thành giọng nói", "chuyển text thành giọng
11
+ nói", "đọc truyện", "giọng kể chuyện", "đọc chậm", "giọng vui tươi",
12
+ "clone giọng", "tạo giọng riêng", "nhân bản giọng nói", "text to speech",
13
+ "voice clone", "TTS", "read this text aloud", "convert text to audio".
11
14
  ---
12
15
 
13
16
  # quickmagic-tts — Text-to-Speech & Voice Cloning
@@ -19,7 +22,7 @@ text read aloud as audio, or wants a custom cloned voice for future TTS calls.
19
22
 
20
23
  | Command | Required flags | Key optional flags |
21
24
  |---|---|---|
22
- | `qm tts` | `--text <t>` or `--file <path>`, `--voice <v>` | `--model <m>` (default `qimi_3`), `--language <l>`, `--speed <n>` (0.5-2.0, qimi_5/qimi_5.5 only), `--style <s>`, `--title <t>`, `--crid <id>`, `--wait`, `--out <dir>` |
25
+ | `qm tts` | `--text <t>` or `--file <path>`, `--voice <v>` | `--model <m>` (default `qimi_3`), `--language <l>`, `--speed <n>` (0.5-2.0, qimi_5/qimi_5.5 only), `--style <s>` (voice label for qimi_1.5/2.5/3; preset or `custom:<mô tả>` for qimi_3.5 — see "Reading styles"), `--title <t>`, `--crid <id>`, `--wait`, `--out <dir>` |
23
26
  | `qm voices list` | `--model <m>` | `--language <l>`, `--search <s>`, `--limit <n>` (default 50, max 100 — qimi_1.5 has 535 voices and qimi_5 310+: use `--language`/`--search` to narrow instead of paging) |
24
27
  | `qm voices clone` | `--audio <file\|url>`, `--name <n>` | `--crid <id>` (auto-generated if omitted), `--wait` |
25
28
  | `qm voices delete <id>` | `<id>` (`voc_12` or bare `12`) | — |
@@ -31,15 +34,18 @@ text read aloud as audio, or wants a custom cloned voice for future TTS calls.
31
34
  | `qimi_1.5` | flat credits/call | 50,000 | fixed catalog |
32
35
  | `qimi_2.5` | flat credits/call | 30,000 | fixed catalog |
33
36
  | `qimi_3` (default) | flat credits/call | 30,000 | fixed catalog |
37
+ | `qimi_3.5` | flat credits/call | 30,000 | the `qimi_3` catalog (multilingual) + reading styles — no clones |
34
38
  | `qimi_5` | credits/character, with a minimum charge | 10,000 | 310 system voices (16 languages) + your own clones |
35
39
  | `qimi_5.5` | credits/character (higher quality), with a minimum charge | 10,000 | 310 system voices (16 languages) + your own clones |
36
40
 
37
- Reference only, as of 260817 — **never quote these from memory**. Always run
41
+ Reference only, as of 260927 — **never quote these from memory**. Always run
38
42
  `qm voices list --model <m>` and read the `pricing` object from its response:
39
- roughly `qimi_1.5`/`qimi_2.5` ≈ 2cr/call, `qimi_3` ≈ 4cr/call, `qimi_5` ≈
40
- 0.09cr/char, `qimi_5.5` ≈ 0.15cr/char (min ~5cr) — rates can change. Voice
41
- cloning is a separate, much larger flat charge (~2,230cr) — see "Cloning a
42
- custom voice" below.
43
+ roughly `qimi_1.5`/`qimi_2.5` ≈ 2cr/call, `qimi_3` ≈ 4cr/call, `qimi_3.5` ≈
44
+ 10cr/call (any length up to 30,000 chars), `qimi_5` ≈ 0.09cr/char,
45
+ `qimi_5.5` ≈ 0.15cr/char (min ~5cr) — rates can change. Per-character models
46
+ count the text **after** your saved pronunciation replacements. Voice cloning
47
+ is a separate, much larger flat charge (~2,230cr) — see "Cloning a custom
48
+ voice" below.
43
49
 
44
50
  ## Pick a voice
45
51
 
@@ -55,6 +61,9 @@ qm voices list --model qimi_5 --search Minh --limit 20
55
61
  - `qimi_1.5`/`qimi_2.5`/`qimi_3` list a fixed catalog with a `STYLES` column
56
62
  (labels like "Vui vẻ"/"Formal") — pass the exact label as `--style`.
57
63
  `qimi_5`/`qimi_5.5` voices don't take `--style`.
64
+ - `qimi_3.5` lists the same voices as `qimi_3` and
65
+ prints a `Kiểu đọc (style)` line — its `--style` is a reading style, not a
66
+ voice label (see "Reading styles" below).
58
67
  - `qimi_5`/`qimi_5.5` output splits into **"Giọng của bạn"** (voices you
59
68
  cloned) and **"Giọng hệ thống"** (310 system voices, 16 languages) —
60
69
  cloning is optional, try a system voice first. Each system voice reads
@@ -74,8 +83,28 @@ qm tts --file ./script.txt --voice <voice_id> --model qimi_5 --language "Tiếng
74
83
  - The CLI prints the character count before submitting; sanity-check it
75
84
  against the model's char limit above to avoid a `char_limit_exceeded`.
76
85
  - Without `--wait`, note the printed job id (`tts_<n>`) and run
77
- `qm jobs wait tts_<n> --out ./out` separately — it auto-downloads the mp3
78
- (single `result_url`).
86
+ `qm jobs wait tts_<n> --out ./out` separately — it auto-downloads the audio
87
+ file (mp3, or wav for qimi_3/qimi_3.5; single `result_url`).
88
+
89
+ ## Reading styles (qimi_3.5 only)
90
+
91
+ ```bash
92
+ qm voices list --model qimi_3.5 # prints the price line + the live "Kiểu đọc (style)" hint
93
+ qm tts --file ./truyen.txt --voice <voice_id> --model qimi_3.5 --style "slow+storytelling" --wait --out ./out
94
+ qm tts --text "Ngày xửa ngày xưa..." --voice <voice_id> --model qimi_3.5 --style "custom:giọng trầm ấm, chậm rãi như kể chuyện đêm khuya" --wait --out ./out
95
+ ```
96
+
97
+ - Preset: at most **one speed** (`fast` | `default` | `slow`) and **one
98
+ emotion** (`cheerful` | `sad` | `storytelling` | `emotional`), joined
99
+ with `+` — e.g. `slow`, `cheerful`, `slow+storytelling`. The server's
100
+ current list is the `Kiểu đọc (style)` line of `qm voices list --model qimi_3.5`.
101
+ - Custom: `custom:<Vietnamese description>`, ≤200 characters after the
102
+ server removes quotes/brackets and turns line breaks into spaces. It only
103
+ changes tone, pace and emotion — the text is still read word for word.
104
+ - Omit `--style` for a natural read. `--speed` does not apply to qimi_3.5 —
105
+ put the speed in `--style` instead.
106
+ - An unknown key, two speeds, two emotions, or a custom text over 200
107
+ characters fails with `invalid_style` **before** any credit is held.
79
108
 
80
109
  ## Cloning a custom voice (optional, for qimi_5/qimi_5.5)
81
110
 
@@ -137,10 +166,10 @@ CLI prints `Lỗi [code]: message`. Common codes:
137
166
 
138
167
  | Code | Meaning | What to do |
139
168
  |---|---|---|
140
- | `invalid_model` | `--model` not one of the 5 keys (e.g. `v3`) | use `qimi_1.5|qimi_2.5|qimi_3|qimi_5|qimi_5.5` |
169
+ | `invalid_model` | `--model` not one of the 6 keys (e.g. `v3`) | use `qimi_1.5|qimi_2.5|qimi_3|qimi_3.5|qimi_5|qimi_5.5` |
141
170
  | `voice_not_found` | bad/unknown `--voice` | re-pick from `qm voices list`; if the name repeats across languages, add `--language` |
142
- | `invalid_style` | `--style` isn't in that voice's `styles` | use the exact label from the `STYLES` column |
143
- | `invalid_speed` | outside 0.5-2.0, or `--speed` used with qimi_1.5/2.5/3 | clamp to range; only pass `--speed` for qimi_5/qimi_5.5 |
171
+ | `invalid_style` | qimi_1.5/2.5/3: `--style` isn't in that voice's `styles`; qimi_3.5: unknown preset key, two speeds/emotions, or `custom:` text over 200 chars | use the exact `STYLES` label; for qimi_3.5 follow "Reading styles" |
172
+ | `invalid_speed` | `--speed` outside 0.5-2.0 on qimi_5/qimi_5.5 (other models ignore `--speed`) | clamp to range; for qimi_3.5 use a speed preset in `--style` |
144
173
  | `char_limit_exceeded` | text longer than the model's char limit | split the text into smaller chunks |
145
174
  | `insufficient_credit` / `negative_balance` | not enough balance | state the exact shortfall and https://quickmagic.vn/pricing |
146
175
  | `rate_limited` / `concurrent_limit` / `busy` | too many requests/jobs right now | wait, then retry |
@@ -159,6 +188,9 @@ qm auth status
159
188
  qm voices list --model qimi_1.5 --language "Tiếng Việt" # qimi_3 has no per-language labels (all "Đa ngôn ngữ (70+)") — omit --language for it
160
189
  qm tts --text "Chào mừng đến với Quick Magic." --voice <voice_id> --model qimi_3 --wait --out ./out
161
190
 
191
+ qm voices list --model qimi_3.5
192
+ qm tts --file ./truyen.txt --voice <voice_id> --model qimi_3.5 --style "slow+storytelling" --wait --out ./out
193
+
162
194
  qm voices list --model qimi_5
163
195
  qm voices clone --audio ./mysample.wav --name "Giọng riêng" --wait
164
196
  qm tts --text "Đọc bằng giọng của tôi." --voice "Giọng riêng" --model qimi_5 --wait --out ./out
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: quickmagic-upscale
3
+ description: >-
4
+ Upscale (sharpen + enlarge) one or more existing images to 2K/4K/8K, or
5
+ denoise/sharpen existing videos, via `qm upscale`. Use when the user wants a
6
+ sharper/higher-resolution version of an existing photo or video — not for
7
+ generating new media, and not for restore/beauty/muscle/color_boost (use
8
+ `quickmagic-edit-image` for those). Triggers: "upscale ảnh lên 4k/8k",
9
+ "phóng to ảnh nét hơn", "nâng độ phân giải ảnh", "upscale image to 4k",
10
+ "sharpen this photo", "upscale video", "làm nét video", "video mờ quá làm
11
+ nét lại", "tăng fps video".
12
+ ---
13
+
14
+ # quickmagic-upscale — Image (2K/4K/8K) + Video Upscale
15
+
16
+ Wraps `qm upscale <image...>`. Takes **one or more existing images or
17
+ videos** and returns a sharper, higher-resolution (or higher-frame-rate)
18
+ version of each — one credit hold and one job per file. Not for restoring
19
+ damage, beauty retouch, muscle enhancement, or color grading
20
+ (`quickmagic-edit-image` handles those tools), and not for generating new
21
+ media from a text prompt (`quickmagic-generate`).
22
+
23
+ ## Command
24
+
25
+ ```
26
+ qm upscale <file...> [--model <m>] [--resolution <r>] [--video] [--crid <id>]
27
+ ```
28
+
29
+ | Flag | Notes |
30
+ |---|---|
31
+ | `<file...>` **required** (positional, 1+) | URL(s) or local file path(s) — repeatable, one job submitted per file |
32
+ | `--model <m>` | Image: `crisp`\|`standard`\|`seedvr2`\|`ultra`. Video: `standard`\|`pro`\|`seedvr2`\|`fps`. Default `standard` (valid for both) |
33
+ | `--resolution <r>` | Image: `2k`\|`4k`\|`8k`, default `4k`. Video: `720p`\|`1080p`\|`2k`\|`4k`, **no CLI default** — omit it and the server picks `1080p` (do NOT pass `4k` "to be safe", it is the most expensive video tier). **Ignored by image `--model crisp`** and **video `--model fps`** (no resolution option); video `--model pro` does not accept `720p` |
34
+ | `--video` | Force every file in this command to be treated as **video** — only needed when a URL hides its extension (e.g. a signed URL); local paths and URLs ending in `.mp4`/`.mov`/`.webm` are auto-detected, no flag needed |
35
+ | `--crid <id>` | idempotency key; the CLI appends `-0`, `-1`, ... per file so retrying the exact same multi-file command is safe |
36
+
37
+ Image model choice (ask the user if unclear, or default to `standard`):
38
+
39
+ | Model | Best for | Notes |
40
+ |---|---|---|
41
+ | `crisp` | quick sharpen, fixed output size | cheapest; does **not** accept `--resolution` |
42
+ | `standard` | general 2K/4K/8K upscale | default |
43
+ | `seedvr2` | best detail retention on faces/text | pricier than `standard` |
44
+ | `ultra` | highest quality, large enlargements | most expensive — confirm cost before running |
45
+
46
+ Video model choice (ask the user if unclear, or default to `standard`):
47
+
48
+ | Model | Resolutions | Best for | Notes |
49
+ |---|---|---|---|
50
+ | `standard` | 720p/1080p/2k/4k | general video upscale | default; wait ≈10× the clip length |
51
+ | `pro` | 1080p/2k/4k (no 720p) | highest-fidelity tier | **slowest**, wait ≈25-30× the clip length |
52
+ | `seedvr2` | 720p/1080p/2k/4k | best detail retention | wait ≈6-27× the clip length (higher resolutions are slower) |
53
+ | `fps` | none (ignores `--resolution`) | double the frame rate | **fastest**, wait ≈2-3× the clip length |
54
+
55
+ Video caps: **300MB / 10 minutes** input. Billing is per second of input,
56
+ rounded up to the next whole second; if that is still below the model
57
+ minimum (`standard`/`seedvr2`: 3s, `pro`/`fps`: 1s) it bills at the minimum
58
+ instead — e.g. a 2s clip on `standard` bills as 3s (30 credits, not 20).
59
+
60
+ ## Before running
61
+
62
+ 1. `qm auth status` → not logged in → `qm auth login`.
63
+ 2. `qm models list --type image` does **not** list upscale pricing (it's a
64
+ separate catalog) — quote credit cost from the table below instead.
65
+
66
+ ## Quote, then confirm
67
+
68
+ **Image** — state the per-image credit cost **× number of images** and get
69
+ confirmation before running — submitting holds credit immediately, one hold
70
+ per image:
71
+
72
+ | Model | Credits/image |
73
+ |---|---|
74
+ | `crisp` | 10 |
75
+ | `standard` | 20 |
76
+ | `seedvr2` | 20 |
77
+ | `ultra` | 116 |
78
+
79
+ **Video** — credits are **per second of input** (not per file); estimate
80
+ from the clip's duration (`ffprobe`, or ask the user): round the seconds up
81
+ to the next whole second, floor that at the model's minimum (`standard`/
82
+ `seedvr2`: 3s, `pro`/`fps`: 1s), then × the rate below — confirm the result
83
+ before running (do not quote a lower number for clips under the minimum):
84
+
85
+ | Model | 720p | 1080p | 2k | 4k |
86
+ |---|---|---|---|---|
87
+ | `standard` | 10 | 10 | 20 | 39 |
88
+ | `pro` | — (unsupported) | 14 | 28 | 56 |
89
+ | `seedvr2` | 39 | 77 | 96 | 116 |
90
+ | `fps` | 16 (flat, no resolution) | | | |
91
+
92
+ ## Run + track
93
+
94
+ No `--wait` flag. The CLI prints one job hint per file
95
+ (`→ Theo dõi: quickmagic jobs get ups_5` for images, `vup_5` for videos);
96
+ collect every id from the output, then `qm jobs wait <id> --out ./out` for
97
+ each — single `result_url` per job, `--out` auto-downloads. Video processing
98
+ is slow (see per-model wait multipliers above) — a `processing` status
99
+ (including while the finished file is still being saved) is normal, keep
100
+ waiting, do not resubmit. Report every final URL + total `credits_charged`.
101
+ Result files follow the account plan retention (free plan: 5 days —
102
+ download promptly; paid plans: long-term).
103
+
104
+ ## Errors
105
+
106
+ `Không đủ credit: ...` → state shortfall + https://quickmagic.vn/pricing.
107
+ Any other failure prints `Lỗi: <message>` and stops the whole command (a
108
+ prior file's job may already be submitted/charged — check with
109
+ `qm jobs get ups_<n>` / `qm jobs get vup_<n>` before retrying that one
110
+ file). Full reference: `quickmagic-account` skill.
111
+
112
+ ## Example
113
+
114
+ ```bash
115
+ qm upscale ./old-photo.jpg --model standard --resolution 4k
116
+ qm upscale ./a.jpg ./b.jpg ./c.jpg --model seedvr2 --resolution 8k
117
+ qm jobs wait ups_5 --out ./out
118
+
119
+ qm upscale ./clip.mp4 --model standard --resolution 1080p
120
+ qm upscale https://files.quickmagic.cloud/media-tools/clip.mp4 --model fps
121
+ qm jobs wait vup_12 --out ./out
122
+ ```
@@ -0,0 +1,76 @@
1
+ // commands/apps.js — Ứng dụng React SSR trên <slug>.quickmagic.app (Apps đợt B): create / list / status / deploy / publish / remove.
2
+ // KHÔNG có `apps db` / `apps secrets` (bề mặt nhạy cảm — chỉ agent qua MCP). repo-access in clone_url ra stdout theo yêu cầu tường minh.
3
+ const api = require('../api');
4
+
5
+ const SLEEP = (ms) => new Promise((r) => setTimeout(r, ms));
6
+
7
+ function printApp(a) {
8
+ console.log(`${a.title || '(chưa tên)'} [${a.id}]`);
9
+ console.log(` URL: ${a.url || '—'}`);
10
+ console.log(` Deploy: ${a.deploy_status || '—'}${a.last_build ? ` (build #${a.last_build.id} ${a.last_build.status}${a.last_build.error_code ? ' ' + a.last_build.error_code : ''})` : ''}`);
11
+ console.log(` Duyệt: ${a.review_status || '—'} · công khai: ${a.is_public ? 'có' : 'không'} · cover: ${a.thumb_url ? 'có' : 'chưa'} · DB: ${a.has_db ? 'có' : 'không'}`);
12
+ if (a.has_unbuilt_commits) console.log(' ⚠️ Có commit chưa deploy — chạy: qm apps deploy <app_id>');
13
+ if (a.last_build && a.last_build.error_text) console.log(` Lỗi build: ${String(a.last_build.error_text).slice(0, 300)}`);
14
+ }
15
+
16
+ async function create(options) {
17
+ const body = { title: options.title, subdomain: options.subdomain, category: options.category, description: options.description };
18
+ if (options.from) body.from_app_id = options.from;
19
+ const data = await api.call('POST', '/apps', { body });
20
+ console.log(`Đã tạo app ${data.id}${data.remixed_from ? ` (remix từ "${data.remixed_from.title}")` : ''}`);
21
+ printApp(data);
22
+ console.log('Tiếp: qm apps repo-access <app_id> → git clone → sửa → push → qm apps deploy <app_id>');
23
+ }
24
+ async function list() {
25
+ const data = await api.call('GET', '/apps');
26
+ const apps = data.apps || [];
27
+ if (!apps.length) { console.log('Chưa có app nào. Tạo: qm apps create --title "Tên app"'); return; }
28
+ const id_w = 36, slug_w = Math.max(4, ...apps.map((a) => String(a.slug || '').length));
29
+ console.log(`${'APP_ID'.padEnd(id_w)} ${'SLUG'.padEnd(slug_w)} DEPLOY DUYỆT PUBLIC TITLE`);
30
+ for (const a of apps) console.log(`${a.id.padEnd(id_w)} ${String(a.slug || '').padEnd(slug_w)} ${String(a.deploy_status || '').padEnd(9)} ${String(a.review_status || '').padEnd(8)} ${a.is_public ? 'có ' : 'không'} ${a.title || ''}`);
31
+ }
32
+ async function status(app_id, options) {
33
+ const data = await api.call('GET', `/apps/${encodeURIComponent(app_id)}`);
34
+ if (options && options.json) { console.log(JSON.stringify(data, null, 2)); return; }
35
+ printApp(data);
36
+ }
37
+ async function repoAccess(app_id) {
38
+ const data = await api.call('POST', `/apps/${encodeURIComponent(app_id)}/repo-access`, { body: {} });
39
+ // In clone_url có token TTL 15' — người dùng CLI chủ động xin, KHÔNG log ở nơi khác.
40
+ console.log(`Quyền push repo (hết hạn ${data.expires_at}):`);
41
+ console.log(data.clone_url);
42
+ console.log(`git clone ${data.clone_url} app && cd app`);
43
+ }
44
+ async function deploy(app_id, options) {
45
+ const data = await api.call('POST', `/apps/${encodeURIComponent(app_id)}/deploy`, { body: {} });
46
+ console.log(`Đã xếp hàng build #${data.build_id} → ${data.url}`);
47
+ if (!options || !options.wait) { console.log('Theo dõi: qm apps status <app_id>'); return; }
48
+ for (let i = 0; i < 60; i++) {
49
+ await SLEEP(5000);
50
+ const s = await api.call('GET', `/apps/${encodeURIComponent(app_id)}`);
51
+ const b = s.last_build;
52
+ if (b && String(b.id) === String(data.build_id) && ['succeeded', 'failed'].includes(b.status)) {
53
+ if (b.status === 'succeeded') { console.log(`✅ Deploy xong (${Math.round((b.duration_ms || 0) / 1000)}s): ${s.url}`); return; }
54
+ console.error(`❌ Build thất bại (${b.error_code || 'lỗi'}): ${String(b.error_text || '').slice(0, 400)}`); process.exit(1);
55
+ }
56
+ process.stdout.write(` … ${b ? b.step || b.status : 'queued'}\r`);
57
+ }
58
+ console.error('Hết 5 phút chưa xong — kiểm: qm apps status <app_id>'); process.exit(1);
59
+ }
60
+ async function publish(app_id, options) {
61
+ try {
62
+ const data = await api.call('POST', `/apps/${encodeURIComponent(app_id)}/publish`, { body: { is_public: !(options && options.unlist) } });
63
+ console.log(data.is_public ? `✅ Đã công khai lên feed Ứng dụng: ${data.url}` : 'Đã gỡ khỏi feed (link trực tiếp vẫn hoạt động).');
64
+ } catch (e) {
65
+ const m = String(e.message || '');
66
+ if (/APP_REVIEW_PENDING|chờ duyệt/.test(m)) { console.log('⏳ App đang chờ duyệt nội dung (app đầu tiên của tài khoản được duyệt tay). Link trực tiếp vẫn dùng được.'); return; }
67
+ throw e;
68
+ }
69
+ }
70
+ async function remove(app_id, options) {
71
+ if (!options || !options.yes) { console.error('Xoá VĨNH VIỄN app (Worker + DB + repo, subdomain khoá mãi). Xác nhận bằng --yes.'); process.exit(1); }
72
+ const data = await api.call('DELETE', `/apps/${encodeURIComponent(app_id)}`);
73
+ console.log(`Đã xoá app ${data.slug || app_id}.`);
74
+ }
75
+
76
+ module.exports = { create, list, status, repoAccess, deploy, publish, remove };
@@ -12,7 +12,9 @@ const jobHint = (data) => {
12
12
  const id = data.job_id || (Array.isArray(data.job_ids) && data.job_ids[0]);
13
13
  if (id) console.log(`\n→ Theo dõi: quickmagic jobs get ${id}`);
14
14
  };
15
- const run = (fn) => (...a) => fn(...a).catch((e) => { console.error('Lỗi:', e.message); process.exit(1); });
15
+ // [code-review-p03.md L8] api.js#call gán e.code = json.code (REST giữ nguyên code cho mục đích này) —
16
+ // bản cũ chỉ in message, script/agent đọc stderr KHÔNG phân biệt được 'feature_disabled' với lỗi khác.
17
+ const run = (fn) => (...a) => fn(...a).catch((e) => { console.error('Lỗi:', e.code ? `[${e.code}] ${e.message}` : e.message); process.exit(1); });
16
18
 
17
19
  // ── Nhập liệu (không tốn credit) ──
18
20
  const scrape = run(async (url) => out(await call('POST', '/scrape', { body: { url } })));
@@ -29,7 +31,39 @@ const product = run(async (o) => jobHint(await call('POST', '/product/images', {
29
31
  const fashion = run(async (o) => jobHint(await call('POST', '/fashion/images', { body: { mode: o.mode, outfit_ids: (o.outfit || []).map(Number), kol_kind: o.kolKind, kol_id: o.kolId ? Number(o.kolId) : undefined, model: o.model, client_request_id: o.crid } })));
30
32
 
31
33
  // ── Ảnh ──
32
- const edit = run(async (image, o) => jobHint(await call('POST', '/edit', { body: { image: await rmi(image), tool: o.tool, model: o.model, upscale_target: o.upscaleTarget, style: o.style, client_request_id: o.crid } })));
34
+ const edit = run(async (image, o) => jobHint(await call('POST', '/edit', { body: { image: await rmi(image), tool: o.tool, model: o.model, style: o.style, client_request_id: o.crid } })));
35
+ // [260825, plans/260825-1344-upscale-studio-hf-clone P04] 1 lệnh CLI = N file = N job (mỗi file 1
36
+ // job/hold riêng, REST /upscale(-video) chỉ nhận 1 file/call). --crid dùng CHUNG y nguyên cho cả vòng
37
+ // lặp sẽ khiến BE coi file 2+ TRÙNG file 1 (idempotency theo client_request_id) → chỉ file đầu có job
38
+ // thật, các file sau lặng lẽ trả về CÙNG job đó (thiếu file, không lỗi rõ ràng) — hậu tố `-${i}` cho
39
+ // mỗi file 1 khoá riêng, vẫn giữ được idempotency khi retry NGUYÊN LỆNH (cùng --crid, cùng thứ tự file).
40
+ //
41
+ // [260826, plans/260826-1200-upscale-video-hf-clone-byteplus-vcube P03] mở rộng ẢNH → VIDEO cùng lệnh:
42
+ // --video ép mọi file coi là video; không truyền thì tự nhận theo đuôi .mp4/.mov/.webm (KHÔNG .m4v —
43
+ // media.js/get_upload_url không có mime cho đuôi này). data:video/ hoặc data:image/ (file ≤64KB đã
44
+ // inline) tự nhận theo mime, KHÔNG cần đuôi.
45
+ const VIDEO_EXT_RE = /\.(mp4|mov|webm)(\?.*)?$/i;
46
+ function looksLikeVideo(ref) {
47
+ if (/^data:video\//i.test(ref)) return true;
48
+ if (/^data:image\//i.test(ref)) return false;
49
+ if (/^https?:\/\//i.test(ref)) {
50
+ try { return VIDEO_EXT_RE.test(new URL(ref).pathname); } catch { return false; }
51
+ }
52
+ return VIDEO_EXT_RE.test(ref);
53
+ }
54
+ const upscale = run(async (files, o) => {
55
+ for (const [i, f] of files.entries()) { // LẶP — không phải files[0]
56
+ const crid = o.crid ? `${o.crid}-${i}` : undefined;
57
+ const is_video = !!o.video || looksLikeVideo(f);
58
+ // [code-review-p03.md H3] --resolution KHÔNG còn default ở commander (index.js). Ảnh: giữ default
59
+ // '4k' CŨ (P04, chỉ áp khi user không truyền). Video: KHÔNG tự thêm default — để trống thì server
60
+ // (createMediaJobs) tự chọn default_resolution 1080p, tránh CLI âm thầm gửi bậc giá đắt nhất.
61
+ const res = is_video
62
+ ? await call('POST', '/upscale-video', { body: { video: await rmi(f), model: o.model, resolution: o.resolution, client_request_id: crid } })
63
+ : await call('POST', '/upscale', { body: { image: await rmi(f), model: o.model, resolution: o.resolution || '4k', client_request_id: crid } });
64
+ jobHint(res); // in job_id từng file
65
+ }
66
+ });
33
67
  const tryon = run(async (o) => jobHint(await call('POST', '/tryon', { body: { type: o.type, model: o.model, model_image: await rmi(o.model_image), garment_image: await rmi(o.garment), upper_image: await rmi(o.upper), lower_image: await rmi(o.lower), background_image: await rmi(o.background), prompt: o.prompt, client_request_id: o.crid } })));
34
68
 
35
69
  // ── Video nặng / audio ──
@@ -43,4 +77,4 @@ const cutout = run(async (o) => jobHint(await call('POST', '/cutout', { body: {
43
77
  const hookPresets = run(async () => out(await call('GET', '/hook/presets')));
44
78
  const hookVideo = run(async (o) => jobHint(await call('POST', '/hook/videos', { body: { preset_id: o.preset, character_url: await rmi(o.character), product_url: await rmi(o.product), aspect: o.aspect, speech_lang: o.speechLang, custom_cta: o.cta, location_url: o.location, accessory_url: o.accessory, style: o.style, format: o.format, resolution: o.resolution, client_request_id: o.crid } })));
45
79
 
46
- module.exports = { scrape, importSocial, assets, analyze, marketingModes, marketingVideo, product, fashion, edit, tryon, stt, subtitle, split, motion, cutout, hookPresets, hookVideo };
80
+ module.exports = { scrape, importSocial, assets, analyze, marketingModes, marketingVideo, product, fashion, edit, upscale, tryon, stt, subtitle, split, motion, cutout, hookPresets, hookVideo };
@@ -66,6 +66,8 @@ const voicesList = run(async (o) => {
66
66
  const data = await call('GET', `/voices${buildQuery({ model: o.model, language: o.language, search: o.search, limit: o.limit })}`);
67
67
  const pricing = data.pricing || {}; // [review C4] BE lỗi/shape cũ → không crash, in được phần còn lại
68
68
  printPricing(pricing);
69
+ // qimi_3.5: server builds this hint from its own preset list — print it verbatim instead of hard-coding keys here.
70
+ if (data.style_hint) console.log(data.style_hint);
69
71
  if (pricing.billing === 'per_char') {
70
72
  if (data.clone_price != null) console.log(`Giá clone giọng riêng: ${data.clone_price} credit`);
71
73
  // [review C2] false có 2 nghĩa: (a) đã dùng suất, (b) chưa có gói trả phí active (BE trả first_free_upsell=true).
@@ -93,7 +95,12 @@ const voicesList = run(async (o) => {
93
95
  }
94
96
  if (systems.length) {
95
97
  console.log('Giọng hệ thống:');
96
- printTable(['VOICE', 'NAME', 'NAME_EN', 'GENDER', 'LANGUAGE'], systems.map((v) => [v.voice, v.name, v.name_en, v.gender, v.language]));
98
+ // qimi_3.5 system voices (the qimi_3 catalog) have no English name — drop the empty column.
99
+ const has_en = systems.some((v) => v.name_en);
100
+ printTable(
101
+ has_en ? ['VOICE', 'NAME', 'NAME_EN', 'GENDER', 'LANGUAGE'] : ['VOICE', 'NAME', 'GENDER', 'LANGUAGE'],
102
+ systems.map((v) => (has_en ? [v.voice, v.name, v.name_en, v.gender, v.language] : [v.voice, v.name, v.gender, v.language])),
103
+ );
97
104
  }
98
105
  }
99
106
  console.log(`\nNgôn ngữ: ${(data.languages || []).join(' · ')}`);
package/src/index.js CHANGED
@@ -11,6 +11,7 @@ const credits = require('./commands/credits');
11
11
  const tools = require('./commands/tools');
12
12
  const voice = require('./commands/voice');
13
13
  const music = require('./commands/music');
14
+ const apps = require('./commands/apps');
14
15
 
15
16
  const collect = (v, acc) => { acc.push(v); return acc; };
16
17
 
@@ -130,9 +131,22 @@ program.command('fashion').description('Tạo ảnh thời trang AI')
130
131
  .action(tools.fashion);
131
132
 
132
133
  // ── Ảnh ────────────────────────────────────────────────────────────────────────
133
- program.command('edit <image>').description('Sửa ảnh: restore/upscale/beauty/muscle/color_boost')
134
+ program.command('edit <image>').description('Sửa ảnh: restore/beauty/muscle/color_boost (upscale → dùng lệnh `qm upscale`)')
134
135
  .requiredOption('--tool <t>').option('--model <m>', 'qimi_2.5|qimi_3', 'qimi_3')
135
- .option('--upscale-target <t>', '2k|4k').option('--style <s...>').option('--crid <id>').action(tools.edit);
136
+ .option('--style <s...>').option('--crid <id>').action(tools.edit);
137
+ // [260826, plans/260826-1200-upscale-video-hf-clone-byteplus-vcube P03] mở rộng ẢNH → VIDEO cùng lệnh
138
+ // (giữ nguyên tên arg <image...> — đã pin cứng trong test BE mcp-upscale-wiring.test.js). Video tự
139
+ // nhận theo đuôi .mp4/.mov/.webm (KHÔNG .m4v — media.js/get_upload_url không có mime cho đuôi này),
140
+ // hoặc ép bằng --video khi URL không lộ đuôi (vd link ký chữ ký).
141
+ program.command('upscale <image...>').description('Upscale ảnh (crisp|standard|seedvr2|ultra) hoặc video (standard|pro|seedvr2|fps) — 1 lệnh nhiều file = mỗi file 1 job. File video: .mp4/.mov/.webm, tự nhận theo đuôi hoặc ép bằng --video')
142
+ .option('--model <m>', 'Ảnh: crisp|standard|seedvr2|ultra — Video: standard|pro|seedvr2|fps', 'standard')
143
+ // [code-review-p03.md H3] KHÔNG đặt default ở đây — default '4k' hợp lý cho ẢNH (giữ nguyên hành vi
144
+ // cũ P04) nhưng SAI cho VIDEO (server default là 1080p, rẻ hơn 4k standard 3.9×). Default lệch theo
145
+ // media_type xử lý TRONG tools.upscale (ảnh mới rơi về '4k' khi không truyền; video để trống, server tự chọn).
146
+ .option('--resolution <r>', 'Ảnh: 2k|4k|8k, mặc định 4k (bỏ qua crisp) — Video: 720p|1080p|2k|4k, mặc định 1080p do server chọn khi không truyền (bỏ qua fps, pro không nhận 720p)')
147
+ .option('--video', 'Ép MỌI file trong lệnh này là VIDEO (mặc định tự nhận theo đuôi .mp4/.mov/.webm)')
148
+ .option('--crid <id>', 'client_request_id (tự thêm hậu tố theo từng file)')
149
+ .action(tools.upscale);
136
150
  program.command('tryon').description('Thử đồ ảo (virtual try-on)')
137
151
  .requiredOption('--model-image <img>', 'Ảnh người mẫu (URL/base64)')
138
152
  .option('--type <t>', 'full|upper', 'full').option('--model <m>', 'qimi_1.5|qimi_2.5|qimi_3', 'qimi_3')
@@ -150,28 +164,46 @@ program.command('motion <video_url>').description('Áp chuyển động video v
150
164
  .requiredOption('--image <url...>', 'Ảnh áp motion (1-20)')
151
165
  .option('--model <m>').option('--mode <m>', 'standard|professional').option('--prompt <p>').option('--crid <id>').action(tools.motion);
152
166
 
167
+ // ── Media-tools mở rộng [260902] — cùng kho model Spaces "Bàn Sáng Tạo" ─────
168
+ program.command('sfx <prompt>').description('Tạo hiệu ứng âm thanh từ mô tả (whoosh/nổ/mưa/bước chân…)')
169
+ .option('--model <m>', 'sfx-lite (mặc định) | sfx-pro').option('--duration <s>', 'Giây: lite 3/5/10/15/30, pro 3/5/10/15 (mặc định 5)').option('--crid <id>').action(tools.sfx);
170
+ program.command('remove-bg <image>').description('Tách nền ảnh → PNG trong suốt')
171
+ .option('--crid <id>').action(tools.removeBg);
172
+ const t3d = program.command('3d').description('Model 3D (.glb): tạo từ ảnh/mô tả + hoạt hình');
173
+ t3d.command('create').description('Tạo model 3D từ ảnh hoặc mô tả')
174
+ .option('--image <i>', 'Ảnh tham chiếu (file/URL)').option('--prompt <p>', 'Mô tả model')
175
+ .option('--model <m>', 'tripo-v3 (mặc định) | tripo-v2-5').option('--texture <t>', 'standard | textureless').option('--crid <id>').action(tools.gen3d);
176
+ t3d.command('animate <model_url>').description('Hoạt hình model 3D đã tạo (rig + preset chuyển động)')
177
+ .option('--preset <p>', 'Tên preset (vd dance_01, wave_goodbye_01)').option('--crid <id>').action(tools.animate3d);
178
+ program.command('talking-photo').description('Ảnh chân dung + audio → video nói chuyện (khớp môi)')
179
+ .requiredOption('--image <i>', 'Ảnh chân dung (file/URL)').requiredOption('--audio <url>', 'Audio giọng nói (vd kết quả qm tts)')
180
+ .option('--model <m>', 'talk-fast (mặc định) | talk-standard').option('--resolution <r>', '480p | 720p (talk-standard)').option('--prompt <p>', 'Gợi ý biểu cảm').option('--crid <id>').action(tools.talkingPhoto);
181
+ program.command('extend-video <video_url>').description('Kéo dài video — sinh tiếp N giây sau khung cuối')
182
+ .requiredOption('--duration <s>', 'Giây đoạn mới: wan 3-10, seedance 4-15')
183
+ .option('--model <m>', 'vext-wan-2-5 (mặc định) | vext-seedance-2-0').option('--resolution <r>', '480p/720p/1080p (+4k seedance)').option('--prompt <p>', 'Điều xảy ra tiếp theo').option('--crid <id>').action(tools.extendVideo);
184
+
153
185
  // ── TTS / Voices ─────────────────────────────────────────────────────────────
154
186
  program
155
187
  .command('tts')
156
- .description('Chuyển văn bản → giọng nói (5 engine qimi_1.5/2.5/3/5/5.5)')
188
+ .description('Chuyển văn bản → giọng nói (6 engine qimi_1.5/2.5/3/3.5/5/5.5)')
157
189
  .option('--text <t>', 'Văn bản cần đọc')
158
190
  .option('--file <path>', 'Đọc văn bản từ file local (thay --text)')
159
- .option('--model <m>', 'qimi_1.5|qimi_2.5|qimi_3|qimi_5|qimi_5.5', 'qimi_3')
191
+ .option('--model <m>', 'qimi_1.5|qimi_2.5|qimi_3|qimi_3.5|qimi_5|qimi_5.5 (qimi_3.5: giọng qimi_3, giá cố định mỗi lần — xem giá ở qm voices list --model qimi_3.5, tối đa 30.000 ký tự)', 'qimi_3')
160
192
  .requiredOption('--voice <v>', 'Tên giọng — xem cột VOICE của qm voices list')
161
193
  .option('--language <l>', 'Ngôn ngữ — phân biệt giọng trùng tên (xem qm voices list)')
162
- .option('--speed <n>', 'Tốc độ đọc 0.5-2.0 (mặc định 1) — CHỈ qimi_5/qimi_5.5')
163
- .option('--style <s>', 'Phong cách đọc — nhãn từ cột STYLES của qm voices list')
194
+ .option('--speed <n>', 'Tốc độ đọc 0.5-2.0 (mặc định 1) — CHỈ qimi_5/qimi_5.5 (qimi_3.5: chỉnh tốc độ bằng --style)')
195
+ .option('--style <s>', 'Kiểu đọc. qimi_1.5/2.5/3: nhãn cột STYLES của qm voices list. qimi_3.5: tối đa 1 tốc độ (fast|default|slow) + 1 cảm xúc (cheerful|sad|storytelling|emotional) nối bằng "+", vd "slow+storytelling"; hoặc tự mô tả tiếng Việt "custom:<mô tả ≤200 ký tự>" — danh sách mới nhất: qm voices list --model qimi_3.5')
164
196
  .option('--title <t>', 'Tiêu đề job')
165
197
  .option('--crid <id>', 'client_request_id')
166
198
  .option('--wait', 'Chờ tới khi job hoàn tất')
167
- .option('--out <dir>', 'Thư mục lưu file mp3 (dùng kèm --wait)')
199
+ .option('--out <dir>', 'Thư mục lưu file audio mp3/wav (dùng kèm --wait)')
168
200
  .action(voice.tts);
169
201
 
170
202
  const voices_cmd = program.command('voices').description('Giọng đọc: catalog + giọng clone của bạn');
171
203
  voices_cmd
172
204
  .command('list')
173
- .description('Liệt kê giọng theo model')
174
- .requiredOption('--model <m>', 'qimi_1.5|qimi_2.5|qimi_3|qimi_5|qimi_5.5')
205
+ .description('Liệt kê giọng theo model (+ giá, và gợi ý kiểu đọc với qimi_3.5)')
206
+ .requiredOption('--model <m>', 'qimi_1.5|qimi_2.5|qimi_3|qimi_3.5|qimi_5|qimi_5.5')
175
207
  .option('--language <l>', 'Lọc theo ngôn ngữ')
176
208
  .option('--search <s>', 'Lọc theo tên (không phân biệt hoa/thường)')
177
209
  .option('--limit <n>', 'Số lượng tối đa (mặc định 50, trần 100)')
@@ -256,6 +288,20 @@ hook_cmd
256
288
  .option('--crid <id>', 'client_request_id')
257
289
  .action(tools.hookVideo);
258
290
 
291
+ // ── apps (Ứng dụng React SSR trên <slug>.quickmagic.app — Apps đợt B) ─────────
292
+ const apps_cmd = program.command('apps').description('Ứng dụng web đầy đủ (React SSR, subdomain riêng, Sign in with Quick Magic)');
293
+ apps_cmd.command('create').description('Tạo app mới (repo từ template) — cần duyệt nếu gọi từ agent')
294
+ .requiredOption('--title <t>', 'Tên app').option('--subdomain <s>', 'Subdomain mong muốn (tự thêm hậu tố 4 ký tự)')
295
+ .option('--category <c>', 'Danh mục').option('--description <d>', 'Mô tả 1 câu')
296
+ .option('--from <app_id>', 'Remix: chép mã nguồn app công khai đã duyệt (không chép secrets/DB/cover)')
297
+ .action(apps.create);
298
+ apps_cmd.command('list').description('Liệt kê app của tôi').action(apps.list);
299
+ apps_cmd.command('status <app_id>').description('Trạng thái deploy/duyệt/build gần nhất').option('--json', 'In JSON').action(apps.status);
300
+ apps_cmd.command('repo-access <app_id>').description('Lấy URL git clone có token 15 phút (in ra stdout)').action(apps.repoAccess);
301
+ apps_cmd.command('deploy <app_id>').description('Build + deploy nhánh main').option('--wait', 'Chờ tới khi xong (≤5 phút)').action(apps.deploy);
302
+ apps_cmd.command('publish <app_id>').description('Đưa lên feed Ứng dụng (cần deployed + cover; tự kiểm duyệt nội dung)').option('--unlist', 'Gỡ khỏi feed').action(apps.publish);
303
+ apps_cmd.command('remove <app_id>').description('Xoá vĩnh viễn app').option('--yes', 'Xác nhận').action(apps.remove);
304
+
259
305
  program.parseAsync(process.argv).catch((e) => {
260
306
  console.error('Lỗi:', e.message);
261
307
  process.exit(1);