Skip to content

Commit 6d192de

Browse files
committed
# Changelog v1.7.6
## 修复与改进 - 修复了一堆bug
1 parent e89d8ed commit 6d192de

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

manga_translator/manga_translator.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3831,7 +3831,16 @@ async def _translate_batch_high_quality(self, images_with_configs: List[tuple],
38313831
try:
38323832
sample_config = preprocessed_contexts[0][1] if preprocessed_contexts else None
38333833
if sample_config:
3834-
enhanced_ctx = preprocessed_contexts[0][0] if preprocessed_contexts else Context()
3834+
# ✅ 创建新的Context用于enhanced_ctx,避免污染第一张图片的context
3835+
enhanced_ctx = Context()
3836+
# 复制第一张图片的必要属性
3837+
if preprocessed_contexts:
3838+
first_ctx = preprocessed_contexts[0][0]
3839+
if hasattr(first_ctx, 'input'):
3840+
enhanced_ctx.input = first_ctx.input
3841+
if hasattr(first_ctx, 'img_rgb'):
3842+
enhanced_ctx.img_rgb = first_ctx.img_rgb
3843+
38353844
enhanced_ctx.high_quality_batch_data = batch_data
38363845
enhanced_ctx.high_quality_batch_size = len(preprocessed_contexts)
38373846

0 commit comments

Comments
 (0)