Skip to content

feat: localize the interface in English and Chinese, add llama.cpp chat workspace - #48

Closed
WenG8868 wants to merge 28 commits into
duckyshell:mainfrom
WenG8868:main
Closed

WenG8868 wants to merge 28 commits into
duckyshell:mainfrom
WenG8868:main

Conversation

@WenG8868

Copy link
Copy Markdown

Summary

This PR adds full English/Chinese localization to ComfyUI MiniMax H3 Prompt Writer and introduces an embedded llama.cpp chat workspace, along with the supporting external-server backend, runtime diagnostics, and tests.

Changes

Localization

  • Added web/i18n.js and web/locales/{en,zh-CN}.js, covering the Writer shell, workspaces, settings, model/runtime/provider panels, media tools, sequence, drafts, notifications, errors, and status messages.
  • Added a language selector in settings; the preference is persisted only after an explicit user switch.
  • The English interface remains unchanged; key parity between locales is enforced by tests.
  • Toasts and status messages use replayable descriptors, so they refresh on language change without network requests or input side effects.

llama.cpp chat

  • The Chat tab appears only when an external llama.cpp server is configured and a model is active; the iframe and host window sync language and theme via postMessage.
  • Streaming SSE chat with thinking toggle, keep-loaded/unload model, stop generation, speed stats, and window protection while generating.
  • Image/video attachments with count, size, and duration validation plus compression.
  • Chat history is stored locally in the browser: text only, media tracked as counts, open and two-step delete, up to 30 conversations.
  • Assistant replies render as Markdown (headings, lists, code blocks, tables, quotes, inline formatting; links restricted to http/https, no innerHTML); the copy button always copies the raw Markdown/input text.

Backend and stability

  • Added external llama.cpp chat forwarding and cancellation endpoints without affecting the existing ComfyUI generation flow.
  • Added backend/runtime_probe.py to probe native backend capabilities in a child process, avoiding pollution of the main process.
  • Improved VRAM/runtime diagnostics, memory handling, and unmeasured-VRAM warnings.
  • Fixed generate/refine being aborted by the 60-second fetch timeout; added a stable network error code for response-body read failures.

Testing

  • Frontend: node --test tests/*.mjs — 368 tests passing; new cases for i18n, chat history, and Markdown rendering.
  • Backend: 425 tests covering the external-server backend, route stability, memory, and runtime diagnostics.
  • No new runtime dependencies.

Notes

  • Chat history is stored only in browser localStorage and excludes image/video data.
  • No breaking interface changes.

WG and others added 28 commits October 22, 2026 11:11
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
- stream chat from a local llama.cpp server with thinking, image/video
  attachments, keep-loaded, unload, and busy-state reporting
- persist text-only conversation history that can be reopened or deleted
- render assistant replies as Markdown and copy the original source text
- add native runtime probe and VRAM diagnostics with coverage and i18n

Co-Authored-By: Claude <noreply@anthropic.com>
@WenG8868 WenG8868 closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant