quickmagic-cli 1.0.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/LICENSE +21 -0
- package/README.md +337 -0
- package/package.json +54 -0
- package/skills/README.md +67 -0
- package/skills/quickmagic-account/SKILL.md +137 -0
- package/skills/quickmagic-cutout/SKILL.md +72 -0
- package/skills/quickmagic-edit-image/SKILL.md +69 -0
- package/skills/quickmagic-fashion/SKILL.md +95 -0
- package/skills/quickmagic-generate/SKILL.md +114 -0
- package/skills/quickmagic-hook-video/SKILL.md +100 -0
- package/skills/quickmagic-product-photoshoot/SKILL.md +91 -0
- package/skills/quickmagic-subtitle-split/SKILL.md +87 -0
- package/src/api.js +77 -0
- package/src/commands/auth.js +32 -0
- package/src/commands/credits.js +19 -0
- package/src/commands/generate.js +70 -0
- package/src/commands/jobs.js +69 -0
- package/src/commands/models.js +46 -0
- package/src/commands/tools.js +41 -0
- package/src/config.js +77 -0
- package/src/index.js +162 -0
- package/src/oauth.js +169 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quickmagic-cutout
|
|
3
|
+
description: >-
|
|
4
|
+
Create a transparent-background PNG cutout of a product/subject, or
|
|
5
|
+
reinterpret a product photo into a new scene, via `qm cutout` (operations:
|
|
6
|
+
generate, from_ref, remix_describe). Triggers: "remove background", "tách
|
|
7
|
+
nền ảnh", "xoá phông sản phẩm", "ảnh PNG trong suốt", "product cutout", "đổi
|
|
8
|
+
bối cảnh ảnh sản phẩm".
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# quickmagic-cutout — Transparent Cutout / Scene Remix
|
|
12
|
+
|
|
13
|
+
Wraps `qm cutout`. Three operations — pick the right one:
|
|
14
|
+
|
|
15
|
+
| Operation | What it does | Needs |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `from_ref` (default) | Keep the subject from 1-5 reference images, isolate it on a **transparent background** | `--ref` (1-5) |
|
|
18
|
+
| `generate` | Pure text-to-image, no reference | `--prompt` (required) |
|
|
19
|
+
| `remix_describe` | Freely reinterpret **only the first** reference image per your prompt (+3 credit vision fee); background stays only if `--no-transparent-bg` | `--ref` (uses only `--ref[0]`), `--prompt` optional |
|
|
20
|
+
|
|
21
|
+
## Command
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
qm cutout [--operation generate|from_ref|remix_describe] [--ref <r...>] [--prompt <p>] [--model <m>] [--aspect-ratio <r>] [--quality <q>] [--n <n>] [--no-transparent-bg] [--crid <id>]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Flag | Notes |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `--operation` | default `from_ref` |
|
|
30
|
+
| `--ref <r...>` | URL or local file, repeatable, max 5; required for `from_ref`/`remix_describe` |
|
|
31
|
+
| `--prompt <p>` | required when `--operation generate`; optional extra instruction otherwise (max 4000 chars) |
|
|
32
|
+
| `--model <m>` | default `nano-banana-2` — recommended for accurate transparent backgrounds; check `qm models list --type image` for alternatives/price |
|
|
33
|
+
| `--n <n>` | number of images, 1-6, default 1 |
|
|
34
|
+
| `--no-transparent-bg` | only meaningful with `remix_describe` — keeps the original scene instead of cutting it out |
|
|
35
|
+
|
|
36
|
+
## Before running
|
|
37
|
+
|
|
38
|
+
1. `qm auth status` → not logged in → `qm auth login`.
|
|
39
|
+
2. If the user hasn't supplied an image yet: `qm scrape <url>` or `qm import
|
|
40
|
+
<url>` can fetch one (free), or `qm assets products` for an existing library
|
|
41
|
+
item's image URL.
|
|
42
|
+
3. `qm models list --type image` for the `--model`'s credit price.
|
|
43
|
+
|
|
44
|
+
## Quote, then confirm
|
|
45
|
+
|
|
46
|
+
Estimated cost = model credit price × `--n`. State it and get confirmation
|
|
47
|
+
before running (this holds credit immediately), e.g. "nano-banana-2, 3cr/ảnh ×
|
|
48
|
+
2 ảnh = 6cr, số dư Ycr — xác nhận?".
|
|
49
|
+
|
|
50
|
+
## Run + track
|
|
51
|
+
|
|
52
|
+
No `--wait` flag. The command prints raw JSON plus a hint:
|
|
53
|
+
`→ Theo dõi: quickmagic jobs get cut_<batch>`. This job type returns an
|
|
54
|
+
**array of images**, so `qm jobs wait cut_... --out ./out` will poll status
|
|
55
|
+
correctly but **won't auto-download**. Once `completed`, run
|
|
56
|
+
`qm jobs get cut_...` and read `images[]` (`{status, result_url, operation}`) —
|
|
57
|
+
report each `result_url`.
|
|
58
|
+
|
|
59
|
+
## Errors
|
|
60
|
+
|
|
61
|
+
`Không đủ credit: ...` → state the shortfall + https://quickmagic.vn/pricing.
|
|
62
|
+
Missing `--prompt` on `generate`, or missing `--ref` on `from_ref`/
|
|
63
|
+
`remix_describe`, surfaces as a plain `Lỗi: <message>` — fix the flag and
|
|
64
|
+
retry. Full reference: `quickmagic-account` skill.
|
|
65
|
+
|
|
66
|
+
## Example
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
qm cutout --operation from_ref --ref ./product-photo.jpg --model nano-banana-2 --n 2
|
|
70
|
+
qm jobs wait cut_1737000000abc --out ./out
|
|
71
|
+
qm jobs get cut_1737000000abc
|
|
72
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quickmagic-edit-image
|
|
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".
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# quickmagic-edit-image — Photo Restore / Upscale / Retouch
|
|
12
|
+
|
|
13
|
+
Wraps `qm edit <image>`. Edits **one existing image** in place — restoring
|
|
14
|
+
damage, upscaling resolution, beauty retouch, muscle enhancement, or color
|
|
15
|
+
grading. Not for generating a new image from a text prompt (use
|
|
16
|
+
`quickmagic-generate` for that).
|
|
17
|
+
|
|
18
|
+
## Command
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
qm edit <image> --tool <t> [--model qimi_2.5|qimi_3] [--upscale-target 2k|4k] [--style <s...>] [--crid <id>]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| Flag | Notes |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `<image>` **required** (positional) | URL or local file path |
|
|
27
|
+
| `--tool <t>` **required** | one of `restore` \| `upscale` \| `beauty` \| `muscle` \| `color_boost` |
|
|
28
|
+
| `--model` | `qimi_2.5` or `qimi_3` (default `qimi_3`) |
|
|
29
|
+
| `--upscale-target` | **required when `--tool upscale`** — `2k` or `4k` |
|
|
30
|
+
| `--style <s...>` | **required when `--tool beauty`** — up to 3 style keywords, repeatable flag |
|
|
31
|
+
| `--crid <id>` | idempotency key |
|
|
32
|
+
|
|
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`.
|
|
37
|
+
|
|
38
|
+
## Before running
|
|
39
|
+
|
|
40
|
+
1. `qm auth status` → not logged in → `qm auth login`.
|
|
41
|
+
2. `qm models list --type image` for `qimi_2.5`/`qimi_3` credit price.
|
|
42
|
+
|
|
43
|
+
## Quote, then confirm
|
|
44
|
+
|
|
45
|
+
State the model's per-image credit cost and get confirmation before running —
|
|
46
|
+
submitting holds credit immediately.
|
|
47
|
+
|
|
48
|
+
## Run + track
|
|
49
|
+
|
|
50
|
+
No `--wait` flag. Copy the job id from the hint
|
|
51
|
+
(`→ Theo dõi: quickmagic jobs get edt_3`), then `qm jobs wait edt_3 --out ./out`
|
|
52
|
+
— single `result_url`, `--out` auto-downloads. Report the final URL +
|
|
53
|
+
`credits_charged`.
|
|
54
|
+
|
|
55
|
+
## Errors
|
|
56
|
+
|
|
57
|
+
`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:
|
|
60
|
+
`quickmagic-account` skill.
|
|
61
|
+
|
|
62
|
+
## Example
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
qm edit ./old-photo.jpg --tool restore --model qimi_3
|
|
66
|
+
qm edit ./portrait.jpg --tool upscale --upscale-target 4k
|
|
67
|
+
qm edit ./selfie.jpg --tool beauty --style smooth-skin soft-light
|
|
68
|
+
qm jobs wait edt_3 --out ./out
|
|
69
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quickmagic-fashion
|
|
3
|
+
description: >-
|
|
4
|
+
Generate fashion photos via `qm fashion` (outfit lookbook/pose shoots on a
|
|
5
|
+
KOL avatar or outfit-only) and `qm tryon` (virtual try-on of a garment onto
|
|
6
|
+
a specific model/person photo). Picks the right command based on whether
|
|
7
|
+
the user supplies a person photo to dress. Triggers: "virtual try-on", "thử
|
|
8
|
+
đồ ảo", "mặc thử quần áo", "lookbook thời trang", "ảnh KOL mặc outfit", "try
|
|
9
|
+
on this dress".
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# quickmagic-fashion — Fashion & Virtual Try-On
|
|
13
|
+
|
|
14
|
+
Two related but distinct commands — pick the right one first:
|
|
15
|
+
|
|
16
|
+
| User wants... | Command |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Put a garment on a **specific person photo** they provide (try-on / OOTD / fit-check) | `qm tryon` |
|
|
19
|
+
| A styled **lookbook/pose shoot** of outfit(s) from the wardrobe library, optionally on a KOL/avatar | `qm fashion` |
|
|
20
|
+
|
|
21
|
+
## Before running
|
|
22
|
+
|
|
23
|
+
1. `qm auth status` → not logged in → tell the user to `qm auth login`.
|
|
24
|
+
2. `qm assets outfits` (free) → `{id, name, preview_url}`, gives `outfit_ids` for
|
|
25
|
+
`qm fashion`.
|
|
26
|
+
3. `qm assets kols` (free) → gives a `kol_id` for either command (the KOL/avatar
|
|
27
|
+
to wear the outfit).
|
|
28
|
+
4. `qm models list --type image` for the credit price of the chosen model.
|
|
29
|
+
|
|
30
|
+
## `qm tryon` — virtual try-on onto a person photo
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
qm tryon --model-image <img> [--type full|upper] [--model qimi_1.5|qimi_2.5|qimi_3] [--garment <img>] [--upper <img>] [--lower <img>] [--background <img>] [--prompt <p>] [--crid <id>]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- `--model-image` **required** — the person/model photo (URL or local file).
|
|
37
|
+
- `--type full` (default) needs `--garment`; `--type upper` needs both `--upper`
|
|
38
|
+
and `--lower`.
|
|
39
|
+
- `--background` and `--prompt` only apply with `qimi_2.5`/`qimi_3`.
|
|
40
|
+
- Default model: `qimi_3`.
|
|
41
|
+
- Output job hint: `vto_<n>`.
|
|
42
|
+
|
|
43
|
+
## `qm fashion` — outfit lookbook
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
qm fashion --outfit <id...> [--mode <m>] [--kol-kind user_kol|system_kol] [--kol-id <id>] [--model <m>] [--crid <id>]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- `--outfit <id...>` **required** — one or more `outfit_ids` from
|
|
50
|
+
`qm assets outfits`.
|
|
51
|
+
- `--mode` (server-validated; examples): `kol_outfit` (outfit worn by a KOL —
|
|
52
|
+
needs `--kol-id`), `outfit_only` (styled flat-lay/ghost-mannequin, no person),
|
|
53
|
+
`kol_couple` (two KOLs). If unsure which modes are valid, omit `--mode` and let
|
|
54
|
+
the server default apply, or ask the user to confirm the look they want.
|
|
55
|
+
- `--kol-kind` distinguishes the user's own saved KOL (`user_kol`) vs a
|
|
56
|
+
system/preset avatar (`system_kol`).
|
|
57
|
+
- Output job hint: `fsh_<n>`.
|
|
58
|
+
|
|
59
|
+
## Quote, then confirm
|
|
60
|
+
|
|
61
|
+
Both commands charge **per resulting image** — `qm fashion` in particular can
|
|
62
|
+
produce multiple poses/results (`total_results` in the response), so the exact
|
|
63
|
+
count may only be pinned down after submission. Tell the user the model's
|
|
64
|
+
per-image credit rate from `qm models list` up front, and confirm intent to
|
|
65
|
+
proceed before running either command — submitting holds credit immediately.
|
|
66
|
+
|
|
67
|
+
## Run + track
|
|
68
|
+
|
|
69
|
+
Neither command has `--wait`. Copy the job id from the printed hint
|
|
70
|
+
(`→ Theo dõi: quickmagic jobs get vto_5` / `fsh_9`), then:
|
|
71
|
+
|
|
72
|
+
- `qm tryon` → `qm jobs wait vto_5 --out ./out` (single `result_url` —
|
|
73
|
+
auto-downloads fine).
|
|
74
|
+
- `qm fashion` → `qm jobs wait fsh_9 --out ./out` polls status but **won't
|
|
75
|
+
auto-download** (the job returns an array, not one `result_url`). Once
|
|
76
|
+
`completed`, run `qm jobs get fsh_9` and read `results[]`
|
|
77
|
+
(`{status, url, pose_index}`) — report each `url`.
|
|
78
|
+
|
|
79
|
+
## Errors
|
|
80
|
+
|
|
81
|
+
`Không đủ credit: ...` → state the shortfall + suggest
|
|
82
|
+
https://quickmagic.vn/pricing. Otherwise relay the CLI's `Lỗi: <message>`
|
|
83
|
+
verbatim. Full reference: `quickmagic-account` skill.
|
|
84
|
+
|
|
85
|
+
## Examples
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
qm assets outfits
|
|
89
|
+
qm assets kols
|
|
90
|
+
qm fashion --outfit 12 15 --mode kol_outfit --kol-id 3 --model qimi_3
|
|
91
|
+
qm jobs wait fsh_9 --out ./out
|
|
92
|
+
|
|
93
|
+
qm tryon --model-image ./person.jpg --garment ./dress.jpg --model qimi_3
|
|
94
|
+
qm jobs wait vto_5 --out ./out
|
|
95
|
+
```
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quickmagic-generate
|
|
3
|
+
description: >-
|
|
4
|
+
Generate AI images or videos from a text prompt and/or reference photos via
|
|
5
|
+
the Quick Magic CLI (`qm generate image` / `qm generate video`). Lists
|
|
6
|
+
models with pricing, quotes the credit cost, confirms with the user before
|
|
7
|
+
spending, and surfaces the Qimi free-image window. Triggers: "generate an
|
|
8
|
+
image", "create a video", "tạo ảnh AI", "tạo video quảng cáo", "vẽ ảnh bằng
|
|
9
|
+
AI", "render video từ ảnh".
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# quickmagic-generate — AI Image & Video Generation
|
|
13
|
+
|
|
14
|
+
Wraps `qm generate image` and `qm generate video`. Use whenever the user wants to
|
|
15
|
+
**create** new image(s) or a video from a prompt and/or reference images/photos.
|
|
16
|
+
For editing an *existing* image see `quickmagic-edit-image`; for product-specific
|
|
17
|
+
studio photos see `quickmagic-product-photoshoot`.
|
|
18
|
+
|
|
19
|
+
## Before anything: auth + balance
|
|
20
|
+
|
|
21
|
+
1. `qm auth status` — if it prints `Chưa đăng nhập...` (exit 1), tell the user to
|
|
22
|
+
run `qm auth login` first and stop.
|
|
23
|
+
2. `qm credits` — read `Số dư`, `Tạm giữ`, `Gói`. If the output includes
|
|
24
|
+
`Qimi miễn phí: còn N ngày (chế độ: ...)`, the account has an active **Qimi
|
|
25
|
+
free-image window** (`qimi_3`/`qimi_2.5` models):
|
|
26
|
+
- Mode **"Miễn phí — 1 ảnh/lần"** → generating with `qimi_3`/`qimi_2.5` and
|
|
27
|
+
`--n 1` is free; proactively tell the user: "Qimi 3/2.5 đang MIỄN PHÍ (còn N
|
|
28
|
+
ngày, 1 ảnh/lần) — muốn tạo nhiều ảnh song song (`--n` > 1) hoặc dùng model
|
|
29
|
+
khác sẽ tốn credit."
|
|
30
|
+
- Mode **"Nhanh — trả credit, chạy song song"** → the benefit is active but this
|
|
31
|
+
account pays credits for parallel speed; say so plainly.
|
|
32
|
+
|
|
33
|
+
## Pick the right model
|
|
34
|
+
|
|
35
|
+
`qm models list --type image` or `qm models list --type video` → table
|
|
36
|
+
`KEY | LABEL | CREDIT` (+ `IMAGES` column for video, showing max reference images
|
|
37
|
+
per mode, e.g. `ref 9 · frames 2`; a `*` after a number means that mode **rejects
|
|
38
|
+
real photos of real people** — pick a different model if the user's refs contain
|
|
39
|
+
people, e.g. `gemini-omni` / a `seedance 1.x` key / `wan-2-7`).
|
|
40
|
+
|
|
41
|
+
- This table doesn't print quality tiers — image quality levels are commonly
|
|
42
|
+
`1K`/`2K`/`4K`, priced differently per level. If `--quality` matters, mention the
|
|
43
|
+
level naming and let the server validate, or omit the flag for the model default.
|
|
44
|
+
- Match model to intent: photorealistic vs stylized, image-to-image (needs `--ref`)
|
|
45
|
+
vs text-only, required aspect ratio, required video duration/resolution.
|
|
46
|
+
|
|
47
|
+
## Quote, then confirm (mandatory before spending credits)
|
|
48
|
+
|
|
49
|
+
Compute an estimate: `credit (from models list) × --n` for images, or the video
|
|
50
|
+
model's listed `credit` (base duration/resolution — actual price can vary by
|
|
51
|
+
`--duration`/`--resolution`, shown precisely only after submission via
|
|
52
|
+
`credits_held`). Present it to the user, e.g.:
|
|
53
|
+
|
|
54
|
+
> "Model qimi_3: 10cr/ảnh × 4 ảnh = 40cr. Số dư hiện tại: 120cr. Xác nhận tạo?"
|
|
55
|
+
|
|
56
|
+
Do not run `generate image`/`generate video` until the user confirms — submitting
|
|
57
|
+
holds credit immediately.
|
|
58
|
+
|
|
59
|
+
## Commands
|
|
60
|
+
|
|
61
|
+
| Command | Required flags | Key optional flags |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| `qm generate image` | `--prompt <p>` | `--model <m>` (default `qimi_3`), `--quality <q>`, `--aspect-ratio <r>`, `--n <n>` (default 1), `--ref <r...>` (repeatable — URL or local file path), `--wait`, `--out <dir>` |
|
|
64
|
+
| `qm generate video` | `--prompt <p>`, `--model <m>` | `--duration <d>`, `--resolution <r>`, `--aspect-ratio <r>`, `--image <i...>` (repeatable), `--mode reference\|frames`, `--wait`, `--out <dir>` |
|
|
65
|
+
|
|
66
|
+
- `--ref` / `--image` accept a URL (kept as-is) or a local file path (read + base64
|
|
67
|
+
encoded automatically). Files over ~8MB print a warning — prefer URLs (`qm scrape
|
|
68
|
+
<url>` or `qm import <url>` can produce a hosted URL from a product page or a
|
|
69
|
+
TikTok/Instagram post).
|
|
70
|
+
- `--mode frames` caps at 2 images (first/last frame); `--mode reference` allows
|
|
71
|
+
more (see the `IMAGES` column). A wrong count is rejected server-side.
|
|
72
|
+
|
|
73
|
+
## Run + wait for results
|
|
74
|
+
|
|
75
|
+
- Add `--wait --out <dir>` to the generate command itself to poll and
|
|
76
|
+
auto-download in one step (polls every 2.5s internally).
|
|
77
|
+
- Or run without `--wait`, note the printed job id(s)
|
|
78
|
+
(`Đã tạo N job ảnh: img_12, img_13` / `Đã tạo job video: vid_7`), then separately:
|
|
79
|
+
`qm jobs wait img_12 --out ./out`.
|
|
80
|
+
- Batch requests (`--n` > 1, or several video jobs): the platform runs several jobs
|
|
81
|
+
in parallel automatically per the account's plan tier; anything beyond that
|
|
82
|
+
queues server-side — no manual throttling needed, just submit and `jobs wait`.
|
|
83
|
+
|
|
84
|
+
## Report the result
|
|
85
|
+
|
|
86
|
+
Always end with: the final URL(s) (downloaded file path if `--out` was used,
|
|
87
|
+
otherwise the `result_url` field from `qm jobs get <id>`) **and** the credit info
|
|
88
|
+
already printed after submission (`Credit tạm giữ: X · Số dư: Y`).
|
|
89
|
+
|
|
90
|
+
## Errors
|
|
91
|
+
|
|
92
|
+
- `Lỗi: Không đủ credit: cần Xcr, hiện có Ycr, thiếu Zcr. Vui lòng nạp thêm để
|
|
93
|
+
tiếp tục.` → tell the user exactly how many credits (Z) are missing and suggest
|
|
94
|
+
topping up at https://quickmagic.vn/pricing (or via the Quick Magic app).
|
|
95
|
+
- `Lỗi: Tài khoản đang âm N credit...` → balance is negative, must top up before
|
|
96
|
+
any new job.
|
|
97
|
+
- `[id] job lỗi: failed` (or `stalled`) after `jobs wait` → relay the job's
|
|
98
|
+
`error` field from `qm jobs get <id>`; a `stalled` status past ~15 minutes
|
|
99
|
+
queued means the queue is backed up — suggest retrying later.
|
|
100
|
+
- Full error-code reference and job-status semantics: `quickmagic-account` skill.
|
|
101
|
+
|
|
102
|
+
## Examples
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
qm auth status
|
|
106
|
+
qm credits
|
|
107
|
+
qm models list --type image
|
|
108
|
+
qm generate image --prompt "a red sneaker on white background" --model qimi_3 --n 4 --aspect-ratio 1:1 --wait --out ./out
|
|
109
|
+
|
|
110
|
+
qm models list --type video
|
|
111
|
+
qm generate video --prompt "product slowly rotating" --model grok-imagine --duration 8 --resolution 720p --image ./product.jpg --wait --out ./out
|
|
112
|
+
|
|
113
|
+
qm jobs get img_12
|
|
114
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quickmagic-hook-video
|
|
3
|
+
description: >-
|
|
4
|
+
Generate a ~10 second comedy ad video from a character photo + a product
|
|
5
|
+
photo using one of 18 Hook Studio presets, via `qm hook presets` (browse +
|
|
6
|
+
price) and `qm hook video` (generate). Triggers: "hook video", "video
|
|
7
|
+
quảng cáo hài hước", "video viral cho sản phẩm", "tạo hook ads", "comedy ad
|
|
8
|
+
video".
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# quickmagic-hook-video — Hook Studio Comedy Ads
|
|
12
|
+
|
|
13
|
+
Wraps `qm hook presets` (browse) and `qm hook video` (generate). Produces a short
|
|
14
|
+
(~10s) comedy-style ad video: a character reacts/performs around a product,
|
|
15
|
+
following one of 18 written presets (each with its own script beats — the actual
|
|
16
|
+
prompt text is not exposed, only title/description/beats/preview).
|
|
17
|
+
|
|
18
|
+
## Step 1 — always browse presets first
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
qm hook presets
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Returns JSON:
|
|
25
|
+
- `presets[]` — `{id, title, title_en, tagline, description, beats[], poster_url,
|
|
26
|
+
video_url, sample_character_url, sample_product_url, aspect_default}` for all 18
|
|
27
|
+
presets: `stream`, `breaking-news`, `bear-chase`, `pitch-invasion`,
|
|
28
|
+
`product-run`, `cho-mang-review`, `unbox-bat-ngo`, `san-sale-sap-san`,
|
|
29
|
+
`time-freeze`, `street-interview`, `podcast-clip`, `elevator-pitch`,
|
|
30
|
+
`red-carpet`, `me-chong-review`, `hang-xom-hong`, `tra-da-via-he`,
|
|
31
|
+
`boc-phot-plot-twist`, `di-cho-flex`.
|
|
32
|
+
- `credit_cost` — the flat credit price for one hook video at the default
|
|
33
|
+
resolution.
|
|
34
|
+
- `aspects` — `["9:16", "16:9"]`.
|
|
35
|
+
- `speech_lang_options[]` — `{value, label}` (e.g. `vi`/`Tiếng Việt`,
|
|
36
|
+
`en`/`English`, plus Thai/Indonesian/Chinese/Japanese/Korean/Spanish/
|
|
37
|
+
Portuguese/French/Hindi).
|
|
38
|
+
- `resolution_options` — typically `["720p", "1080p"]`.
|
|
39
|
+
- `style_options[]` — `{value, label}`, 9 comedic styles (`slapstick`, `chase`,
|
|
40
|
+
`chaos`, `absurd`, `epic_fail`, `heroic`, `surreal`, `panic`, `parody`).
|
|
41
|
+
- `format_options[]` — `{value, label}`, 4 formats (`shorts`, `reels`, `ugc`,
|
|
42
|
+
`ad`).
|
|
43
|
+
|
|
44
|
+
## Step 2 — recommend a preset for the user's product
|
|
45
|
+
|
|
46
|
+
Read each preset's `title`/`tagline`/`description`/`beats` and match to the
|
|
47
|
+
product's category and the vibe the user wants (chaotic/action →
|
|
48
|
+
`bear-chase`/`pitch-invasion`/`time-freeze`; sales/livestream energy →
|
|
49
|
+
`cho-mang-review`/`san-sale-sap-san`; reveal/twist → `unbox-bat-ngo`; news parody
|
|
50
|
+
→ `breaking-news`). Show the user 1-3 candidate presets with their `tagline` +
|
|
51
|
+
`poster_url`/`video_url` before picking one.
|
|
52
|
+
|
|
53
|
+
## Step 3 — quote + confirm
|
|
54
|
+
|
|
55
|
+
State `credit_cost` from `hook presets` and get explicit confirmation before
|
|
56
|
+
running `hook video` (it holds credit immediately).
|
|
57
|
+
|
|
58
|
+
## Step 4 — generate
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
qm hook video --preset <id> --character <img> --product <img> [--aspect 9:16|16:9] [--speech-lang <l>] [--cta <s>] [--location <img>] [--accessory <img>] [--style <s>] [--format <f>] [--resolution 720p|1080p] [--crid <id>]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
| Flag | Notes |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `--preset <id>` **required** | a valid `id` from `hook presets` |
|
|
67
|
+
| `--character <img>` **required** | URL or local file — the person featured |
|
|
68
|
+
| `--product <img>` **required** | URL or local file — the product |
|
|
69
|
+
| `--aspect` | default `9:16` |
|
|
70
|
+
| `--speech-lang` | default `vi`; any value from `speech_lang_options`, or free text for another language |
|
|
71
|
+
| `--cta` | custom call-to-action line (overrides the preset's default line) |
|
|
72
|
+
| `--location` / `--accessory` | optional extra reference photos |
|
|
73
|
+
| `--style` / `--format` | single value from `style_options` / `format_options` |
|
|
74
|
+
| `--resolution` | `720p` or `1080p` |
|
|
75
|
+
|
|
76
|
+
If the user doesn't have character/product photos ready, `qm scrape <url>` /
|
|
77
|
+
`qm import <url>` / `qm assets products` / `qm assets kols` can source them (all
|
|
78
|
+
free).
|
|
79
|
+
|
|
80
|
+
## Run + track
|
|
81
|
+
|
|
82
|
+
No `--wait` flag. Copy the job id from the hint
|
|
83
|
+
(`→ Theo dõi: quickmagic jobs get hok_7`), then `qm jobs wait hok_7 --out ./out`
|
|
84
|
+
— this job type has a single `result_url` (+ `thumbnail_url`), so `--out`
|
|
85
|
+
**does** auto-download. Report the final video URL + `credits_charged`.
|
|
86
|
+
|
|
87
|
+
## Errors
|
|
88
|
+
|
|
89
|
+
`Không đủ credit: ...` → state shortfall + https://quickmagic.vn/pricing.
|
|
90
|
+
Invalid `--preset`, or a missing character/product image, surfaces as a plain
|
|
91
|
+
`Lỗi: <message>` — re-check against `hook presets` output. Full reference:
|
|
92
|
+
`quickmagic-account` skill.
|
|
93
|
+
|
|
94
|
+
## Example
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
qm hook presets
|
|
98
|
+
qm hook video --preset cho-mang-review --character ./host.jpg --product ./drink-can.jpg --speech-lang vi --aspect 9:16
|
|
99
|
+
qm jobs wait hok_7 --out ./out
|
|
100
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quickmagic-product-photoshoot
|
|
3
|
+
description: >-
|
|
4
|
+
Generate studio/marketing product photos (packshots, lifestyle posters,
|
|
5
|
+
infographics, composites) from 1-3 reference images via `qm product`. Use
|
|
6
|
+
for product catalog/ad photography, not for putting a garment on a person.
|
|
7
|
+
Triggers: "product photoshoot", "ảnh sản phẩm studio", "chụp ảnh sản phẩm
|
|
8
|
+
AI", "tạo poster sản phẩm", "packshot", "catalog photo".
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# quickmagic-product-photoshoot — Product AI
|
|
12
|
+
|
|
13
|
+
Wraps `qm product` (Product AI batch generation). Use for **studio/marketing
|
|
14
|
+
photos of a product** — packshots, lifestyle/poster images, infographics, or
|
|
15
|
+
composites — NOT for putting a product/outfit ON a person (that's
|
|
16
|
+
`quickmagic-fashion`'s `tryon`).
|
|
17
|
+
|
|
18
|
+
## Before running
|
|
19
|
+
|
|
20
|
+
1. `qm auth status` → if not logged in, tell the user to `qm auth login` first.
|
|
21
|
+
2. Get a reference image if the user doesn't have one ready:
|
|
22
|
+
- Already saved in the product library → `qm assets products` (free, no
|
|
23
|
+
credit) lists `{id, name, preview_url}`; use the numeric `id` directly as a
|
|
24
|
+
`--refs` value.
|
|
25
|
+
- From a product page URL → `qm scrape <url>` (free) returns a Quick
|
|
26
|
+
Magic-hosted image URL.
|
|
27
|
+
- From a TikTok/Instagram product post → `qm import <url> --media image`
|
|
28
|
+
(free).
|
|
29
|
+
- Otherwise a plain image URL or a local file path both work as `--refs`
|
|
30
|
+
values.
|
|
31
|
+
3. `qm models list --type image` for the credit price of the chosen `--model`
|
|
32
|
+
(default `qimi_2.5`).
|
|
33
|
+
|
|
34
|
+
## Command
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
qm product --refs <r...> [--types <t...>] [--count <n>] [--kol-id <id>] [--instruction <s>] [--model <m>] [--crid <id>]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| Flag | Meaning |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `--refs <r...>` **required** | 1-3 values: numeric `product_id` (from `qm assets products`) OR an image URL/local file |
|
|
43
|
+
| `--types <t...>` | one or more of `product` \| `poster` \| `infographic` \| `composite` (default `product`) |
|
|
44
|
+
| `--count <n>` | images generated **per type** (1-20, default 4) |
|
|
45
|
+
| `--kol-id <id>` | optional avatar/KOL id (from `qm assets kols`) to feature alongside the product |
|
|
46
|
+
| `--instruction <s>` | extra free-text art direction (max 2000 chars) |
|
|
47
|
+
| `--model <m>` | image model key (default `qimi_2.5`) |
|
|
48
|
+
| `--crid <id>` | idempotency key — reuse on retry to avoid double charge |
|
|
49
|
+
|
|
50
|
+
Map user intent to `--types`: catalog/e-commerce shot → `product`; social/ad
|
|
51
|
+
banner → `poster`; spec sheet / feature callouts → `infographic`; multiple items
|
|
52
|
+
together → `composite`. Multiple types can be combined in one call.
|
|
53
|
+
|
|
54
|
+
## Quote, then confirm
|
|
55
|
+
|
|
56
|
+
Total images = `--count` × number of `--types` values. Estimated cost = that
|
|
57
|
+
total × the model's `credit` from `qm models list --type image`. State it, e.g.
|
|
58
|
+
"qimi_2.5, 4 ảnh × 2 loại (product+poster) = 8 ảnh × 8cr = 64cr, số dư hiện tại
|
|
59
|
+
Ycr — xác nhận tạo?" before running.
|
|
60
|
+
|
|
61
|
+
## Run + track
|
|
62
|
+
|
|
63
|
+
`qm product` has **no `--wait` flag** — it prints raw JSON plus a hint line:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
→ Theo dõi: quickmagic jobs get pai_1737000000_ab12
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Copy that job id and run `qm jobs wait pai_... --out ./out` — **but note**: this
|
|
70
|
+
job type returns an **array of images**, not one `result_url`; `jobs wait --out`
|
|
71
|
+
will poll status correctly but will **not auto-download** (the CLI only
|
|
72
|
+
auto-downloads when the job view has a single `result_url`). Once status is
|
|
73
|
+
`completed`, run `qm jobs get pai_...` and read `images[]` — each entry is
|
|
74
|
+
`{status, image_url, image_type}`. Report every `image_url` to the user.
|
|
75
|
+
|
|
76
|
+
## Errors
|
|
77
|
+
|
|
78
|
+
- `Không đủ credit: cần Xcr, hiện có Ycr, thiếu Zcr...` → state the shortfall,
|
|
79
|
+
suggest topping up (https://quickmagic.vn/pricing).
|
|
80
|
+
- Invalid/missing ref → CLI prints `Lỗi: <message>`; check the `--refs` value is
|
|
81
|
+
a valid id, URL, or existing local file.
|
|
82
|
+
- Full error/status reference: `quickmagic-account` skill.
|
|
83
|
+
|
|
84
|
+
## Example
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
qm assets products
|
|
88
|
+
qm product --refs 42 --types product poster --count 4 --model qimi_2.5
|
|
89
|
+
qm jobs wait pai_1737000000_ab12 --out ./out
|
|
90
|
+
qm jobs get pai_1737000000_ab12
|
|
91
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quickmagic-subtitle-split
|
|
3
|
+
description: >-
|
|
4
|
+
Add auto-subtitles (with optional translation/dubbing) via `qm subtitle`,
|
|
5
|
+
or cut a long video into short highlight clips via `qm split`. Both take a
|
|
6
|
+
direct video URL or a TikTok/Instagram post link (not YouTube). Triggers:
|
|
7
|
+
"thêm phụ đề tự động", "lồng tiếng video", "dịch phụ đề", "cắt video dài
|
|
8
|
+
thành clip ngắn", "auto subtitle", "split video into shorts".
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# quickmagic-subtitle-split — Auto-Subtitle & Video Splitting
|
|
12
|
+
|
|
13
|
+
Wraps two related video post-processing commands:
|
|
14
|
+
|
|
15
|
+
| Command | What it does |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `qm subtitle <video_url>` | Adds subtitles to a video, with optional translation and/or voice dubbing |
|
|
18
|
+
| `qm split <video_url>` | Cuts one long video into several short highlight clips with auto-generated titles |
|
|
19
|
+
|
|
20
|
+
Both need a **direct video file URL, or a TikTok/Instagram POST link** — **not a
|
|
21
|
+
YouTube link, not a profile page**. If the user only has a YouTube link, tell
|
|
22
|
+
them it's not supported by this command.
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
qm subtitle <video_url> [--dub] [--translate <lang>] [--crid <id>]
|
|
28
|
+
qm split <video_url> [--mode auto|specific] [--title-lang <l>] [--translate <lang>] [--crid <id>]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
| Flag | Notes |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `--dub` (subtitle only) | enable voice dubbing, not just text subtitles |
|
|
34
|
+
| `--translate <lang>` | translate subtitles / clip titles to this language |
|
|
35
|
+
| `--mode` (split only) | `auto` (default, auto-detected highlights) or `specific` |
|
|
36
|
+
| `--title-lang` (split only) | language for generated clip titles |
|
|
37
|
+
|
|
38
|
+
## Before running
|
|
39
|
+
|
|
40
|
+
1. `qm auth status` → not logged in → `qm auth login`.
|
|
41
|
+
2. If the user only gave a TikTok/Instagram link and the raw file is needed for
|
|
42
|
+
another step first, `qm import <url> --media video` (free) re-hosts it on
|
|
43
|
+
Quick Magic.
|
|
44
|
+
|
|
45
|
+
## Pricing — no upfront quote is possible
|
|
46
|
+
|
|
47
|
+
Unlike other features, there is **no command to preview the credit price**
|
|
48
|
+
before submitting — both are billed **by the video's duration**, which the
|
|
49
|
+
server only knows after it downloads/probes the video. Do not invent a number.
|
|
50
|
+
Instead:
|
|
51
|
+
|
|
52
|
+
1. Tell the user plainly: "Phí tính theo thời lượng video, chỉ biết chính xác
|
|
53
|
+
sau khi server tải video về — vẫn muốn tiếp tục?"
|
|
54
|
+
2. Get a go-ahead to proceed (not a numeric confirmation).
|
|
55
|
+
3. Run the command; read `credits_held` and `duration_sec` from the JSON
|
|
56
|
+
response and report those as the actual charge.
|
|
57
|
+
|
|
58
|
+
## Run + track
|
|
59
|
+
|
|
60
|
+
Neither command has `--wait`. Copy the job id from the printed hint:
|
|
61
|
+
|
|
62
|
+
- `qm subtitle` → `→ Theo dõi: quickmagic jobs get sub_4` →
|
|
63
|
+
`qm jobs wait sub_4 --out ./out` (single `result_url`, auto-downloads).
|
|
64
|
+
- `qm split` → `→ Theo dõi: quickmagic jobs get spl_8` →
|
|
65
|
+
`qm jobs wait spl_8 --out ./out` polls status but **won't auto-download**
|
|
66
|
+
(result is a `clips[]` array, not one `result_url`). Once `completed`, run
|
|
67
|
+
`qm jobs get spl_8` and read `clips[]`
|
|
68
|
+
(`{title, url, thumbnail_url, start_time, end_time, status, social_content}`)
|
|
69
|
+
— report every clip's `url` + `title`.
|
|
70
|
+
|
|
71
|
+
## Errors
|
|
72
|
+
|
|
73
|
+
`Không đủ credit: ...` → state shortfall + https://quickmagic.vn/pricing. A
|
|
74
|
+
YouTube link or an unreachable URL surfaces as a plain `Lỗi: <message>` — ask
|
|
75
|
+
the user for a direct file URL or a TikTok/Instagram post link instead. Full
|
|
76
|
+
reference: `quickmagic-account` skill.
|
|
77
|
+
|
|
78
|
+
## Example
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
qm subtitle https://cdn.example.com/video.mp4 --translate en
|
|
82
|
+
qm jobs wait sub_4 --out ./out
|
|
83
|
+
|
|
84
|
+
qm split https://www.tiktok.com/@user/video/123456 --mode auto --title-lang Vietnamese
|
|
85
|
+
qm jobs wait spl_8
|
|
86
|
+
qm jobs get spl_8
|
|
87
|
+
```
|