$ show koharu-rs/koharu
Koharu is a desktop application for manga/comic translation, built with Rust (Tauri) and a React/TypeScript frontend. It provides an end-to-end pipeline: page import, AI-based layout detection, speech bubble segmentation, OCR (multiple models including Manga OCR, PP-OCRv6, Baberu OCR), text translation (local LLMs via llama.cpp and 13+ remote providers), inpainting (LaMa, AOT, FLUX.2 Klein, RORem mixed), and typesetting with CJK/RTL support. The application features a WebGPU canvas editor, project management with undo/redo, PSD export, and an AI agent (Codex) for natural-language editing. The architecture is modular: a scene graph document model (koharu-scene), content-addressed blob storage (koharu-storage), a pipeline orchestrator (koharu-pipeline), and a hardware abstraction layer (koharu-runtime) for CUDA/ROCm/Vulkan/Metal. The frontend uses a custom UI component library (packages/ui) built on @base-ui/react. While the codebase is well-structured and actively maintained, it has technical drift risks from pinned git dependencies, multiple ML model ports that must stay synchronized with upstream, and platform-specific runtime packages.
The LLM identified 5 files worth highlighting for reuse:
Implements a generic IndexOp trait for multi-dimensional tensor indexing (Select, Narrow, IndexSelect, InsertNewAxis) with tuple arities up to 7. This is a reusable pattern for any tensor library, decoupled from the specific backend (here libtorch). It demonstrates non-obvious skill in trait design and type-level programming.
Provides a content-addressed blob store using BLAKE3 hashing, with memory-mapped files, reference counting, leases, and garbage collection. The pattern is self-contained and could be extracted for any application needing immutable, deduplicated blob storage with safe concurrent access.
A reusable Dialog component built on @base-ui/react with support for nested dialogs, animations, and accessible behavior. It follows a consistent pattern (cn utility, data-slot attributes, CVA variants) used across the entire UI library, making it easy to extract and reuse in other React projects.
Defines a typed component system for a scene graph with revisioned serialization, validation, and origin tracking. The pattern is generic enough to model any hierarchical document with forward/backward compatibility, and is not tied to manga-specific logic.
Contains the `model_repository!` macro that pins model assets to specific Hugging Face revisions and filenames, with automatic download and version checking. This pattern solves the recurring problem of managing ML model checkpoints in a reproducible way and can be adapted for any project using remote model assets.