How aklid01/manhua works
This is a local-first manhua-to-English translation application. Its main workflow imports chapter images, detects text regions, runs OCR, translates and optionally paraphrases dialogue, renders English onto cleaned pages, performs QA, and optionally packages the result. Chapter workspaces hold editable intermediate JSON and support reruns or resumption. The graph also shows backend choices, glossary and manual-review support, the guided GUI, and touch-up editor. Stage sequencing and optional capabilities are documented in the README; unsampled stage implementations are represented by their exact paths, with no additional internal call relationships inferred.
Main entry points: engine.py Literal translation · backends.py Translation backends · pipeline.py Pipeline CLI · stage4_paraphrase.py Dialogue paraphrase
Components 25
Chapter workflow
- Chapter import
manhua_pipeline/stages/stage0_import.py - Region detection
manhua_pipeline/stages/stage1_detection.py - Text OCR
manhua_pipeline/stages/stage2_ocr.py
Translation and review
- Literal translation
manhua_pipeline/stages/stage3_translation/engine.py - Translation backends
manhua_pipeline/stages/stage3_translation/backends.py - OpenAI-compatible client
manhua_pipeline/stages/_openai_compat.py - Translation validation
manhua_pipeline/translation_validation.py - Translation triage
manhua_pipeline/stages/stage3_translation/triage.py - Series glossary
manhua_pipeline/io/glossary_series.py - Manual overrides
manhua_pipeline/manual_overrides.py - Dialogue paraphrase
manhua_pipeline/stages/stage4_paraphrase.py - MCP interface
manhua_pipeline/adapters/mcp_server.py
Rendering and quality
- Page rendering
manhua_pipeline/stages/stage5_render/engine.py - Render geometry
manhua_pipeline/stages/stage5_render/geometry.py - Quality assurance
manhua_pipeline/stages/stage6_qa.py - ZIP / CBZ packaging
manhua_pipeline/stages/stage7_package.py - Touch-up editor
touchup/app.py
Workspace and interfaces
- Pipeline CLI
pipeline.py - Guided GUI
pipeline_gui.py - Chapter workspace
manhua_pipeline/io/workspace.py - Pipeline events
manhua_pipeline/events.py - Event emitter
manhua_pipeline/io/event_emitter.py - Runtime settings
manhua_pipeline/io/settings.py - Pipeline configuration
config.py
Other components
- Reader / translator
Connections 24
- Reader / translator → Pipeline CLI: runs commands
- Reader / translator → Guided GUI: uses guided flow
- Pipeline CLI → Chapter import: runs stages
- Guided GUI → Touch-up editor: opens editor
- Chapter import → Region detection: next stage
- Region detection → Text OCR: next stage
manhua_pipeline/stages/stage1_detection.py - Text OCR → Literal translation: next stage
- Literal translation → Dialogue paraphrase: next stage
- Dialogue paraphrase → Page rendering: next stage
- Page rendering → Quality assurance: next stage
- Quality assurance → ZIP / CBZ packaging: optional packaging
- Literal translation → Translation backends: uses backend
manhua_pipeline/stages/stage3_translation/engine.py - Translation backends → OpenAI-compatible client: calls client
manhua_pipeline/stages/stage3_translation/backends.py - Translation backends → Translation validation: validates output
manhua_pipeline/stages/stage3_translation/backends.py - Literal translation → Translation triage: triages regions
manhua_pipeline/stages/stage3_translation/engine.py - Literal translation → Series glossary: uses terms
manhua_pipeline/stages/stage3_translation/engine.py - Literal translation → Manual overrides: resolves overrides
manhua_pipeline/stages/stage3_translation/engine.py - Dialogue paraphrase → MCP interface: supports backend
manhua_pipeline/adapters/mcp_server.py - Page rendering → Render geometry: uses geometry
manhua_pipeline/stages/stage5_render/engine.py - Pipeline CLI → Chapter workspace: resumes workspaces
pipeline.py - Translation backends → Event emitter: emits events
manhua_pipeline/stages/stage3_translation/backends.py - Event emitter → Pipeline events: serializes events
manhua_pipeline/io/event_emitter.py - Pipeline CLI → Runtime settings: sets output directory
pipeline.py - Translation backends → Pipeline configuration: selects backend
config.py