Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ollm/opencomic-ai-training/llms.txt

Use this file to discover all available pages before exploring further.

The OpenComic AI Training generator connects to a running Krita instance via the kra-remote plugin, draws procedural artwork using randomized brushes and compositions, applies configurable degradations (halftone patterns, compression, blur, resize, rotation), and saves matched clean/degraded image pairs to disk. Each run produces a dataset ready for use with any paired-image training framework.

Pre-Run Checklist

Before starting generation, confirm the following:
  • Krita is running with the ollm/kra-remote plugin active. The plugin must be listening before the generator starts.
  • Your options file is ready. Use a preset from the options/ directory (e.g., options/opencomic-ai-artifact-removal.yml) or write a custom one.
  • Node.js and npm are installed and npm install has been run in the repository root.
  • Dependencies are prepared by running npm run prepare before your first generation run.

Running the Generator

1

Install dependencies

Install Node.js packages and compile TypeScript sources:
npm install
npm run prepare
2

Start Krita with the kra-remote plugin

Launch Krita and ensure the kra-remote plugin is active before proceeding. The generator will fail to connect if Krita is not already running.
3

Run generation

Start the generator by passing your options file and the path to the Krita executable or AppImage:
npm run generate -- \
  --options ./options/opencomic-ai-artifact-removal.yml \
  --krita ./krita-5.3.1-x86_64.AppImage
For the upscale-2x preset:
npm run generate -- \
  --options ./options/opencomic-ai-upscale-2x.yml \
  --krita ./krita-5.3.1-x86_64.AppImage
4

Monitor progress

The CLI displays a live progress bar with the following fields:
FieldDescription
{percentage}%Overall completion percentage
{value} / {total} Clean ImagesNumber of clean images generated so far vs. total target
{degradedImages} / {totalDegradedImages} Final ImagesTotal degraded images written (clean count × degradedImagesPerCleanImage)
SpeedRolling average throughput in images per second (img/s)
ElapsedWall-clock time since generation started
RemainingEstimated time left based on current speed
The speed metric is a rolling average over the last degradedImagesPerCleanImage × 10 samples, so it stabilizes as the run progresses.
5

Locate output

Generated pairs are written to the paths defined in your options file. The default structure is:
datasets/<dataset-name>/
  clean/       # Ground-truth images
  degraded/    # Degraded counterparts
  options/     # Resolved options snapshot (if configured)

CLI Flags Reference

FlagDefaultDescription
--options <file>(Required) Path to the YAML options file.
--krita <path>(Required) Path to the Krita executable or AppImage. Must be Krita 5.3.0 or later with kra-remote installed.
--restart-krita-every <n>20Restart Krita every N clean images to prevent memory leaks.
--print-optionsPrint the randomized options object as resolved from the YAML file, then exit.
--print-krita-filtersConnect to Krita, list available plugin filters, then exit.
--print-krita-gradientsConnect to Krita, list available gradients, then exit.
--help, -hShow the help message.

Resume Behavior

When resume: true is set in the options file and the output directory for the first degradation pipeline’s clean/ folder already contains images, the generator scans filenames for the highest-numbered image and resumes from that point. The last image is regenerated to ensure it is complete:
Resuming from image: 1452
If the clean/ directory is empty or does not yet exist, generation starts from image 1.
On very long runs (tens of thousands of images), Krita’s memory usage can grow unbounded and eventually crash. The --restart-krita-every flag (default 20) automatically restarts Krita at the specified interval to reclaim memory. Lower this value if you observe slowdowns or crashes before the default interval triggers.

Krita Connection Failure

If the generator cannot connect to the kra-remote plugin at startup, it prints an error and exits with code 1:
Failed to connect to Krita plugin! Make sure the Krita plugin is running and try again.
Ensure Krita is fully loaded and the plugin is active before running the generator.

Inspecting the Environment Before Running

Run --print-options before a full generation to preview how the Rand values in your options file will be resolved for a sample image. This is useful to confirm weighted distributions and probability thresholds are configured as expected:
npm run generate -- \
  --options ./options/opencomic-ai-upscale-2x.yml \
  --krita ./krita-5.3.1-x86_64.AppImage \
  --print-options
Use --print-krita-filters to see the full list of filters exposed by the kra-remote plugin in the connected Krita instance:
npm run generate -- \
  --options ./options/opencomic-ai-upscale-2x.yml \
  --krita ./krita-5.3.1-x86_64.AppImage \
  --print-krita-filters
Use --print-krita-gradients to list all gradients available in Krita’s resource library:
npm run generate -- \
  --options ./options/opencomic-ai-upscale-2x.yml \
  --krita ./krita-5.3.1-x86_64.AppImage \
  --print-krita-gradients
Both flags establish a live connection to Krita and then exit without generating any images.

Build docs developers (and LLMs) love