Every aspect of dataset generation — from image dimensions and drawing types to degradation steps and output paths — is controlled by a YAML options file passed to the generator withDocumentation 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.
--options. The repository ships with ready-made presets in options/ and shared building blocks in options/common/. You can compose your own options file by starting from options/template.yml and overriding only the fields you need.
Top-Level Fields
| Field | Type | Description |
|---|---|---|
seed | integer | Random seed used to initialize the per-run RNG. Identical seeds produce structurally identical sequences, subject to the caveat below. |
resume | boolean | When true, the generator detects the highest-numbered file in the first degradation pipeline’s clean/ directory and resumes from that image number. |
images | integer | Number of clean images to generate per run. |
degradedImagesPerCleanImage | integer | Number of degraded variants to produce for each clean image. Total output = images × degradedImagesPerCleanImage. |
format | string | Output format for saved images. Accepts jpg or png. |
base | object | Controls canvas size, scale multiplier, halftone angle, and brush filtering. |
drawings | object | Defines the drawing compositions used to populate each canvas layer. |
postProcessing | array | Post-processing steps applied after drawing (not yet implemented in current releases). |
finalProcessing | array | Final-pass processing applied to the finished canvas (not yet implemented). |
degradations | array | One or more named degradation pipelines, each specifying Krita-side and Node.js-side steps and output paths. |
The
seed field ensures the RNG sequence is deterministic between runs, but Krita brush stroke patterns can vary across sessions because they depend on Krita’s internal state and loaded resources. Full pixel-level reproducibility between separate Krita sessions is not guaranteed even with the same seed.The file: Include Mechanism
Any object in the options tree can carry a file: key pointing to another YAML file. When the loader encounters file:, it reads that file and merges its values with the surrounding object, with local keys taking precedence over the referenced file’s keys. If the referenced file is an array, its items are spliced directly into the parent array.
The Rand Type System
Option values can be specified in several forms to control randomization:
| Form | Example | Behavior |
|---|---|---|
| Literal | 45 | Always uses this exact value. |
Range [min, max] | [2.5, 9.99] | Picks a random float uniformly between min and max. |
| Weighted list | [{value: 45, weight: 5.0}, {value: 0, weight: 1.0}] | Picks a value according to relative weights. |
| Probability boolean | {prob: 0.3} | Resolves to true with probability 0.3, false otherwise. |
| Conditional | [{if: "key op val", value: ...}, {if: "default", value: ...}] | Evaluates each if expression in order; uses the first matching entry’s value. |
value entry in a weighted list can itself be a [min, max] array.
Conditional entries evaluate a dot-separated key path (e.g., inKrita.halftone.config.size) against a resolved value using standard comparison operators (==, !=, <, >, <=, >=, typeof). The last entry can use if: default as a fallback.
Configuration Blocks
base
base
The
Example — upscale-2x base:
base block defines the canvas properties for every generated image. The full set of defaults lives in options/common/base.yml, which you can reference with file: and then selectively override.| Field | Description |
|---|---|
scale | Multiplier applied to all size values. For example, scale: 2 with size: [250, 1000] produces canvases of [500, 2000] pixels. |
disableBrushesWithPixelatedEdges | When true, excludes brushes that produce pixelated edges. Recommended for upscale and restoration datasets. |
size.size | Forces a square canvas. Accepts a literal or a [min, max] range. |
size.width / size.height | Explicit non-square canvas dimensions. |
size.multiple | Rounds generated dimensions to the nearest multiple of this value. |
halftone.angle | Base halftone angle, expressed as a weighted list of literals or ranges. |
colors.colored.active.prob | Probability that a generated image uses a full color palette instead of grayscale. |
drawings
drawings
The The drawings file defines a weighted list of composition strategies:
drawings block determines which procedural drawing types are composited onto each canvas. In practice, every built-in preset delegates to options/common/drawings.yml via the file: mechanism:3layered— A full comic-style composition with three independent Krita layers (up, middle, down), each populated withlineart,colorize-mask,paint,lineart-texture,lineart-random, dots/circles, and parallel-lines/grid drawing primitives.singlelayered— A simpler single-layer composition using texture, paint, and lineart-random primitives with optional gradients.
disableBrushesWithPixelatedEdges flag.degradations
degradations
The
Halftone step (Setting When Multiple compression steps can appear in the same pipeline; each is applied independently with its own probability, allowing double-compressed degradations to appear in the dataset.The blur common file adds a single-pass and a double-pass blur step, each with low probability, to simulate soft lens or print blur.
degradations field is an array of named pipelines. Each pipeline specifies where to write output, what Krita-side processing to apply, and what Node.js-side processing to apply.| Sub-field | Description |
|---|---|
name | Human-readable label for the degradation pipeline. |
output.clean | Directory path for ground-truth (clean) images. |
output.degraded | Directory path for degraded images. |
output.options | Optional directory path to save the resolved options snapshot for each image. |
inKrita | Array of Krita-side steps. Currently supports type: halftone. |
inNode | Array of Node.js-side steps: resize, jpeg, webp, avif, jxl, blur, rotate, group. |
inNodePromiseAll | When true, all inNode steps run in parallel. Incompatible with if conditions when singleRun is disabled. |
checkSizes | When true, validates that the clean image dimensions equal the degraded dimensions multiplied by scale. Pairs that fail are discarded. |
inKrita):singleRun: true renders the halftone layer once and shares it across all degraded variants of a clean image, significantly reducing Krita processing time for presets with high degradedImagesPerCleanImage counts.Resize step (inNode):both: true, the step is applied to both the clean and degraded images (useful for rotation or paired resizing). When both: false, only the degraded image is resized.Compression steps:file: includes in inNode:Minimal Custom Options File
The following is a minimal working options file derived fromoptions/template.yml. It generates 500 clean images, each with 10 degraded variants, using the hard-halftone descreen pipeline: