TheDocumentation 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.
generate command is the primary entry point for producing paired training datasets. It launches Krita in the background via the kra-remote plugin, reads a YAML options file describing how synthetic degradations should be applied, and writes matching clean and degraded image pairs to the configured output folder. Each run progresses through the full image count specified in the options file, automatically managing Krita restarts to avoid memory leaks and resuming from where it left off if a previous run was interrupted.
Invocation
Why npm run prepare must run first
The generate script executes the compiled output at ./dist/index.mjs, not the raw TypeScript source. Running npm run prepare first invokes the TypeScript compiler (tsc) and then bundles the output with Rollup, placing the ready-to-run module in dist/. Skipping this step means any recent source changes will not be reflected — or the dist/ directory may not exist at all on a fresh clone.
Flags
Path to the YAML options file that defines the dataset configuration. Options files for the official OpenComic AI presets live in the
options/ directory (e.g. ./options/opencomic-ai-upscale-2x.yml). The file controls image count, degraded-images-per-clean-image ratio, degradation parameters, and output paths.Path to the Krita executable or AppImage. Krita 5.3.0 or later is required, and the
ollm/kra-remote plugin must be installed in that Krita instance. Both an installed binary and a standalone AppImage are accepted.Restart the Krita process every N clean images to prevent unbounded memory growth during long generation runs. Defaults to
20 if not specified. Increasing this value may improve throughput on systems with ample RAM; lowering it can help on memory-constrained machines.Print the fully resolved (post-randomization) options object to stdout — first as a plain object, then as a JSON string — and exit immediately. No images are generated. Useful for inspecting exactly which parameter values were sampled for a given options file before committing to a full run.
Connect to the running Krita instance, query the filter properties for the
opencomic:gradient:filter filter (using the gradientmap filter type) via the kra-remote plugin, print the result to stdout, and exit. Requires --krita and --options to be provided so the plugin connection can be established.Connect to the running Krita instance, print all available gradient resources retrieved from Krita via the
kra-remote plugin, and exit. Requires --krita and --options to be provided.Print the built-in help message showing usage syntax and a summary of all arguments, then exit. Triggered automatically when
--options or --krita are missing.Progress output
While generating, the CLI renders a single-line progress bar that is continuously updated in place:| Field | Description |
|---|---|
| Bar + percentage | Fraction of clean images completed |
{value}/{total} Clean Images | Current clean image index out of the total defined in the options file |
{degradedImages}/{totalDegradedImages} Final Images | Total degraded images written so far out of images × degradedImagesPerCleanImage |
Speed | Rolling average generation rate in images per second (averaged over the last degradedImagesPerCleanImage × 10 samples) |
Elapsed | Wall-clock time since the run started (duration_formatted) |
Remaining | ETA based on current rolling speed (eta_formatted) |
Error behavior
If the generator cannot connect to the Krita plugin after launching Krita, it prints the following message and exits with code 1:- The
kra-remoteplugin is installed and enabled in the Krita instance pointed to by--krita. - No other Krita process is blocking the plugin’s communication channel.
- The Krita version is 5.3.0 or later.
Example commands
1. Generate an upscale-2x dataset using the official preset:The
--dev flag is an internal testing shortcut. When present, the generator produces exactly one image and then exits immediately, skipping the rest of the run. It is intended only for rapid development iteration and should not be used for actual dataset generation.