Options files are YAML documents loaded by 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.
options.load() function at startup. The loader reads the root file, recursively resolves every file: key it encounters by merging the referenced YAML content with any sibling keys present in the parent, and then hands the fully-assembled object to the rest of the pipeline. This composition system lets you split shared configuration into reusable blocks stored under options/common/ and override individual fields per-preset without duplicating the whole file.
The Rand Type
Many fields accept a Rand value — a flexible union that the randomizer resolves once per image. The TypeScript definition is:
Literal
Literal
A plain scalar value — always used as-is.
Range [min, max]
Range [min, max]
A two-element numeric array. The randomizer picks a uniformly distributed value in
[min, max], including decimal values when the bounds are non-integer.Weighted list [{value, weight}]
Weighted list [{value, weight}]
An array of objects, each with a
value and a relative weight. Weights are not probabilities — they are summed and each entry is sampled proportionally. value may itself be a range.Probability wrapper {prob}
Probability wrapper {prob}
An object with a
prob key between 0.0 and 1.0. When the randomizer evaluates this node, the wrapped feature is enabled with that probability and disabled otherwise.Conditional array [{if, value}]
Conditional array [{if, value}]
An array of objects each containing an
if condition string and a value. Conditions are evaluated in order; the first match wins. The special condition "default" always matches and acts as a fallback. Condition strings follow the pattern "key operator rvalue" where operator is one of ==, ===, !=, !==, <, >, <=, >=, or typeof. The key uses dot notation to reference a previously resolved value in the option tree (e.g. inKrita.halftone.config.size).Top-Level Fields
Base integer seed used to initialize the main random generator. All per-image seeds are derived deterministically from this value combined with the image index, so the same seed always reproduces the same sequence of images. Note that Krita brush patterns may still vary across sessions independent of this seed.
When
true, the pipeline skips images that already exist in the output directories and continues from where it left off. Useful for resuming interrupted runs without regenerating completed images.Number of distinct clean images to generate. The total number of output image pairs is
images × degradedImagesPerCleanImage.How many degraded variants to produce for each clean image. Each variant applies the degradation pipeline independently with freshly randomized parameters.
The
format field (jpg or png) is read from the YAML config file by the pipeline but is not declared in the TypeScript Options interface. It is treated as a plain config-file-only field. Set it at the top level of your options file:Base image settings that apply globally before any degradation pipeline runs.
A global multiplier applied to all size values. For example, setting
scale: 2 with size: [250, 1000] effectively yields size: [500, 2000].When
true, brushes known to produce pixelated edges are excluded from brush selection. Recommended for upscaling and artifact-removal datasets where such edges would corrupt the training signal.Same exclusion as above, but only applied when the canvas is at a small size.
Controls canvas dimensions. The TypeScript interface defines
width and height as Rand values. In practice, YAML presets also use a size shorthand for square canvases and a multiple key to snap dimensions to a given integer, which the pipeline resolves before constructing the canvas.Halftone settings for the base image, primarily the screentone angle that Krita applies when rendering halftone layers.
angle is a Rand value — typically a weighted list biased toward 45°.Probability that the generated image uses a color palette instead of grayscale.
The list of drawing layer types and amounts composited to produce the clean image. In practice this field is almost always a
file: reference to options/common/drawings.yml, which defines the full set of drawing types (lineart, background, texture, colorize-mask, paint, lineart-texture, lineart-random, dots, lines, etc.) and their brush, size, and point-count parameters.Post-processing operations applied to the rendered Krita canvas after all drawing layers have been composited. Currently defined types include
texture-image and layer-blur. These are applied inside Krita before the image is exported for Node.js processing.Final processing steps run after all degradations have been applied. Supported types include
noise.An array of degradation pipeline definitions. Each entry describes one dataset to generate — its output directories, Krita-side operations, and Node.js-side operations. Multiple entries can coexist in a single options file to produce several datasets in one run.
The degradations[] Block
Each entry in the degradations array defines one complete dataset pipeline.
A human-readable identifier for the dataset. Used in logging and is reflected in the default output directory names.
Paths to output directories. All three directories are created automatically if they do not exist.
Directory where clean (ground-truth) images are written.
Directory where degraded images are written.
Optional directory where per-image JSON option snapshots are saved for inspection or debugging.
Operations executed inside Krita on the rendered canvas before it is exported to Node.js. Currently the only supported type is
halftone.Must be
halftone.Probability that this Krita operation is applied.
When
true, halftone is applied only once and reused across all degraded variants of the same clean image. This reduces Krita processing time significantly but means all variants share the same screentone.When
true, the same halftone parameters are used for every layer (all, up, middle, down). Required when you reference inKrita.halftone.config.size in a conditional Rand expression for the Node.js resize step.Path to a halftone preset YAML file (e.g.
options/common/halftone-hard.yml).Controls whether halftone is applied to the degraded image only (
degraded), both clean and degraded (both), or neither (without).Node.js-side operations applied to the exported image. Steps run sequentially by default (or in parallel if
inNodePromiseAll is set). Each step object has at minimum a type and prob field. Supported types:resize— Scale the image.scaleis aRand;kernelpicks the resampling filter;both: trueapplies the resize to both clean and degraded,both: falseapplies it to degraded only. A nestedclean:sub-object can specify separate kernel options for the clean copy.rotate— Rotate both clean and degraded images by the sameangle(in degrees).backgroundsets the fill color for exposed corners.skipIfprevents a second rotation from being applied if an earlier step already rotated the image.jpeg— Re-encode to JPEG at randomizedquality.webp— Re-encode to WebP at randomizedquality.avif— Re-encode to AVIF at randomizedquality.jxl— Re-encode to JPEG XL at randomizedquality.blur/resize-blur— Apply Gaussian blur or a combined resize-then-blur step. Both types accept asigmaorscalerange.group— Apply a list of sub-steps together, gated by a singleprob.
file::When
true, all inNode steps are launched in parallel with Promise.all. This is faster but is not compatible with conditional Rand expressions that reference previously resolved values (such as if: inKrita.halftone.config.size >= ...) when singleRun is disabled.After each image pair is written, verifies that the clean image dimensions are equal to the degraded dimensions multiplied by the expected upscale factor. Enables detection of cases where different resize kernels for clean and degraded images have produced mismatched outputs.
Minimal Complete Example
The following is a minimal but fully functional options file that generates a small 2× upscale dataset:The
file: key works at any depth. When the loader encounters it inside an object, it reads the referenced YAML, merges it with the sibling keys in the parent, then removes the file: key from the merged result. When encountered inside an array element, the file content is expanded in place. Local keys always take precedence over the referenced file’s keys.