Skip to contentSkip to content

Workflow Matrix

This page is the reference index for the nine workflows of the "Translation Workflow Mode:" selector on the translation page: it summarizes the inputs, skipped stages, and outputs of each workflow in one matrix and reverse-links to the corresponding pages. For the full operations, parameter boundaries, file formats, and skip conditions of a workflow, enter its workflow page from a matrix row; the selector, start-button texts, output-directory controls, and mutually exclusive writes are covered by Output Directory and Workflow, adding files and list states by File List and Input, and mode-forced parameter overrides by Mode-Specific Workflow and Template Alignment.

This page summarizes and reverse-links only; it does not replace the workflow pages or the settings pages. The parameter algorithms of detection, OCR, translation, mask, inpainting, rendering, upscaling, and colorization live in the corresponding settings pages.

Selector and workflow fields

IndexEnglishSimplified ChineseStart button (English / Simplified Chinese)
0Normal Translation正常翻译流程Start Translation / 开始翻译
1Export Translation导出翻译Export Translation / 导出翻译
2Export Original Text导出原文Generate Original Text Template / 仅生成原文模板
3Translate JSON Only仅翻译(JSON)Start JSON Translation / 开始仅翻译(JSON)
4Import Translation and Render导入翻译并渲染Import Translation and Render / 导入翻译并渲染
5Colorize Only仅上色Start Colorizing / 开始上色
6Upscale Only仅超分Start Upscaling / 开始超分
7Inpaint Only仅修复Start Inpainting / 开始修复
8Replace Translation替换翻译Start Replace Translation / 开始替换翻译

Workflow summary matrix

The table below summarizes the inputs, skipped stages, and outputs of the nine workflows. "Conditional" means the stage is decided by ordinary parameters (for example colorizer.colorizer != none, a truthy upscale.upscale_ratio, or detected text), not forced by the workflow; the "Skipped stages" column lists only the parts that the workflow path does not call or explicitly skips. Detailed discovery rules, file naming, and skip conditions are in the workflow page linked from each row.

WorkflowInput and prerequisitesSkipped stagesOutputsDetailed page
Normal TranslationMain input images; no workflow side-file prerequisiteNo forced skip; returns early when detection finds no textlines or OCR finds no textMain output image; project JSON and inpainted image when save_text=true; editor base image when colorization or upscaling is enabledNormal Translation
Export TranslationMain input images and a readable export templateInpainting, rendering, main-image savingProject JSON and translations/<stem>_translated.<template-format>Export Translation
Export Original TextMain input images and a readable export templateTranslation, inpainting, rendering, main-image savingProject JSON and originals/<stem>_original.<template-format>Export Original Text
Translate JSON OnlyMain input images must resolve to a project JSONColorization, upscaling, detection, OCR, merge, mask, inpainting, renderingWrites back the project JSON; deletes the original side-file on success; no main output imageTranslate JSON Only
Import Translation and RenderMain input images must have a project JSON; original side-file preferred over translated side-fileColorization, upscaling, detection, OCR, translation, textline merge (detection is the exception when the JSON lacks a mask and YOLO labels are imported)Main output image and updated project JSON; inpainted image when re-inpainting runsImport Translation and Render
Colorize OnlyMain input images; whether colorization runs depends on colorizer.colorizerUpscaling, detection, OCR, merge, translation, mask, inpainting, renderingMain output image; editor base image when a colorizer is activeColorize Only
Upscale OnlyMain input images; the actual ratio comes from upscale.upscale_ratioDetection, OCR, merge, translation, mask, inpainting, renderingMain output image; editor base image when colorization or a ratio is enabledUpscale Only
Inpaint OnlyMain input imagesOCR, translation, renderingMain output image; the branch clears text_regions and does not render translated textInpaint Only
Replace TranslationMain input is the raw image; a same-named translated image must exist in translated_images/ in the per-image work directoryTranslation service callMain output image; additionally the inpainted image and project JSON when not direct-paste and save_text=true; neither is written in direct-paste mode, and no PSD is exportedReplace Translation

