feat: translate all cache/task console logs to English

MultiTrack and H3 conditioning cache logging printed Chinese labels
(ProjectMedia/SegmentMedia statuses, timing and cache-size breakdowns).
Translate every console-facing string to English so the ComfyUI log is
fully English-readable:

- cache status values are now 'cache-hit' / 'first-load' (was Chinese),
  including the _all_media_caches_hit sentinel comparison and the
  _easy_media_cache_status data written into tracks_info
- cache size breakdown now reads 'file(...)=conditioning(...)+...'
  with English category labels
- timing/stage messages, video-track compositing and locked-audio
  extraction messages, and llama.cpp install errors are English
- fullwidth '|' in the media_loading timing line replaced with ASCII
- test assertions updated to the new English strings

No behavioral changes beyond the log/status wording; the Chinese
prompt-reference syntax (@图片N etc.) and LLM prompt templates are
intentionally untouched as they are functional.
This commit is contained in:
Z User 2026-09-26 23:27:09 +00:00
parent 27041a8a9f
commit fc040c1645
6 changed files with 71 additions and 71 deletions

View File

@ -697,7 +697,7 @@ def _merge_video_track(
if source is not None:
log_node_info(
"MultiTrack Video Track",
"单片段覆盖任务窗口,直接裁剪缩放",
"single-segment override covers the task window; cropping and scaling directly",
)
rendered_path = render_single_video_segment_with_ffmpeg(
source,
@ -2877,25 +2877,25 @@ class MultiTrackTaskOutput(io.ComfyNode):
if isinstance(cached_task_output, io.NodeOutput):
cache_status = info.get("_easy_media_cache_status", {})
if isinstance(cache_status, dict):
cache_status["task_output"] = "命中恢复缓存"
cache_status["task_output"] = "cache-hit"
log_node_info(
"MultiTrack Cache",
f"segment={requested_index} | "
f"项目媒体={cache_status.get('project_media', '未知')} | "
f"分段媒体={cache_status.get('segment_media', '未知')} | "
"TaskOutput=命中恢复缓存",
f"ProjectMedia={cache_status.get('project_media', 'unknown')} | "
f"SegmentMedia={cache_status.get('segment_media', 'unknown')} | "
"TaskOutput=cache-hit",
)
return cached_task_output
if "_preloaded_media" in info:
cache_status = info.get("_easy_media_cache_status", {})
if isinstance(cache_status, dict):
cache_status["task_output"] = "首次加载"
cache_status["task_output"] = "first-load"
log_node_info(
"MultiTrack Cache",
f"segment={requested_index} | "
f"项目媒体={cache_status.get('project_media', '未知')} | "
f"分段媒体={cache_status.get('segment_media', '未知')} | "
"TaskOutput=首次加载",
f"ProjectMedia={cache_status.get('project_media', 'unknown')} | "
f"SegmentMedia={cache_status.get('segment_media', 'unknown')} | "
"TaskOutput=first-load",
)
tracks = info.get("tracks", [])
@ -2960,12 +2960,12 @@ class MultiTrackTaskOutput(io.ComfyNode):
with log_stage_time(
"MultiTrack Task Output",
f"segment {requested_index} / media_loading | "
f"segment {requested_index} / media_loading | "
f"{info.get('width', 544)}x{info.get('height', 960)}",
):
log_node_info(
"MultiTrack Task Output",
f"segment={requested_index} | 开始加载分段媒体",
f"segment={requested_index} | loading segment media",
)
selected_images = [
item
@ -3266,8 +3266,8 @@ class MultiTrackTaskOutput(io.ComfyNode):
if not is_minimax or resolved_video_segments:
log_node_info(
"MultiTrack Task Output",
f"segment={requested_index} | 开始合成视频轨 "
f"({len(resolved_video_segments)} 个片段)",
f"segment={requested_index} | compositing video track "
f"({len(resolved_video_segments)} clips)",
)
merged_video = _merge_video_track(
resolved_video_segments,
@ -3283,7 +3283,7 @@ class MultiTrackTaskOutput(io.ComfyNode):
if locked_audio_priority < 1 and locked_audio_track:
log_node_info(
"MultiTrack Task Output",
f"segment={requested_index} | 开始提取锁定视频原声",
f"segment={requested_index} | extracting locked video audio",
)
video_audio = extract_video_audio(
merged_video,
@ -3674,14 +3674,14 @@ class MultiTrackPromptEnhancer(io.ComfyNode):
comfy_nodes, "NODE_CLASS_MAPPINGS", {}
):
raise RuntimeError(
f"Missing node '{LLAMA_CPP_INSTRUCT_NODE_ID}'. 未找到该节点。请前往 "
f"{LLAMA_CPP_INSTALL_URL} 下载并安装 ComfyUI-llama-cpp_vlm,"
"然后重启 ComfyUI。"
f"Missing node '{LLAMA_CPP_INSTRUCT_NODE_ID}'. Please download "
f"and install ComfyUI-llama-cpp_vlm from {LLAMA_CPP_INSTALL_URL} "
"and restart ComfyUI."
)
selected_llama_model = _unwrap_singleton_container(llama_model, None)
if selected_llama_model is None:
raise RuntimeError(
"llama_model must be connected when model is llama.cpp (本地)."
"llama_model must be connected when the llama.cpp model backend is selected."
)
if not isinstance(selected_llama_model, dict) and not is_link(
selected_llama_model

View File

@ -1390,7 +1390,7 @@ class EasyH3ConditioningCache(io.ComfyNode):
touch_h3_conditioning_cache(cache_path)
log_node_info(
"H3 Conditioning Cache",
f"segment={int(segment_index)} | Conditioning=命中恢复缓存",
f"segment={int(segment_index)} | Conditioning=cache-hit",
)
return io.NodeOutput(*restored)
@ -1401,7 +1401,7 @@ class EasyH3ConditioningCache(io.ComfyNode):
if scope_token is None:
log_node_info(
"H3 Conditioning Cache",
f"segment={int(segment_index)} | 缓存写入已跳过: temp缓存池不可用",
f"segment={int(segment_index)} | cache write skipped: temp cache pool unavailable",
)
return io.NodeOutput(conditioning, latent)
try:
@ -1414,13 +1414,13 @@ class EasyH3ConditioningCache(io.ComfyNode):
)
log_node_info(
"H3 Conditioning Cache",
f"segment={int(segment_index)} | Conditioning=首次加载 | "
f"segment={int(segment_index)} | Conditioning=first-load | "
f"{format_h3_conditioning_cache_stats(stats)}",
)
except (OSError, RuntimeError, TypeError, ValueError) as error:
log_node_info(
"H3 Conditioning Cache",
f"segment={int(segment_index)} | 缓存写入已跳过: {error}",
f"segment={int(segment_index)} | cache write skipped: {error}",
)
return io.NodeOutput(conditioning, latent)
@ -1431,7 +1431,7 @@ class EasyH3ConditioningCache(io.ComfyNode):
return False
status = info.get("_easy_media_cache_status")
return isinstance(status, dict) and all(
status.get(name) == "命中恢复缓存"
status.get(name) == "cache-hit"
for name in ("project_media", "segment_media", "task_output")
)
@ -1486,11 +1486,11 @@ class EasyH3ConditioningCache(io.ComfyNode):
except OSError as unlink_error:
log_node_info(
"H3 Conditioning Cache",
f"损坏缓存无法删除: {unlink_error}",
f"could not remove corrupted cache file: {unlink_error}",
)
log_node_info(
"H3 Conditioning Cache",
f"缓存读取失败,已回退条件编码: {error}",
f"cache read failed, falling back to fresh conditioning encode: {error}",
)
@staticmethod

View File

@ -707,7 +707,7 @@ class EasyH3ProjectStaticPrepare(io.ComfyNode):
cached_task_info = cached_segment[0]
cached_task_info["_easy_media_cache_status"] = {
**project_static.get("_cache_status", {}),
"segment_media": "命中恢复缓存",
"segment_media": "cache-hit",
}
return io.NodeOutput(
project_static,
@ -734,7 +734,7 @@ class EasyH3ProjectStaticPrepare(io.ComfyNode):
multitrack_runtime_cache(task_info, create=True)
task_info["_easy_media_cache_status"] = {
**project_static.get("_cache_status", {}),
"segment_media": "首次加载",
"segment_media": "first-load",
}
if isinstance(segment_cache, dict):
segment_cache[segment_cache_key] = (
@ -763,18 +763,18 @@ class EasyH3ProjectStaticPrepare(io.ComfyNode):
media_data = cached_media
locked = cached_media.get("full_locked_audio")
media_data["_cache_status"] = {
"project_media": "命中恢复缓存",
"project_media": "cache-hit",
}
else:
info = parse_tracks_info(tracks_info)
log_node_info(
"H3 Project Static Prepare",
"开始加载项目媒体(包括锁定视频原声)",
"loading project media (incl. locked video audio)",
)
task_base, images, audio, video, locked = (
prepare_multitrack_project_media(info)
)
log_node_info("H3 Project Static Prepare", "项目媒体加载完成")
log_node_info("H3 Project Static Prepare", "project media loaded")
task_base.pop(MULTITRACK_RUNTIME_CACHE_KEY, None)
media_data = {
"task_tracks_info_base": task_base,
@ -784,7 +784,7 @@ class EasyH3ProjectStaticPrepare(io.ComfyNode):
"full_locked_audio": locked,
"_segment_cache": {},
"_cache_status": {
"project_media": "首次加载",
"project_media": "first-load",
},
}
if isinstance(runtime_cache, dict):

View File

@ -616,9 +616,9 @@ def test_h3_conditioning_cache_round_trips_and_skips_lazy_inputs(
latent = _empty_h3_context_latent(video_steps=2)
first_status = {
"_easy_media_cache_status": {
"project_media": "首次加载",
"segment_media": "首次加载",
"task_output": "首次加载",
"project_media": "first-load",
"segment_media": "first-load",
"task_output": "first-load",
}
}
assert module.EasyH3ConditioningCache.check_lazy_status(
@ -659,17 +659,17 @@ def test_h3_conditioning_cache_round_trips_and_skips_lazy_inputs(
)
assert cache_metadata["schema_version"] == "3"
assert cache_metadata["scope_token"]
assert "文件(" in cache_logs[-1][1]
assert "=主条件(" in cache_logs[-1][1]
assert "+参考视频(" in cache_logs[-1][1]
assert "+参考音频(" in cache_logs[-1][1]
assert "file(" in cache_logs[-1][1]
assert "=conditioning(" in cache_logs[-1][1]
assert "+reference-video(" in cache_logs[-1][1]
assert "+reference-audio(" in cache_logs[-1][1]
assert "initial latent" not in cache_logs[-1][1]
hit_status = {
"_easy_media_cache_status": {
"project_media": "命中恢复缓存",
"segment_media": "命中恢复缓存",
"task_output": "命中恢复缓存",
"project_media": "cache-hit",
"segment_media": "cache-hit",
"task_output": "cache-hit",
}
}
original_load = module.load_h3_conditioning_cache
@ -735,9 +735,9 @@ def test_h3_conditioning_cache_reencodes_when_model_changes(
model = object()
hit_status = {
"_easy_media_cache_status": {
"project_media": "命中恢复缓存",
"segment_media": "命中恢复缓存",
"task_output": "命中恢复缓存",
"project_media": "cache-hit",
"segment_media": "cache-hit",
"task_output": "cache-hit",
}
}
module.EasyH3ConditioningCache.execute(
@ -829,9 +829,9 @@ def test_h3_conditioning_cache_invalidates_temp_pool_once_per_queue(
model = object()
miss_status = {
"_easy_media_cache_status": {
"project_media": "首次加载",
"segment_media": "首次加载",
"task_output": "首次加载",
"project_media": "first-load",
"segment_media": "first-load",
"task_output": "first-load",
}
}
@ -870,9 +870,9 @@ def test_h3_conditioning_cache_switching_project_resets_temp_pool(
model = object()
hit_status = {
"_easy_media_cache_status": {
"project_media": "命中恢复缓存",
"segment_media": "命中恢复缓存",
"task_output": "命中恢复缓存",
"project_media": "cache-hit",
"segment_media": "cache-hit",
"task_output": "cache-hit",
}
}
@ -911,9 +911,9 @@ def test_h3_conditioning_cache_keeps_only_five_recent_segments(
model = object()
hit_status = {
"_easy_media_cache_status": {
"project_media": "命中恢复缓存",
"segment_media": "命中恢复缓存",
"task_output": "命中恢复缓存",
"project_media": "cache-hit",
"segment_media": "cache-hit",
"task_output": "cache-hit",
}
}
@ -959,9 +959,9 @@ def test_h3_conditioning_cache_unavailable_pool_falls_back_to_encoding(
model = object()
hit_status = {
"_easy_media_cache_status": {
"project_media": "命中恢复缓存",
"segment_media": "命中恢复缓存",
"task_output": "命中恢复缓存",
"project_media": "cache-hit",
"segment_media": "cache-hit",
"task_output": "cache-hit",
}
}
@ -1011,9 +1011,9 @@ def test_h3_conditioning_cache_scope_rejects_stale_file_when_clear_fails(
model = object()
hit_status = {
"_easy_media_cache_status": {
"project_media": "命中恢复缓存",
"segment_media": "命中恢复缓存",
"task_output": "命中恢复缓存",
"project_media": "cache-hit",
"segment_media": "cache-hit",
"task_output": "cache-hit",
}
}
module.EasyH3ConditioningCache.execute(
@ -1068,9 +1068,9 @@ def test_h3_conditioning_cache_corrupt_body_falls_back_in_same_queue(
model = object()
hit_status = {
"_easy_media_cache_status": {
"project_media": "命中恢复缓存",
"segment_media": "命中恢复缓存",
"task_output": "命中恢复缓存",
"project_media": "cache-hit",
"segment_media": "cache-hit",
"task_output": "cache-hit",
}
}
module.EasyH3ConditioningCache.execute(

View File

@ -2858,8 +2858,8 @@ def test_multitrack_task_output_restores_project_runtime_media_cache():
"format": "MiniMax",
"_easy_media_runtime_cache": {},
"_easy_media_cache_status": {
"project_media": "命中恢复缓存",
"segment_media": "命中恢复缓存",
"project_media": "cache-hit",
"segment_media": "cache-hit",
},
"_preloaded_media": {
"images": [shared_image],
@ -2888,7 +2888,7 @@ def test_multitrack_task_output_restores_project_runtime_media_cache():
)
assert second is first
assert tracks_info["_easy_media_cache_status"]["task_output"] == "命中恢复缓存"
assert tracks_info["_easy_media_cache_status"]["task_output"] == "cache-hit"
def test_multitrack_task_output_uses_selected_user_prompt_variant():

View File

@ -37,11 +37,11 @@ class H3ConditioningCacheStats:
_CACHE_CATEGORY_LABELS = {
"conditioning": "主条件",
"reference_image": "参考图片",
"reference_video": "参考视频",
"reference_audio": "参考音频",
"keyframe": "关键帧",
"conditioning": "conditioning",
"reference_image": "reference-image",
"reference_video": "reference-video",
"reference_audio": "reference-audio",
"keyframe": "keyframe",
}
@ -243,7 +243,7 @@ def format_h3_conditioning_cache_stats(stats: H3ConditioningCacheStats) -> str:
size = stats.stored_bytes_by_category.get(category, 0)
if size:
parts.append(f"{label}({_format_bytes(size)})")
return f"文件({_format_bytes(stats.file_bytes)})=" + "+".join(parts)
return f"file({_format_bytes(stats.file_bytes)})=" + "+".join(parts)
def load_h3_conditioning_cache(