From 15608320d92fefad505692544f9e09c15db3eebc Mon Sep 17 00:00:00 2001 From: LianWan Wen <2094941626@qq.com> Date: Mon, 23 Nov 2026 17:23:05 +0800 Subject: [PATCH 1/2] docs: rewrite v2.6.0 release notes and redesign READMEs --- CHANGELOG.md | 8 +- README.md | 613 +++++++++++++++------------------------ README_en.md | 630 +++++++++++++++-------------------------- docs/RELEASE-v2.6.0.md | 138 +++++++-- 4 files changed, 577 insertions(+), 812 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc5ba57..93bbac4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,11 @@ ## v2.6.0(2026-11-23) -- Windows x64 安装向导包含桌面程序与默认模型。正式发布包附 SHA-256,未签名版本通过 GitHub 发布页手动安装。 -- 模型在独立进程中预热。启动时按版本号检查正式更新,发现更高版本后在顶栏模型状态左侧显示「有更新」。 -- 新增作品术语库、试译与用量报告。精修支持全书译稿、单气泡重译和 CBZ 导出。[安装与升级说明](docs/RELEASE-v2.6.0.md) +- **Windows 一体化安装向导**:推出基于 NSIS(固实 LZMA 压缩)的单文件 Windows x64 安装包,内置桌面客户端、字体与默认 ONNX 模型;支持自定义中文路径、`.comitrans` 项目关联、`%LOCALAPPDATA%\ComiTrans` 用户数据隔离、静默参数与 SHA-256 校验,未签名版本通过 GitHub 发布页手动安装。 +- **独立进程预热与更新提醒**:将检测、OCR 与 LaMa 等图像模型会话隔离至独立进程,脱离 Qt 主事件循环,启动加载期间界面持续可操作;启动时后台比较 GitHub 最新正式版,仅在存在更高版本时于顶栏「模型已就绪」左侧显示「有更新」按钮。 +- **翻译工作流增强**:新增「作品术语库」(仅需填写固定译名且纳入当前作品断点指纹)、队列开头 1–3 页独立「试译」、基于 API 真实 Token 用量的「翻译消耗」与整本费用预估,以及 CBZ 漫画包导入翻译与保存后重新「导出 CBZ」。 +- **精修编辑器重构**:顶部工具栏收拢为无嵌套单层菜单(视图 / 文件 / 填色 / 字体管理);支持列表 `Ctrl`/`Shift` 与画布 `Ctrl` 点击/`Shift` 框选多气泡批量修改样式、「取样式 / 样式刷 / 撤销样式」(跨页共享样式剪贴板,保护译文与已还原原图气泡)、跨页「全书译稿」查找替换与「重译气泡」。 +- **60fps 墨韵动效与双主题统一**:引入 60fps 黑白交互动效与下拉框/控件反馈体系,全面优化纸白与夜墨双主题表现。详见 [v2.6.0 发布说明](docs/RELEASE-v2.6.0.md)。 ## v2.5.2 — 2026-11-17 diff --git a/README.md b/README.md index 9255ed6..56f13b2 100644 --- a/README.md +++ b/README.md @@ -2,509 +2,346 @@
-**[简体中文](README.md)** | **[English](README_en.md)** - -
- -release -python -PySide6 -ONNX Runtime -stars +

ComiTrans

+ +

本地 ONNX 视觉管线 × 大模型上下文翻译 × 专业级嵌字精修桌面工作台

+ +

+ 简体中文 | English +

+ +

+ Release + Windows x64 + Python 3.12+ + PySide6 + ONNX Runtime + GPL-3.0 + GitHub Stars +

+ +

+ v2.6.0 亮点 · + 界面预览 · + 翻译效果 · + 快速开始 · + 核心特性 · + 工作流 · + 模型与文档 · + 常见问题 +

-ComiTrans 是一款漫画自动汉化桌面客户端。本地执行文本检测、日语/韩语/英语 OCR、背景修复和中文排版,通过配置的大模型 API 翻译。支持接入自定义 OCR,不依赖 Web 前端。 - -从 v2.2.1 开始,检测、OCR 和修复均使用 **ONNX Runtime**,无需 PyTorch / torchvision / transformers。 - -> [!NOTE] -> **v2.6.0 Windows x64 版**将程序和模型放进一个安装包。模型在独立进程预热,翻译前可用作品术语库统一译名、先试译几页查看用量。[发布说明与升级步骤](docs/RELEASE-v2.6.0.md) - -> [!NOTE] -> **v2.5.2 更新**:滚动上下文记忆与可选缓存保留、OCR 后“按序翻译 ∥ 后台修补”Fork-Join 并行流水线、实时工作流拓扑可视化,以及精修画框、取色与自定义 RGB 填色、9 槽收藏字体、文字拉伸/旋转/描边和 PDF 边缘修复。已有 v2.5.1 模型可复用。[v2.5.2 发布说明](docs/RELEASE-v2.5.2.md) · [更新日志](CHANGELOG.md)。 - -## v2.5.2 重要更新 +ComiTrans 是一款面向漫迷与嵌字协作者的纯本地桌面漫画汉化客户端。软件在本地通过 **ONNX Runtime** 完成漫画文本检测、日/韩/英 OCR、原分辨率擦字修补与中文排版(完全脱离 PyTorch 与 Web 前端),并结合大语言模型 API 实现上下文感知翻译,内置可实时热预览的专业级嵌字精修工作台。 -- **上下文记忆与 Fork-Join 并行流水线**:单批按阅读顺序延续跨页上下文(最多 12 页 / 24,000 字符),原子持久化在 `.cache/translation-context.json`;偏好新增「保留上下文缓存」(联动锁定断点续传)。OCR 完成后按序 API 翻译与后台 `repair_comic_page` 擦字并发执行,汇合时自动按译文结果对账掩码。[上下文与并行说明](docs/CONTEXT_TRANSLATION.md)。 -- **工作流拓扑实时可视化**:自动处理页取消旧版线性 7 步条,改为对应真实管道的有向工作流图(`读取 → 检测 → OCR → [翻译 ∥ 修补] → 排版 → 保存 / PDF`),直观呈现并发在途页角标、待汇合状态、上下文计数、续传复用与底部逐页矩阵。 -- **嵌字精修增强**:新增画布手工添加气泡框、图片取色(避开辅助线并支持长条)、自定义 RGB/Hex 填色、9 槽常用字体快捷栏(数字键 `1–9`)、文字颜色持久化、横向/纵向拉伸(`10%–400%`)、旋转(`±180°`)、描边(`0–30 px`)与「白字黑边竖排」预设,补充页面移除/清空、气泡 `1 / N` 计数及单页滚动隔离。 -- **冷启动与导出修复**:ONNX 模型预热延后至首帧绘制后触发;修复小数尺寸 PDF 页面边缘背景铺底覆盖不完整的问题。 +--- -## v2.5.0 重要更新 +## ✨ v2.6.0 核心亮点 -- **长篇 PDF 工作流**:页图按需生成;精修保存和切页不合成整本 PDF,完成后显式后台导出。连续长条按可见范围加载,支持打开 `project.json`。[PDF 使用说明](docs/PDF_EDITING.md)。 -- **翻译速度与续传**:当前页修补时,后续页继续检测、OCR 和 API 翻译;默认最多 4 页在途。GPU 日志报告实际设备。失败、停止或重启后跳过完成页,复用合法译文。[续传](docs/RESUMABLE_TRANSLATION.md) · [性能实测](docs/TRANSLATION_PERFORMANCE.md)。 -- **保留清晰度的擦字**:LaMa 按原尺寸分块,内存不足时缩小块而非缩图。改善黑底白字、头发交叠、白描边、网点和渐变背景;掩膜可独立测试或替换。[掩膜组件](docs/TEXT_MASK_COMPONENT.md)。 -- **更完整的精修**:自选区域后台修补、按块文字颜色与描边、中文按词换行;“还原此气泡”同时撤销该块修补和嵌字,保存重开后仍可切回处理结果。[气泡还原](docs/BUBBLE_RESTORATION.md)。 -- **大项目操作**:后台索引、切页和保存;只保留最新加载请求,保存时继续编辑不丢草稿。折叠栏、侧栏和专注模式保留手动偏好。[精修性能与边界](docs/EDITOR_PERFORMANCE.md)。 -- **API 与架构**:严格 JSON Schema 优先,降级后仍校验译文类型和数量;页面文件事务、模型共享、掩膜和调度拆成独立组件。[接口约定](docs/TRANSLATION_JSON_CONTRACT.md) · [架构图](docs/ARCHITECTURE.md)。 +> [!TIP] +> **v2.6.0 现已发布!** 首次提供包含桌面客户端、默认模型与中文字体的单文件 Windows x64 安装向导,并全面升级全书翻译工作流、精修批量排版与 60fps 墨韵动效。 +> 👉 [查看完整 v2.6.0 发布说明与迁移指南](docs/RELEASE-v2.6.0.md) · [前往下载安装包](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0) · [完整更新日志](CHANGELOG.md) -三页离线调度对照为 **42.43 → 37.85 秒**,输出像素一致;其中 API 等待模拟为 2 秒,不代表整本 PDF 或实时服务的速度保证。复杂背景仍可能需要人工修图。独立修图插件目前只有接口设计,宿主加载尚未实现。 - -## 漫画工作台 +| 升级维度 | v2.6.0 核心改进 | +| --- | --- | +| **📦 Windows 一体化安装与更新提示** | 单文件 NSIS Setup(固实 LZMA 压缩),内置程序、字体与默认 ONNX 模型,CPU 开箱即用;启动时后台检查 GitHub 正式版,仅发现更高版本时在顶栏「模型已就绪」左侧显示「有更新」提醒。 | +| **📚 作品术语库、试译估价与 CBZ** | 新增「作品术语库」统一角色/地点译名(仅纳入当前生效术语指纹);批前支持「试译」1–3 页并统计真实 Token 消耗与整本费用预估;支持 CBZ 按页翻译与「导出 CBZ」。 | +| **🎨 精修单层菜单、多选与样式刷** | 顶部工具栏重整为无嵌套单层菜单,释放画布空间;支持列表/画布多选气泡、「取样式 / 样式刷 / 撤销样式」、跨页「全书译稿」查找替换与「重译气泡」。 | +| **⚡ 60fps 墨韵动效与独立进程预热** | 引入统一 60fps 黑白交互动效与纸白/夜墨双主题打磨;图像模型会话隔离至独立进程预热,脱离 Qt 主事件循环,启动加载期间界面依然流畅可操作。 | -黑白漫画工作台:开放式分区标题、局部网点、Skribble 字标和柔和控件,工作页直接进入操作区。翻译页可直接导入字体、固定 9 个常用字体快捷槽并查看实际字形;底部并行工作流拓扑图按真实后台流水线实时显示并发在途页、`AI 翻译 ∥ 背景修复`分叉并行、上下文累计与逐页状态矩阵。精修画布保留作品原色。 +--- -**自动处理工作台 · Fork-Join 并行工作流** +## 📷 界面预览 -![ComiTrans 自动处理并行工作流](docs/ui-review/automatic-workflow-v252.png) +采用黑白漫画杂志风设计:开放式分区标题、局部网点、Skribble 字标与 60fps 克制动效;支持 **跟随系统 / 纸白 / 夜墨** 三种外观即时切换,夜间模式仅作用于界面与画布周边,不改变漫画像素与导出结果。 -**嵌字精修工作区 · 常用字体 / 填色与排版** +| v2.6.0 纸白主题 · 精修单层菜单与重译入口 | v2.6.0 夜墨主题 · 深色工作台与护眼画布 | +| --- | --- | +| ![v2.6.0 纸白主题精修界面](docs/ui-review/release-260-light.png) | ![v2.6.0 夜墨主题精修界面](docs/ui-review/release-260-dark.png) | -![ComiTrans 嵌字精修界面](docs/ui-review/editor-fill-fonts-1440-style-review.png) +| Fork-Join 实时并行工作流拓扑(自动处理页) | 9 槽收藏字体、取色填色与排版控制 | +| --- | --- | +| ![ComiTrans 自动处理并行工作流](docs/ui-review/automatic-workflow-v252.png) | ![ComiTrans 嵌字精修界面](docs/ui-review/editor-fill-fonts-1440-style-review.png) | -**夜间模式(夜墨)** +
+展开更多界面细节截图与逐字日志动图(夜墨工作流、上下文缓存偏好、取色描边、字体库与设置页) -设置 → 运行与输出 → 外观 可切换「跟随系统 / 纸白 / 夜墨」,切换即时生效,Windows 标题栏同步换色;夜墨只改变界面与画布周围,漫画像素与导出结果保持不变。 +
-| 自动处理与并行工作流 | 嵌字精修 | +| 夜墨下的并行工作流 | 夜墨下的嵌字精修 | | --- | --- | | ![夜墨下的并行工作流](docs/ui-review/dark-workflow-v252.png) | ![夜墨下的嵌字精修](docs/ui-review/dark-editor.png) | -
-展开更多 v2.5.2 界面截图(上下文缓存偏好、画布取色、拉伸描边、字体库与设置) - -| 翻译偏好与上下文缓存保留 | 批处理完成与工作流状态 | +| 翻译偏好与上下文缓存保留 | 批处理完成与逐页状态矩阵 | | --- | --- | | ![翻译偏好与上下文缓存](docs/ui-review/context-1440-retained-style-review.png) | ![批处理完成工作流](docs/ui-review/automatic-complete-style-review.png) | -| 画布图片取色 | 文字拉伸 / 旋转 / 描边预设 | +| 画布图片取色与自定义填色 | 文字拉伸 / 旋转 / 白字黑边竖排预设 | | --- | --- | | ![画布图片取色与自定义填色](docs/ui-review/editor-color-pick-1440-style-review.png) | ![文字拉伸、旋转与白字黑边竖排预设](docs/ui-review/editor-outline-1440-style-review.png) | -| 离线字体库检索 | 设置与翻译服务配置 | +| 离线字体库检索(2,056 族) | 设置与翻译服务配置 | | --- | --- | | ![字体库检索](docs/ui-review/font-library-search-style-review.png) | ![设置页](docs/ui-review/settings-style-review.png) | -
+**快速逐字日志(实际 Qt 录屏)**:日志正文采用「Aa今日花晴 春懒猫困」,以约每秒 250 字速度展开并在积压时自动加速;支持级别筛选、搜索、字号调节、暂停跟随与选区保留,界面保留最近 5,000 条记录,完整日志同步写入磁盘。 -**快速逐字日志(实际 Qt 录屏,v2.5.2 界面测试文本)** +![快速逐字日志输出](docs/ui-review/log-reveal-v252.gif) -日志正文使用 Aa今日花晴 春懒猫困,以约每秒 250 字快速展开,积压时自动加速;复制、导出与任务结束时补齐全文。支持级别筛选、搜索、字号调整、暂停跟随和选区保留,显示最近 5,000 条记录,完整日志保存在磁盘。 +
-![快速逐字日志输出](docs/ui-review/log-reveal-v252.gif) +--- -## 翻译前后对比 +## 🎨 翻译前后对比 > [!NOTE] -> 以下为用户提供的第 6、7 页对比:左列为日文原图,右列为对应的简体中文译图。 +> 以下为用户提供的漫画第 6、7 页实际汉化对比:左列为日文原图,右列为自动擦字与中文嵌字后的成品效果。 -| 翻译前 | 翻译后 | +| 日文原图 | 简体中文译图 | | --- | --- | -| ![日文原图](docs/images/20.1.png) | ![中文译图](docs/images/20.11.png) | -| ![日文原图](docs/images/20.2.png) | ![中文译图](docs/images/20.21.png) | - -## 目录 - -[漫画工作台与日志动画](#漫画工作台) · [OCR 接口](#ocr-接口) · [精修工具插件接口设计](docs/RETOUCH_PLUGIN_API.md) · [完整更新日志](CHANGELOG.md) - -1. [核心特性](#核心特性) -2. [快速开始](#快速开始) -3. [使用说明](#使用说明) -4. [翻译流程](#翻译流程) -5. [模型说明](#模型说明) -6. [打包与发布](#打包与发布) -7. [项目结构](#项目结构) -8. [更新日志](#更新日志) -9. [常见问题](#常见问题) -10. [反馈与支持](#反馈与支持) -11. [开源协议](#开源协议) - -## 核心特性 - -- **多语言源文与自定义 OCR**:选择日语、韩语、英语或“自定义 OCR”,可翻译成简体或繁体中文;支持独立 HTTP OCR 与兼容视觉模型接口。[接入说明与混合语言策略](docs/MULTILINGUAL_OCR.md)。 -- **纯本地桌面客户端**:PySide6 桌面应用,抛弃 Web 页面,启动后即可使用。 -- **全 ONNX 推理**:漫画文本检测、日/韩/英本地 OCR、LaMa 修复全部为 ONNX 模型,不再依赖 PyTorch。 -- **Windows 一体化安装**:v2.6.0 将程序和本地模型放进一个 Setup。 -- **延迟后台预热**:打开客户端先显示界面,模型在低优先级后台准备,开始翻译时直接复用。 -- **GPU 推理**:新安装默认优先 NVIDIA CUDA;软件内提供 CUDA/cuDNN 官方安装链接,需兼容的 NVIDIA 驱动,日志明确实际设备。保留旧配置中的 CPU 选择。 -- **多模态翻译开关**:勾选后发送整页图片给 AI,结合画面翻译;不勾选则发送 OCR 文本。字体、字号与横竖方向默认由本地算法决定,实验性字体比对需单独启用。 -- **PDF 整本翻译**:可与图片混合导入 PDF,逐页翻译后按原页序和原页面尺寸生成一个 `*_translated.pdf`。 -- **15 类字体风格**:提供对白、强调、手写、内心、旁白、拟声、标题等风格,本地自动分类并支持编辑器手动选择,对缺字逐字回退。 -- **自选译文字体与开源字体库**:翻译页和精修页均可检索字体;Google Fonts 快照收录 2,056 个字体族,目录约 1 MB,字体按需下载并离线使用。也可导入 TTF / OTF / TTC / OTC。翻译默认字体自动保存,精修手动字体只作用于当前块并优先生效,缺字逐字回退。[字体库说明](docs/FONT_LIBRARY.md)。 -- **掩膜擦除与掩膜嵌字**:擦除只按检测文字掩膜执行;嵌字可用面积与排版中心按掩膜计算。 -- **嵌字人工编辑与热预览**:翻译后可微调字体风格、实际字号、横竖方向、X/Y 偏移与排版蒙版宽高;画布可直接拖拽蒙版边角缩放、框内拖动位置,修改自动预览,保存直接输出当前结果。 -- **报错日志与 AI 诊断**:日志写入 `Log/app.log`,自动生成诊断提示词,支持 AI 多轮诊断。 -- **文件夹批量选择**:支持选择整个文件夹并递归添加图片和 PDF。 -- **安全停止**:点击停止后显示“正在停止”,等待当前推理或请求收尾后确认终态,不继续调度剩余页面。 -- **Issue 反馈**:右上角可跳转到自填的 GitHub Issue 链接。 -- **可调整布局**:左右主区域、预览与日志区域均可拖拽调整大小。 - -## 快速开始 +| ![第 6 页日文原图](docs/images/20.1.png) | ![第 6 页中文译图](docs/images/20.11.png) | +| ![第 7 页日文原图](docs/images/20.2.png) | ![第 7 页中文译图](docs/images/20.21.png) | -界面支持 **中文 / English / 日本語**,默认中文。首次启动时选择界面语言;之后可在“设置 → 翻译服务 → 界面语言”修改并保存,下次启动生效。此选项不改变漫画译文语言。[界面语言说明](docs/UI_LANGUAGES.md)。 +--- -翻译批次全部成功后,有 15% 概率在右下角显示仓库 Star 提示,8 秒无操作自动关闭,也可点 X 关闭。点击按钮才打开 GitHub 仓库。 +## 🚀 快速开始 -### Release 用户(推荐) +### Windows 一体化安装包(推荐) -下载 `ComiTrans-v2.6.0-x64-Setup.exe` 和 `SHA256SUMS.txt`,核对 SHA-256 后关闭 ComiTrans 并运行 Setup。首次使用请在设置中填写翻译 API 密钥和模型。[下载 v2.6.0](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0) +无需提前安装 Python、PyTorch 或手动拼接模型目录: -本版安装包未签名,Windows 可能显示「未知发布者」,请从发布页手动下载安装。应用启动时会检查更高的正式版本,点击模型状态左侧的「有更新」可查看版本详情并前往发布页。[安装与迁移说明](docs/WINDOWS_INSTALLER.md) +1. **下载与校验**:前往 [v2.6.0 发布页](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0) 下载 `ComiTrans-v2.6.0-x64-Setup.exe` 与 `SHA256SUMS.txt`,在 PowerShell 中校验哈希一致: -#### 历史 ZIP 版(v2.5.2) + ```powershell + Get-FileHash -Algorithm SHA256 .\ComiTrans-v2.6.0-x64-Setup.exe + Get-Content .\SHA256SUMS.txt + ``` -1. 在[发布页](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.5.2)下载 `ComiTrans-v2.5.2-app.zip`(程序包);首次安装或从 v2.5.0 及更早版本升级请同时下载 `ComiTrans-v2.5.2-models.zip`(模型包,与 v2.5.1 一致,已有 v2.5.1 模型可直接复用)。 -2. 所需压缩包解压到同一个父目录,合并顶层同名 `ComiTrans` 文件夹,保留子目录结构。最终模型路径为 `ComiTrans\comic-translate-ai\models\`。 -3. 双击合并后的 `ComiTrans.exe`,在“设置”页填写翻译 API Key 和模型。 +2. **运行安装向导**:关闭正在运行的旧版 ComiTrans,双击 Setup 完成安装。 + - 本版安装包**未签名**,Windows 可能显示「未知发布者」,核对哈希后手动运行即可。 + - 用户配置、字体与默认输出均独立保存在 `%LOCALAPPDATA%\ComiTrans`,卸载或覆盖升级不会丢失用户数据。 + - 从 `v2.6.0-pre.1` 升级可直接覆盖安装;从旧 MSI/WiX 版迁移请先在系统「已安装的应用」卸载旧版;从 `v2.5.2` 等历史 ZIP 版迁移请参阅 [安装与升级指南](docs/RELEASE-v2.6.0.md#从历史版本升级--迁移)。 +3. **填写翻译服务与可选 GPU**:安装后 CPU 模式即可直接加载模型。打开「设置」填写翻译 API 密钥与模型即可开始翻译;如需 NVIDIA GPU 加速,可在「设置 → 运行与输出 → GPU 安装说明与下载」按指引配置兼容驱动、CUDA 12 与 cuDNN 9([GPU 配置指南](docs/GPU_SETUP.md))。 -从 v2.5.1 升级可直接复用已有模型;从 v2.3.0 / v2.5.0 升级若仍使用旧模型包,建议合并 v2.5.1+ 模型包以使用更轻量的 CharSpot Small 日语 OCR 和双检测器切换。保留原有 `config.yaml`、整个 `user_fonts` 文件夹与输出文件。 - -Release 用户不需要安装 Python、PyTorch 或 pip。GPU 加速需要兼容的 NVIDIA 驱动、CUDA 12 和 cuDNN 9;软件“设置 → 运行与输出 → GPU 安装说明与下载”提供官方链接。已有兼容环境可复用,CPU 用户无需安装这些 GPU 库。[GPU 安装指南](docs/GPU_SETUP.md)。 - -升级到 v2.5.2:关闭程序,将 `ComiTrans-v2.5.2-app.zip` 解压到新目录,把旧目录的 `config.yaml`、`user_fonts/` 和 `comic-translate-ai/models/` 复制到对应位置。漫画输出及其 `_cleaned`、`_layout` 目录保持相对位置;确认新程序正常后再整理旧目录。GPU 用户可从软件设置打开官方运行库安装链接;本项目不打包上传 CUDA/cuDNN。本版使用完整程序包,详见[v2.5.2 更新说明](docs/RELEASE-v2.5.2.md)。 - -### 源码运行(开发者) +> [!NOTE] +> 界面支持 **简体中文 / English / 日本語**(首次启动可选,或在「设置 → 翻译服务 → 界面语言」修改,[语言说明](docs/UI_LANGUAGES.md))。整批翻译全部成功时有 15% 概率在右下角展示轻量 Star 提示,8 秒无操作自动收起。 -推荐 Python 3.12+,支持 CUDA 的 NVIDIA GPU 可选。 +
+源码运行(开发者 · Python 3.12+,NVIDIA GPU 可选) ```powershell cd D:\ComiTrans python -m venv .venv .\.venv\Scripts\python -m pip install -r comic-translate-ai/requirements.txt -``` -复制示例配置: +# 如需本地韩语 / 英语 PP-OCRv5 模型: +.\.venv\Scripts\python scripts/download_ocr_models.py -```powershell +# 复制示例配置并启动客户端 Copy-Item comic-translate-ai/main/config.example.yaml comic-translate-ai/main/config.yaml -``` - -启动客户端: - -```powershell .\.venv\Scripts\python run.py ``` -也可以直接双击 `start.bat`。客户端启动后会立即显示界面,模型随后在低优先级后台准备。 - -## 使用说明 - -1. 点击“添加文件”或“添加文件夹”,也可以直接拖拽图片、PDF 或文件夹到窗口。 -2. 在“设置”页填写翻译 API,并在工作台选择“原文语言”。日语自动使用 CharSpot Small,旧包可沿用 Baberu / manga-ocr,韩语、英语使用 PP-OCRv5;其它语言配置“自定义 OCR”。缺少韩英模型时运行 `.\.venv\Scripts\python scripts/download_ocr_models.py`,详见[接入文档](docs/MULTILINGUAL_OCR.md)。 -3. 勾选“多模态翻译”后,翻译会发送整页图片给 AI;不勾选则使用纯文本翻译。两种模式默认都由本地算法选择字体和排版。 -4. 在翻译页顶部展开“翻译偏好”,设置背景提示词、中文人名对照,以及可选的「保留上下文缓存」(跨任务复用并自动保持「断点续传」)。 -5. 点击“开始翻译”,在底部并行工作流拓扑图中实时查看各页所处的检测、并发翻译/修补、汇合排版与逐页状态。 -6. 翻译失败时可在“诊断”页查看诊断提示词,或点击顶部“反馈”按钮提交反馈。 -7. 需要微调时,切换到“嵌字精修”页,选择已翻译图片和文本块;直接拖动蒙版四角或边缘调整大小,框内拖动位置。右侧可输入字号、X/Y 偏移和蒙版宽高,画布自动更新。点击“保存图片”或 Ctrl+S 直接输出当前结果。[精修热预览说明](docs/EDITOR_LIVE_PREVIEW.md)。 +也可以直接双击 `start.bat` 启动。客户端会立即渲染主界面,模型随后在独立进程后台预热。 -### 译文字体 +
-竖排各列可在精修页“排版与位置 → 竖排列对齐”选择上对齐、居中对齐或下对齐,按最长列统一起点/终点,整组文字保持居中。设置按文本块保存,实时预览并随布局恢复。 +--- -精修译文可按 **Enter** 或点击“插入换行”手动分行,横排换行、竖排向左换列,连续回车保留空行/空列。修改立即预览,保存图片与布局后可继续恢复编辑。“排版与位置 → 文字效果”可选黑字白边或白字黑边(空心)。[操作说明](docs/EDITOR_LIVE_PREVIEW.md)。 +## 🧩 核心特性 -竖排连续省略号、破折号整体换列,兼容常见标点变体;省略号点间距一致,破折号连成竖线,保留手动指定的换列位置。 +### 1. 本地全 ONNX 视觉与推理管线 +- **轻量无 PyTorch**:检测、日/韩/英本地 OCR、LaMa 背景修补全部基于 **ONNX Runtime**,无需安装 PyTorch / torchvision / transformers。 +- **多源语言与自定义 OCR**:原生支持日语(CharSpot Small,兼容旧包 Baberu / manga-ocr)、韩语与英语(PP-OCRv5),并可配置独立 HTTP OCR 或兼容视觉模型接口。[多语言接入指南](docs/MULTILINGUAL_OCR.md) +- **原分辨率保真擦字**:只针对检测文字掩膜执行擦除;LaMa 显存紧张时自适应缩小分块而不缩图,结合纯色背景回填、网点/渐变重建与白气泡整框涂白兜底。 +- **独立进程预热与 GPU 优先**:图像模型会话隔离在独立进程中预热,不卡顿界面;新安装默认优先 NVIDIA CUDA 并明确汇报实际推理设备,同时保留已有 CPU 偏好。 -内置“狮尾B2黑体”和“狮尾牙膏圆体”的独立简体/繁体特黑版本,共 4 个字体、约 58.6 MiB,可离线检索使用;用于粗重强调字和圆润空心字的风格替代。[字体、搭配与授权](comic-translate-ai/font_file/Manga/README.md)。 +### 2. 上下文感知翻译与全书项目管理 +- **Fork-Join 并行流水线**:OCR 完成后自动分叉并发执行「按阅读顺序带上下文的 API 翻译」与「后台线程背景修复」,汇合时自动按译文结果对账掩膜并跳过空译文气泡。[上下文与并行架构](docs/CONTEXT_TRANSLATION.md) +- **跨页上下文与断点续传**:单批最多延续 12 页 / 24,000 字符阅读上下文并原子持久化至 `.cache/translation-context.json`;默认启用断点续传,失败或中断后可复用已付费译文。[断点续传说明](docs/RESUMABLE_TRANSLATION.md) +- **作品术语库与批前试译**:在 `任务 → 作品术语库` 统一角色、地点译名(支持仅填目标译名);整批前点击「试译」先跑开头 1–3 页,查看真实 Token 用量与自定义单价预估整本费用。 +- **PDF 与 CBZ 整本工作流**:支持图片、文件夹递归、PDF 与 CBZ 导入。PDF 按需渲染并保留 `.comitrans` 项目索引与独立精修目录,完成编辑后后台无损导出 `*_translated.pdf`;CBZ 支持保存后直接「导出 CBZ」。[PDF 精修指南](docs/PDF_EDITING.md) +- **多模态可选 & 简繁一键切换**:支持发送整页图片辅助翻译(字体/字号/方向默认仍由本地智能决策),顶部「译文」选择器支持即时切换简体/繁体中文输出。[简繁输出说明](docs/CHINESE_OUTPUT.md) -翻译页顶部的“译文”可切换 **简体中文/繁體中文**,选择后自动保存,重启后恢复。翻译请求、续传和本地输出规范化均使用所选字形,适用于图片和 PDF;当前字体选择、已有结果和精修草稿保持原样。[简繁切换说明](docs/CHINESE_OUTPUT.md)。 +### 3. 专业级嵌字精修与排版体系 +- **精简单层菜单与高效画布**:单层收纳「视图」「文件」「填色」「字体管理」,配合连续长条视图、单页滚轮隔离、`F2` 全屏编辑与 `Z` 缩放工具,专注修图与嵌字。 +- **多选气泡与连续样式刷**:列表 `Ctrl`/`Shift` 或画布 `Ctrl` 点击/`Shift` 框选批量改样式;支持「取样式」「应用样式到所选气泡」「样式刷」(跨页共享剪贴板、`Esc` 退出)及逐次「撤销样式」,严格保护译文与已还原气泡。 +- **全书译稿与单气泡重译**:通过「全书译稿」跨页查找替换全书文本;右侧「重译气泡」可对单个气泡单独重新请求翻译。 +- **全能画布修图工具**:支持手工添加气泡框、图片取色(避开辅助线)、自定义 RGB/Hex 框选填色、自选区域修补、逐气泡「还原此气泡」(保存重开后仍可切换还原),以及撤回修补。 +- **15 类字体风格 & 离线字体库**:本地自动匹配对白、强调、手写、内心、旁白、拟声、标题等 15 类风格,支持 `3×` 超采样 Lanczos 渲染、拉伸(`10%–400%`)、旋转(`±180°`)、描边(`0–30 px`)与白字黑边竖排预设;内置 9 槽收藏字体快捷栏(`1–9` 键)、10 套繁体漫画字体、4 款特黑漫画字体与 **2,056 族 Google Fonts** 按需下载离线目录。[字体库说明](docs/FONT_LIBRARY.md) · [自定义字体](docs/CUSTOM_FONTS.md) -展开翻译页的“翻译偏好”,即可选择“译文字体”和默认“竖排列对齐”,无需进入设置;默认折叠,自动保存选择。选中具体字体后,全部译文使用该字体;选择“自动匹配漫画风格”恢复各类原有风格字体。“+ 导入字体”支持多选 TTF、OTF、TTC、OTC,导入完成后自动选中最后一款,字体集合使用第一个款式。默认对齐写入新译文的精修布局,已有草稿保留各自选择。 +### 4. 诊断、安全控制与交付 +- **逐字日志与 AI 多轮诊断**:运行日志写入 `Log/app.log`,诊断页自动汇集环境、模型路径与堆栈,支持一键生成诊断提示词并与 AI 进行多轮排障对话。 +- **安全停止与更新提醒**:点击停止后等待在途请求与推理平稳收尾,不调度新页;启动时静默核对 GitHub 正式版,发现新版时在顶栏显示「有更新」提示。 -两个页面的字体选择框均可输入名称检索;点击“字体库”还可按名称、语言和风格筛选 Google Fonts,选择款式后点击“下载并使用”。完整目录可离线检索,下载一次后可断网使用。当前快照中 10 个缺少许可证附件的字体族仅展示,暂不提供下载。详见[字体库说明](docs/FONT_LIBRARY.md)。 +--- -另随应用内置 **10 个繁体漫画字体系列、12 个字重**,含源泉圆体、粉圆、芫荽、霞鹜文楷 TC、内海、清松手写体,以及思源黑体/宋体 TC、狮尾加糖宋体和大波浪圆体,首次使用即可离线选择。原始字体约 183.4 MiB,授权与来源一并分发。[完整清单](docs/TRADITIONAL_MANGA_FONTS.md)。字体选择优先显示中文名和粗细,保留英文名检索;精修页字体框独占一行,下方完整名称可换行,下拉列表自动加宽。 +## 🔄 翻译流水线 -选择自动保存,下次翻译生效;精修中的页面会更新预览并保留草稿,手动指定字体的文本块保持原选择,点击“保存图片”才写入输出。精修选择“跟随翻译默认字体”可恢复默认。导入和下载的字体保存在应用目录的 `user_fonts`,不安装到系统;重复文件复用已有字体,缺字逐字回退。搬迁或更新应用时保留整个 `user_fonts` 文件夹。详见[字体使用说明](docs/CUSTOM_FONTS.md)。 +```text +读取图片 / PDF / CBZ ──▶ 气泡与文字检测 ──▶ 源语言 OCR + │ + ┌──────────────────────────────────┴──────────────────────────────────┐ + ▼ ▼ + [ 分支 A:按阅读顺序翻译 ] [ 分支 B:后台线程擦字修补 ] + 携带最多 12 页上下文请求 API 纯色回填 / 网点渐变 / 原尺寸分块 LaMa + └──────────────────────────────────┬──────────────────────────────────┘ + ▼ + 汇合对账(空译文自动还原掩膜)──▶ 3× 超采样中文排版 ──▶ 保存输出 / 导出 PDF·CBZ +``` -默认在输出页右下角添加小号半透明 Skribble `@ComiTrans` 字标,可在“设置 → 第一页(翻译服务)→ 添加 @ComiTrans 水印”取消勾选并保存以关闭。已保存的关闭选择会保留。后续翻译图片和 PDF 每页按开关添加水印;精修中的页面也会更新预览,点击“保存图片”写入。重复保存不会叠加水印,清理底图保持无水印。 +1. **气泡与文本检测**:ONNX 检测器输出气泡框、文字掩膜与文本行。 +2. **源语言 OCR**:日语使用 CharSpot Small,韩/英使用 PP-OCRv5,或接入自定义 OCR;无原文/无译文区域保持原图。 +3. **分支 A · 顺序上下文翻译**:结合作品术语库与滚动上下文(最多 12 页 / 24,000 字符)发起翻译;多模态模式附带整页图像。 +4. **分支 B · 并行背景修复**:与翻译请求等待并发执行擦字;汇合时根据最终译文动态对账,清除空译文气泡的涂抹掩膜。 +5. **中文排版**:按掩膜有效面积估算字号、按掩膜质心定位,横竖自动适配,长文本自动收紧并处理竖排省略号/破折号。 +6. **保存与可逆精修**:输出成图、`<输出目录>_cleaned/` 无字底图与 `<输出目录>_layout/` 布局 JSON,随时可在精修页继续微调。 +7. **整书汇编**:PDF 全部页面成功后按原页面尺寸无损汇编并重新打开校验(覆盖小数尺寸边缘);CBZ 可在精修保存后导出为新压缩包。 -默认启用按页断点续传。网络失败或停止后,使用相同原文件、输出目录和翻译设置再次开始,即可跳过已完成页面并复用已保存译文;重启程序后同样有效。需要全部重译时,取消“翻译偏好 → 断点续传”勾选。[断点续传说明](docs/RESUMABLE_TRANSLATION.md)。 +> 服务返回 HTTP `401/403`(鉴权失败)、`402`(余额不足)或 `404`(接口/模型不存在)时,客户端会立即汇报具体原因并停止后续页面调度。 -PDF 会以一个文件任务显示,内部按在途页数上限连续处理,成功后输出 `<原文件名>_translated.pdf`,并保留同名 `.comitrans` 索引和独立精修资料目录。点击结果页的精修入口,或在“嵌字精修”导入译文 PDF,即可逐页改字、排版与修补背景;开启“连续长条”可纵向滚动浏览并点击页面原位编辑。精修始终操作逐页图片,“保存图片”和切页不会合成 PDF;需要成书时点击“导出 PDF”,选择文件名后在后台无损合成,支持进度与取消。也可直接导入资料目录中的 `project.json`,不依赖 PDF 本身。输出保留页数、顺序和页面尺寸,页面内容会栅格化;加密或需要密码的 PDF 暂不支持。移动项目时请一起保留 PDF、索引和资料目录。详见 [PDF 精修说明](docs/PDF_EDITING.md)。 +--- -### OCR 接口 +## 📦 模型与文档导航 -在“设置”中选择源语言和 OCR 引擎;OCR 与翻译服务分别配置地址、密钥和模型。 +### 内置 ONNX 模型清单 -| 引擎 | 使用方式 | -| --- | --- | -| 日语本地 OCR | 自动模式优先 CharSpot Small;使用旧模型包时兼容 Baberu 和 manga-ocr | -| 韩语 / 英语本地 OCR | PP-OCRv5 ONNX,模型随 v2.3.0 模型包提供 | -| 标准 HTTP OCR | 对完整 POST 地址发送文本区域 PNG 的 Base64,返回原文字符串 | -| 兼容视觉模型接口 | 填写兼容 OpenAI 的 Base URL、独立 Key 和支持图片输入的模型,调用 `chat.completions` 识别原文 | +| 用途 | 默认模型 | 说明与文档 | +| --- | --- | --- | +| **漫画文字块与文字行** | ogkalu Small INT8 + PP-OCRv6 manga | [固定来源、许可证与 SHA256](docs/models/split-detector.json) | +| **日文 OCR** | CharSpot Small | [模型卡、词表及许可证](docs/models/charspot-small.json) · [v2.5.1 评测](docs/MODEL_UPGRADE-v2.5.1.md) | +| **韩语 / 英语 OCR** | `korean_PP-OCRv5_rec_mobile.onnx` / `en_PP-OCRv5_rec_mobile.onnx` | [固定模型来源与校验值](docs/MULTILINGUAL_OCR.md#韩语和英语模型) | +| **LaMa 背景修复** | `lama-manga-dynamic.onnx` | [来源核验](docs/MODEL_UPGRADE-v2.5.1.md) · [更多候选模型](docs/ONNX_MODELS.md) | -标准 HTTP 请求体(`model` 选填): +### 专题文档速查 -```json -{"image_base64": "", "mime_type": "image/png", "language": "fr", "model": "my-ocr"} -``` +| 主题 | 文档 | 主题 | 文档 | +| --- | --- | --- | --- | +| **v2.6.0 发布与迁移** | [RELEASE-v2.6.0.md](docs/RELEASE-v2.6.0.md) | **Windows 打包与签名** | [WINDOWS_INSTALLER.md](docs/WINDOWS_INSTALLER.md) | +| **上下文与并行流水线** | [CONTEXT_TRANSLATION.md](docs/CONTEXT_TRANSLATION.md) | **多语言与自定义 OCR** | [MULTILINGUAL_OCR.md](docs/MULTILINGUAL_OCR.md) | +| **PDF 精修与项目导出** | [PDF_EDITING.md](docs/PDF_EDITING.md) | **字体库与自定义字体** | [FONT_LIBRARY.md](docs/FONT_LIBRARY.md) · [CUSTOM_FONTS.md](docs/CUSTOM_FONTS.md) | +| **精修热预览与性能** | [EDITOR_LIVE_PREVIEW.md](docs/EDITOR_LIVE_PREVIEW.md) · [EDITOR_PERFORMANCE.md](docs/EDITOR_PERFORMANCE.md) | **整体架构与完整日志** | [ARCHITECTURE.md](docs/ARCHITECTURE.md) · [CHANGELOG.md](CHANGELOG.md) | -响应体(`confidence` 可省略;有值时为 0–1): +--- -```json -{"text": "Bonjour le monde !", "confidence": 0.96} -``` +## 🔧 进阶说明与开发打包 -配置密钥时附带 `Authorization: Bearer `。无文字返回 `{"text":""}`;接口失败时该页停止,不继续擦除原文。默认超时 60 秒,可设 1–300 秒。自定义 OCR 会把文本区域图片发送到填写的服务;多模态翻译还会发送整页图片到翻译服务。 +
+使用进阶:译文字体、自定义 OCR 协议、15 类字体风格与 AI 诊断 -Python 扩展通过 `OcrEngine.recognize(image, language) -> OcrResult` 接入。一次任务使用一种源语言,自动混合语言路由尚未启用。完整协议、配置字段、模型下载和 Python 示例见 [多语言 OCR 接入文档](docs/MULTILINGUAL_OCR.md)。 +#### 译文字体、繁简与水印控制 +- **字体导入与离线字体库**:支持导入多选 `TTF / OTF / TTC / OTC`(保存于 `user_fonts/`,不污染系统字体),也可在「字体库」按名称、语言和风格检索并下载 **2,056 个 Google Fonts 字体族**;另内置 **10 个繁体漫画字体系列(12 字重)**([清单](docs/TRADITIONAL_MANGA_FONTS.md))与狮尾 B2/牙膏圆体特黑字重([授权](comic-translate-ai/font_file/Manga/README.md))。缺字按字符自动回退。 +- **竖排对齐与手动换行**:在「排版与位置」选择竖排列上/中/下对齐;译文框支持按 `Enter` 或「插入换行」保留空行/空列;支持黑字白边与白字黑边预设。 +- **文字水印开关**:默认在输出右下角添加半透明 Skribble `@ComiTrans` 字标,可在「设置 → 翻译服务 → 添加 @ComiTrans 水印」关闭并持久化记忆;清理底图始终保持无水印。 -### 字体风格 +#### 自定义 OCR 接口协议 +在「设置」中配置与翻译服务独立的 OCR 地址、密钥与超时(默认 60 秒,支持 1–300 秒): +- **标准 HTTP OCR**:POST 发送文本区域 PNG Base64,请求体 `{"image_base64": "...", "mime_type": "image/png", "language": "fr", "model": "my-ocr"}`,返回 `{"text": "...", "confidence": 0.96}`;配置密钥时附带 `Authorization: Bearer `。 +- **兼容视觉模型接口**:填写 OpenAI 兼容 Base URL、独立 Key 与支持视觉输入的模型名称,调用 `chat.completions` 识别原文。 +- **Python 扩展**:实现 `OcrEngine.recognize(image, language) -> OcrResult`。详见 [docs/MULTILINGUAL_OCR.md](docs/MULTILINGUAL_OCR.md)。 +#### 15 类字体风格映射 | 风格 | 用途 | 默认字体 | | --- | --- | --- | | `dialogue` / `bold_dialogue` | 普通 / 粗体对话 | 霞鹜文楷 / 思源黑体 Heavy | | `radiating` / `sfx` | 强调放射 / 拟声词 | 得意黑 Smiley Sans 斜体 | -| `handwriting` | 手写注记 | setofont | -| `seto` | 濑户手写(可选手动指定) | SetoFont 濑户字体 | -| `tegaki_851` | 851 随性手写(可选手动指定) | 851tegakizatsu 851手写杂书体(缺字回退手写/正文) | +| `handwriting` / `seto` / `tegaki_851` | 手写 / 濑户 / 851 随性手写(后两项支持手动指定) | setofont / 851手写杂书体 | | `thought` / `serious` | 内心 / 严肃正式 | 思源宋体 | -| `whisper` / `cute` | 低语 / 可爱活泼 | Klee One(缺字自动回退思源字体) | -| `narration` | 横向长条旁白 | 霞鹜文楷 LXGW WenKai | -| `sfx` | 拟声词 | 得意黑 Smiley Sans 斜体 | -| `lxgw_marker` | 漫黑/马克笔强调(可选手动指定) | 霞鹜漫黑 LXGW Marker Gothic | -| `next_preview` | 下回预告 | Klee One | -| `title` | 章节标题 | 思源黑体 Heavy | - -普通气泡默认 `dialogue`,再根据 OCR 内容、检测类别、原字笔画强度和文本框比例选择其它风格。方向以检测器结果为主,仅在长宽比明显矛盾时纠偏;编辑器提供自动、明确竖排和明确横排三种选择。 - -`seto`、`tegaki_851`、`lxgw_marker` 可在嵌字精修页的「字体风格」中手动指定,本地自动判断暂不主动选择这三种风格。实验性字体比对仅在同时启用 `multimodal` 与 `multimodal_font_probe` 时运行,后者默认关闭:AI 从本地生成的黑体、宋体、手写三组候选中判断字体族,再经过本地门控和许可表应用;正文的黑体结果可映射到 `lxgw_marker`。策略与实测数据见 [docs/FONT_STYLE_STRATEGY.md](docs/FONT_STYLE_STRATEGY.md)。 - -嵌字使用局部 3 倍超采样后以 Lanczos 缩回原尺寸,小字号对白不再直接落在低分辨率画布上;普通气泡同时取消强制白描边,使笔画边缘更自然,复杂背景上的非气泡文字仍会保留描边以保证可读性。 - -### 报错日志与 AI 诊断 - -- 所有运行日志写入 `Log/app.log`。 -- “诊断”页自动整理环境信息、模型路径、最近日志和报错堆栈。 -- 支持复制诊断提示词、复制原始日志、打开日志文件。 -- AI 诊断会携带当前日志上下文,并保留多轮对话记忆,只有点击“清空上下文”才会重置。 +| `whisper` / `cute` / `next_preview` | 低语 / 可爱 / 下回预告 | Klee One(缺字回退思源) | +| `narration` / `lxgw_marker` / `title` | 旁白 / 漫黑强调(手动)/ 章节标题 | 霞鹜文楷 / 霞鹜漫黑 / 思源黑体 Heavy | -## 翻译流程 +> `multimodal_font_probe`(实验性多模态字体比对)默认关闭,策略与测试见 [docs/FONT_STYLE_STRATEGY.md](docs/FONT_STYLE_STRATEGY.md)。 -每张图片或 PDF 页面按以下 Fork-Join 流水线处理:不同页面的准备与检测按并发上限重叠推进,OCR 完成后分叉并发执行“按阅读顺序带上下文翻译”与“后台线程背景修复”,汇合对账后按输入顺序排版并保存结果: +#### 报错日志与 AI 诊断 +- 所有运行日志写入 `Log/app.log`;「诊断」页自动汇总环境信息、模型路径、最近日志与错误堆栈,支持一键复制诊断提示词并与 AI 进行多轮对话排障(点击「清空上下文」重置)。 -1. **气泡与文本检测**:ONNX 文本检测器输出气泡、文字掩膜和文本行。 -2. **源语言 OCR**:日语使用 CharSpot Small(兼容旧包 Baberu / manga-ocr),韩语和英语按文本行使用 PP-OCRv5,也可使用自定义 OCR。仅日语本地模式保留原有英文跳过规则;其它模式可正常识别、翻译英文。无原文或无译文的区域保留原图。 -3. **分叉分支 A · 顺序上下文翻译**:纯文本模式发送 OCR 结果,多模态模式发送整页图片,并自动拼接近期上下文(最多 12 页 / 24,000 字符);字体默认由本地按角色、字形和文本框选择,字号与排版方向由本地决定。 -4. **分叉分支 B · 并行背景修复**:与翻译 API 等待并发在独立后台线程执行整页擦字(纯色回填、规则网点/渐变重建或原尺寸分块 LaMa 修复);译文返回后汇合对账,自动移除空译文气泡的掩膜。 -5. **中文排版**:按掩膜有效面积估算字号、按掩膜质心定位,横竖方向自适应,长文本自动收紧字号。 -6. **保存与编辑**:输出翻译图,清理底图单独保存到 `<输出目录>_cleaned/`,布局 JSON 保存到 `<输出目录>_layout/`,可在嵌字精修页继续人工微调(含手动添加气泡、取色填色、收藏字体与拉伸旋转描边)。 -7. **PDF 重组**:PDF 的全部页面成功后,按原页面尺寸重组并重新打开校验(覆盖小数尺寸边界);任一页失败时不生成半成品 PDF。 - -翻译服务返回 401/403(鉴权)、402(余额不足)或 404(接口/模型不存在)时,客户端会显示实际原因并停止请求剩余页面。HTTP 402 需要为对应 API 账户充值,或更换有额度的 API Key,代码本身无法绕过服务商额度限制。 - -## 模型说明 - -| 用途 | 模型 | 来源 | -| --- | --- | --- | -| 漫画文字块与文字行 | ogkalu Small INT8 + PP-OCRv6 manga | [固定来源、许可证与 SHA256](docs/models/split-detector.json) | -| 日文 OCR | CharSpot Small | [模型卡、词表及许可证](docs/models/charspot-small.json) | -| 韩语 / 英语 OCR | `korean_PP-OCRv5_rec_mobile.onnx` / `en_PP-OCRv5_rec_mobile.onnx` | [固定模型来源与校验值](docs/MULTILINGUAL_OCR.md#韩语和英语模型) | -| LaMa 背景修复 | `lama-manga-dynamic.onnx` | [固定来源与许可证核验](docs/MODEL_UPGRADE-v2.5.1.md) | - -v2.5.1 本地预览只随包提供 CharSpot Small 日语 OCR,默认使用 Small+文字行半幅修框,全套模型 284.712 MB(v2.5.0 的 48.71%)。旧日语模型包仍可使用。3 页漫画的 22 框测试中,字符错误从 12 减至 5。[评测](docs/MODEL_UPGRADE-v2.5.1.md) · [安装与回退](docs/RELEASE-v2.5.1.md) - -模型来源、可替换的其它 ONNX 版本以及效果更好的漫画文本检测模型候选见 [docs/ONNX_MODELS.md](docs/ONNX_MODELS.md)。 - -## 打包与发布 - -### 打包主程序 - -先安装固定版本的构建依赖;构建脚本不再自动升级工具: - -```powershell -.\.venv\Scripts\python -m pip install -r requirements-build.txt -.\build_app.ps1 -``` +
-默认只打包主程序,不复制模型;本地联调模型时使用: +
+本地构建主程序与生成 Windows 安装包命令 -```powershell -.\build_app.ps1 -IncludeModels -``` +1. 安装固定版本的构建依赖(构建脚本不再自动升级工具): -### 生成发布包 + ```powershell + .\.venv\Scripts\python -m pip install -r requirements-build.txt + .\build_app.ps1 + ``` -构建桌面程序并安装 NSIS 后,运行以下命令生成包含默认模型的 Windows 安装包。打包脚本从客户端读取版本号。[Windows 打包说明](docs/WINDOWS_INSTALLER.md) + 如需本地联调模型,可附带 `-IncludeModels`:`.\build_app.ps1 -IncludeModels`。 -```powershell -.\.venv\Scripts\python.exe installer/build.py --include-models -``` +2. 安装 [NSIS 3.13](https://nsis.sourceforge.io/Download) 后,生成包含默认模型的 Windows 安装包(版本号自动读取自 `comic_translate_desktop/__init__.py`): -历史 ZIP 版的校验文件 + ```powershell + .\.venv\Scripts\python.exe installer/build.py --include-models + ``` -- [docs/releases/v2.5.2/baseline.json](docs/releases/v2.5.2/baseline.json):2.5.2 目标构建基线 -- [docs/releases/v2.5.2/SHA256SUMS.txt](docs/releases/v2.5.2/SHA256SUMS.txt):2.5.2 程序包、模型包及目标基线的 SHA256 -- [docs/releases/v2.5.1/baseline.json](docs/releases/v2.5.1/baseline.json):2.5.1 构建基线 -- [docs/releases/v2.5.1/SHA256SUMS.txt](docs/releases/v2.5.1/SHA256SUMS.txt):2.5.1 校验清单 -- [docs/releases/v2.4.0/baseline.json](docs/releases/v2.4.0/baseline.json):程序文件 SHA256 清单与构建指纹,供后续生成补丁 -- [docs/releases/v2.4.0/SHA256SUMS.txt](docs/releases/v2.4.0/SHA256SUMS.txt):程序包、模型包和基线清单的 SHA256 + 完整构建、签名与 CI 验证流程见 [docs/WINDOWS_INSTALLER.md](docs/WINDOWS_INSTALLER.md)。历史 ZIP 发布版的 `baseline.json` 与 `SHA256SUMS.txt` 保留在 `docs/releases/`(如 [v2.5.2](docs/releases/v2.5.2/SHA256SUMS.txt)、[v2.5.1](docs/releases/v2.5.1/SHA256SUMS.txt)、[v2.4.0](docs/releases/v2.4.0/SHA256SUMS.txt))。 -模型包解压到 `ComiTrans\comic-translate-ai\models\`。 +
-## 项目结构 +
+项目目录结构 ```text ComiTrans ├── run.py # 桌面客户端入口 -├── comic-translate-ai/ # AI 核心 -│ ├── main/ -│ │ ├── comic_translator_pipeline.py -│ │ ├── onnx_text_detector.py # ONNX 文本检测 -│ │ ├── onnx_manga_ocr.py # ONNX 日文 OCR -│ │ ├── onnx_baberu_ocr.py # Baberu ONNX OCR(旧模型包) -│ │ ├── manga_lama.py # ONNX 背景修复 -│ │ └── vertical_typesetter.py # 中文排版 -│ ├── models/ # 模型权重(Release 中位于 exe 旁) -│ └── font_file/ # 中文字体 -├── comic_translate_core/ # 源语言、OCR 协议及 PP-OCR 适配 -├── comic_translate_desktop/ # PySide6 桌面客户端 -├── assets/ui/ # SVG、界面字体与空状态插画 -├── assets/font_catalog.json # Google Fonts 目录快照,字体按需下载 -├── user_fonts/ # 用户导入/下载字体与许可证(本地,不提交) -├── scripts/update_font_catalog.py # 维护字体目录快照 -├── scripts/download_ocr_models.py # 韩英模型下载 -├── docs/ui-review/ # 新 UI 截图与逐字日志录屏 -├── docs/ONNX_MODELS.md # 模型来源与可选模型 -├── requirements-build.txt # 固定版本的构建依赖 -├── build_app.ps1 # 打包脚本 -└── package_release.py # Release 拆包脚本 +├── comic-translate-ai/ # AI 核心管线、ONNX 检测/OCR/LaMa 与中文排版 +├── comic_translate_core/ # 源语言路由、OCR 协议、图像隔离会话与更新校验 +├── comic_translate_desktop/ # PySide6 桌面客户端(主窗口、精修页、工作流对话框与动效) +├── assets/ +│ ├── i18n/ # 英文 / 日文界面翻译词典 +│ ├── ui/ # SVG 图标、UI 字体与空状态插画 +│ └── font_catalog.json # Google Fonts 目录快照(2,056 族按需下载) +├── installer/ # NSIS 安装脚本、更新查询服务与打包验收脚本 +├── scripts/ # 字体目录维护、韩英 OCR 模型下载与 UI 截图审查 +├── docs/ # 架构、模型清单、性能基准与版本发布文档 +├── tests/ # 自动化单元测试与桌面 UI 回归套件 +├── build_app.ps1 # PyInstaller 主程序打包脚本 +└── package_release.py # Release 文件清单与校验生成脚本 ``` -## 更新日志 - -### v2.6.0(2026-11-23) - -Windows 安装包附带默认模型。桌面端支持后台模型预热、作品术语库、试译和顶栏更新提醒。[发布说明](docs/RELEASE-v2.6.0.md) - -### v2.5.2(2026-11-17) - -- 新增滚动上下文记忆与 `.cache/translation-context.json` 原子缓存;偏好新增「保留上下文缓存」(联动锁定断点续传)。 -- OCR 后分叉并发执行按序翻译与后台 `repair_comic_page` 擦字修补,汇合对账空译文掩码;重绘翻译页工作流拓扑可视化面板与逐页状态矩阵。 -- 精修编辑器支持手工添加气泡框、图片取色与自定义 RGB 填色、9 槽收藏字体快捷切换(`1–9`)、拉伸(`10%–400%`)、旋转(`±180°`)、描边(`0–30 px`)与白字黑边竖排预设、列表清理控制及单页滚动隔离。 -- 推迟模型预热至首帧绘制后执行,修复小数尺寸 PDF 页面边缘覆盖问题。 -- [v2.5.2 发布说明](docs/RELEASE-v2.5.2.md) · [完整开发日志](CHANGELOG.md)。 - -### v2.5.1(2026-11-10) - -- 新增「夜墨」深色主题、画布点击选区、右栏可拖拽分隔线、`F2` 全屏编辑、缩放 HUD 与 `Z` 缩放工具、详细配置页、一键精修与框选填白/填黑。 -- 新增 CUDA 加速开关及检测器说明,日语自动切换为 CharSpot Small,v2.5.1 模型包可由 v2.5.2 直接复用。[v2.5.1 说明](docs/RELEASE-v2.5.1.md)。 -### v2.5.0(2026-11-02) - -- PDF 图片项目与显式无损导出;原尺寸分块修补、改进文字掩膜、网点/渐变重建和白描边处理。 -- 有上限的连续翻译流水线、GPU 实际设备检测、背景估计滤波加速、按页断点续传和付费译文缓存。 -- 连续长条、后台索引/切页/保存、局部合成;折叠栏与专注模式记住手动偏好。 -- 自选区域修补、逐气泡原图还原、默认和块级文字颜色、中文按词换行。 -- 独立翻译与文件服务,严格 JSON 输出及本地校验;诊断报告移除 PyTorch/CUDA 探测。 -- 新增 GPU 官方安装入口及已安装运行库目录识别;新安装默认优先 GPU,运行库不随发布包上传,旧模型可复用。 -- [详细更新、安装与已知边界](docs/RELEASE-v2.5.0.md) · [完整开发日志](CHANGELOG.md)。 - - -### v2.4.0(2026-10-13) - -- 新增逐文件 SHA256 补丁基线、构建指纹和 Windows 更新入口;后续小版本可按文件生成补丁,校验原构建、备份修改文件并在失败时恢复。[补丁说明](docs/PATCH_UPDATES.md)。 -- 基线和 SHA256 校验信息保存在源码仓库;发布页提供程序包与模型包,程序内自带更新校验基线。 -- 漫画风界面改为开放式分区,移除大号章节横幅,柔化按钮与边框;增加局部网点和空状态漫画插画,补齐右上角日文字形。 -- 翻译页直接导入字体、设置默认译文字体;加入约 1 MB 的完整 Google Fonts 目录快照,支持名称检索、语言/风格筛选、后台下载、许可证保留及离线使用。 -- 精修支持八个拖拽点自由调整蒙版、拖动位置和 Esc 撤销本次拖动;字号、X/Y、文本与字体自动预览,保存直接输出当前结果并持久化布局。 -- 修复精修字体被全局默认字体覆盖、缺字时整段换字体的问题;手动字体只作用于当前块,逐字回退,保存和重新打开后保留。 -- 删除已确认的 82 个旧 Web、失效 CLI 和训练文件,简化 ONNX 后处理导入、预热与构建依赖,修复诊断 HTTP 客户端释放。 -- 多模态翻译与实验性字体比对使用独立开关,字体比对默认关闭;完善本地字体候选、投票和 API 思考开关,并记录后续翻译约束计划。 -- 验证:176 项自动化测试通过;正常与 200% 缩放各 33 张真实 Qt 截图检查通过;实际字体下载与断网选用、补丁校验及失败回滚验证通过。 - -主程序与模型继续拆包,v2.3.0 用户可复用已有模型。更多细节见[v2.4.0 发布说明](docs/RELEASE-v2.4.0.md)、[完整更新日志](CHANGELOG.md)、[项目瘦身记录](docs/PROJECT_CLEANUP.md)和[精修说明](docs/EDITOR_LIVE_PREVIEW.md)。 - -### v2.3.0(2026-09-16) - -- 重构为黑白漫画杂志风 UI:通栏章节标题、边缘网点、Skribble 字标;自动处理与嵌字精修采用统一视觉。 -- 流程改为单行直线节点,紧凑显示原文语言和输出目录;按真实页面事件推进,保留并行页、跳过、失败与取消状态。 -- 日志使用 Aa 手写字体快速逐字展开,积压自动加速;支持回看、选区、搜索、筛选、复制与完整导出。 -- 新增韩语、英语 PP-OCRv5 ONNX,以及独立 HTTP OCR / 兼容视觉模型 OCR 接口;OCR 原文、语言和后端信息写入布局 JSON。 -- 统一源语言翻译路由:韩英与自定义模式不再套用日语模式的英文跳过规则;空原文、空译文和 OCR 失败时保护原图。 -- 发布资源包含两款 UI 字体、SVG 图标和韩英模型;README 更新真实 UI 截图、日志动画及 A/B 两组对比图。 - -### v2.2.2(2026-09-14) - -**新增与优化** - -- 全面美化桌面端 UI 与操作反馈,加入克制的过渡动画、递归目录导入和拖放操作。 -- 支持整本 PDF 漫画导入、逐页翻译与重新导出。 -- 默认使用 Baberu ONNX OCR,并保留 manga-ocr-onnx 回退路径。 -- 优化漫画嵌字:采用更圆润的字体风格与 3 倍超采样渲染,降低文字像素感。 -- 竖排文本中的双破折号 `——` 改为连续长竖线,并扩展字体样式与标点布局规则。 - -**修复** - -- 修复 Issue #19:翻译 API 请求日志引用未定义变量 `zhengzai`,导致请求发出前直接报错。 -- 改进 API 错误分类与提示,遇到鉴权、余额、模型、限流和服务端错误时给出明确原因;致命错误会停止剩余任务。 - -### v2.2.1(2026-08-07) - -**新功能** - -- 翻译工作台新增“输出目录”设置,默认输出路径不变,与 API 配置页双向同步。 -- 主窗口与按钮补齐应用图标,统一 UI 样式与交互观感。 -- 多图翻译优化:检测/OCR 与修复/嵌字串行,各页翻译 API 请求并行发起(默认 4 并发),整体处理时间显著压缩。 -- 翻译 API 请求日志:记录请求模型、文本条数、返回条数、耗时、数量不匹配与失败原因;未嵌字时输出明确警告。 -- 翻译系统提示词严谨化:统一 JSON 对象输出格式,严格约束数量一致,拟声词强制翻译,减少空译文导致的漏嵌字。 -- 下回预告与画外音字号分档:章节预告识别扩展(第 N 话、后篇、预告、最终话等),两档字号独立调优。 - -**调整** - -- 输出目录系列改为 `output_page_*`;测试素材统一放在 `page/test`,测试输出写入 `page/test_output`。 -- 测试与输出目录不再上传、不再打包。 - -### v2.1.0(2026-08-06) - -**架构重构** - -- 抛弃 Web 架构(Spring Boot / FastAPI / PostgreSQL / Redis / Nginx),重构为纯本地 PySide6 桌面客户端。 -- 检测、OCR、修复全部切换为 ONNX Runtime 推理,彻底移除 PyTorch / torchvision / transformers 依赖。 -- 主程序与模型拆分发布:模型单独一个下载包,更新程序无需重新下载模型。 - -**新增功能** - -- 延迟后台预热:打开客户端先显示界面,模型随后低优先级加载,翻译时直接复用。 -- 多模态翻译开关:勾选后发送整页图片,翻译后让 AI 配置字体、字号和横竖方向。 -- 嵌字人工编辑:调整字体风格、字号、横竖方向和位置,保存覆盖输出。 -- 报错日志与 AI 诊断:自动生成诊断提示词,支持多轮对话上下文。 -- 文件夹批量选择、即时停止任务、Issue 反馈、可拖拽调整布局。 -- 特殊字体分类:画外音、拟声词、下回预告、大标题使用不同开源字体。 - -**优化与修复** +
-- 修复打包版 exe 预热停滞问题(unittest 误排除、检测器动态导入、pyclipper / unidic / manga_ocr assets 缺失)。 -- 横竖方向判断与嵌字方向阈值调整,减少横排误判竖排。 -- 字号算法平衡:竖排放大、横排收紧,长文本自动收紧,按掩膜面积估算字号、按掩膜质心排版。 -- 擦除只按检测文字掩膜执行,不再擦除整个气泡。 -- 英文文本块完整跳过:不 OCR、不擦除、不嵌字;OCR 结果中拉丁/全角拉丁占比高时自动判定为英文并保留原文。 -- 清理底图移入独立的 `<输出目录>_cleaned/` 目录。 -- 移除训练/可视化依赖(matplotlib、wandb、pandas、torchsummary)。 +
+近期版本摘要(v2.6.0 / v2.5.2 / v2.5.1 / v2.5.0) -### v1.x(已归档) +- **v2.6.0(2026-11-23)**:单文件 Windows x64 NSIS Setup(含默认模型)、独立进程模型预热、后台正式版更新提醒、作品术语库、1–3 页试译与 Token 消耗估算、CBZ 导入与导出、精修单层菜单重构、气泡多选与连续样式刷、全书译稿跨页查找替换、单气泡重译,以及 60fps 黑白墨韵动效与双主题统一。[发布说明](docs/RELEASE-v2.6.0.md) +- **v2.5.2(2026-11-17)**:滚动翻译上下文与缓存保留、OCR 后按序翻译 ∥ 后台修补 Fork-Join 并行流水线、实时工作流拓扑图与逐页状态矩阵、手动画框/图片取色/RGB 填色/9 槽收藏字体/拉伸旋转描边预设、冷启动首帧优化与 PDF 边缘覆盖修复。[发布说明](docs/RELEASE-v2.5.2.md) +- **v2.5.1(2026-11-10)**:夜墨深色主题、画布点选、右栏拖拽分隔、F2 全屏编辑、Z 缩放工具、CUDA 开关提示、CharSpot Small 默认日语 OCR 与白气泡涂白兜底。[发布说明](docs/RELEASE-v2.5.1.md) +- **v2.5.0(2026-11-02)**:大 PDF 图片工作流与显式无损导出、原分辨率分块修补、有上限连续流水线、按页断点续传与气泡原图还原。[发布说明](docs/RELEASE-v2.5.0.md) -- 基于 Web 的漫画翻译平台:Spring Boot 后端、Vue 前端、PostgreSQL / Redis / Nginx,图像处理由 Python worker 完成。 -- 支持批量图片翻译、文字擦除、字体分类、横向排版、模型托管。 -- 旧 Web 源码和对应文档已从当前工作树移除,历史实现保留于 Git 历史;本轮清理见 [项目瘦身记录](docs/PROJECT_CLEANUP.md)。 +完整演进记录(含 v2.4.x ~ v1.x)请查阅 [CHANGELOG.md](CHANGELOG.md)。 -## 常见问题 +
-**Release 需要安装 Python 或 GPU 运行库吗?** +--- -不需要 Python。单文件 Setup 安装完成后即可用 CPU 加载本地模型。GPU 模式需要兼容的 NVIDIA 驱动、CUDA 12 和 cuDNN 9,软件内提供安装指引。 +## ❓ 常见问题 -**模型放哪里?** +**1. 安装 Release 需要配置 Python 或 PyTorch 吗?** +不需要。v2.6.0 Windows Setup 已内置运行环境、中文字体与默认 ONNX 模型,安装后即可用 CPU 推理。如需 NVIDIA GPU 加速,请按软件「设置 → 运行与输出」中的官方指引安装兼容的 NVIDIA 驱动、CUDA 12 和 cuDNN 9。 -v2.6.0 Setup 会自动把模型装到程序目录。v2.5.2 等历史 ZIP 版仍按上方步骤将程序和模型解压到同一目录。 +**2. 模型存放在哪里?还需要单独下载模型包吗?** +v2.6.0 Setup 会自动将默认模型安装到程序目录,无需再合并模型压缩包。韩语 / 英语 OCR 模型可通过源码脚本下载或在旧版模型包中复用;历史 ZIP 版请保持 `ComiTrans\comic-translate-ai\models\` 目录结构。 -**为什么英文文本没有被翻译?** +**3. 为什么日语模式下部分英文文本没有被翻译?** +日语本地模式默认保留检测器标记的英文块以及拉丁字符占比较高的 OCR 结果。翻译纯英文页面时,请在工作台将「原文语言」切换为「英语」;韩语、英语及自定义 OCR 模式均会正常识别并翻译英文区域(自动混合语言路由尚未启用)。 -日语本地模式会保留检测器标记的英文块,以及拉丁字符占比较高的 OCR 结果。处理英文页面时请选择“原文语言:英语”;韩语、英语和自定义 OCR 模式会正常识别并翻译这些区域。自动混合语言路由尚未启用。 +**4. 为什么打开安装包时 Windows 提示「未知发布者」?** +当前发布的 Windows Setup 未购买商业代码签名证书。请务必从 [GitHub Releases](https://github.com/Aaaaamadeus/ComiTrans/releases) 下载,并使用本页提供的 `SHA256SUMS.txt` 核对文件哈希一致后再安装。 -**为什么主程序包这么小?** +--- -v2.2.1 已全面 ONNX 化并移除 PyTorch。检测、OCR、修复均使用 ONNX Runtime;GPU 推理还需兼容的 CUDA/cuDNN,通过软件中的官方安装链接获取。 +## 💬 反馈与支持 -## 反馈与支持 +使用中遇到异常或有功能建议,欢迎在 [GitHub Issues](https://github.com/Aaaaamadeus/ComiTrans/issues) 提交,或直接点击客户端顶部的「反馈」按钮。建议附上「诊断」页自动生成的诊断提示词,以便快速定位问题。 -使用中遇到问题,可以在 [GitHub Issues](https://github.com/Aaaaamadeus/ComiTrans/issues) 提交,或使用客户端顶部的“反馈”按钮。建议附上“诊断”页生成的诊断提示词,方便快速定位。 +--- -## 开源协议 +## 📄 开源协议 -- 项目源码采用 [GPL-3.0](LICENSE)。 -- 字体:得意黑 Smiley Sans、霞鹜文楷 LXGW WenKai、霞鹜漫黑 LXGW Marker Gothic(SIL OFL 1.1)、Klee One、思源黑体/宋体、setofont(濑户字体)、851手写杂书体 均为可免费商用的开源/免费字体,各自的授权见字体项目说明。 -- UI 字体 Skribble 与 Aa今日花晴 春懒猫困使用各自的内嵌版权信息,来源与用途见 [字体说明](assets/ui/fonts/README.md)。 -- 模型:CharSpot Small 权重为 CC BY-NC-SA 4.0,各模型的来源、署名与许可见 [docs/ONNX_MODELS.md](docs/ONNX_MODELS.md)。 +- **项目源码**:采用 [GPL-3.0](LICENSE) 开源协议。 +- **内嵌中文字体**:得意黑 Smiley Sans、霞鹜文楷 LXGW WenKai、霞鹜漫黑 LXGW Marker Gothic(SIL OFL 1.1)、Klee One、思源黑体 / 宋体、setofont(濑户字体)、851手写杂书体 均为可免费商用的开源 / 免费字体,各自授权见对应字体说明;繁体漫画字体包见 [docs/TRADITIONAL_MANGA_FONTS.md](docs/TRADITIONAL_MANGA_FONTS.md)。 +- **UI 字体**:Skribble 与 Aa今日花晴 春懒猫困保留各自内嵌版权信息,来源与用途见 [assets/ui/fonts/README.md](assets/ui/fonts/README.md)。 +- **AI 模型**:CharSpot Small 权重采用 CC BY-NC-SA 4.0 协议;各模型的来源、署名与完整许可条款见 [docs/ONNX_MODELS.md](docs/ONNX_MODELS.md)。 diff --git a/README_en.md b/README_en.md index 759a440..ed3b754 100644 --- a/README_en.md +++ b/README_en.md @@ -2,522 +2,346 @@
-**[English](README_en.md)** | **[简体中文](README.md)** - -
- -release -python -PySide6 -ONNX Runtime -stars +

