@gitruck/cli 1.1.10 → 1.2.1

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/AGENT.md CHANGED
@@ -116,6 +116,8 @@ gtrk transcript <本地视频.mp4> --json # 转成一个含总结/时
116
116
  > ⚠️ **`render` 自 1.1.10 起分两种情形**:工程无 MG 颗粒(或带 `--no-particles`)时仍是纯本地、不出现这条;
117
117
  > 有未命中缓存的颗粒时,**颗粒 HTML 文本会上行**去云端烤(素材本体仍不上行),此时会打这条告知,
118
118
  > 且在它之前先出计费预估确认。
119
+ > 另:`render` 会按叠加 clip 的 `clip_transform` / `border_radius` / `clip_mask` 本地合成画中画几何与形状蒙版
120
+ > (纯本地、零计费,蒙版纹理缓存在工程旁 `.tonghe-cache/masks/`),`--json` 的 `overlay.transformed / masked / maskSkipped` 如实计数。
119
121
 
120
122
  5. **按需装运行时资产**(只有用到本地渲染/烧录才需要):
121
123
 
@@ -345,6 +347,25 @@ gtrk patch set --project <dir> --total max # 改顶层总长(
345
347
 
346
348
  ---
347
349
 
350
+ ## 2.5 双源画中画:`gtrk pip lay`(屏录 / 第二机位 · 纯本地零计费)
351
+
352
+ 讲软件 / 讲代码的口播多是**两条文件同步录**(屏幕一条、人像一条)。`oralcut` 只剪人像;本命令把粗剪的**每个切点镜像到屏录**,
353
+ 铺「屏录满幅轨(N+1,静音)+ 人像画中画副本轨(N+2,静音、带 `clip_transform` / `border_radius` / `clip_mask`)」,主轨与音轨**逐字节不动**。
354
+
355
+ ```bash
356
+ gtrk pip lay --project <口播工程目录> --companion <屏录.mp4> [--shape ellipse|rectangle|heart|diamond|star|none] [--feather 10] [--border-radius 24] [--anchor bottom-right] [--scale 0.28] [--margin 40] [--offset <秒>] [--dry-run] [--json]
357
+ ```
358
+
359
+ - **三分支偏移**:缺省互相关自动对齐(人像为参考、屏录为待对齐,阈值沿 `audio align`);置信度不足 → 产 `<屏录名>_pip_align.gtrk` 让用户在客户端把「伴随源」轨拖齐后 `--resume <该工程>`;`--offset <秒>` 跳过检测。
360
+ 偏移口径全库统一:正 = 屏录晚开录(`clip_st' = clip_st − offset`)。**屏录 MUST 带麦克风音轨**才能自动对齐,无音轨只剩后两条路——开工时就要提醒用户。
361
+ - **钳位与留空**:屏录比人像短 / 晚开录 ⇒ 对应 beat 留空或只铺可用部分,回执逐颗点名毫秒数;MUST NOT 拉伸或变速。成片该段只见人像主轨,如实告诉用户。
362
+ - **幂等 + 不覆盖用户改动**:改参数直接重跑,自产 clip(`producer=gtrk:pip@1`)剥旧重铺;用户在客户端动过的画中画 clip 失去身份 ⇒ 保留并在回执 `strip.keptForeign` 点名。
363
+ - **位置**:`oralcut` → 检查点① → `pip lay` → `subtitle lay` / `audio lay` → 出片。**不新增必停点**,铺完让用户在客户端看一眼即可。
364
+ - 出片:客户端本地导出 / `gtrk render`(本地合成几何与蒙版)/ 导剪映(菱形无对应会跳过并明示)。
365
+ - 拒写口径同 `gtrk patch`(内容 revision 冲突回 `conflict`、写方自检违例硬拒零写)。
366
+
367
+ ---
368
+
348
369
  ## 3. 产物结构 + 三端打开
349
370
 
350
371
  ```
package/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # 更新日志
2
2
 
3
+ ## 1.2.0(2026-09-11)
4
+
5
+ ### `gtrk pip lay`:屏幕一条 + 人像一条同步录的口播,一句话合成画中画(add-pip-companion-lay)
6
+
7
+ 讲软件 / 讲课件 / 讲代码的口播多是**两条文件同步录**:屏录一条、人像一条。此前流水线只能剪其中一条——
8
+ `gtrk oralcut` 粗剪的每个切点没法落到另一条上,画中画只能去客户端手工摆,圆角与蒙版只有客户端看得见。
9
+ 镜像切点是纯算术(每颗 clip 一个偏移),却是「每片必做、手工必错」的事,现在做成命令:
10
+
11
+ ```bash
12
+ gtrk pip lay --project <口播工程目录> --companion <屏录.mp4> [--shape ellipse|rectangle|heart|diamond|star|none] [--feather 10] [--corner-radius 0.25] [--border-radius <px>] [--anchor bottom-right] [--scale 0.28] [--margin 40] [--offset <秒>] [--dry-run] [--expected-revision <sha256>] [--json]
13
+ gtrk pip lay --resume <屏录名>_pip_align.gtrk
14
+ ```
15
+
16
+ **测偏移三分支,与 `gtrk audio align` 同一套原语**:缺省互相关自动对齐(人像为参考、屏录为待对齐);
17
+ 置信度不足 ⇒ 产 `<屏录名>_pip_align.gtrk`(人像整段 + 屏录整段按估测偏移摆好),用户在客户端把「伴随源」轨拖齐保存后 `--resume` 读回偏移再铺;
18
+ `--offset <秒>` 显式给值跳过检测。偏移口径全库统一:**正 = 屏录晚开录**。
19
+ ⚠️ 屏录 **MUST 带麦克风音轨**才能自动对齐(互相关没有参照就没法算),只有系统音的屏录只剩后两条路——开工时就要提醒用户;
20
+ 本命令与 `audio align` 一样只做**恒定偏移**,两台设备采样钟差导致的长片渐飘不矫正。
21
+
22
+ **镜像切点**:主轨每颗非空档 clip 的 `track_st / duration` 原样落到屏录轨,`clip_st′ = clip_st − offset`,整毫秒域、不累加游标;
23
+ 越过屏录素材上界 / 下界的部分**钳位 + 留空 + 回执逐颗点名毫秒数**,MUST NOT 拉伸或变速——
24
+ 屏录比人像短 / 晚开录的那几段成片只见人像主轨,如实告诉用户。
25
+
26
+ **铺两条轨,主轨与音轨一字不动**:屏录满幅轨(`track_index` = 现存视频轨最大值 + 1,静音)+ 人像画中画副本轨(再 + 1,静音,
27
+ 带 `clip_transform` / `border_radius` / `clip_mask`)。人声仍由主轨镜像音轨承担,副本轨 MUST NOT 双声;
28
+ 主轨不动 ⇒ 下游 `split` / `subtitle lay` / `mg` 照旧按 main 对 transcript,零感知。
29
+ 形状缺省 `ellipse` = 以画中画短边内切的正圆;`rectangle` 满幅可带 `--corner-radius`;`heart` / `diamond` / `star` 短边内切;`none` 只摆位不遮。
30
+ `--scale` 的语义是**画中画显示高度占画布高度的比例**(缺省 0.28),写进 `clip_transform` 时按 contain-fit 反算。
31
+
32
+ **幂等 + 不覆盖用户改动**:改参数直接重跑,自产 clip(`producer = gtrk:pip@1`)先剥后铺、空轨删除;
33
+ 用户在客户端动过、被清掉身份的画中画 clip **保留并在回执 `strip.keptForeign` 点名**(与 `matrix lay` 同一条认领纪律)。
34
+ 写方自检(恒等式 / 接缝 / 素材上界)破了即抛零副作用;原子写回 + revision 断言,`--expected-revision` 跨命令拒写口径同 `gtrk patch`;`--dry-run` 只算不写。
35
+ 回执打印的是**数字**(每颗的偏移 / 钳位 / 留空毫秒),不是一句「已验证」。
36
+
37
+ 链路位置:`oralcut` 检查点① → **`pip lay`** → 拆分 / 字幕 → 出片,**不新增必停点**,铺完让用户在客户端看一眼即可;
38
+ 口播图纸(`gtrk-talking-head`)开工五问加第 ⑥ 问(有没有同步录的屏录或第二机位、画中画形状 / 位置 / 大小),屏录题材默认不铺 B-roll。
39
+ 出片三口:客户端本地导出 / `gtrk render`(见下一节)/ 导剪映(`diamond` 剪映无对应,跳过并明示)。
40
+ 纯本地**零计费**,素材不上行。一条伴随源起步,多机位切人另立。
41
+ ⚠️ 客户端预览里看到画中画的圆角与形状蒙版,要等客户端同步更新(消费这两个契约字段的那一半随客户端发版)。
42
+
43
+ ### `gtrk render`:画中画的缩放 / 落位 / 旋转 / 透明、圆角与五形状蒙版随工程本地合成(link-clip-mask-contract-render)
44
+
45
+ 1.1.10 把叠加层渲进了成片,但每一层的**几何**还没读:叠加输入一律 contain-fit 后贴满画布,
46
+ 客户端里摆好的画中画渲出来是**满幅信箱**,圆角与蒙版更是零支持。现在按契约逐 clip 消费:
47
+
48
+ - **`clip_transform`**:`scale_x/y` 在 contain-fit 之后再乘(与客户端「先 contain 再乘 scale」同口径,负值 = 翻转);
49
+ `position_x/y` 以画布中心为原点落位;`rotation` 旋转(落点按旋转后包围盒算);`alpha` 透明。
50
+ - **`border_radius`**(画布像素)与 **`clip_mask`** 五形状(`rectangle` + `corner_radius` / `ellipse` / `heart` / `diamond` / `star`,与契约枚举一字不差):
51
+ 支持 `invert` 反相、蒙版自身 `rotation`、`feather` 羽化(0..100 = 占蒙版短边百分比);两者同时在场**叠乘**(元素圆角 ∩ 形状窗),不降级。
52
+ - 颗粒(`beat_track`)不动:契约不给颗粒这两个字段,颗粒尺寸由 HTML 自带。
53
+
54
+ **不引图形库**:五形状 + 圆角 + 反相 + 旋转都是闭合路径填充,用纯 JS 扫描线光栅成一张 8-bit 灰度 PNG(node 内置 `zlib` 编码,**零新依赖**——
55
+ 多一个原生依赖就多一条安装故障面),ffmpeg 只负责 `gblur`(羽化)+ `alphamerge` + `overlay`。确定性、离线、**零计费**。
56
+ 蒙版纹理按参数 + 尺寸内容寻址落 `<工程目录>/.tonghe-cache/masks/<sha256>.png`,可复用、丢了重生;
57
+ 缓存目录不可写退系统临时目录,两处都写不了才放弃该纹理——此时该 clip **只按几何叠加并明示**(`maskSkipped`),MUST NOT 阻断渲染。
58
+
59
+ **零回归门**:`clip_transform` 缺席或恒等、且无圆角 / 蒙版的 clip,滤镜链与 1.1.10 **逐字节相同**,既有黄金向量原样通过。
60
+ `--json` 的 `overlay` 段新增 `transformed` / `masked` / `maskSkipped` 三个计数,完成话术逐类点名
61
+ 「几段按 clip_transform 落位 / 几段合成了蒙版或圆角 / 几段纹理不可用只按几何叠加」。
62
+ 两条口径:羽化是高斯近似,与客户端的距离场羽化**观感等价、不逐像素等价**;
63
+ 客户端专有蒙版形态(钢笔 / 文字 / 分屏 / 黑边 / 描边 / 多蒙版)只在客户端状态里,本地渲染不读。
64
+
65
+ ### `gtrk oralcut --lang`:按识别源语种分档校验,切点线不支持的码在抽取前就拒(link-enum-catalog-cli §7)
66
+
67
+ 1.1.10 的枚举清单把 `--lang` 改成按快照校验,但拿的是 `subtitle.languages`——那是翻译目标语与识别源语种的 **11 项共同范围**,
68
+ 会放行 `es-ES` / `pt-PT` / `ru-RU` / `vi-VN`,让用户抽完音频、传完文件,才被服务端 6015 拒。
69
+ 现在 `/catalog` 下发 `subtitle.source_languages`,**按 task_type 分档**(切点三线 7 项:`en-US` / `fr-FR` / `ja-JP` / `ko-KR` / `zh-CHS` / `zh-CHT` / `zh-CN`;
70
+ `video_ai_subtitle` / `subtitle_translate` 11 项),`oralcut --lang` 改按 `video_oral_cut` 那一档在**抽取之前**校验,报错只列本线 7 项。
71
+ 退回规则不破 1.1.10 的两条既定口径:分档整体缺失(老服务端 / 旧快照)/ 缺该线 / 形态不合 ⇒ 退回 11 项共同范围;
72
+ 共同范围也拿不到或无快照 ⇒ 放行交服务端裁决——**fail-open、只降不升**。
73
+ `long2short --language` / `transcript --lang` / `gtrk tool` 的翻译语种参数本来就不做本地取值校验,这次一格不动。
74
+
3
75
  ## 1.1.10(2026-09-10)
4
76
 
5
77
  ### `gtrk render` 现在会把 MG 颗粒与 overlay 真的渲进成片(add-render-overlay-compositing)
package/README.en.md CHANGED
@@ -36,12 +36,12 @@
36
36
  | 📦 | `gtrk deps` | Runtime assets: `status` shows where ffmpeg/fonts come from and under which licence, `install` fetches them from the Gitruck Cloud mirror (**must be triggered explicitly — never a silent auto-download**) |
37
37
  | 🤖 | `gtrk skills install` | Installs the 18 bundled CLI skills into the agents detected on this machine, via the generic `skills` adapter plus a gtrk supplement layer; `--all` covers every registered host; `gtrk skills recommend --scene <id>` browses the bundled third-party skill catalog (snapshot, offline, recommend-only) and `gtrk skills add <owner/repo>` installs through the adapter and registers the skill in the show config `style.skills` |
38
38
  | ⬆️ | `gtrk upgrade` | Upgrade the CLI to the latest version + refresh skills (config preserved); `--check` only reports |
39
- | 🎞️ | `gtrk render` | Render a gtrk project (EDL) locally → finished mp4 (requires ffmpeg); composites **every visible overlay layer** in contract z-order (B-roll and other overlay video tracks + MG particles; `hidden` tracks stay out); output frames are allocated against the **cumulative** timeline (per-clip rounding never accumulates, so the picture cannot drift away from the voiceover); runs a QC pass afterwards and writes `.qc.json` (`--no-qc` skips it). ⚠️ MG particles that miss the cache are cloud-rendered and **billed** (estimate + confirmation first; `--no-particles` renders particle-free at zero cost) |
39
+ | 🎞️ | `gtrk render` | Render a gtrk project (EDL) locally → finished mp4 (requires ffmpeg); composites **every visible overlay layer** in contract z-order (B-roll and other overlay video tracks + MG particles; `hidden` tracks stay out); output frames are allocated against the **cumulative** timeline (per-clip rounding never accumulates, so the picture cannot drift away from the voiceover); runs a QC pass afterwards and writes `.qc.json` (`--no-qc` skips it); picture-in-picture clips get their `clip_transform` (scale / position / rotation / opacity), `border_radius` corners and `clip_mask` shape masks (ellipse / rounded rectangle / heart / diamond / star, feathered) composited locally, visually matching the client preview. ⚠️ MG particles that miss the cache are cloud-rendered and **billed** (estimate + confirmation first; `--no-particles` renders particle-free at zero cost) |
40
40
  | 🔬 | `gtrk qc <cut>` | Final-cut QC: one decoding pass over the whole file for flash frames, black/frozen frames, clipping, silence and audio/video drift, each with a timecode; `--gtrk <project>` enables project-aware detection of **intra-clip cuts**, `--fail-on error\|warn\|never` gates pipelines via the exit code |
41
41
  | 🔎 | `gtrk matrix` | B-roll retrieval + **candidate track laying**: consumes the FILM_BROLL dispatch → produces a candidate list + downloads preview proxies and lays N candidate tracks (`--lay N`, default 1; open it in opencut and toggle track visibility to compare; `--lay 0` produces the list only); `matrix search "<query>"` is a one-off ad-hoc search; `matrix fetch <clip_id...>` pulls raw footage during the fine cut (free re-signing + download for already-granted materials, drag straight into Jianying); **local-footage mode**: `matrix index --dirs <folders>` builds a slice-free index → `--local --dirs` retrieves and lays tracks (**your footage never leaves your machine**) → `matrix lay` consumes the (editable) plan; `matrix describe` understands candidates on demand |
42
42
  | 🎨 | `gtrk mg` | MG motion-graphics particle laying: consumes the MG dispatch → lays html-particle assets (transparent overlay / full-screen bed, produced by your show's MG skill) into the `.gtrk` `beat_track`; `mg lint <particle.html>` runs the statically checkable subset of the house rules, `mg status --project <dir>` is an orchestration dashboard; `mg render <particle.html> --duration <sec>` renders a single particle in the cloud, independent of any project, into a Jianying-readable qtrle transparent MOV (the fine-cut supplement channel); aux overlay particles can be layered on the same span (one beat derives a main particle plus `-aux<n>`). The old name `gtrk rrv` remains as a deprecated alias; `gtrk mg fetch` pulls neutral block skeletons from the HyperFrames registry (offline snapshot candidates, three-source fetch with our mirror first, mechanical rewrite then lint) |
43
43
  | 🎙️ | `gtrk project init` | Audio-first project bootstrap: build a `.gtrk` project from a voice-over — main path `--tts-task <task_id>` references a completed TTS task (fetches the audio plus sentence timecodes directly, zero ASR); fallback path `--audio`+`--transcript` takes your own voice-over as a pair. Once landed, `gtrk split --project` continues the production pipeline as usual |
44
- | 🎼 | `gtrk audio lay` / `tighten` | Audio-track atoms: `lay` appends an audio track to a `.gtrk` project (BGM/score; idempotent same-source replacement, no track pile-up); `--beat-align` runs cloud beat analysis and snaps the in-point to the nearest downbeat (billed once; degrades gracefully without a key or on failure). `tighten` tightens the pauses between sentences in the voice-over (purely local, zero billing; only silence straddling a sentence boundary is compressed, within-sentence breaths untouched) |
44
+ | 🎼 | `gtrk audio lay` / `tighten` | Audio-track atoms: `lay` appends an audio track to a `.gtrk` project (BGM/score; idempotent same-source replacement, no track pile-up); `--beat-align` runs cloud analysis and **pins the BGM’s emotional peak onto the cut’s climax**, tiling outward on bar lines and tiling **not at all** when both sides are already long enough (billed once; the climax comes from the `split.beats` criterion chain and can be overridden with `--climax <track-sec>`; `--no-loop` lays only the anchored span and leaves head/tail silence; without a key / on failure / when the track has no highlight it degrades to no anchoring and the command still succeeds). `tighten` tightens the pauses between sentences in the voice-over (purely local, zero billing; only silence straddling a sentence boundary is compressed, within-sentence breaths untouched) |
45
45
  | 🎯 | `gtrk audio align` | Audio-video alignment part (fully local, zero billing): cross-correlates an external audio recording (lav mic / recorder) against the video to measure offset + confidence; high confidence swaps the track directly (video stream untouched byte-for-byte), low confidence emits an alignment project for the client timeline, then `--resume` reads the confirmed offset back; `--offset` swaps at an explicit offset |
46
46
  | 🧰 | `gtrk tool <name>` | Single-shot tool family: image-to-camera-move, image/video matting, image black-border removal / aspect adaptation / cleanup / square conversion / LivePhoto, smart collage covers and vertical stitching (multi-image input), video black-border removal / aspect adaptation / stabilization / vaporwave filter / mechanical & semantic shot segmentation / motion highlights / AI subtitles, vocal-accompaniment separation / speaker diarization / pitch-and-tempo shift, piano-to-MIDI and piano restoration, audio denoising, silence removal, MAD, and more; `gtrk tool list` shows every input/output/live price/status. Single request, single result, shared runner — adding a tool means adding one descriptor |
47
47
  | 💬 | `gtrk feedback` | Tell us what feels wrong: `gtrk feedback "<one line>" --command <command>`. **Disclosed submission** — when an assistant files it for you it must first read the exact content back to you and only add `--disclosed` once you agree; in a pipe or any non-interactive environment, sending without that declaration is refused outright. Content is redacted before it leaves your machine (local paths, credentials, e-mail addresses, phone numbers and the like are replaced by shape), so what you are shown is exactly what gets sent |
@@ -274,6 +274,7 @@ Then just say "**cut a version of this talking-head**", or explicitly pick `gtrk
274
274
  | ④ | (no skill) | (no command) | **Global frame-sampling composition check**: sample frames from the merged three-source base layer and have the user confirm the composition — a hard agent-discipline gate feeding ⑤'s placement decisions |
275
275
  | ⑤ | `/gtrk-mg` | `gtrk mg` | **MG (incl. ov) goes on last** (stacked on the settled, composition-checked base layer) |
276
276
  | — | `/gtrk-style-maker` | (no command, builds a show) | A one-time interview that builds your show's style system (skill family + show config, see next section) |
277
+ | ③′ | "**screen-recording PiP**" | `gtrk pip lay` | Mirror the talking-head rough cut's cut points onto a screen recording / second camera recorded in sync: lays a full-frame companion track + a muted picture-in-picture copy of the talking head (ellipse / rounded rectangle / heart / diamond / star mask, optional corner radius); purely local, zero billing; when alignment confidence is low it writes an alignment project for the client to drag into place, then `--resume` |
277
278
  | — | (wrap-up) | `gtrk render` | Render a gtrk project locally → finished mp4 (overlays and MG particles included; particles that miss the cache are cloud-rendered and billed, `--no-particles` skips them) |
278
279
  | ✂️ | `/gtrk-long2short` | `gtrk long2short` | Long-to-short rough cut: semantic segment selection + jump cuts → per-clip client/Jianying/Premiere projects (the raw file is never uploaded); **not part of the production SOP**, usable standalone at any time |
279
280
  | 📝 | `/gtrk-transcript` | `gtrk transcript` | Local video / voice-over audio → one Markdown file with an agent-written summary, timecoded record and plain text; **not part of the production SOP** |
