Skip to content

Commit a07859f

Browse files
committed
Release v1.8.9: Bug 修复、功能增强和文档更新
- UI: 字体和提示词下拉菜单支持动态刷新 - UI: 隐藏废弃的 gimp_font 参数 - 文档: 为所有参数添加英文名称 - 文档: 完善参数说明和使用指南 - 版本: 更新到 v1.8.9
1 parent aff3225 commit a07859f

5 files changed

Lines changed: 203 additions & 106 deletions

File tree

desktop_qt_ui/main_view.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ def _create_param_widgets(self, data, parent_layout, prefix=""):
291291
# 跳过这些选项,因为已经用下拉框替代或不需要在UI中显示
292292
# realcugan_model 将通过 upscale_ratio 动态下拉框处理
293293
# batch_concurrent 并发处理已隐藏
294-
if full_key in ["cli.load_text", "cli.template", "cli.generate_and_export", "cli.colorize_only", "cli.upscale_only", "upscale.realcugan_model", "cli.batch_concurrent"]:
294+
# gimp_font 已废弃,使用 font_path 代替
295+
if full_key in ["cli.load_text", "cli.template", "cli.generate_and_export", "cli.colorize_only", "cli.upscale_only", "upscale.realcugan_model", "cli.batch_concurrent", "render.gimp_font"]:
295296
continue
296297

297298
label_text = key
@@ -349,7 +350,29 @@ def showPopup(self):
349350
container = QWidget()
350351
hbox = QHBoxLayout(container)
351352
hbox.setContentsMargins(0, 0, 0, 0)
352-
combo = QComboBox()
353+
354+
# 创建自定义ComboBox,在下拉时刷新提示词列表
355+
class RefreshablePromptComboBox(QComboBox):
356+
def __init__(self, controller_ref, parent=None):
357+
super().__init__(parent)
358+
self.controller_ref = controller_ref
359+
360+
def showPopup(self):
361+
current_text = self.currentText()
362+
self.clear()
363+
prompt_files = self.controller_ref.get_hq_prompt_options()
364+
if prompt_files:
365+
self.addItems(prompt_files)
366+
# 恢复之前选择的值
367+
if current_text:
368+
index = self.findText(current_text)
369+
if index >= 0:
370+
self.setCurrentIndex(index)
371+
else:
372+
self.setCurrentText(current_text)
373+
super().showPopup()
374+
375+
combo = RefreshablePromptComboBox(self.controller)
353376
prompt_files = self.controller.get_hq_prompt_options()
354377
if prompt_files:
355378
combo.addItems(prompt_files)

doc/CHANGELOG_v1.8.9.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# v1.8.9 更新日志
2+
3+
发布日期:2025-01-23
4+
5+
---
6+
7+
## 🐛 Bug 修复
8+
9+
### API 服务器修复
10+
- 修复 `get_work_dir()` 缺少必需参数的错误
11+
- 修复流式端点的 Windows 文件锁定问题
12+
- 使用 importlib 直接导入 workflow_service,避免触发 `__init__.py`
13+
- 修复旋转检测时 mask 为 tuple 导致的错误
14+
- 修复翻译结果为空时的错误处理
15+
- 修复 web 模式缺少 nonce 和 start_instance 属性的错误
16+
- 修复 web 模式命令行参数未生效的问题
17+
18+
## 🎯 新增功能
19+
20+
### API 功能增强
21+
- **临时文件清理**:添加 `/cleanup/temp` 端点用于清理临时文件
22+
- 支持自定义清理时间(默认 24 小时前的文件)
23+
- 自动跳过正在使用的文件(Windows 文件锁定)
24+
- **默认配置支持**:API 未传入 config 时自动使用默认配置文件
25+
26+
### 检测器优化
27+
- **最小检测框面积占比** (min_box_area_ratio)
28+
- 默认值:0.0009(0.09%)
29+
- 用于过滤面积过小的检测框,避免误检噪点
30+
- 可在配置文件中调整,建议范围:0.0005-0.002
31+
32+
### 命令行参数
33+
- 添加 `--retry-attempts` 参数,控制翻译失败时的重试次数
34+
- 为 web 模式添加 `--models-ttl` 参数,控制模型在内存中的保留时间
35+
36+
## � 改进优化
37+
38+
### UI 改进
39+
- **动态刷新功能**:字体和提示词下拉菜单支持动态刷新
40+
- 添加新字体文件后,点击下拉菜单即可看到,无需重启程序
41+
- 添加新提示词文件后,点击下拉菜单即可看到,无需重启程序
42+
- **隐藏废弃参数**:隐藏 `gimp_font` 参数,统一使用 `font_path`
43+
44+
### 参数整合
45+
- **批量大小统一**:移除 `hq_batch_size` 参数,统一使用 `batch_size`
46+
- 对于高质量翻译器,`batch_size` 控制一次发送的图片数量
47+
- 建议范围:1-10
48+
49+
## 📚 文档改进
50+
51+
- 为所有参数添加英文名称
52+
- 完善参数说明文档
53+
- 更新 API 文档
54+
55+
---
56+
57+
**完整更新内容请查看**: [GitHub Releases](https://github.com/hgmzhn/manga-translator-ui/releases/tag/v1.8.9)

doc/README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,13 @@
484484

485485
- **图像保存质量**:JPEG 保存质量(0-100)
486486

487-
- **批量大小**:批量处理大小
487+
- **批量大小 (batch_size)**:批量处理大小
488+
- 默认:1
489+
- 对于高质量翻译器(OpenAI HQ/Gemini HQ),此参数控制一次发送的图片数量
490+
- 越大翻译速度越快,但消耗的 tokens 越多
491+
- 建议范围:1-10
488492

489-
- **上下文页数**:翻译上下文页面数
493+
- **上下文页数 (context_size)**:翻译上下文页面数
490494

491495
### 高级设置
492496

@@ -497,21 +501,27 @@
497501
- **ctd**:Comic 文本检测器
498502
- **craft**:CRAFT 检测器
499503

500-
- **检测大小**:检测时的图像缩放尺寸(默认 2048,越大越准确但越慢)
504+
- **检测大小 (detection_size)**:检测时的图像缩放尺寸(默认 2048,越大越准确但越慢)
501505

502-
- **文本阈值**:文本检测置信度阈值(0-1,越高越严格)
506+
- **文本阈值 (text_threshold)**:文本检测置信度阈值(0-1,越高越严格)
503507

504-
- **旋转图像进行检测**:旋转图像进行检测(提高检测率)
508+
- **旋转图像进行检测 (det_rotate)**:旋转图像进行检测(提高检测率)
505509

506-
- **旋转图像以优先检测垂直文本行**:自动旋转优先检测垂直文本(适合竖排文字)
510+
- **旋转图像以优先检测垂直文本行 (det_auto_rotate)**:自动旋转优先检测垂直文本(适合竖排文字)
507511

508-
- **反转图像颜色进行检测**:反转图像颜色进行检测(适合白底黑字)
512+
- **反转图像颜色进行检测 (det_invert)**:反转图像颜色进行检测(适合白底黑字)
509513

510-
- **应用伽马校正进行检测**:应用伽马校正进行检测(提高低对比度图像检测率)
514+
- **应用伽马校正进行检测 (det_gamma_correct)**:应用伽马校正进行检测(提高低对比度图像检测率)
511515

512-
- **边界框生成阈值**:文本框生成的置信度阈值(值越低检测到的文本框越多)
516+
- **边界框生成阈值 (box_threshold)**:文本框生成的置信度阈值(值越低检测到的文本框越多)
513517

514-
- **Unclip比例**:Unclip 比例(控制文本框扩展程度)
518+
- **Unclip比例 (unclip_ratio)**:Unclip 比例(控制文本框扩展程度)
519+
520+
- **最小检测框面积占比 (min_box_area_ratio)**:最小检测框面积占比,相对于图片总像素(默认 0.0009 = 0.09%)
521+
- 过滤掉面积过小的检测框
522+
- 值越大,过滤越严格,小文本框会被移除
523+
- 值越小,保留更多小文本框
524+
- 建议范围:0.0005-0.002(0.05%-0.2%)
515525

516526
#### 修复器设置
517527

0 commit comments

Comments
 (0)