ComiTrans

+ +

Local ONNX Vision Pipeline × Context-Aware LLM Translation × Professional Typesetting Workbench

+ +

+ 简体中文 | English +

+ +

+ Release + Windows x64 + Python 3.12+ + PySide6 + ONNX Runtime + GPL-3.0 + GitHub Stars +

+ +

+ v2.6.0 Highlights · + Preview · + Before / After · + Quick Start · + Features · + Pipeline · + Models & Docs · + FAQ +

-Source-language selection supports Japanese, Korean, English, and **Custom OCR**, with Simplified or Traditional Chinese output. Download the local Korean/English PP-OCRv5 ONNX models using `.venv\Scripts\python scripts/download_ocr_models.py`. Custom OCR supports HTTP endpoints and compatible vision models. See the [integration guide and proposed mixed-language strategy](docs/MULTILINGUAL_OCR.md). Automatic mixed-language routing is not yet enabled. - -ComiTrans is a manga translation desktop client. Detection, built-in Japanese/Korean/English OCR, inpainting, and Chinese typesetting run locally; translation uses your configured LLM API. No web frontend is required. - -Since v2.2.1, detection, OCR, and inpainting have run on **ONNX Runtime**, with no PyTorch, torchvision, or transformers dependencies. - -> [!NOTE] -> **v2.6.0 for Windows x64** bundles the app and models in one installer. Model warm-up runs in a separate process. Project glossaries and trial translations help check a batch before running it. [Release notes and upgrade instructions](docs/RELEASE-v2.6.0.md) - -> [!NOTE] -> **v2.5.2 update:** rolling cross-page translation context with optional cache retention, an OCR-forked sequential-translation ∥ background-repair Fork-Join pipeline, a redesigned live workflow graph on the translation page, plus manual bubble boxes, eyedropper & custom RGB fills, 9-slot favorite fonts (`1–9`), lettering stretch/rotation/outline, and fractional-edge PDF export fixes. v2.5.1 models remain reusable. [v2.5.2 release notes](docs/RELEASE-v2.5.2.md) · [Changelog](CHANGELOG.md). - -## What's new in v2.5.2 - -- **Contextual translation & Fork-Join pipeline:** Rolling cross-page memory (up to 12 pages / 24,000 serialized chars) atomically saved to `.cache/translation-context.json`, with a "Keep context cache" preference that keeps per-page resume enabled. Right after OCR, sequential reading-order translation and background-thread page inpainting (`repair_comic_page`) run concurrently and reconcile empty translations at join. [Context & parallel pipeline guide](docs/CONTEXT_TRANSLATION.md). -- **Live Fork-Join workflow visualizer:** Replaces the 7-step straight bar on the translation page with a real-time directed graph (`Start → Detect → OCR → [Translate ∥ Inpaint] → Typeset → Save / PDF`) displaying concurrent in-flight page badges, repair-ready join state, context count, resumed pages, and a bottom per-page matrix strip. -- **Typesetting editor upgrades:** Manual bubble frame creation, canvas/strip color picking (avoiding guides), custom RGB/Hex selection fills (undoable), 9 pinned favorite fonts with `1–9` shortcuts, persisted text colors, stretch (`10–400%`), rotation (`±180°`), manual outline stroke (`0–30 px`) with a vertical white-text black-outline preset, page removal/clear controls, `1 / N` block counter, and single-page scroll isolation. -- **Startup & PDF fixes:** Defers ONNX model warmup until after first paint and covers fractional page edges during PDF export. +ComiTrans is a pure-local PySide6 desktop client for manga translation and lettering. Text detection, Japanese/Korean/English OCR, native-resolution inpainting, and Chinese typesetting all run locally via **ONNX Runtime** (with zero PyTorch or web frontend dependencies), paired with your configured LLM API and a live-preview lettering studio. -## What's new in v2.5.0 +--- -- **Long PDF workflow:** render pages on demand; edit individual images and explicitly export a lossless PDF. Continuous Strip loads nearby pages, and projects can open from `project.json`. [PDF guide](docs/PDF_EDITING.md). -- **Streaming translation and resume:** prepare/OCR/translate later pages while repairing the current page, with a default cap of four in-flight pages. Logs report the actual GPU/CPU provider. Resume completed pages and reuse cached valid translations. [Resume](docs/RESUMABLE_TRANSLATION.md) · [Measured performance](docs/TRANSLATION_PERFORMANCE.md). -- **Native-resolution repair:** smaller repair tiles on memory pressure, without downscaling pages. Improved masks for light/dark text, outlines, overlapping artwork, screentones and gradients; masks are independently testable and replaceable. [Mask component](docs/TEXT_MASK_COMPONENT.md). -- **Retouching controls:** background selection repair, per-block colors/outlines, word-aware Chinese wrapping, and restoration of a selected bubble's original pixels and text. Restoration remains reversible after saving. [Bubble restoration](docs/BUBBLE_RESTORATION.md). -- **Large-project editing:** background indexing, decoding and saving; bounded loading and visible-canvas reuse; edits made during saving remain dirty. Preference panels retain manual choices across resizing and focus mode. [Editor measurements](docs/EDITOR_PERFORMANCE.md). -- **API reliability:** strict JSON Schema where supported, with local type/count validation on every fallback; isolated translation, mask, persistence and scheduling components. [JSON contract](docs/TRANSLATION_JSON_CONTRACT.md) · [Architecture](docs/ARCHITECTURE.md). +## ✨ v2.6.0 Highlights -A three-page offline scheduling comparison measured **42.43 → 37.85 seconds**, with identical output pixels and a simulated two-second API delay. This is not a live API or whole-PDF speed guarantee. Complex backgrounds may still need manual retouching. The independent retouch plugin API is designed; host-side plugin loading is not implemented. +> [!TIP] +> **ComiTrans v2.6.0 is out!** Now shipped as a single-file Windows x64 Setup installer bundling the app, fonts, and default ONNX models, alongside major workflow, editor, motion, and startup upgrades. +> 👉 [Read v2.6.0 Release & Migration Guide](docs/RELEASE-v2.6.0.md) · [Download v2.6.0 Setup](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0) · [Full Changelog](CHANGELOG.md) -## Manga workbench +| Area | What's New in v2.6.0 | +| --- | --- | +| **📦 All-in-One Windows Setup & Update Indicator** | Single-file solid-LZMA NSIS installer bundling app, fonts, and default ONNX models—CPU inference works out of the box. Background startup check surfaces an `Update` badge beside `Models ready` only when GitHub lists a newer stable release. | +| **📚 Work Terminology, Trial Run & CBZ** | Maintain per-series glossaries (`Task → Work terminology`); test 1–3 pages with `Trial` and inspect token usage & estimated full-book cost under `Translation usage`; import `.cbz` archives and export edited pages via `File → Export CBZ`. | +| **🎨 Flat Menus, Multi-Select & Style Brush** | Streamlined non-nested View, File, Fill, and Font menus free up canvas space; supports `Ctrl`/`Shift` multi-select, `Pick style` / `Style brush` / `Undo style`, cross-page `Book transcript` search/replace, and single-bubble `Retranslate`. | +| **⚡ 60fps Monochrome Motion & Subprocess Warm-Up** | Unified 60fps motion system across Paper and Night Ink themes; detector, OCR, and LaMa sessions warm up in an isolated process off the Qt event loop so the UI stays responsive from launch. | -A black-and-white manga workbench with open section headings, local halftones, the Skribble wordmark, and soft controls. Workspaces open directly into their tools. Import fonts and pin up to 9 favorite translation fonts (`1–9` shortcuts) with a real glyph preview; the bottom Fork-Join workflow graph tracks live in-flight pages, `AI Translate ∥ Inpaint` branches, rolling context count, and a per-page status strip. The editor canvas preserves the artwork's colors. +--- -**Automatic processing · Fork-Join live workflow** +## 📷 Interface Preview -![ComiTrans live Fork-Join workflow visualizer](docs/ui-review/automatic-workflow-v252.png) +Designed with a monochrome manga-magazine aesthetic—open section headings, halftone accents, the Skribble wordmark, and 60fps restrained motion. Switch instantly between **Follow system / Paper / Night ink** without affecting manga pixels or exported images. -**Typesetting editor · Favorite fonts, fills & layout** +| v2.6.0 Paper Theme · Flat Menus & Retranslate | v2.6.0 Night Ink Theme · Dark Workbench | +| --- | --- | +| ![v2.6.0 Paper theme editor](docs/ui-review/release-260-light.png) | ![v2.6.0 Night Ink theme editor](docs/ui-review/release-260-dark.png) | -![ComiTrans typesetting editor](docs/ui-review/editor-fill-fonts-1440-style-review.png) +| Live Fork-Join Parallel Workflow Graph | Favorite Fonts (`1–9`), Fills & Lettering Controls | +| --- | --- | +| ![ComiTrans live Fork-Join workflow visualizer](docs/ui-review/automatic-workflow-v252.png) | ![ComiTrans typesetting editor](docs/ui-review/editor-fill-fonts-1440-style-review.png) | -**Night mode (Night ink)** +
+Expand more UI screenshots & log reveal animation (Night Ink workflow, context cache, eyedropper, outlines, font library & settings) -Settings → Runtime & output → Appearance switches between Follow system / Paper / Night ink. It applies instantly and recolors the Windows title bar too; Night ink changes the UI and the area around the canvas only, never the manga pixels or exports. +
-| Automatic processing & workflow | Typesetting | +| Night Ink Parallel Workflow | Night Ink Typesetting Editor | | --- | --- | | ![Live workflow in night ink](docs/ui-review/dark-workflow-v252.png) | ![Typesetting in night ink](docs/ui-review/dark-editor.png) | -
-More v2.5.2 screenshots (context preferences, color picker, lettering transforms, font library & settings) - -| Context cache preferences | Completed batch workflow | +| Translation Preferences & Context Retention | Completed Batch & Per-Page Matrix | | --- | --- | | ![Translation preferences and retained context cache](docs/ui-review/context-1440-retained-style-review.png) | ![Completed Fork-Join workflow](docs/ui-review/automatic-complete-style-review.png) | -| Canvas eyedropper color pick | Stretch, rotation & outline preset | +| Canvas Eyedropper & Custom RGB Fill | Stretch, Rotation & White-on-Black Outline Preset | | --- | --- | | ![Canvas eyedropper and custom fill](docs/ui-review/editor-color-pick-1440-style-review.png) | ![Stretch, rotation, and white-on-black vertical preset](docs/ui-review/editor-outline-1440-style-review.png) | -| Mask resizing & live editor preview | Font library & settings | +| Offline Google Fonts Search (2,056 Families) | Settings & Service Configuration | | --- | --- | -| ![Mask resizing and live editor preview](docs/ui-review/editor-mask-drag-style-review.png) | ![Font library and name search](docs/ui-review/font-library-search-style-review.png) | +| ![Font library and name search](docs/ui-review/font-library-search-style-review.png) | ![Settings page](docs/ui-review/settings-style-review.png) | -![Settings page](docs/ui-review/settings-style-review.png) +**Fast Character-Reveal Logs (captured from Qt)**: Log output renders in the Aa handwriting font at ~250 characters/second (auto-accelerating on backlog), retaining 5,000 in-view records with search, filtering, pause-follow, and full disk logging. -
- -**Fast character reveal — recorded from v2.5.2 Qt with UI test messages** +![Fast log output animation](docs/ui-review/log-reveal-v252.gif) -Logs use the Aa handwriting font and reveal at about 250 characters per second, accelerating when messages accumulate. Copy, export, errors, and task completion flush the full text. Filtering, search, font size, pause-follow, and text selection remain available. The view retains 5,000 records; complete logs are stored on disk. +
-![Fast log output animation](docs/ui-review/log-reveal-v252.gif) +--- -## Before / After +## 🎨 Before / After > [!NOTE] -> User-provided examples from pages 6 and 7: Japanese originals on the left, with their corresponding Simplified Chinese translations on the right. +> User-provided examples from pages 6 and 7: Japanese originals on the left, Simplified Chinese translated & lettered outputs on the right. -| Before | After | +| Before (Japanese) | After (Simplified Chinese) | | --- | --- | | ![Page 6 Japanese original](docs/images/20.1.png) | ![Page 6 Chinese translation](docs/images/20.11.png) | | ![Page 7 Japanese original](docs/images/20.2.png) | ![Page 7 Chinese translation](docs/images/20.21.png) | -## Table of Contents - -[Manga workbench and log animation](#manga-workbench) · [OCR interfaces](#ocr-interfaces) · [Retouch plugin API design (Chinese)](docs/RETOUCH_PLUGIN_API.md) · [Detailed changelog](CHANGELOG.md) - -1. [Key Features](#key-features) -2. [Quick Start](#quick-start) -3. [Usage](#usage) -4. [Translation Pipeline](#translation-pipeline) -5. [Models](#models) -6. [Packaging & Release](#packaging--release) -7. [Project Structure](#project-structure) -8. [Changelog](#changelog) -9. [FAQ](#faq) -10. [Feedback](#feedback) -11. [License](#license) - -## Key Features - -- **Native desktop UI**: PySide6 app with a manga magazine design and a clean editing canvas. -- **Source languages and OCR**: Japanese, Korean, English, or a custom language; independent HTTP and compatible vision OCR endpoints. -- **All-ONNX inference**: text detection, Japanese/Korean/English local OCR, and LaMa inpainting all use ONNX; no PyTorch required. -- **Single Windows installer**: v2.6.0 bundles the app and local models in one Setup. -- **Startup warmup**: the AI pipeline loads automatically when the app opens. -- **GPU inference**: new installations prefer NVIDIA CUDA. Settings provide official CUDA/cuDNN installation links; a compatible NVIDIA driver is required; logs report the actual device. Existing CPU preferences are preserved. -- **Multimodal translation toggle**: sends the full page image to the AI for visual context; pure-text mode sends OCR results. Font selection, size, and orientation are local by default. Experimental font comparison requires a separate opt-in. -- **Whole-PDF translation**: import PDFs alongside images, translate them page by page, and create one `*_translated.pdf` with the original page order and page sizes. -- **15 font categories**: dialogue, bold dialogue, emphasis, handwriting, Seto, 851 handwriting, thought, whisper, serious, narration, SFX, LXGW Marker, cute, preview, and title styles with per-glyph fallback. -- **Searchable open-source font library**: search fonts on the translation and editor pages. The Google Fonts snapshot includes 2,056 families in an approximately 1 MB catalog; font files download on demand for offline use. TTF / OTF / TTC / OTC imports remain available. Manual editor choices affect only the selected block and override the translation default, with per-glyph fallback. [Font library guide](docs/FONT_LIBRARY.md). -- **Mask-based erasing and typesetting**: erasing only removes the detector text mask; layout area and center follow the mask. -- **Manual typesetting with live preview**: adjust font style, actual font size, direction, X/Y offsets, and layout mask dimensions per block. Drag mask corners or edges to resize, or drag inside to move. The canvas updates automatically; saving exports the current result. -- **Error logs with AI diagnosis**: logs go to `Log/app.log`, diagnosis prompts are auto-generated, and multi-turn AI diagnosis is supported. -- **Batch folder selection**: pick a whole folder and images/PDFs are added recursively. -- **Safe cancellation**: stop requests remain visible while the current inference/request finishes; remaining pages are not scheduled. -- **Issue feedback**: jump to your configured GitHub Issues link from the top-right button. -- **Adjustable layout**: resize the main areas, preview, and log panels by dragging. - -## Quick Start +--- -The interface supports **中文 / English / 日本語**, with Chinese as the default. Choose a language on first launch, or change it under **Settings → Translation service → Interface language** and save; settings changes apply on the next launch. This does not change the manga translation language. [Interface language guide](docs/UI_LANGUAGES.md). +## 🚀 Quick Start -A fully successful translation batch has a 15% chance of showing a small repository support prompt in the bottom-right corner. It closes after eight idle seconds or via its X button; GitHub opens only when its action button is clicked. +### Windows All-in-One Installer (Recommended) -### Release users (recommended) +No Python, PyTorch, or manual model directory merging required: -Download `ComiTrans-v2.6.0-x64-Setup.exe` and `SHA256SUMS.txt`. Verify the SHA-256, close ComiTrans and run Setup. Enter your translation API key and model in Settings. [Download v2.6.0](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0) +1. **Download & Verify:** Grab `ComiTrans-v2.6.0-x64-Setup.exe` and `SHA256SUMS.txt` from the [v2.6.0 Release Page](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0), and verify the SHA-256 hash in PowerShell: -This installer is unsigned. Windows may display “Unknown publisher.” Install this release manually. At startup the app checks GitHub for a newer stable release. Select **Update** beside the model status to view the version and open its release page. [Installation and migration guide](docs/WINDOWS_INSTALLER.md) + ```powershell + Get-FileHash -Algorithm SHA256 .\ComiTrans-v2.6.0-x64-Setup.exe + Get-Content .\SHA256SUMS.txt + ``` -#### Earlier ZIP releases (v2.5.2) +2. **Run Setup:** Close any running ComiTrans instance and launch Setup. + - This build is **unsigned**; Windows may display "Unknown publisher"—verify the SHA-256 hash before running. + - User configuration, imported/downloaded fonts, logs, and default output stay in `%LOCALAPPDATA%\ComiTrans`, surviving upgrades and uninstalls. + - Upgrading from `v2.6.0-pre.1` works in place; legacy MSI/WiX users should uninstall the old entry in Windows *Installed Apps* first; ZIP users can follow the [Migration Guide](docs/RELEASE-v2.6.0.md#windows-installation-verification--migration). +3. **Configure API & Optional GPU:** CPU inference is ready immediately. Open **Settings** to enter your LLM API key and model. For NVIDIA GPU acceleration, follow the official CUDA 12 / cuDNN 9 links under **Settings → Runtime & Output → GPU setup and downloads** ([GPU Setup Guide](docs/GPU_SETUP.md)). -1. Download `ComiTrans-v2.5.2-app.zip` from the [v2.5.2 release](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.5.2); for fresh installs or upgrades from v2.5.0 and earlier, also download `ComiTrans-v2.5.2-models.zip` (identical to v2.5.1 models; existing v2.5.1 users can reuse their models folder). -2. Extract the required archives into the same parent directory and merge their top-level `ComiTrans` folders, preserving the subfolder structure. The final model path is `ComiTrans\comic-translate-ai\models\`. -3. Double-click the merged `ComiTrans.exe` and enter your translation API key and model on the "Settings" page. - -Upgrading from v2.5.1: reuse your existing models directly. Upgrading from v2.3.0 / v2.5.0: merge the v2.5.1+ model archive to switch to the lighter CharSpot Small Japanese OCR and CUDA-aware dual detector. Keep your existing `config.yaml`, entire `user_fonts` folder, and output files. - -Release users do not need Python, PyTorch, or pip. GPU acceleration requires a compatible NVIDIA driver, CUDA 12 and cuDNN 9. Open Settings → Runtime & Output → GPU setup and downloads to install the portable runtime or to open official installer links. Reuse a compatible environment; CPU users do not need GPU libraries. [Setup guide](docs/GPU_SETUP.md). New installations prefer GPU; if CUDA cannot start, the app reports its CPU fallback. Existing CPU preferences are preserved. - -To upgrade to v2.5.2, close the app and extract `ComiTrans-v2.5.2-app.zip` into a new folder. Copy `config.yaml`, `user_fonts/` and `comic-translate-ai/models/` from the old installation to the same relative locations. Keep output images and their companion `_cleaned` and `_layout` folders together. Keep the old installation until the new one works. This version uses the full app archive; see the [v2.5.2 update guide](docs/RELEASE-v2.5.2.md). - -### Run from source (developers) +> [!NOTE] +> UI languages include **中文 / English / 日本語** (first-launch prompt or **Settings → Translation service → Interface language**; see [UI Languages](docs/UI_LANGUAGES.md)). Completed batches have a 15% chance to show a quiet, auto-dismissing Star prompt in the bottom-right corner. -Python 3.12+ is recommended; an NVIDIA GPU with CUDA support is optional. +
+Run from source (Developers · Python 3.12+, NVIDIA GPU optional) ```powershell cd D:\ComiTrans python -m venv .venv .\.venv\Scripts\python -m pip install -r comic-translate-ai/requirements.txt -``` -Copy the example config: +# Optional: download Korean / English PP-OCRv5 ONNX models +.\.venv\Scripts\python scripts/download_ocr_models.py -```powershell +# Copy example config and launch Copy-Item comic-translate-ai/main/config.example.yaml comic-translate-ai/main/config.yaml -``` - -Run the client: - -```powershell .\.venv\Scripts\python run.py ``` -You can also double-click `start.bat`. The AI pipeline warms up automatically after launch. - -## Usage - -1. Click "Add Files" or "Add Folder", or drag images, PDFs, or folders into the window. -2. Configure the translation API in Settings, then choose Source Language on the workbench. Japanese Auto uses CharSpot Small (with legacy Baberu/manga-ocr packs still supported); Korean/English use PP-OCRv5. Choose Custom OCR for another language or provider. -3. Enable "Multimodal Translation" to send the full page image to the AI; disable it for pure-text translation. Both modes use local font selection and typesetting by default. -4. Expand "Preferences" on the translation page to configure background prompts, Chinese character names (one per line), and optional "Keep context cache" (keeps page resume locked on across runs). -5. Click "Start Translation" and follow live in-flight stages, Fork-Join parallel progress, and per-page states in the workflow graph below. -6. On failure, open the "Diagnostics" page for diagnosis prompts, or click the Issue button. -7. Select a text block in "Typesetting Refinement". Drag its mask corners or edges to resize, or drag inside to move; press Esc during a drag to restore its starting geometry. Font size, X/Y offsets, and exact dimensions are also available under “排版与位置”. The canvas updates automatically. Click Save Image or press Ctrl+S to export the current result. See the [live preview guide](docs/EDITOR_LIVE_PREVIEW.md). +You can also double-click `start.bat`. The desktop window opens immediately while image models warm up in an isolated subprocess. -### Translation fonts - -In the editor, “排版与位置 → 竖排列对齐” selects top, center, or bottom alignment for vertical columns. Top and bottom use the longest column as their reference while keeping the text group centered. Each block retains its choice in saved layouts and live previews. - -Press **Enter** or click “插入换行” in the editor to insert a hard break: horizontal text continues on the next row, vertical text in the next column to the left. Consecutive breaks preserve blank rows or columns. Preview, saved images, and restored layouts retain these breaks. “排版与位置 → 文字效果” offers black text with white outlines and white text with black outlines. [Editor guide](docs/EDITOR_LIVE_PREVIEW.md). - -Vertical ellipsis and em-dash runs stay together across automatic column breaks, including common alternate glyphs. Ellipsis dots are evenly spaced and dashes form continuous vertical lines; explicit line breaks retain their positions. - -Swei B2 Sans and Swei Toothpaste are bundled in separate SC and TC Black faces (four fonts, approximately 58.6 MiB) for bold emphasis and rounded outline lettering. They are visual alternatives rather than identification of the original Japanese reference fonts. [Sources and licenses](comic-translate-ai/font_file/Manga/README.md). - -Use the “译文” selector on the translation page to switch between **Simplified and Traditional Chinese**. The choice saves automatically and applies to subsequent image and PDF translations, including continuation requests and local output normalization. Existing results, editor drafts, and font choices are preserved. [Chinese output guide](docs/CHINESE_OUTPUT.md). - -Expand “翻译偏好” on the translation page to choose the default font and vertical column alignment. The panel remembers manual expansion choices, and settings save automatically. A specific font applies to all translated text; “自动匹配漫画风格” restores the existing style fonts. “+ 导入字体” imports multiple TTF, OTF, TTC, or OTC files and selects the last successful import. Font collections use their first face. Default alignment is recorded in newly translated layouts; existing editor drafts retain their own choices. - -Both pages support name search in their font selectors. Open “字体库” to filter Google Fonts by name, language, or style, choose a face, and click “下载并使用”. The full catalog is searchable offline, and downloaded fonts remain available without a connection. Ten families in the snapshot lack a license attachment and are currently view-only. See the [font library guide](docs/FONT_LIBRARY.md). - -The application also bundles **10 Traditional Chinese manga font families in 12 faces**, available offline on first use, including GenSen Rounded, Huninn, Iansui, LXGW WenKai TC, Naikai, Jason Handwriting 3, Source Han Sans/Serif TC, Swei Sugar and Pop Gothic. Original font files total approximately 183.4 MiB, with upstream notices and provenance included. [Full list](docs/TRADITIONAL_MANGA_FONTS.md). Font selectors show concise Chinese names and localized weights while keeping original English names searchable. The editor gives the selector a full row, shows a wrapping full-name label, and widens popup lists. +
-Choices save automatically and apply to the next translation. The editor refreshes its preview while retaining drafts and explicit per-block font choices; Save Image writes the updated output. Select “跟随翻译默认字体” to restore the default for a block. Imported and downloaded fonts are stored in the app's `user_fonts` folder without system installation. Duplicate files are reused and missing glyphs fall back per character. Keep the entire `user_fonts` folder when moving or updating the app. See the [font guide](docs/CUSTOM_FONTS.md). +--- -The `@ComiTrans` watermark is enabled by default. To disable it, uncheck Add @ComiTrans Watermark on the first Settings tab (Translation Service) and save the configuration. Previously saved off settings are preserved. Subsequent image translations and every PDF page receive a small, translucent Skribble wordmark in the lower-right corner when enabled. The current editor page also updates its preview; click Save Image to write it. Repeated saves do not accumulate the watermark, and the clean background remains unmarked. +## 🧩 Key Features -Per-page resume is enabled by default. After a network failure, cancellation, or restart, use the same source files, output folder, and translation settings to skip completed pages and reuse saved translations. Uncheck Resume in Translation Preferences to start over. [Resume guide](docs/RESUMABLE_TRANSLATION.md). +### 1. Local All-ONNX Vision & Inference Pipeline +- **Zero PyTorch Footprint:** Text detection, Japanese/Korean/English local OCR, and LaMa inpainting all run on **ONNX Runtime** with no PyTorch, torchvision, or transformers dependencies. +- **Multi-Language Source & Custom OCR:** Supports Japanese (CharSpot Small; legacy Baberu / manga-ocr supported), Korean & English (PP-OCRv5), plus independent HTTP OCR or OpenAI-compatible vision endpoints. Automatic mixed-language routing is not yet enabled. [Multilingual OCR Guide](docs/MULTILINGUAL_OCR.md) +- **Native-Resolution Erasing:** Erases strictly along detected text masks. LaMa tiles adaptively under memory pressure without downscaling, paired with paper-color fills, halftone/gradient reconstruction, and uniform white-bubble fallback. +- **Subprocess Warm-Up & GPU Priority:** Model sessions warm up in an isolated process off the Qt event loop; new installations prefer NVIDIA CUDA and report the active execution provider in logs while honoring existing CPU settings. -A PDF is shown as one file task and processed through a bounded page pipeline. ComiTrans retains the translated PDF, a matching `.comitrans` index, and a separate directory of editable pages. Open the result in the Typesetting Editor or import the translated PDF to adjust text, layout, and backgrounds. Continuous Strip mode lets you scroll vertically and click a page to edit it in place. Editing and Save Image operate on individual images. Export PDF explicitly assembles saved pages in the background with lossless compression, progress and cancellation, preserving page count, order, and sizes. You can also import the project directory’s `project.json` without the PDF. Content is rasterized; password-protected PDFs are not supported. Keep the PDF, index, and project directory together when moving them. [PDF editing guide](docs/PDF_EDITING.md). +### 2. Context-Aware Translation & Book Workflows +- **Fork-Join Parallel Pipeline:** Immediately after OCR, sequential reading-order translation and dedicated-thread background inpainting (`repair_comic_page`) run concurrently, reconciling masks on join to skip empty translations. [Context & Parallel Guide](docs/CONTEXT_TRANSLATION.md) +- **Rolling Context & Resumable Runs:** Carries up to 12 pages / 24,000 serialized chars of context in `.cache/translation-context.json`. Per-page resume is enabled by default to skip completed pages and reuse cached paid translations. [Resume Guide](docs/RESUMABLE_TRANSLATION.md) +- **Work Terminology & Trial Estimates:** Register consistent series names in `Task → Work terminology` (only the target translation is required; checkpoints fingerprint only active project terms). Run `Trial` on the first 1–3 pages and review token usage & full-book cost estimates in `Translation usage`. +- **Whole-PDF & CBZ Support:** Import images, recursive folders, PDFs, or `.cbz` archives. PDFs render on demand with a `.comitrans` project index and background lossless export (`*_translated.pdf`); CBZ edits export cleanly back via `File → Export CBZ`. [PDF Editing Guide](docs/PDF_EDITING.md) +- **Multimodal & SC/TC Switch:** Optional multimodal toggle sends the full page image for visual context (font/size/direction stay local by default); switch Simplified/Traditional Chinese output anytime from the top workbench selector. [Chinese Output Guide](docs/CHINESE_OUTPUT.md) -### OCR interfaces +### 3. Professional Typesetting & Retouching Studio +- **Flat Menus & Focused Canvas:** Non-nested View, File, Fill, and Font menus keep the canvas clean alongside Continuous Strip mode, single-page wheel isolation, `F2` full-screen editing, and the `Z` zoom tool. +- **Multi-Select & Cross-Page Style Brush:** Select blocks with `Ctrl`/`Shift` in the list or `Ctrl`-click/`Shift`-drag on the canvas. Use `Pick style`, `Apply style to selected`, `Style brush` (cross-page clipboard, hides drag handles, `Esc` to exit), and `Undo style` without touching text or restored bubbles. +- **Book Transcript & Single-Bubble Retranslation:** Find and replace text across the entire book in `Book transcript`, or re-translate any single block in place with `Retranslate`. +- **Precision Canvas Tools:** Manual bubble box creation, canvas/strip eyedropper color picking, undoable custom RGB/Hex fills, background selection repair, and reversible per-bubble original restoration (`Restore bubble`). +- **15 Font Categories & Offline Font Library:** Automatic classification across 15 manga styles with `3×` Lanczos supersampling, stretch (`10–400%`), rotation (`±180°`), manual outline stroke (`0–30 px`), 9 pinned favorite font slots (`1–9` shortcuts), 10 bundled TC manga font families, Swei B2/Toothpaste Black faces, and **2,056 Google Fonts families** downloadable on demand for offline use. [Font Library](docs/FONT_LIBRARY.md) · [Custom Fonts](docs/CUSTOM_FONTS.md) -Choose the source language and engine in Settings. OCR credentials, endpoint, and model are independent of the translation service. +### 4. Diagnostics, Safe Control & Delivery +- **Character-Reveal Logs & AI Diagnostics:** Logs write to `Log/app.log`; Diagnostics gathers environment info, model paths, and stack traces with one-click diagnosis prompts and multi-turn AI troubleshooting. +- **Safe Cancellation & Quiet Update Check:** Stopping waits gracefully for in-flight pages without scheduling new ones. Startup checks GitHub for newer stable releases and surfaces a subtle `Update` button beside `Models ready` when available. -| Engine | Configuration | -| --- | --- | -| Japanese local | Auto uses CharSpot Small, with Baberu and manga-ocr supported in older installations | -| Korean / English local | PP-OCRv5 ONNX; both models are included in the v2.3.0 model archive | -| Standard HTTP | Full POST endpoint; receives a PNG text-region crop as Base64 and returns the original text | -| Compatible vision API | OpenAI-compatible Base URL, independent key, and an image-capable model; uses `chat.completions` for OCR | +--- -HTTP request (`model` is optional): +## 🔄 Translation Pipeline -```json -{"image_base64": "", "mime_type": "image/png", "language": "fr", "model": "my-ocr"} +```text +Load Images / PDF / CBZ ──▶ Bubble & Text Detection ──▶ Source OCR + │ + ┌───────────────────────────────────────────────┴───────────────────────────────────────────────┐ + ▼ ▼ + [ Branch A: Sequential Contextual Translation ] [ Branch B: Background Inpainting ] + Rolling context (up to 12 pages) + Work Terminology Solid fill / halftone / tiled LaMa + └───────────────────────────────────────────────┬───────────────────────────────────────────────┘ + ▼ + Join & Mask Reconciliation ──▶ 3× Supersampled Chinese Typesetting ──▶ Save / Export PDF · CBZ ``` -Response (`confidence` is optional and must be 0–1 when supplied): +1. **Detection:** ONNX detector extracts bubbles, text masks, and text lines. +2. **Source OCR:** CharSpot Small for Japanese, PP-OCRv5 for Korean/English, or a configured Custom OCR endpoint; empty sources/translations preserve original artwork. +3. **Branch A · Contextual Translation:** Combines Work Terminology and up to 12 pages / 24,000 chars of rolling context; Multimodal mode attaches the full page image. +4. **Branch B · Parallel Background Repair:** Inpaints concurrently in a worker thread while waiting on the API; join-stage reconciliation drops masks for empty translations. +5. **Chinese Typesetting:** Estimates font size from effective mask area, centers on mask centroid, adapts direction, and renders vertical ellipsis/em-dash runs cleanly. +6. **Save & Reversible Editing:** Writes output images, `_cleaned/` canvases, and `_layout/` JSON for lossless continuation in the Typesetting Editor. +7. **Book Assembly:** Rebuilds full PDFs at original page sizes (covering fractional edges) once every page succeeds, or exports edited pages to `.cbz`. -```json -{"text": "Bonjour le monde !", "confidence": 0.96} -``` +> On HTTP `401/403` (auth), `402` (insufficient balance), or `404` (endpoint/model missing), ComiTrans reports the exact cause and stops scheduling remaining pages. -When a key is configured, requests include `Authorization: Bearer `. Return `{"text":""}` for no text. An OCR error fails that page before erasing the original. The timeout defaults to 60 seconds and accepts 1–300 seconds. Custom OCR sends region images to the selected service; multimodal translation also sends full-page images to the translation provider. +--- -Python backends implement `OcrEngine.recognize(image, language) -> OcrResult`. Each task uses one source language; automatic mixed-language routing is not implemented. See the [full integration guide](docs/MULTILINGUAL_OCR.md) for fields, model downloads, and Python examples. +## 📦 Models & Documentation -### Font styles +### Bundled ONNX Models -| Style | Usage | Default font | +| Role | Default Model | Reference | | --- | --- | --- | -| `dialogue` / `bold_dialogue` | Normal / bold dialogue | LXGW WenKai / Source Han Sans Heavy | -| `radiating` / `sfx` | Emphasis / sound effects | Smiley Sans Oblique | -| `handwriting` | Handwritten notes | setofont | -| `seto` | Seto handwriting (optional, manual) | SetoFont | -| `tegaki_851` | Casual 851 handwriting (optional, manual) | 851tegakizatsu with handwriting/body fallback | -| `thought` / `serious` | Thoughts / formal text | Source Han Serif | -| `whisper` / `cute` | Whisper / playful text | Klee One with glyph fallback | -| `narration` | Wide narration strips | LXGW WenKai | -| `sfx` | Sound effects | Smiley Sans Oblique | -| `lxgw_marker` | Marker emphasis (optional, manual) | LXGW Marker Gothic | -| `next_preview` / `title` | Preview / title | Klee One / Source Han Sans Heavy | - -Normal bubbles default to `dialogue`; OCR content, detector class, original stroke weight, and box geometry select the other styles. Detector orientation is preserved unless the aspect ratio strongly contradicts it. The editor offers Auto, explicit Vertical, and explicit Horizontal modes. +| **Comic text blocks & lines** | ogkalu Small INT8 + PP-OCRv6 manga | [Pinned sources, licenses & SHA256](docs/models/split-detector.json) | +| **Japanese OCR** | CharSpot Small | [Model card, vocab & license](docs/models/charspot-small.json) · [v2.5.1 Benchmark](docs/MODEL_UPGRADE-v2.5.1.md) | +| **Korean / English OCR** | `korean_PP-OCRv5_rec_mobile.onnx` / `en_PP-OCRv5_rec_mobile.onnx` | [Pinned sources & checksums](docs/MULTILINGUAL_OCR.md#韩语和英语模型) | +| **LaMa Inpainting** | `lama-manga-dynamic.onnx` | [License audit](docs/MODEL_UPGRADE-v2.5.1.md) · [Alternative models](docs/ONNX_MODELS.md) | -`seto`, `tegaki_851`, and `lxgw_marker` can be selected per block in the editor; the local automatic heuristic does not select these three styles yet. Experimental font comparison runs only when both `multimodal` and `multimodal_font_probe` are enabled; the latter is disabled by default. The AI compares locally rendered gothic, mincho, and handwriting candidates, then local gates and permissions decide whether to apply the result. A gothic result on body text can map to `lxgw_marker`. See [docs/FONT_STYLE_STRATEGY.md](docs/FONT_STYLE_STRATEGY.md) for the strategy and measurements. +### Documentation Index -Typesetting renders text on a local 3x supersampled surface and downsamples it with Lanczos, so small dialogue is no longer drawn directly at low resolution. Normal bubbles also avoid a forced white outline for softer edges, while non-bubble text on complex backgrounds keeps an outline for readability. +| Topic | Link | Topic | Link | +| --- | --- | --- | --- | +| **v2.6.0 Release & Migration** | [RELEASE-v2.6.0.md](docs/RELEASE-v2.6.0.md) | **Windows Packaging & Signing** | [WINDOWS_INSTALLER.md](docs/WINDOWS_INSTALLER.md) | +| **Context & Parallel Pipeline** | [CONTEXT_TRANSLATION.md](docs/CONTEXT_TRANSLATION.md) | **Multilingual & Custom OCR** | [MULTILINGUAL_OCR.md](docs/MULTILINGUAL_OCR.md) | +| **PDF Editing & Export** | [PDF_EDITING.md](docs/PDF_EDITING.md) | **Font Library & Custom Fonts** | [FONT_LIBRARY.md](docs/FONT_LIBRARY.md) · [CUSTOM_FONTS.md](docs/CUSTOM_FONTS.md) | +| **Live Preview & Performance** | [EDITOR_LIVE_PREVIEW.md](docs/EDITOR_LIVE_PREVIEW.md) · [EDITOR_PERFORMANCE.md](docs/EDITOR_PERFORMANCE.md) | **Architecture & Changelog** | [ARCHITECTURE.md](docs/ARCHITECTURE.md) · [CHANGELOG.md](CHANGELOG.md) | -### Error logs & AI diagnosis +--- -- All runtime logs are written to `Log/app.log`. -- The "Diagnostics" page gathers environment info, model paths, recent logs, and stack traces. -- Copy diagnosis prompts, copy raw logs, or open the log file directly. -- AI diagnosis keeps the current log context and multi-turn memory; only "Clear Context" resets it. +## 🔧 Advanced Usage & Packaging -## Translation Pipeline - -1. **Bubble & text detection**: an ONNX detector outputs bubbles, text masks, and text lines. -2. **Source-language OCR**: Japanese uses CharSpot Small (legacy Baberu/manga-ocr packs remain supported), Korean and English use PP-OCRv5 text-line recognition, or a custom OCR service can be selected. The English-skip rule applies only to Japanese local mode. Empty source/translation regions retain the original artwork. -3. **Fork branch A · sequential contextual translation**: pure-text mode sends OCR results; multimodal mode sends the page image, carrying rolling context across up to 12 recent pages (24,000 serialized chars). Local heuristics select fonts by default while size and orientation stay local. -4. **Fork branch B · parallel background inpainting**: runs concurrently in a dedicated worker thread while waiting on the translation API, erasing detected masks via solid fill, screentone/gradient reconstruction, or tiled LaMa; join-stage reconciliation restores masks for empty translations. -5. **Chinese typesetting**: font size is estimated from the mask area, text is centered on the mask centroid, orientation adapts automatically, and long text gets tighter sizing. -6. **Save & edit**: output images are saved, cleaned canvases go to `_cleaned/`, layout JSON goes to `_layout/`, and the editor lets you refine everything manually (including manual bubble boxes, eyedropper & custom fills, `1–9` favorite fonts, stretch, rotation, and outlines). -7. **PDF assembly**: once every page succeeds, pages are rebuilt at their original sizes (covering fractional page edges) and the PDF is reopened for validation; no partial PDF is emitted if a page fails. +
+Advanced guides: fonts, custom OCR protocol, 15 font styles & AI diagnostics -When the translation provider returns 401/403 (authentication), 402 (insufficient balance), or 404 (endpoint/model not found), the client reports the real cause and stops scheduling remaining pages. HTTP 402 requires funding the API account or switching to a key with available credit. +#### Translation Fonts, Alignment & Watermark +- **Imports & Offline Catalog:** Import multiple `TTF / OTF / TTC / OTC` files into `user_fonts/` without installing them system-wide, or browse/download **2,056 Google Fonts families** on demand. Also bundles **10 Traditional Chinese manga font families (12 faces)** ([list](docs/TRADITIONAL_MANGA_FONTS.md)) and Swei B2/Toothpaste Black faces ([licenses](comic-translate-ai/font_file/Manga/README.md)), all with per-glyph fallback. +- **Vertical Alignment & Hard Breaks:** Choose top/center/bottom column alignment under **排版与位置**; press `Enter` or click **插入换行** to preserve blank lines/columns; choose black-on-white or white-on-black outline presets. +- **Watermark Toggle:** A subtle translucent `@ComiTrans` Skribble wordmark is enabled by default in the bottom-right corner; uncheck **Add @ComiTrans Watermark** in Settings (first tab) to disable persistently. Cleaned canvases stay unmarked. -## Models +#### Custom OCR Protocol +Configure independent OCR endpoints, keys, and timeouts (default 60s, range 1–300s) in Settings: +- **Standard HTTP OCR:** POSTs PNG text-region crops as Base64 (`{"image_base64": "...", "mime_type": "image/png", "language": "fr", "model": "my-ocr"}`) and expects `{"text": "...", "confidence": 0.96}`. Sends `Authorization: Bearer ` when set. +- **Compatible Vision API:** OpenAI-compatible Base URL, independent key, and vision-capable model using `chat.completions`. +- **Python Extension:** Implement `OcrEngine.recognize(image, language) -> OcrResult`. Full specification in [docs/MULTILINGUAL_OCR.md](docs/MULTILINGUAL_OCR.md). -| Purpose | Model | Source | +#### 15 Font Style Mapping +| Style | Usage | Default Font | | --- | --- | --- | -| Comic text regions and lines | ogkalu Small INT8 + PP-OCRv6 manga | [Pinned sources, licenses and SHA256](docs/models/split-detector.json) | -| Japanese OCR | CharSpot Small | [Model, vocabulary and license](docs/models/charspot-small.json) | -| Korean / English OCR | `korean_PP-OCRv5_rec_mobile.onnx` / `en_PP-OCRv5_rec_mobile.onnx` | [Pinned sources and checksums](docs/MULTILINGUAL_OCR.md#韩语和英语模型) | -| LaMa inpainting | `lama-manga-dynamic.onnx` | [Pinned source and license audit](docs/MODEL_UPGRADE-v2.5.1.md) | +| `dialogue` / `bold_dialogue` | Dialogue / bold dialogue | LXGW WenKai / Source Han Sans Heavy | +| `radiating` / `sfx` | Emphasis / sound effects | Smiley Sans Oblique | +| `handwriting` / `seto` / `tegaki_851` | Handwriting / Seto / 851 (last two manual) | setofont / 851tegakizatsu | +| `thought` / `serious` | Thoughts / formal text | Source Han Serif | +| `whisper` / `cute` / `next_preview` | Whisper / playful / preview | Klee One (fallback to Source Han) | +| `narration` / `lxgw_marker` / `title` | Narration / marker (manual) / title | LXGW WenKai / LXGW Marker Gothic / Source Han Sans Heavy | -The v2.5.1 local preview ships only CharSpot Small for Japanese OCR and supports existing legacy model directories. Default detection uses Small with manga line-based box refinement. The full model set is 284.712 MB (48.71% of v2.5.0). On 22 crops from three pages, character errors fell from 12 to 5. [Evaluation](docs/MODEL_UPGRADE-v2.5.1.md) · [Upgrade and rollback](docs/RELEASE-v2.5.1.md) +> Experimental `multimodal_font_probe` is off by default; see [docs/FONT_STYLE_STRATEGY.md](docs/FONT_STYLE_STRATEGY.md). -More model sources, alternative ONNX versions, and better detection candidates: [docs/ONNX_MODELS.md](docs/ONNX_MODELS.md). +#### Error Logs & AI Diagnosis +- Runtime logs go to `Log/app.log`. The **Diagnostics** tab packages environment info, model paths, recent logs, and tracebacks with one-click diagnosis prompts and multi-turn AI chat until **Clear Context** is clicked. -## Packaging & Release +
-### Build the app +
+Build the app & generate Windows Setup locally -Install the pinned build dependencies first; the build script does not upgrade tools automatically: +1. Install pinned build dependencies and build the desktop bundle: -```powershell -.\.venv\Scripts\python -m pip install -r requirements-build.txt -.\build_app.ps1 -``` + ```powershell + .\.venv\Scripts\python -m pip install -r requirements-build.txt + .\build_app.ps1 + ``` -By default the app is built without models. For local testing with models: + Pass `-IncludeModels` (`.\build_app.ps1 -IncludeModels`) for local testing with models. -```powershell -.\build_app.ps1 -IncludeModels -``` +2. With [NSIS 3.13](https://nsis.sourceforge.io/Download) installed, build the all-in-one Windows Setup (version is read from `comic_translate_desktop/__init__.py`): -### Generate release packages + ```powershell + .\.venv\Scripts\python.exe installer/build.py --include-models + ``` -After building the desktop app, run the following command with NSIS installed. Setup includes the default models and uses the version declared by the desktop package. [Windows packaging guide](docs/WINDOWS_INSTALLER.md) + Full signing and CI verification workflow: [docs/WINDOWS_INSTALLER.md](docs/WINDOWS_INSTALLER.md). Historical ZIP baselines and checksums remain in `docs/releases/` ([v2.5.2](docs/releases/v2.5.2/SHA256SUMS.txt), [v2.5.1](docs/releases/v2.5.1/SHA256SUMS.txt), [v2.4.0](docs/releases/v2.4.0/SHA256SUMS.txt)). -```powershell -.\.venv\Scripts\python.exe installer/build.py --include-models -``` - -Historical ZIP release metadata - -- [docs/releases/v2.5.2/baseline.json](docs/releases/v2.5.2/baseline.json): v2.5.2 target build fingerprint -- [docs/releases/v2.5.2/SHA256SUMS.txt](docs/releases/v2.5.2/SHA256SUMS.txt): v2.5.2 app, models and target baseline checksums -- [docs/releases/v2.5.1/baseline.json](docs/releases/v2.5.1/baseline.json): v2.5.1 build fingerprint -- [docs/releases/v2.5.1/SHA256SUMS.txt](docs/releases/v2.5.1/SHA256SUMS.txt): v2.5.1 checksums -- [docs/releases/v2.4.0/baseline.json](docs/releases/v2.4.0/baseline.json): file hashes and build fingerprint for generating future patches -- [docs/releases/v2.4.0/SHA256SUMS.txt](docs/releases/v2.4.0/SHA256SUMS.txt): checksums for the app, models and baseline - -Extract the models archive into `ComiTrans\comic-translate-ai\models\`. +
-## Project Structure +
+Project Structure ```text ComiTrans -├── run.py # desktop client entry -├── comic-translate-ai/ # AI core -│ ├── main/ -│ │ ├── comic_translator_pipeline.py -│ │ ├── onnx_text_detector.py # ONNX text detection -│ │ ├── onnx_manga_ocr.py # ONNX Japanese OCR -│ │ ├── onnx_baberu_ocr.py # Baberu ONNX OCR (legacy) -│ │ ├── manga_lama.py # ONNX inpainting -│ │ └── vertical_typesetter.py # Chinese typesetting -│ ├── models/ # model weights (beside exe in releases) -│ └── font_file/ # Chinese fonts -├── comic_translate_core/ # source languages, OCR protocol, PP-OCR -├── comic_translate_desktop/ # PySide6 desktop client -├── assets/ui/ # UI fonts, SVG icons, and empty-state artwork -├── assets/font_catalog.json # Google Fonts snapshot; files download on demand -├── user_fonts/ # local imports/downloads and licenses (not committed) -├── scripts/update_font_catalog.py # catalog maintenance -├── scripts/download_ocr_models.py # Korean/English model downloads -├── docs/ui-review/ # UI screenshots and log animation -├── docs/ONNX_MODELS.md # model sources & alternatives -├── requirements-build.txt # pinned build dependencies -├── build_app.ps1 # build script -└── package_release.py # release split script +├── run.py # Desktop client entry point +├── comic-translate-ai/ # AI core pipeline, ONNX detection/OCR/LaMa & Chinese typesetter +├── comic_translate_core/ # Source languages, OCR protocol, isolated image session & updater +├── comic_translate_desktop/ # PySide6 desktop app (main window, editor, workflow dialogs & motion) +├── assets/ +│ ├── i18n/ # English & Japanese UI translations +│ ├── ui/ # SVG icons, UI fonts & empty-state illustrations +│ └── font_catalog.json # Google Fonts catalog snapshot (2,056 families on demand) +├── installer/ # NSIS script, release check service & verification tests +├── scripts/ # Font catalog sync, Korean/English OCR downloader & UI review +├── docs/ # Architecture, model manifests, benchmarks & release notes +├── tests/ # Automated unit & desktop UI regression suite +├── build_app.ps1 # PyInstaller build script +└── package_release.py # Release manifest & checksum helper ``` -## Changelog - -### v2.6.0 (2026-11-23) - -Windows Setup includes the default models. The desktop app adds background model warm-up, project glossaries, trial translations and a compact update indicator. [Release notes](docs/RELEASE-v2.6.0.md) - -### v2.5.2 (2026-11-17) - -- Rolling cross-page translation context with atomic `.cache/translation-context.json` persistence and a "Keep context cache" toggle locking per-page resume. -- Fork-Join pipeline after OCR running sequential API translation in parallel with dedicated-thread background repair (`repair_comic_page`), reconciling empty translations at join; redesigned translation page workflow visualizer with in-flight page badges, context/resume counters, and per-page matrix strip. -- Editor upgrades: manual bubble frames, canvas/strip eyedropper & custom RGB/Hex fills, 9-slot favorite fonts (`1–9` shortcuts), persisted text colors, stretch (`10–400%`), rotation (`±180°`), manual outline stroke (`0–30 px`), vertical white-text black-outline preset, page-list cleanup controls, `1 / N` block counter, and single-page scroll isolation. -- Deferred model warmup until after first paint and fixed fractional-edge coverage during PDF export. -- [v2.5.2 release notes](docs/RELEASE-v2.5.2.md) · [Full changelog](CHANGELOG.md). - -### v2.5.1 (2026-11-10) - -- Night ink dark theme, direct canvas bubble hit-testing & selection, resizable right inspector splitter, `F2` full-screen editor, zoom HUD & `Z` zoom tool, Advanced settings tab, one-click retouch, and undoable white/black selection fills. -- CUDA toggle with detector tradeoff hint and CharSpot Small default Japanese OCR (models unchanged for v2.5.2). [v2.5.1 notes](docs/RELEASE-v2.5.1.md). - -### v2.5.0 (2026-11-02) - -- Image-based PDF editing and explicit lossless export; native-resolution tiled repair, improved masks/background reconstruction and outline handling. -- Bounded streaming translation, actual CUDA provider reporting, faster equivalent background filtering, per-page resume and cached valid translations. -- Continuous Strip, background project/page/save jobs and regional composition; persistent preference panels and focus-mode choices. -- Selection repair, per-bubble restoration, default/per-block text colors and word-aware Chinese wrapping. -- Separate translation/persistence services with strict JSON validation; diagnostics no longer probe PyTorch/CUDA. -- Official GPU setup links and installed runtime discovery; new installations prefer GPU. CUDA/cuDNN are not bundled. Existing models can be reused. -- [Detailed update, installation and limitations](docs/RELEASE-v2.5.0.md). - - -### v2.4.1 (2026-10-18) - -- English and Japanese interfaces, a first-launch language chooser and a Settings language option; Chinese remains the default. -- Continuous vertical ellipses and dashes with consistent preview and output. -- A 15% Star prompt after successful batches, with an X button and eight-second idle dismissal. -- Simplified/Traditional Chinese output with local normalization and bundled manga fonts. -- Translation font and default vertical alignment choices grouped inside collapsible Translation Preferences. -- Manual hard line breaks, outline lettering, top/center/bottom column alignment and persistent live editor previews. -- Default watermark with an off switch on the first Settings tab; prior off choices remain honored. -- Full app and model archives are provided together; extract and merge their top-level `ComiTrans` folders. Existing models remain reusable. [Update guide](docs/RELEASE-v2.4.1.md). - -### v2.4.0 (2026-10-13) - -- Added a file-level SHA256 baseline, build fingerprint and Windows patch launcher. Future minor releases can use file-level patches with source-build checks, backups and restoration on failed writes. [Patch guide](docs/PATCH_UPDATES.md). -- Baselines and checksums are stored in the source repository. Releases provide the app and model archives; the app includes its update baseline. -- Open manga workspaces with softer buttons and borders, local halftones, and empty-state illustrations; removed large chapter banners and supplied missing Japanese header glyphs. -- Font imports and default translation font selection on the translation page; an approximately 1 MB Google Fonts catalog with name search, language/style filters, background downloads, license preservation, and offline reuse. -- Eight mask resize handles, free resizing, position dragging, and Esc to cancel a drag. Text, font, size, and X/Y changes preview automatically; saving exports the current result and persists its layout. -- Fixed global defaults overriding editor font choices and whole-text replacement on missing glyphs. Manual fonts affect only the selected block, retain per-glyph fallback, and survive save/reload. -- Removed the approved 82 legacy web, obsolete CLI, and training files. Simplified ONNX imports, warmup, and build dependencies; closed diagnosis HTTP clients correctly. -- Separate multimodal translation and experimental font-comparison switches, with comparison disabled by default. Improved local candidates, voting, and API thinking controls; documented the proposed translation constraints. -- Validation: 176 automated tests passed, 33 real Qt captures at each of normal and 200% scaling passed, and real font downloads, offline selection, patch validation and rollback were verified. - -App and models remain separate packages; v2.3.0 users can reuse their models. See the [v2.4.0 release notes](docs/RELEASE-v2.4.0.md), [detailed changelog](CHANGELOG.md), [cleanup record](docs/PROJECT_CLEANUP.md), and [editor guide](docs/EDITOR_LIVE_PREVIEW.md). - -### v2.3.0 (2026-09-16) - -- Manga magazine UI with full-width chapter headings, edge halftones, the Skribble wordmark, and consistent automatic-processing/editor navigation. -- Compact language/output controls and a single straight node track driven by real page events, including skips, failures, cancellation, and parallel pages. -- Fast character-reveal logs in the Aa handwriting font, with backlog acceleration, search, filtering, selection, pause-follow, and full-text export. -- Korean/English PP-OCRv5 ONNX and independent HTTP / compatible vision OCR services; source text, language, engine, and confidence saved in layout JSON. -- Source-language-aware translation; Korean/English/custom modes do not inherit Japanese-mode English skipping. Empty results and OCR failures preserve original text. -- Bundled UI fonts/SVG assets and Korean/English models; updated UI captures, log animation, and A/B before/after examples. - -### v2.2.2 (2026-09-14) - -**New and improved** - -- Refreshed the desktop UI and operation feedback with restrained transitions, recursive folder import, and drag-and-drop support. -- Added whole-book PDF import, page-by-page translation, and PDF export. -- Made Baberu ONNX OCR the default, with manga-ocr-onnx kept as a fallback. -- Improved comic typesetting with rounder font choices and 3x supersampling to reduce visible pixelation. -- Rendered double em dashes (`——`) in vertical text as one continuous long vertical line, with expanded font styles and punctuation layout rules. - -**Fixes** - -- Fixed Issue #19, where an undefined `zhengzai` identifier in the translation API progress log crashed before the request was sent. -- Improved API error classification and guidance for authentication, balance, model, rate-limit, and server failures; fatal failures now stop remaining tasks. - -### v2.2.1 (2026-08-07) - -**New features** - -- Added an output directory setting on the translation workbench; the default output path stays unchanged and stays in sync with the API config page. -- Applied the app icon to the main window and header buttons, and polished the UI styles. -- Multi-page translation optimization: detection/OCR and inpainting/typesetting stay serial, while translation API requests across pages run in parallel (4 workers by default), significantly reducing total processing time. -- Translation API request logs: model, text count, returned count, elapsed time, count mismatch and failure reasons; skipped typesetting now logs a clear warning. -- Stricter translation system prompt: unified JSON object output, strict item count, and mandatory onomatopoeia translation to reduce missing typesetting. -- Tiered font sizes for next-episode previews and narration, with expanded preview keywords (chapter N, preview, final episode, etc.). - -**Adjustments** - -- Output directories now use `output_page_*`; test assets live in `page/test`, and test output goes to `page/test_output`. -- Test and output directories are excluded from uploads and packaging. - -### v2.1.0 (2026-08-06) - -**Architecture** - -- Rebuilt as a fully local PySide6 desktop client, removing the web stack (Spring Boot / FastAPI / PostgreSQL / Redis / Nginx). -- Switched detection, OCR, and inpainting to ONNX Runtime, removing PyTorch / torchvision / transformers. -- Split releases: ~0.4GB app archive plus a separate models archive. - -**New features** - -- Startup warmup for the AI pipeline. -- Multimodal translation toggle with AI font/size/direction configuration. -- Manual typesetting editor with save-over. -- Error logs with AI diagnosis and multi-turn context. -- Batch folder selection, instant stop, Issue feedback, draggable layout. -- Special open-source fonts for narration, onomatopoeia, next-episode previews, and titles. - -**Fixes & tuning** +
-- Fixed frozen exe warmup stalls (unittest exclusion, detector dynamic import, pyclipper / unidic / manga_ocr assets). -- Balanced orientation thresholds to reduce horizontal/vertical misclassification. -- Balanced font sizes: larger for vertical text, tighter for horizontal and long text; mask-area sizing and mask-centroid layout. -- Erasing now uses the detector text mask only, not the whole bubble. -- English text blocks are fully skipped: no OCR, no erasing, no typesetting; high Latin/full-width Latin ratio in OCR output is auto-detected and the original text is kept. -- Cleaned canvases moved to `_cleaned/`. -- Removed training/visualization dependencies (matplotlib, wandb, pandas, torchsummary). +
+Recent Release Summaries (v2.6.0 / v2.5.2 / v2.5.1 / v2.5.0) -### v1.x (archived) +- **v2.6.0 (2026-11-23):** Single-file Windows x64 NSIS Setup with bundled models, isolated subprocess model warm-up, quiet stable update indicator, Work Terminology, 1–3 page Trial runs & token/cost estimation, CBZ import/export, flat editor menus, block multi-select & cross-page Style Brush/undo, Book Transcript search/replace, single-bubble Retranslate, and 60fps monochrome motion across Paper & Night Ink themes. [Release notes](docs/RELEASE-v2.6.0.md) +- **v2.5.2 (2026-11-17):** Rolling cross-page translation context with cache retention, OCR-forked sequential translation ∥ background repair Fork-Join pipeline, live workflow topology visualizer & per-page matrix, manual bubble frames, eyedropper & RGB fills, 9-slot favorite fonts (`1–9`), stretch/rotation/outline presets, deferred post-first-paint warmup, and fractional PDF export fixes. [Release notes](docs/RELEASE-v2.5.2.md) +- **v2.5.1 (2026-11-10):** Night Ink dark theme, canvas click selection, draggable right inspector splitter, `F2` full-screen editor, `Z` zoom HUD, CUDA toggle guidance, CharSpot Small default Japanese OCR, and white-bubble fallback fill. [Release notes](docs/RELEASE-v2.5.1.md) +- **v2.5.0 (2026-11-02):** Image-based PDF workflow & lossless export, native-resolution tiled inpainting, bounded streaming pipeline, per-page resume, and reversible per-bubble restoration. [Release notes](docs/RELEASE-v2.5.0.md) -- Web-based manga translation platform: Spring Boot backend, Vue frontend, PostgreSQL / Redis / Nginx, Python worker for image processing. -- Batch translation, text erasing, font classification, horizontal typesetting, hosted models. -- Old web sources and their documentation have been removed from the working tree; historical implementations remain in Git history. See the [cleanup record](docs/PROJECT_CLEANUP.md). +See [CHANGELOG.md](CHANGELOG.md) for the complete version history back to v1.x. -## FAQ +
-**Do releases require Python or GPU libraries?** +--- -Setup includes the CPU runtime and models, so no Python installation is required. CUDA acceleration requires a compatible NVIDIA driver, CUDA 12, and cuDNN 9. See GPU setup in Settings for instructions. +## ❓ FAQ -**Where do models go?** +**1. Do releases require Python or PyTorch?** +No. The v2.6.0 Windows Setup bundles the runtime, fonts, and default ONNX models for out-of-the-box CPU inference. For NVIDIA GPU acceleration, follow the in-app links under Settings → Runtime & Output to install a compatible NVIDIA driver, CUDA 12, and cuDNN 9. -The v2.6.0 Setup installs the models with the app. For v2.5.2 and earlier ZIP releases, follow the extraction instructions above. +**2. Where do models go?** +The v2.6.0 Setup installs default models automatically alongside the app. Korean/English OCR models can be downloaded via `scripts/download_ocr_models.py` or copied from legacy packs; older ZIP releases keep models in `ComiTrans\comic-translate-ai\models\`. -**Why is English text not translated?** +**3. Why is English text not translated in Japanese mode?** +Japanese local mode intentionally preserves detector-labeled English blocks and high-Latin-ratio OCR output. For English manga/comics, switch Source Language to English; Korean, English, and Custom OCR modes translate English regions normally (automatic mixed-language routing is not enabled). -Japanese local mode preserves detector-labeled English blocks and high-Latin-ratio OCR output. For an English page, select English as the source language; Korean/English/custom modes recognize and translate those regions. Automatic mixed-language routing is not enabled. +**4. Why does Windows show "Unknown publisher" when running Setup?** +This release is currently unsigned. Always download from [GitHub Releases](https://github.com/Aaaaamadeus/ComiTrans/releases) and verify the installer hash against `SHA256SUMS.txt` before installing. -**Why is the app archive so small?** +--- -Since v2.2.1 everything is ONNX and PyTorch is gone. Detection, OCR, and inpainting use ONNX Runtime. GPU inference also needs compatible CUDA/cuDNN libraries, available via the official installation links in Settings. +## 💬 Feedback & Support -## Feedback +Report bugs or request features via [GitHub Issues](https://github.com/Aaaaamadeus/ComiTrans/issues) or the **Issue** button in the top-right corner of the app. Attaching the diagnosis prompt generated on the **Diagnostics** page helps pinpoint issues quickly. -Report issues at [GitHub Issues](https://github.com/Aaaaamadeus/ComiTrans/issues) or use the Issue button in the app. Attach the diagnosis prompt from the "Diagnostics" page when possible. +--- -## License +## 📄 License -- Project source code is licensed under [GPL-3.0](LICENSE). -- Fonts: Smiley Sans, LXGW WenKai, LXGW Marker Gothic (SIL OFL 1.1), Klee One, Source Han Sans/Serif, setofont (SetoFont), and 851tegakizatsu are free for commercial use, each under its own license. -- UI fonts Skribble and Aa retain their embedded copyright information; see [font provenance](assets/ui/fonts/README.md). -- Models: CharSpot Small weights use CC BY-NC-SA 4.0. For attribution, terms, and sources of each model see [docs/ONNX_MODELS.md](docs/ONNX_MODELS.md). +- **Source Code:** Licensed under [GPL-3.0](LICENSE). +- **Bundled Chinese Fonts:** Smiley Sans, LXGW WenKai, LXGW Marker Gothic (SIL OFL 1.1), Klee One, Source Han Sans/Serif, SetoFont, and 851tegakizatsu are free for commercial use under their respective licenses; see [docs/TRADITIONAL_MANGA_FONTS.md](docs/TRADITIONAL_MANGA_FONTS.md) for the TC manga bundle. +- **UI Fonts:** Skribble and Aa retain their embedded copyright notices; see [assets/ui/fonts/README.md](assets/ui/fonts/README.md). +- **AI Models:** CharSpot Small weights use CC BY-NC-SA 4.0; full attributions, sources, and terms are listed in [docs/ONNX_MODELS.md](docs/ONNX_MODELS.md). diff --git a/docs/RELEASE-v2.6.0.md b/docs/RELEASE-v2.6.0.md index 292ab62..e7f8f51 100644 --- a/docs/RELEASE-v2.6.0.md +++ b/docs/RELEASE-v2.6.0.md @@ -1,31 +1,133 @@ # ComiTrans v2.6.0 -## Windows 安装与升级 +ComiTrans v2.6.0 现已发布。本次更新正式推出**单文件 Windows x64 安装向导**(内含桌面客户端、字体与默认 ONNX 模型),同时在工作流、精修编辑器、动效与启动性能上带来多项实质升级:新增**作品术语库、试译与翻译消耗预估、CBZ 漫画包支持**,重构精修顶部栏为**单层菜单**并加入**气泡多选、连续样式刷、全书译稿查找替换与单气泡重译**,并引入 **60fps 黑白墨韵动效、独立进程模型预热与后台正式版更新提醒**。 -下载本页的 `ComiTrans-v2.6.0-x64-Setup.exe` 和 `SHA256SUMS.txt`。安装包为 Windows x64,包含程序、字体和默认 OCR、检测、修补模型。关闭 ComiTrans,核对安装包的 SHA-256 后运行 Setup。安装后在设置中填写翻译 API 密钥与模型。 +[核心功能更新](#一核心功能更新) · [Windows 安装与升级](#二windows-安装校验与升级迁移) · [English Release Notes](#english) · [v2.6.0 发布页](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0) -```powershell -Get-FileHash -Algorithm SHA256 .\ComiTrans-v2.6.0-x64-Setup.exe -Get-Content .\SHA256SUMS.txt -``` +| 模块 | 主要更新 | +| --- | --- | +| **翻译与全书工作流** | 新增「作品术语库」、1–3 页「试译」与真实 Token「翻译消耗」预估;支持 CBZ 导入翻译与保存后重新「导出 CBZ」 | +| **精修编辑器与批量排版** | 工具栏收纳为无嵌套单层菜单;支持多选气泡、「取样式 / 样式刷 / 撤销样式」、跨页「全书译稿」查找替换与「重译气泡」 | +| **视觉动效与启动性能** | 全界面 60fps 黑白墨韵动效与纸白/夜墨双主题统一;检测/修复模型隔离至独立进程预热;顶栏新增「有更新」低干扰提醒 | +| **Windows 安装与交付** | 单文件 NSIS Setup(固实 LZMA 压缩,约 681 MiB),开箱含默认模型与字体;支持自定义中文路径、静默参数与独立用户数据目录 | -两处的十六进制哈希应一致。这个版本的安装包未签名,Windows 可能显示「未知发布者」。请从项目的 GitHub 发布页手动下载和安装。[v2.6.0 发布页](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0) +--- -- **从预发布 NSIS 版升级**:关闭应用后直接运行新版 Setup,沿用原安装目录和用户配置。 -- **从旧 MSI / WiX 版迁移**:先在 Windows「已安装的应用」中卸载旧版,再运行 Setup。保留用户数据目录。 -- **从 ZIP 版迁移**:原有配置和字体可从旧目录的 `config.yaml`、`user_fonts` 迁入 `%LOCALAPPDATA%\ComiTrans`。保留漫画、项目索引和配套精修目录之间的相对位置。 +## 一、核心功能更新 -## 使用变化 +### 1. 翻译前准备与全书工作流 -- 打开应用后,检测和修补模型在独立进程中预热。加载期间可继续操作界面,顶栏会显示模型状态。 -- 在「作品术语库」里记录角色、地点和统一译名。整批翻译前可以先试译少量页面,查看用量和按已配置单价估算的费用。 -- 精修支持「全书译稿」跨页查找、替换,以及单气泡重译。CBZ 可以按页翻译,已保存的页面可以重新导出为 CBZ。 -- 启动时在后台比较客户端版本与 GitHub 最新正式版。只有发现更高版本时,「模型已就绪」左侧才会出现「有更新」。点击可查看两个版本号及下载入口。 +- **作品术语库(`任务 → 作品术语库` / 翻译偏好)** + - 按作品记录角色、地点与统一译名;**仅需填写固定译名**,类型与识别线索均可选填,无需手填原文,也不会增加额外的识别请求。 + - 断点指纹仅纳入当前生效术语:修改其他作品术语或调整计费单价时,不会让已付费页面重新翻译。 +- **试译与翻译消耗预估(自动处理页「试译」、`任务 → 翻译消耗`)** + - 整批翻译前可先试译队列开头的 **1–3 页**(PDF 按页计数);试译使用独立结果目录、独立上下文与独立断点,不污染正式任务进度,完成后可直接精修试译结果或一键启动正式翻译。 + - 任务或试译结束后,基于翻译接口返回的真实 Token 用量(计入无效内容重试响应)展示「翻译消耗」,并支持填写自定义单价与按样页估算整本费用。 +- **CBZ 漫画包端到端支持** + - 支持直接导入 `.cbz` 漫画压缩包按页翻译,并在「嵌字精修」保存各页后通过 `文件 → 导出 CBZ` 重新打包导出。 + +### 2. 精修编辑器重构与批量排版 + +- **单层菜单与紧凑属性栏** + - 将「视图」「文件」「填色」「常用字体管理」等高频能力收拢为**无嵌套单层菜单**,减少工具栏遮挡并释放更多画布区域;右侧属性栏新增的快捷字号框与原字号框实时双向同步。 +- **气泡多选与批量样式编辑** + - 气泡列表支持 `Ctrl` / `Shift` 多选,画布支持 `Ctrl` 点击加选与 `Shift` 拖拽框选,右上角计数随当前选区实时更新。 + - 多选修改仅同步实际发生变化的样式字段,**严格保护译文文本、原文、蒙版位置/尺寸以及已还原原图的气泡**。 +- **样式取样、连续样式刷与样式撤销** + - 在气泡右上角 `⋯` 菜单、列表右键或画布右键菜单中使用「取样式」「应用样式到所选气泡」「样式刷」与「撤销样式」。 + - **样式刷**支持跨页共享样式剪贴板,点击或框选目标气泡即可连续套用;开启期间隐藏气泡调整手柄以防误拖,按 `Esc` 或点击「退出样式刷」结束。 + - **撤销样式**可逐次撤回当前页最近的样式改动,不会覆盖后续修改过的译文内容。 +- **全书译稿跨页查找替换 & 单气泡重译** + - 新增「全书译稿」对话框,支持跨页检索、批量替换译文并快速定位修改。 + - 右侧编辑栏新增「重译气泡」,可对单个气泡单独重新请求翻译 API,无需整页重跑。 + +### 3. 界面动效、双主题与启动性能 + +- **60fps 黑白墨韵动效与双主题统一** + - 引入统一的 60fps 单色交互动效系统与精细化控件反馈,全面打磨「纸白」与「夜墨」双主题下的下拉框、按钮、卡片、对话框、工具栏与选中态表现。 +- **独立进程模型预热** + - 将检测(CharSpot / 文本检测)与 LaMa 背景修复等图像模型会话隔离至独立进程,彻底脱离 Qt 主事件循环;启动加载期间界面持续流畅可操作,顶栏实时反馈模型准备状态。 +- **低干扰更新提醒** + - 启动时在后台比较本地客户端版本与 GitHub 最新正式版;仅当存在更高正式版时,顶栏「模型已就绪」左侧才会出现「有更新」按钮,点击可查看版本对比与发布页下载入口(不会对正式版用户误报预发布测试版)。 + +| 纸白主题 · 嵌字精修(v2.6.0) | 夜墨主题 · 嵌字精修(v2.6.0) | +| --- | --- | +| ![v2.6.0 纸白主题精修界面](https://raw.githubusercontent.com/Aaaaamadeus/ComiTrans/v2.6.0/docs/ui-review/release-260-light.png) | ![v2.6.0 夜墨主题精修界面](https://raw.githubusercontent.com/Aaaaamadeus/ComiTrans/v2.6.0/docs/ui-review/release-260-dark.png) | + +--- + +## 二、Windows 安装、校验与升级迁移 + +### 下载与安装 + +下载本页的 `ComiTrans-v2.6.0-x64-Setup.exe` 与 `SHA256SUMS.txt`([v2.6.0 发布页](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0))。安装包采用固实 LZMA 压缩(约 681 MiB),**内置桌面客户端、全部中文字体以及默认检测、OCR 和修复模型**。 + +1. **校验 SHA-256**:运行安装包前,在 PowerShell 中核对两处十六进制哈希是否一致: + + ```powershell + Get-FileHash -Algorithm SHA256 .\ComiTrans-v2.6.0-x64-Setup.exe + Get-Content .\SHA256SUMS.txt + ``` + +2. **运行 Setup**:关闭正在运行的 ComiTrans,双击安装向导。本版安装包**未签名**,Windows 可能显示「未知发布者」,请确认来自官方发布页且哈希一致后手动运行。 +3. **配置翻译服务**:安装后 CPU 模式即可直接加载本地模型。首次使用请在「设置」填写翻译 API 密钥与模型;如需 NVIDIA GPU 加速,可在「设置 → 运行与输出 → GPU 安装说明与下载」按指引配置 CUDA 12 与 cuDNN 9。 + +### 系统集成与静默参数 + +- 支持自定义多级目录与中文安装路径;自动创建开始菜单与桌面快捷方式、`.comitrans` 项目文件关联及系统「已安装的应用」卸载入口。 +- 用户配置 `config.yaml`、导入/下载的字体 `user_fonts`、日志与默认输出均存放在 `%LOCALAPPDATA%\ComiTrans`,卸载程序时保留用户数据。 +- 静默安装支持 `/S`(区分大小写)、`/LOG="路径"` 与放在命令末尾的 `/D=安装路径`(不加引号),例如: + + ```powershell + .\ComiTrans-v2.6.0-x64-Setup.exe /S /LOG="D:\install.log" /D=D:\Apps\ComiTrans + ``` + +### 从历史版本升级 / 迁移 + +| 原安装形态 | 升级 / 迁移方式 | +| --- | --- | +| **v2.6.0-pre.1 预发布 NSIS 版** | 关闭应用后直接运行新版 Setup,自动沿用原安装目录与 `%LOCALAPPDATA%\ComiTrans` 用户配置 | +| **旧版 MSI / WiX 安装版** | 请先在 Windows「已安装的应用」中卸载旧版,再运行新版 Setup(用户数据目录会保留) | +| **v2.5.2 及更早 ZIP 便携版** | 可将旧目录中的 `config.yaml` 与 `user_fonts` 复制到 `%LOCALAPPDATA%\ComiTrans`;移动漫画项目时请保留漫画、`.comitrans` 索引与配套精修目录的相对位置 | + +--- ## English -Download `ComiTrans-v2.6.0-x64-Setup.exe` and `SHA256SUMS.txt` from this release. Compare the SHA-256 values using the PowerShell commands above. This Windows x64 installer is **unsigned** and requires a manual download. Windows may display “Unknown publisher.” Setup includes the app, fonts and default models. Enter your translation API key and model in Settings after installation. +ComiTrans v2.6.0 introduces a single-file Windows x64 installer alongside major improvements across batch translation preparation, editor ergonomics, visual polish, and startup responsiveness. + +### What's New + +#### 1. Pre-Translation & Full-Book Workflow +- **Work Terminology (`Task → Work terminology` & Translation Preferences):** Maintain per-series character names, places, and fixed translations. Only the target translation term is required (category and matching hints are optional, with no extra OCR/recognition calls). Checkpoints fingerprint only the active project's terms, so editing pricing or another series will not invalidate already-translated pages. +- **Trial Run & Translation Usage Estimates (`Trial` & `Task → Translation usage`):** Test the first **1–3 queued pages** (counting PDF pages individually) in an isolated output directory, context, and checkpoint before committing to a full batch. After completion, inspect token usage reported by your provider (including invalid-output retries), configure custom unit pricing, and estimate full-book cost. +- **End-to-End CBZ Support:** Import `.cbz` comic archives for page-by-page translation and export edited pages back to `.cbz` via `File → Export CBZ`. + +#### 2. Editor Redesign & Batch Styling +- **Single-Level Menus & Compact Inspector:** Reorganizes View, File, Fill, and Favorite Font Management into flat, non-nested menus to keep the canvas unobstructed. A quick font-size box stays synchronized with the inspector size control. +- **Multi-Select & Batch Property Sync:** Select multiple blocks in the list (`Ctrl` / `Shift`) or directly on the canvas (`Ctrl`-click / `Shift`-drag marquee). Batch edits apply only the fields actually changed, leaving translated text, source text, mask geometry, and restored original bubbles untouched. +- **Style Picker, Continuous Style Brush & Undo:** Access `Pick style`, `Apply style to selected`, `Style brush`, and `Undo style` from each block's `⋯` button or the list/canvas context menu. Style Brush keeps a cross-page style clipboard, hides drag handles while active to prevent accidental moves, and exits on `Esc` or `Exit brush`. `Undo style` steps backward through style changes on the current page without reverting later text edits. +- **Book Transcript & Single-Bubble Retranslation:** Search and replace translations across all pages from `Book transcript`, and re-translate an individual bubble in place with `Retranslate`. + +#### 3. Visual Polish, Motion & Startup Performance +- **60fps Monochrome Motion & Theme Consistency:** Adds a unified 60fps monochrome motion system and refined combo-box/control feedback across both Paper (light) and Night Ink (dark) themes. +- **Isolated Subprocess Model Warm-Up:** Moves detector, OCR, and LaMa image model sessions out of the Qt event loop into an isolated process so the UI remains responsive while models warm up. +- **Quiet Update Indicator:** Checks GitHub for newer stable releases in the background at startup. Only when a newer stable version exists does a compact `Update` button appear to the left of `Models ready`, opening a version comparison and release download link (stable users are never alerted for pre-releases). + +### Windows Installation, Verification & Migration + +Download `ComiTrans-v2.6.0-x64-Setup.exe` and `SHA256SUMS.txt` from the [v2.6.0 Release Page](https://github.com/Aaaaamadeus/ComiTrans/releases/tag/v2.6.0). The solid-LZMA installer (~681 MiB) bundles the desktop client, fonts, and default ONNX models so CPU inference works immediately after setup. + +1. **Verify SHA-256** in PowerShell before running Setup: -Close the app before upgrading an NSIS installation. Uninstall an older MSI or WiX installation through Windows Settings first. ZIP users can migrate `config.yaml` and `user_fonts` into `%LOCALAPPDATA%\ComiTrans`. Keep project indexes and their editing folders together. + ```powershell + Get-FileHash -Algorithm SHA256 .\ComiTrans-v2.6.0-x64-Setup.exe + Get-Content .\SHA256SUMS.txt + ``` -Model warm-up runs in a separate process. Project glossaries, trial translations and usage estimates help prepare a batch. The editor supports cross-page transcript search and replacement, single-bubble retranslation and CBZ export. A small **Update** button beside the model status appears when GitHub lists a newer stable version. +2. **Install:** Close any running ComiTrans instance and run Setup. This release is **unsigned** and requires manual download/installation; Windows may show an "Unknown publisher" prompt. +3. **Configure API & Optional GPU:** Enter your translation API key and model in Settings. For NVIDIA GPU acceleration, follow the CUDA 12 / cuDNN 9 links under **Settings → Runtime & Output → GPU setup and downloads**. +4. **Upgrade / Migration:** + - **From `v2.6.0-pre.1` NSIS preview:** Close the app and run the new Setup directly to upgrade in place. + - **From legacy MSI / WiX builds:** Uninstall the older version in Windows *Installed Apps* first, then run Setup (user data in `%LOCALAPPDATA%\ComiTrans` is preserved). + - **From historical ZIP editions:** Copy `config.yaml` and `user_fonts/` into `%LOCALAPPDATA%\ComiTrans`, and keep manga images, `.comitrans` indexes, and editing folders together. From 674dd217001121a1b3e51482e48088ad7c7fea35 Mon Sep 17 00:00:00 2001 From: LianWan Wen <2094941626@qq.com> Date: Mon, 23 Nov 2026 17:27:50 +0800 Subject: [PATCH 2/2] chore: update push proxy port to 7890 in AGENTS.md --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 7e0b972..2fabedf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,7 +38,7 @@ $branch = 'feat/ui-2.0' $tmp = Join-Path $env:TEMP 'gitconfig-push-direct' @" [http] - proxy = http://127.0.0.1:7897 + proxy = http://127.0.0.1:7890 [credential] helper = manager "@ | Set-Content -Encoding utf8 $tmp