@@ -554,6 +555,7 @@ gtrk matrix --local --dirs <folder-or-file,...> --project <dir> # ② local ret
554
555
  gtrk matrix lay --project <dir> [--plan <path>] # ③ consume the (edited) plan and lay tracks, zero retrieval cost
555
556
  ```
556
557
 
558
+ - **Repeat the flag when a path contains an ASCII comma**: `--dirs` / `--materials` split on ASCII commas by default; when a path carries one, repeat the flag instead (`--dirs "A" --dirs "B"` — it **accumulates**, it does not overwrite). A whole string that exists on disk is never split, and the full-width comma "," never participates in splitting. **When enumeration reports `0/0`, check this first**, then check the folder for broken symlinks.
557
559
  - **Your footage never leaves your machine**: only 512px sampled frames are sent to Gitruck Cloud's own embed endpoint for vectorization, discarded on arrival; results reference your local originals by absolute path (no downloads, no proxies). Indexing is metered by frames actually sampled (pre-held before the run, settled to actual usage afterwards); text-side retrieval costs zero credits.
558
560
  - **Images are first-class**: images are indexed, retrievable and layable; when selected, an image goes through cloud `image_move` and lands as a 5-second camera-move video — **the image itself does go to the cloud** (2 credits per image, summarized for confirmation before laying; same image + same params is reused forever, never re-billed). Zero images to the cloud → `--no-image-broll`.
559
561
  - **No material reuse**: within one laying round each material unit is used once globally (local video per scene, images per file); when candidates run dry, slots stay empty rather than repeat; `--dedup-scope material` tightens to file level.
@@ -623,11 +625,16 @@ Project entry points that start from **a voice-over** instead of a talking-head
623
625
  | `gtrk project init --tts-task <task_id>` | **Main path**: references a completed `audio_tts_clone` task — the server hands over the audio and sentence timecodes directly (zero ASR, zero extra billing); the audio download lands in the project's `audio/` |
624
626
  | `gtrk project init --audio <voice-over> --transcript <transcript.json>` | **Fallback path**: your own voice-over audio plus its sentence-timecoded transcript as a pair (produced by `gtrk transcript <voice-over> --json`; for TTS-synthesized voice-overs take the main path instead of re-running ASR) |
625
627
  | `gtrk audio lay --project <dir> --file <bgm.mp3>` | Appends an audio track to the project; **idempotent same-source replacement** (re-running with the same source replaces instead of piling up tracks; zero-reference protection when stripping the old one); `--volume <0..1>` (default 0.1, bed volume — the contract carries linear gain only, never dB; the client's volume panel shows -20.0, the same scale on both sides), `--offset <ms>` sets the in-point |
626
- | `gtrk audio lay … --beat-align` | Cloud beat analysis (`audio_music_analyze`, billed once) snaps the in-point to the nearest downbeat; without a key / on analysis failure / out of range it degrades to no alignment — the command never fails over it |
628
+ | `gtrk audio lay … --beat-align` | **Climax anchoring** (`audio_music_analyze`, billed once): pins the BGM’s emotional peak `H` (the server’s `highlight.time`) onto the cut’s climax `A`; the mapping is always `track_sec = A + (bgm_sec − H)`. **Both sides long enough ⇒ zero tiling** (exactly one clip); only a short side is tiled outward, with seams snapped to downbeats (the two hard track boundaries are cut without snapping). `A` comes from the criterion chain over `struct_meta.split.beats`: elevation → container flip → callback closure → `0.75×total` fallback, and **the CLI reports which rung was used — the fallback is explicitly flagged as a guess**. Without a key / on analysis failure / when the track has no highlight it degrades to no anchoring and the command never fails over it |
629
+ | `gtrk audio lay … --beat-align --climax <track-sec>` | Climax **escape hatch**: always overrides the chain above. Out of range (≤ `--offset` or ≥ the project end) or non-numeric **errors out immediately** rather than falling back silently — an explicitly wrong value should be visible at once. Must be used together with `--beat-align` |
630
+ | `gtrk audio lay … --no-loop` | No tiling: with `--beat-align` it lays only the anchored span and leaves head/tail silence (**the silent seconds are reported**); without `--beat-align` it keeps a single pass instead of looping to fill the project |
627
631
  | `gtrk audio tighten --project <dir>` | Tightens the pauses **between sentences** in the voice-over track (**purely local, zero billing**): only silence that straddles a sentence boundary is compressed — **within-sentence breaths and quoted original-audio spans are left alone** — and the output honestly reports how many within-sentence breaths were skipped. `--keep <sec>` silence to keep after tightening, `--min-silence <sec>` leave anything shorter untouched, `--boundary-tol <sec>` tolerance for "sits on a sentence boundary", `--dry-run` report how many spots and how many seconds would be compressed without writing. For the three defaults see `gtrk audio tighten --help` (measured, accepted values — tune them for another subject or voice) |
628
632
 
629
633
  `project init` also takes `--canvas <WxH>` (default 1080x1920), `-o/--out`, `--reupload`, `--no-open` and `--json` with the same semantics as `oralcut`; with `--json` both commands emit a single-line result JSON on stdout (human logs go to stderr).
630
634
 
635
+ > ⚠️ **`--beat-align` was redesigned wholesale on 2026-09-02** (change `redesign-beat-align-climax-anchor`). The old implementation pushed the whole BGM back by `firstDownbeat` seconds — it analysed the **BGM’s own timeline**, which has no consumer on the project timeline at all, so the net effect was **paying for one cloud analysis in exchange for an equally long silence at the head of the cut**.
636
+ > ⇒ **Artifacts produced with `--beat-align` are no longer byte-reproducible**; the default path without that flag is **byte-for-byte unchanged**.
637
+
631
638
  > **Run `tighten` before laying tracks**: it changes the voice-over track's length, and `gtrk split` / `gtrk matrix` reproject beat timecodes against the project as it stands — tighten first and you save a round of rework. To get it right at synthesis time instead, in-house voices accept `--fragment-interval` during TTS (see `audio_tts_clone` below); cloud voices do not support that parameter, which is when you tighten after synthesis instead.
632
639
 
633
640
  ### `gtrk tool <name> [inputs...]` — the single-shot tool family
@@ -642,13 +649,13 @@ Standalone single-request capabilities, kept separate from the pipeline's lane c
642
649
  | `image_matting` | One image | Transparent-background png (`--param` can request a backing plate) | Queried live before the run | Live |
643
650
  | `image_blackborder_remove` | One local image | Image with black borders removed | Queried live before the run | Live |
644
651
  | `image_canvas_adapt` | One local image; optional target width/height and `normal` / `rectangle` / `square` | Aspect-adapted image | Queried live before the run | Live |
645
- | `image_purify` | One local image (only material you have the rights to process) | Image cleaned of watermarks, logos or overlays | Queried live before the run | Live |
652
+ | `image_purify` | One local image; optional `full_screen` / `region` and region boxes (only material you have the rights to process) | Image cleaned of watermarks, logos or overlays | Queried live before the run | Live |
646
653
  | `video_matting` | One video (**≤ 10 minutes**, uploaded as-is with no proxy) | Transparent-background webm | Queried live before the run | Live |
647
654
  | `video_blackborder_remove` | One local video | Video with black borders removed | Queried live before the run | Live |
648
655
  | `video_canvas_adapt` | One local video; optional target width/height, clip range, canvas mode and audio-free output | Aspect-adapted video | Queried live before the run | Live |
649
656
  | `video_stabilizer` | One local video; optional `fast` / `exp` / `turbo` | Stabilized video | Queried live before the run | Live |
650
657
  | `video_vaporwave` | One local video; the filter takes an exact preset name | Vaporwave-filtered video | Queried live before the run | Live |
651
- | `video_purify` | One local video; optional `full_screen` / `subtitle` / `custom`, `ffmpeg` / `raft` and a normalized ROI (only material you have the rights to modify) | One cleaned video | Queried live before the run | Live |
658
+ | `video_purify` | One local video; optional `full_screen` / `subtitle` / `custom` / `region`, `ffmpeg` / `raft`, a normalized ROI and region boxes with optional time ranges (only material you have the rights to modify) | One cleaned video | Queried live before the run | Live |
652
659
  | `video_upscale` | One local video (**≤ 1 minute**); optional `2` / `3` / `4`× and `Reality` / `Anime` | One upscaled video | Queried live before the run | Live |
653
660
  | `video_interpolate` | One local video; optional `2` / `3` / `4`×, with no extra one-minute limit | One frame-interpolated video | Queried live before the run | Live |
654
661
  | `video_segment` | One local video; optional `--detector content\|adaptive`, `--threshold` | Shot-range structure in `result-output.json` (structured data, not a downloadable file) | Queried live before the run | Live |
@@ -685,11 +692,13 @@ The seven shared video tools — black-border removal, aspect adaptation, stabil
685
692
  - `gtrk tool image_blackborder_remove ./photo.jpg [--json]` — automatically crops black borders from one image.
686
693
  - `gtrk tool image_canvas_adapt ./photo.jpg --canvas-width 1080 --canvas-height 1920 --canvas-type rectangle [--json]` — image aspect conversion; omitting the canvas parameters uses the server defaults. Per the actual runtime contract the canvas mode accepts only `normal`, `rectangle` and `square`, not the `fit` from older docs.
687
694
  - `gtrk tool image_purify ./photo.jpg [--json]` — clean watermarks, logos or overlays from an image you have the rights to process.
695
+ - `gtrk tool image_purify ./photo.jpg --purify-scope region --purify-region 0.02,0.02,0.15,0.08 [--json]` — remove a box directly: no recognition, **everything inside the box is processed**; smaller boxes that fit the element tightly give better results.
688
696
  - `gtrk tool video_blackborder_remove ./clip.mp4 [--json]` — automatically crops black borders from one video while keeping the original audio.
689
697
  - `gtrk tool video_canvas_adapt ./clip.mp4 --canvas-width 1080 --canvas-height 1920 --canvas-type rectangle --clip-start 12 --clip-end 60 --without-audio [--json]` — video aspect conversion; `--clip-start/--clip-end` are start/end frame numbers, omitted fields use the server defaults, and the canvas mode accepts only `normal`, `rectangle`, `square`.
690
698
  - `gtrk tool video_stabilizer ./clip.mp4 --stabilizer-method turbo [--json]` — video stabilization; supports `fast`, `exp` and `turbo`, where `exp` is experimental and you should check the result yourself.
691
699
  - `gtrk tool video_vaporwave ./clip.mp4 --vaporwave-filter "灼熱苦夏" [--json]` — add a vaporwave filter using an exact preset name; omitting it explicitly uses `愈漸升溫`.
692
700
  - `gtrk tool video_purify ./clip.mp4 --purify-scope custom --purify-method ffmpeg --purify-roi 0,0.78,1,0.2 [--json]` — clean a video you have the rights to modify; the ROI is a normalized `x,y,w,h` and is only used together with `custom`. `raft` supports videos under 20 minutes, `ffmpeg` has no such limit; restoring occluded content is not promised.
701
+ - `gtrk tool video_purify ./clip.mp4 --purify-scope region --purify-region 0.8,0.02,0.18,0.08,0,5 --purify-region 0.3,0.85,0.4,0.1,120 [--json]` — remove boxes directly; repeat the option for more boxes (up to 16), each optionally followed by `start,end` in seconds (omit `end` to run to the end). No recognition — **everything inside the box is processed, including the main subject**; `ffmpeg` blurs the box while `raft` repaints it, and tighter boxes give better results. `--purify-region` only works with `region`.
693
702
  - `gtrk tool video_upscale ./clip.mp4 --upscale-times 3 --upscale-type Anime [--json]` — experimental video upscaling; input up to 60 seconds, neither side may exceed 4000 px after scaling, supports `2`, `3`, `4`× and `Reality`, `Anime`.
694
703
  - `gtrk tool video_interpolate ./clip.mp4 --interpolate-multiplier 3 [--json]` — frame interpolation; supports `2`, `3`, `4`×, does not apply the one-minute limit from older docs, and neither side of the source may exceed 4000 px.
695
704
  - `gtrk tool video_segment ./clip.mp4 [--detector adaptive] [--threshold 27] [--json]` — mechanical shot segmentation; produces **structured** `result-output.json` (`scene_list` with each range's start/end/duration), not a downloadable file.
package/README.md CHANGED
@@ -36,12 +36,12 @@
36
36
  | 📦 | `gtrk deps` | 运行时资产:`status` 查 ffmpeg/字体的来源与授权,`install` 从同合云镜像装(**须显式触发,绝不静默自动下载**) |
37
37
  | 🤖 | `gtrk skills install` | 通过通用 `skills` 适配器和 gtrk 补充层,把 18 个 CLI 自带 skill 装进本机检测到的主流 Agent;`--all` 可覆盖全部已登记宿主;`gtrk skills recommend --scene <id>` 查第三方 skill 推荐目录(随包快照、不联网、只推荐不打包),`gtrk skills add <owner/repo>` 透传安装并登记进栏目配置 `style.skills` |
38
38
  | ⬆️ | `gtrk upgrade` | 升级 CLI 到最新版 + 刷新 skill(配置保留);`--check` 只查不装 |
39
- | 🎞️ | `gtrk render` | 本地渲染 gtrk 工程(EDL)→ 成片 mp4(需 ffmpeg);按契约 z 序合成**全部可见叠加层**(B-roll 等 overlay 视频轨 + MG 颗粒,`hidden` 的轨不进片);输出帧按时间线**累计对齐**(逐段取整误差不累加,画面不会对配音渐进失步);渲完自动质检并落 `.qc.json`(`--no-qc` 跳过)。⚠️ 未命中缓存的 MG 颗粒要云渲**有计费**(先预估要确认;`--no-particles` 零计费出无颗粒版) |
39
+ | 🎞️ | `gtrk render` | 本地渲染 gtrk 工程(EDL)→ 成片 mp4(需 ffmpeg);按契约 z 序合成**全部可见叠加层**(B-roll 等 overlay 视频轨 + MG 颗粒,`hidden` 的轨不进片);输出帧按时间线**累计对齐**(逐段取整误差不累加,画面不会对配音渐进失步);渲完自动质检并落 `.qc.json`(`--no-qc` 跳过);画中画 clip 的 `clip_transform`(缩放 / 落位 / 旋转 / 透明)、`border_radius` 圆角与 `clip_mask` 形状蒙版(圆 / 圆角方 / 爱心 / 菱形 / 星形,带羽化)随工程本地合成,与客户端预览观感等价。⚠️ 未命中缓存的 MG 颗粒要云渲**有计费**(先预估要确认;`--no-particles` 零计费出无颗粒版) |
40
40
  | 🔬 | `gtrk qc <成片>` | 成片质检:单趟扫全片查闪帧/黑帧/冻结/爆音/静音/音画不同步,带时码定位;`--gtrk <工程>` 开工程感知识别**段内跳切**,`--fail-on error\|warn\|never` 供管线门控 |
41
41
  | 🔎 | `gtrk matrix` | B-roll 检索+**候选铺轨**:消费 FILM_BROLL 派单 → 产候选清单 + 下载 preview 代理铺 N 条候选轨(`--lay N` 默认 1,opencut 打开即可用轨道小眼睛对比;`--lay 0` 只出清单);`matrix search "<词>"` 单条 ad-hoc;`matrix fetch <clip_id...>` 精剪期拉原片(已授予素材免费重签+下载落盘,直接拖进剪映);**本地素材模式**:`matrix index --dirs <素材夹>` 免切片建索引 → `--local --dirs` 检索铺轨(**素材本体不上云**)→ `matrix lay` 消费(可编辑的)plan;`matrix describe` 按需理解候选 |
42
42
  | 🎨 | `gtrk mg` | MG 动态图颗粒铺轨:消费 MG 派单 → 把 html-particle 颗粒(透明叠加 / 满屏底层,由你栏目的 MG 生产 skill 所产)铺进 `.gtrk` 的 beat_track;`mg lint <颗粒.html>` 铁律静态子集校验、`mg status --project <dir>` 编排看板(缺 HTML / 已产未铺 / 已铺);`mg render <颗粒.html> --duration <sec>` 脱离工程独立云渲单颗颗粒为剪映可读 qtrle 透明 MOV(精剪补给口);aux 叠层颗粒同段多铺(一 beat 派生主 + `-aux<n>`)。旧名 `gtrk rrv` 保留为弃用别名;`gtrk mg fetch` 从 Hyperframes registry 取中性块骨架(快照随包离线候选、三源取块我方镜像优先、机械改写后过 lint) |
43
43
  | 🎙️ | `gtrk project init` | 音频驱动工程起盘:从一条配音建 `.gtrk` 工程——主路 `--tts-task <task_id>` 引用已完成的 TTS 配音任务(直取产物音频+句级时码,零 ASR);兜底 `--audio`+`--transcript` 自备配音成对给。落好即可 `gtrk split --project` 接成片流水线 |
44
- | 🎼 | `gtrk audio lay` / `tighten` | 音频轨零件:`lay` 往 `.gtrk` 工程追加一条音频轨(BGM/配乐上轨,同源幂等替换不堆轨);`--beat-align` 云端节拍分析把入点吸附最近 downbeat(计费一次,无 Key/失败自动降级不失败)。`tighten` 收紧配音的句间停顿(纯本地零计费,只压跨句界的静音、句内换气不动) |
44
+ | 🎼 | `gtrk audio lay` / `tighten` | 音频轨零件:`lay` 往 `.gtrk` 工程追加一条音频轨(BGM/配乐上轨,同源幂等替换不堆轨);`--beat-align` 云端分析把 **BGM 的情绪峰值压到成片的高潮点上**,锚点前后按小节线平铺补齐、两侧都够长时零平铺(计费一次;高潮点取自 `split.beats` 的判据链,可用 `--climax <轨秒>` 覆盖;`--no-loop` 只放锚点那一段、头尾留白;无 Key / 失败 / 曲子缺高潮点自动降级为不锚定,命令不失败)。`tighten` 收紧配音的句间停顿(纯本地零计费,只压跨句界的静音、句内换气不动) |
45
45
  | 🎯 | `gtrk audio align` | 音画对轨零件(纯本地零计费):外录音轨(领夹麦/录音笔)与视频互相关测偏移+置信度;高置信直接换轨(视频流零像素改动),低置信产对齐工程交客户端拖齐后 `--resume` 读回;`--offset` 显式偏移直换 |
46
46
  | 🧰 | `gtrk tool <name>` | 单点工具族:图转运镜、图片/视频抠像、图片去黑边/比例转换/净化/转方图/LivePhoto、智能拼图封面/拼长图(多图输入)、视频去黑边/比例转换/防抖/蒸汽波滤镜/机械·智能分镜/运镜高光/智能字幕、人声伴奏分离/说话人分轨/变调变速、钢琴转MIDI/修复、音视频降噪、静音移除、MAD 等;`gtrk tool list` 查全部输入/产物/实时价格/状态。单发单收、共享 runner,接新工具只加一个 descriptor |
47
47
  | 💬 | `gtrk feedback` | 把用得不顺手的地方反馈给我们:`gtrk feedback "<一句话>" --command <命令名>`。**告知式提交**——助手代提时必须先把要发的内容原样念给你、得到同意后才加 `--disclosed` 重跑;管道/非交互环境下没有这句声明会直接拒发。发送前内容会先做一遍脱敏(本机路径、凭据、邮箱、手机号等按形态替换),你看到的就是将要发出的那一份 |
@@ -269,6 +269,7 @@ gtrk skills install --copy
269
269
  | ④ | (无 skill) | (无命令) | **全局抽帧检查画面构图**:对三源合并后的最终底轨抽帧,用户确认构图——这是 agent 纪律硬门,供 ⑤ 的排版避让决策使用 |
270
270
  | ⑤ | `/gtrk-mg` | `gtrk mg` | **MG(含 ov)最后叠上**(叠在已定稿、构图已核的底轨之上) |
271
271
  | — | `/gtrk-style-maker` | (无命令,建栏目) | 一次性访谈式建你栏目的风格体系(skill 家族 + 栏目配置,见下节) |
272
+ | ③′ | 「**屏录画中画**」 | `gtrk pip lay` | 把口播粗剪的切点镜像到同步录的屏录 / 第二机位,铺屏录满幅轨 + 人像画中画副本轨(圆 / 圆角方 / 爱心 / 菱形 / 星形蒙版,可圆角);纯本地零计费;低置信时产对齐工程让客户端拖齐后 `--resume` |
272
273
  | — | (收口) | `gtrk render` | 本地渲染 gtrk 工程 → 成片 mp4(含 overlay 与 MG 颗粒;颗粒未命中缓存时云渲计费,`--no-particles` 可跳过) |
273
274
  | ✂️ | `/gtrk-long2short` | `gtrk long2short` | 长剪短·粗剪:长视频语义选段+跳剪 → 逐 clip 出客户端/剪映/PR 三方工程(毛片不上传),**不在成片 SOP 序列内**、随时可独立用 |
274
275
  | 📝 | `/gtrk-transcript` | `gtrk transcript` | 本地视频/配音音频 → 一个含 Agent 总结、时码记录和纯文本的 Markdown,**不在成片 SOP 序列内** |
@@ -570,6 +571,7 @@ gtrk matrix --local --dirs <素材夹或素材文件,...> --project <目录> #
570
571
  gtrk matrix lay --project <目录> [--plan <path>] # ③ 消费(可编辑后的)plan 铺轨,零检索开销
571
572
  ```
572
573
 
574
+ - **路径里有英文半角逗号就重复传**:`--dirs` / `--materials` 缺省按半角逗号分隔;路径自带逗号时改成重复传(`--dirs "A" --dirs "B"`,**累加不覆盖**)。整串在盘上存在时会自动不拆,中文全角「,」从不参与拆分。**枚举报 `0/0` 时先看这一条**,其次看素材夹里有没有断链(失效的软链接)。
573
575
  - **素材本体永不上云**:只把 512px 抽帧图送同合云自建 embed 端点向量化、即传即弃;产物以绝对路径直引本地原文件(免下载免代理)。索引按实际抽帧张数会话计量(跑前预扣、跑完多退少不补),文本检索零积分。
574
576
  - **图片一视同仁**:图片可检索可铺轨;被选中时经云端 `image_move` 转 5 秒运镜视频入轨——**图片本体会上云**(2 积分/张,铺轨前汇总确认;同图同参恒复用不重复扣费)。零图片上云 → `--no-image-broll`。
575
577
  - **同素材不二用**:单轮铺轨一个素材单元全局只用一次(本地视频按场景、图片按文件),候选枯竭宁空不重复;`--dedup-scope material` 收严到文件级。
@@ -639,11 +641,16 @@ gtrk matrix lay --project <目录> [--plan <path>] # ③ 消费(
639
641
  | `gtrk project init --tts-task <task_id>` | **主路**:引用一个已完成的 `audio_tts_clone` 配音任务——服务端直取产物音频与句级时码(零 ASR、零额外计费),音频下载落工程 `audio/` |
640
642
  | `gtrk project init --audio <配音> --transcript <transcript.json>` | **兜底路**:自备配音音频 + 句级时码稿成对给(时码稿由 `gtrk transcript <配音音频> --json` 产出;TTS 合成的配音请走主路,别重跑 ASR) |
641
643
  | `gtrk audio lay --project <目录> --file <bgm.mp3>` | 往工程追加一条音频轨;**同源幂等替换**(同一来源重跑替换不堆轨、零引用保护剥旧);`--volume <0..1>`(默认 0.1 垫底音量——契约 volume 只写线性增益、不写 dB;客户端音量面板显示 -20.0,两侧同一标尺)、`--offset <ms>` 定入点 |
642
- | `gtrk audio lay … --beat-align` | 云端节拍分析(`audio_music_analyze`,计费一次)把入点吸附最近 downbeat;无 Key / 分析失败 / 出界一律自动降级为不对齐,命令不失败 |
644
+ | `gtrk audio lay … --beat-align` | **高潮点锚定**(`audio_music_analyze`,计费一次):把 BGM 的情绪峰值 `H`(服务端 `highlight.time`)压到成片高潮点 `A` 上,映射恒为 `轨秒 = A + (BGM 秒 − H)`;**两侧都够长就零平铺**(恰好 1 个 clip),不够长才按小节线平铺补齐、接缝吸附 downbeat(轨的两个硬边界处的截断不吸附)。`A` 取自 `struct_meta.split.beats` 的判据链:升华段 → 容器转折 → 回扣段 → `0.75×全片`兜底,**命中哪一档 CLI 如实报出,兜底档会明示是猜的**。无 Key / 分析失败 / 曲子缺高潮点一律降级为不锚定,命令不失败 |
645
+ | `gtrk audio lay … --beat-align --climax <轨秒>` | 高潮点**逃生门**:一律覆盖上面那条判据链。越界(≤ `--offset` 或 ≥ 工程末尾)或非数**直接报错**,不静默回落 —— 显式给错了值要当场知道。须与 `--beat-align` 同用 |
646
+ | `gtrk audio lay … --no-loop` | 不平铺补齐:开了 `--beat-align` 时只放锚点那一段、头尾留白(**留白秒数如实报出**);未开 `--beat-align` 时保留单次、不循环叠满至工程末尾 |
643
647
  | `gtrk audio tighten --project <目录>` | 收紧配音轨的**句间**停顿(**纯本地、零计费**):只压跨句界的静音,**句内换气与原声引用段不动**,出参如实报「跳过句内换气 N 处」。`--keep <秒>` 收紧后保留的静音、`--min-silence <秒>` 短于此不动、`--boundary-tol <秒>` 判「贴着句界」的容差、`--dry-run` 只报会压几处共几秒、不写盘。三个缺省值见 `gtrk audio tighten --help`(实测认可值,换题材/音色可调) |
644
648
 
645
649
  `project init` 另有 `--canvas <WxH>`(默认 1080x1920)、`-o/--out`、`--reupload`、`--no-open`、`--json`,语义与 `oralcut` 一致;两命令 `--json` 恒出单行结果 JSON(人读日志走 stderr)。
646
650
 
651
+ > ⚠️ **`--beat-align` 的语义在 2026-09-02 整套换过**(change `redesign-beat-align-climax-anchor`,主理人拍板)。旧实现是「把整条 BGM 后推 `firstDownbeat` 秒」—— 分析的是 **BGM 自己的时间轴**,工程时间轴里根本没有它的消费方,净效果只是**付一次云端分析的钱换来片头一段等长静音**。
652
+ > ⇒ **开过 `--beat-align` 的旧产物不再逐字节可复现**;没开这个 flag 的缺省路径产物**字节零变化**。
653
+
647
654
  > **`tighten` 该在铺轨之前跑**:它会改配音轨时长,`gtrk split` / `gtrk matrix` 的 beat 时码按当刻工程重投影——先收紧再铺轨,省一次返工。想要合成时就对,自训音色可在 TTS 阶段直接传 `--fragment-interval`(见下节 `audio_tts_clone`);云引擎音色不支持该参数,才用本命令在合成之后收。
648
655
 
649
656
  ### `gtrk tool <name> [输入...]` — 单点工具族
@@ -658,13 +665,13 @@ gtrk matrix lay --project <目录> [--plan <path>] # ③ 消费(
658
665
  | `image_matting` | 单张图片 | 透明背景 png(可 `--param` 请求背景底板) | 运行前实时查询 | 已上线 |
659
666
  | `image_blackborder_remove` | 单张本地图片 | 去黑边图片 | 运行前实时查询 | 已上线 |
660
667
  | `image_canvas_adapt` | 单张本地图片;可选目标宽高与 `normal` / `rectangle` / `square` | 比例适配图片 | 运行前实时查询 | 已上线 |
661
- | `image_purify` | 单张本地图片(仅处理你有权处理的素材) | 清理水印、Logo 或叠加元素后的净化图片 | 运行前实时查询 | 已上线 |
668
+ | `image_purify` | 单张本地图片;可选 `full_screen` / `region` 与区域框(仅处理你有权处理的素材) | 清理水印、Logo 或叠加元素后的净化图片 | 运行前实时查询 | 已上线 |
662
669
  | `video_matting` | 单条视频(**≤10 分钟**,原片直传不压代理) | 透明背景 webm | 运行前实时查询 | 已上线 |
663
670
  | `video_blackborder_remove` | 单条本地视频 | 去黑边视频 | 运行前实时查询 | 已上线 |
664
671
  | `video_canvas_adapt` | 单条本地视频;可选目标宽高、片段、画布模式和无音轨输出 | 比例适配视频 | 运行前实时查询 | 已上线 |
665
672
  | `video_stabilizer` | 单条本地视频;可选 `fast` / `exp` / `turbo` | 防抖视频 | 运行前实时查询 | 已上线 |
666
673
  | `video_vaporwave` | 单条本地视频;滤镜使用精确预设名称 | 蒸汽波滤镜视频 | 运行前实时查询 | 已上线 |
667
- | `video_purify` | 单条本地视频;可选 `full_screen` / `subtitle` / `custom`、`ffmpeg` / `raft` 与归一化 ROI(仅处理有权修改的素材) | 一条净化视频 | 运行前实时查询 | 已上线 |
674
+ | `video_purify` | 单条本地视频;可选 `full_screen` / `subtitle` / `custom` / `region`、`ffmpeg` / `raft`、归一化 ROI 与可带时间段的区域框(仅处理有权修改的素材) | 一条净化视频 | 运行前实时查询 | 已上线 |
668
675
  | `video_upscale` | 单条本地视频(**≤1 分钟**);可选 `2` / `3` / `4` 倍与 `Reality` / `Anime` | 一条超分视频 | 运行前实时查询 | 已上线 |
669
676
  | `video_interpolate` | 单条本地视频;可选 `2` / `3` / `4` 倍,不附加 1 分钟限制 | 一条插帧视频 | 运行前实时查询 | 已上线 |
670
677
  | `video_segment` | 单条本地视频;可选 `--detector content\|adaptive`、`--threshold` | 分镜区间结构 `result-output.json`(结构化数据,非下载文件) | 运行前实时查询 | 已上线 |
@@ -701,11 +708,13 @@ gtrk matrix lay --project <目录> [--plan <path>] # ③ 消费(
701
708
  - `gtrk tool image_blackborder_remove ./photo.jpg [--json]` — 自动裁去单张图片四周黑边。
702
709
  - `gtrk tool image_canvas_adapt ./photo.jpg --canvas-width 1080 --canvas-height 1920 --canvas-type rectangle [--json]` — 图片比例转换;省略画布参数时沿用服务端默认。画布模式按实际运行时契约只接受 `normal`、`rectangle`、`square`,不接受旧文档中的 `fit`。
703
710
  - `gtrk tool image_purify ./photo.jpg [--json]` — 清理你有权处理的图片中的水印、Logo 或叠加元素。
711
+ - `gtrk tool image_purify ./photo.jpg --purify-scope region --purify-region 0.02,0.02,0.15,0.08 [--json]` — 按框直接去除:不做识别,**框内全部内容都会被处理**;框越小、越贴近要去除的元素效果越好。
704
712
  - `gtrk tool video_blackborder_remove ./clip.mp4 [--json]` — 自动裁去单条视频四周黑边并保留原音轨。
705
713
  - `gtrk tool video_canvas_adapt ./clip.mp4 --canvas-width 1080 --canvas-height 1920 --canvas-type rectangle --clip-start 12 --clip-end 60 --without-audio [--json]` — 视频比例转换;`--clip-start/--clip-end` 是起止帧序号,省略字段时沿用服务端默认,画布模式只接受 `normal`、`rectangle`、`square`。
706
714
  - `gtrk tool video_stabilizer ./clip.mp4 --stabilizer-method turbo [--json]` — 视频防抖;支持 `fast`、`exp`、`turbo`,其中 `exp` 为实验方式,产物观感需自行检查。
707
715
  - `gtrk tool video_vaporwave ./clip.mp4 --vaporwave-filter "灼熱苦夏" [--json]` — 使用精确预设名称添加蒸汽波滤镜;省略时显式使用 `愈漸升溫`。
708
716
  - `gtrk tool video_purify ./clip.mp4 --purify-scope custom --purify-method ffmpeg --purify-roi 0,0.78,1,0.2 [--json]` — 净化用户有权修改的视频;ROI 为归一化 `x,y,w,h` 且只和 `custom` 同用。`raft` 仅支持 20 分钟以内视频,`ffmpeg` 不套用该限制;不承诺还原被遮挡内容。
717
+ - `gtrk tool video_purify ./clip.mp4 --purify-scope region --purify-region 0.8,0.02,0.18,0.08,0,5 --purify-region 0.3,0.85,0.4,0.1,120 [--json]` — 按框直接去除,可重复给多个框(最多 16 个);框后可带 `start,end`(秒,`end` 省略即到结尾)。不做识别,**框内全部内容都会被处理(包括画面主体)**;`ffmpeg` 在框内做模糊、`raft` 做修复补全,框越小、越贴边效果越好。`--purify-region` 只能和 `region` 同用。
709
718
  - `gtrk tool video_upscale ./clip.mp4 --upscale-times 3 --upscale-type Anime [--json]` — 实验性视频超分;输入最多 60 秒,放大后任一边不得超过 4000 px,支持 `2`、`3`、`4` 倍和 `Reality`、`Anime`。
710
719
  - `gtrk tool video_interpolate ./clip.mp4 --interpolate-multiplier 3 [--json]` — 视频插帧;支持 `2`、`3`、`4` 倍,不套用旧文档中的 1 分钟限制,原视频任一边不得超过 4000 px。
711
720
  - `gtrk tool video_segment ./clip.mp4 [--detector adaptive] [--threshold 27] [--json]` — 机械分镜;产**结构化** `result-output.json`(`scene_list` 各段起止/时长),非下载文件。