Mutual exclusion, concurrency, and parameter boundaries

  • GUI switching guarantees that the eight workflow boolean fields are mutually exclusive, but it does not validate combinations provided by hand-written JSON, service requests, or other entry points. When sync_workflow_mode_from_config() reads an existing combination, the display priority is: Replace Translation, Inpaint Only, Upscale Only, Colorize Only, Import Translation, Translate JSON Only, Export Original Text, Export Translation, Normal. The translate_batch() entry performs the load_text TXT pre-import first, then dispatches in the order replace_translationload_texttranslate_json_only → ordinary pre-processing (colorize_only returns before upscale_only/inpaint_only) → Export Original Text → Export Translation; hand-combined modes have no "run simultaneously" contract.
  • batch_concurrent can enter the concurrent pipeline only from Normal Translation; the other eight modes are treated as incompatible in both the desktop controller and the core translate_batch(). The frontend switches the local variable for this run to non-concurrent, and the core branch builds a ConcurrentPipeline only when no incompatible mode is present.
  • render.enable_template_alignment ("Enable Direct Paste Mode") is specific to Replace Translation: when enabled it uses direct paste and writes no JSON, inpainted image, or PSD; when disabled it re-renders with the paired regions from OCR.
PageRelationship to this page
Output Directory and Workflowoverview entry for selecting the nine modes, button texts, output-directory controls, and exclusive writes
File List and Inputthe shared main-input discovery rules of all workflows (recursive, natural sort, skip manga_translator_work)
Progress, Stop, and Task Statethe shared start, stop, cancel, and progress states of all workflows
Mode-Specific Workflow and Template Alignmentforced parameter overrides and template alignment of modes such as Replace Translation
CLI Batch and Outputbatch_size/batch_concurrent and output format; concurrency is open to Normal mode only
Upscale and Colorizationprerequisite parameters of conditional colorization/upscaling (colorizer, ratio)

The reverse links to the nine workflow pages live in the "Detailed page" column of the matrix; the workflow pages also link among themselves (for example the template/JSON family and the pass-through workflows).

Developer Guide

Option matrix

The "Translation Workflow Mode:" (Translation Workflow Mode:) combo box is built by index, and the index is also the mapping used by on_workflow_mode_changed() to write configuration. When the mode changes, the GUI first clears all eight mutually exclusive cli workflow fields to false, then sets and saves only the field of the selected mode; a single GUI selection is therefore exclusive. "Export Original Text" additionally depends on cli.save_text, see Mutual exclusion, concurrency, and parameter boundaries.

IndexEnglishSimplified ChineseStored valueStart button (English / Simplified Chinese)
0Normal Translation正常翻译流程all eight workflow fields falseStart Translation / 开始翻译
1Export Translation导出翻译generate_and_export=trueExport Translation / 导出翻译
2Export Original Text导出原文template=trueGenerate Original Text Template / 仅生成原文模板
3Translate JSON Only仅翻译(JSON)translate_json_only=trueStart JSON Translation / 开始仅翻译(JSON)
4Import Translation and Render导入翻译并渲染load_text=trueImport Translation and Render / 导入翻译并渲染
5Colorize Only仅上色colorize_only=trueStart Colorizing / 开始上色
6Upscale Only仅超分upscale_only=trueStart Upscaling / 开始超分
7Inpaint Only仅修复inpaint_only=trueStart Inpainting / 开始修复
8Replace Translation替换翻译replace_translation=trueStart Replace Translation / 开始替换翻译

For all nine modes the call key equals the actual English value (both are the strings passed to _t() at runtime, not label_* setting keys); the Simplified Chinese column is verified against desktop_qt_ui/locales/zh_CN.json. The combo box has no separate userData; the index is the mode value.

The boundaries of cross-mode parameters on workflow branches are:

ParameterEffective/ignored boundary
cli.save_textGUI/release default is true; required for the Export Original Text branch, also controls project JSON, inpainted images, and editor-project writes in ordinary workflows; Translate JSON Only writes back JSON unconditionally
colorizer.colorizernot a forced value of Colorize Only; Normal, Upscale Only, Inpaint Only, and Replace Translation also colorize first when it is not none
upscale.upscale_rationot a forced value of Upscale Only; when empty, Upscale Only passes through (or keeps the preceding colorization result); Normal, Inpaint Only, and Replace Translation also upscale first when it is truthy
detector.import_yolo_labelsExport Original Text/Export Translation skip mask refinement and mask saving; Import Translation triggers detection to create a mask when the JSON has none
render.paste_mask_dilation_pixelsconsumed only by the direct-paste branch of Replace Translation to dilate the paste mask
cli.overwritebefore start, the GUI checks existing side-files or the main output image per workflow: the corresponding TXT for the two exports, the original side-file for Translate JSON Only, and the main output image for the other modes

The "skip when the original side-file does not exist" condition of Translate JSON Only runs in the opposite direction of a normal overwrite check and may vary by release; the real GUI dialogs, files retained after cancellation, and error prompts of the nine modes also follow the unverified list in the research material.

Per-image work directory and file naming

Apart from the main output image, all workflow side-files are located in the per-image work directory based on the original path and extension-less <stem> of the input image; JSON lookup uses the new location first and falls back to the old image-side location. The extension of template-exported/imported side-files comes from the first output_format: line of config/translation_template.json; a legal value is a safe 1–32 character extension, and a missing or invalid value falls back to json.

ResourceNew location / file nameCompatibility or priority
Translation project JSONmanga_translator_work/json/<stem>_translations.jsonfalls back to <image-dir>/<stem>_translations.json
Original exportmanga_translator_work/originals/<stem>_original.<template-format>format is json when the template is missing or unreadable
Translation exportmanga_translator_work/translations/<stem>_translated.<template-format>same as above
Inpainted imagemanga_translator_work/inpainted/<stem>_inpainted.<original-ext>no other lookup location
Colorization/upscaling editor basemanga_translator_work/editor_base/<original-filename>compatible with the same-named base at the old work-directory root
Replace-translation pair imagemanga_translator_work/translated_images/<stem><ext>same extension first, then every SUPPORTED_IMAGE_EXTENSIONS entry

The main output image is decided by MangaTranslator._calculate_output_path(): the normal output directory keeps the input folder name and relative hierarchy; with save_to_source_dir=true it becomes manga_translator_work/result/ next to the original; with cli.format empty or none the original extension is kept, otherwise the given extension is used.

Code locations

LayerFileWhat this page verified
UI layoutdesktop_qt_ui/ui/main_page/pages/translation_page.py:27translation page, workflow combo box, start button, and event wiring
Workflow state and writesdesktop_qt_ui/ui/main_page/runtime.py:21,151-238nine indexes, prompts, exclusive-field writes, config-sync priority, and button texts
i18ndesktop_qt_ui/locales/en_US.json:488; desktop_qt_ui/locales/zh_CN.json:486actual values of workflows, start buttons, prompts, and settings
Input and discoverydesktop_qt_ui/services/file_service.py:31main-input extension validation, recursive discovery, natural sort, and work-directory exclusion
Controllerdesktop_qt_ui/app_logic.py:3094main-output path passing, pre-overwrite checks, and special-mode concurrency disabling
Qt configdesktop_qt_ui/core/config_models.py:123workflow fields and the save_text default
Core dispatchmanga_translator/manga_translator.py:504,3399,4236,5206main output, JSON writes, template exports, TXT imports, and the nine runtime dispatches
Paths/templatesmanga_translator/utils/path_manager.py:12; manga_translator/utils/translation_template.py:10per-image work directory, side-file discovery, and output_format fallback
Replace translationmanga_translator/utils/replace_translation.py:128,726dual-image processing, pairing, direct paste, and output boundaries
Research materialdoc/wiki/research/workflow-matrix-source-evidence.mdinputs, stages, outputs, and the unverified list of the nine workflows