Skip to content

ollm/opencomic-ai-training

Repository files navigation

opencomic-ai-training

Ethical dataset generation pipeline for OpenComic AI models. The models have been designed to preserve as much detail from the original image as possible, modifying only the necessary parts.

This repository contains the scripts and configuration files used to generate paired training datasets with Krita. The generated pairs are used to train OpenComic AI models for artifact removal, descreening, and upscaling.

Example Generated Dataset

About

OpenComic AI models are trained with ethically generated images created procedurally/randomly in Krita and have been designed to preserve as much detail from the original image as possible, modifying only the necessary parts.

This repository focuses on dataset generation. For model training, the project has been used with the-database/traiNNer-redux and the training options in options/train, but you can use any training framework that supports paired datasets.

Requirements

  • Linux (Tested on Ubuntu)
  • Windows and macOS (Untested, may require adjustments)
  • Krita 5.3.0 or newer (AppImage works)
  • ollm/kra-remote plugin installed in Krita
  • Node.js + npm

Quick Start

npm install
npm run prepare && npm run generate -- --options ./options/opencomic-ai-upscale-2x.yml --krita ./krita-5.3.1-x86_64.AppImage

CLI Reference

Generate a dataset of clean and degraded images using Krita and an options file.

npm run prepare && npm run generate -- --options <file> --krita <path>

Arguments

  --options <file>                    Path to the options file (YAML).
  --krita <path>                      Path to the Krita executable or AppImage (Krita 5.3.0 or later with the kra-remote plugin).
  --restart-krita-every <number>      Restart Krita every N images to avoid memory leaks (default: 20).
  --print-options                     Print the loaded options (Randomized) and exit.
  --print-krita-filters               Print the Krita plugin filters and exit.
  --print-krita-gradients             Print the Krita plugin gradients and exit.
  --help, -h                          Show help.

Configuration Files

Dataset generation presets are stored in options.

Main presets:

  • opencomic-ai-artifact-removal.yml
  • opencomic-ai-descreen-hard.yml
  • opencomic-ai-descreen-hard-any-angle.yml
  • opencomic-ai-descreen-moire-only.yml
  • opencomic-ai-upscale-2x.yml
  • opencomic-ai-upscale-3x.yml
  • opencomic-ai-upscale-4x-new.yml

Shared building blocks are available under options/common.

Generated Dataset Structure

Each generated dataset follows the paired format:

datasets/<dataset-name>/
  clean/
  degraded/
  options/
  • clean: Ground-truth images.
  • degraded: Input images with synthetic degradations.
  • options: Resolved options used for reproducibility.

Dataset Examples

Examples of generated dataset pairs (clean vs degraded):

Artifact Removal

Clean Degraded
Artifact removal clean Artifact removal degraded

Descreen

Clean Degraded
Descreen clean Descreen degraded

Upscale 3x

Clean Degraded
Upscale 3x clean Upscale 3x degraded

Validate Dataset Structure

Use fix-images.mjs to verify that all paired images in a dataset have the expected scale and matching files.

node fix-images.mjs

Check dataset consistency between clean and degraded images

Usage:
  node fix-images.mjs --dataset opencomic-ai-upscale-2x --scale 2

Arguments:
  --dataset   Dataset name (required)
  --scale     Scale factor (optional, auto-detected from dataset name)
  --print     Print mismatched rows
  --delete    Delete unmatched images

Training

Training options used with traiNNer-redux are available in options/train.

Typical workflow:

  1. Generate paired datasets with this repository.
  2. Point your training framework to the generated clean and degraded folders or use options/train options.
  3. Train from scratch or continue from a pretrained model.

Models Info

The models can be found in the models folder, in the ollm/opencomic-ai-models repository, or in the releases section.

Artifact Removal

Model Type Pretrained From Image Pairs Iterations
opencomic-ai-artifact-removal-compact Compact - 400,000 450,000
opencomic-ai-artifact-removal-lite ESRGAN Lite - 400,000 1,000,000
opencomic-ai-artifact-removal ESRGAN - 400,000 1,000,000

Descreen

Model Type Pretrained From Image Pairs Iterations
opencomic-ai-descreen-hard-compact Compact artifact-removal-compact 120,000 450,000
opencomic-ai-descreen-hard-lite ESRGAN Lite artifact-removal-lite 120,000 1,000,000
opencomic-ai-descreen-hard ESRGAN artifact-removal 120,000 1,000,000

Upscale

Model Type Pretrained From Image Pairs Iterations
opencomic-ai-upscale-2x-compact Compact artifact-removal-compact 25,000 450,000
opencomic-ai-upscale-2x-lite ESRGAN Lite artifact-removal-lite 25,000 1,000,000
opencomic-ai-upscale-2x ESRGAN artifact-removal 25,000 1,000,000
opencomic-ai-upscale-3x-compact Compact upscale-2x-compact 100,000 450,000
opencomic-ai-upscale-3x-lite ESRGAN Lite upscale-2x-lite 100,000 500,000
opencomic-ai-upscale-3x ESRGAN upscale-2x 100,000 500,000
opencomic-ai-upscale-4x-compact Compact upscale-2x-compact 100,000 450,000
opencomic-ai-upscale-4x-lite ESRGAN Lite upscale-2x-lite 100,000 500,000
opencomic-ai-upscale-4x ESRGAN upscale-2x 100,000 500,000

Acknowledgments

This project builds upon and is made possible thanks to:

Related Projects

Citation

If you use this project, please cite it as follows.

@software{opencomic_ai,
    author = {Llopart Mora, Oleguer},
    title = {{OpenComic AI}},
    year = {2026},
    version = {1.0.1},
    doi = {10.5281/zenodo.20802371},
    url = {https://doi.org/10.5281/zenodo.20802371}
}

Release models citation. To see the differences between versions, you can check the CHANGELOG.md file.

OpenComic AI v1.0

@software{opencomic_ai_models_v1_0,
    author = {Llopart Mora, Oleguer},
    title = {{OpenComic AI v1.0 Models}},
    year = {2026},
    version = {1.0.1},
    doi = {10.5281/zenodo.20802371},
    url = {https://doi.org/10.5281/zenodo.20802371}
}

License

Component License
Source code MIT
OpenComic AI model weights CC BY 4.0

The source code of this repository is licensed under the MIT License.

OpenComic AI model weights are licensed under the CC BY 4.0.

See LICENSE and LICENSE_MODELS for details.

About

Ethical dataset generation pipeline for OpenComic AI models.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors