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.

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 with --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

FieldTypeDescription
seedintegerRandom seed used to initialize the per-run RNG. Identical seeds produce structurally identical sequences, subject to the caveat below.
resumebooleanWhen true, the generator detects the highest-numbered file in the first degradation pipeline’s clean/ directory and resumes from that image number.
imagesintegerNumber of clean images to generate per run.
degradedImagesPerCleanImageintegerNumber of degraded variants to produce for each clean image. Total output = images × degradedImagesPerCleanImage.
formatstringOutput format for saved images. Accepts jpg or png.
baseobjectControls canvas size, scale multiplier, halftone angle, and brush filtering.
drawingsobjectDefines the drawing compositions used to populate each canvas layer.
postProcessingarrayPost-processing steps applied after drawing (not yet implemented in current releases).
finalProcessingarrayFinal-pass processing applied to the finished canvas (not yet implemented).
degradationsarrayOne 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.
base:
  file: options/common/base.yml   # Pulls in defaults from base.yml
  size:
    size: [250, 1000]             # Overrides the size defined in base.yml
    multiple: 2
This mechanism lets you share common building blocks across multiple presets without duplicating YAML.

The Rand Type System

Option values can be specified in several forms to control randomization:
FormExampleBehavior
Literal45Always 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.
Weighted lists can also be combined with ranges — a 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

The 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.
FieldDescription
scaleMultiplier applied to all size values. For example, scale: 2 with size: [250, 1000] produces canvases of [500, 2000] pixels.
disableBrushesWithPixelatedEdgesWhen true, excludes brushes that produce pixelated edges. Recommended for upscale and restoration datasets.
size.sizeForces a square canvas. Accepts a literal or a [min, max] range.
size.width / size.heightExplicit non-square canvas dimensions.
size.multipleRounds generated dimensions to the nearest multiple of this value.
halftone.angleBase halftone angle, expressed as a weighted list of literals or ranges.
colors.colored.active.probProbability that a generated image uses a full color palette instead of grayscale.
Example — upscale-2x base:
base:
  scale: 1
  disableBrushesWithPixelatedEdges: true
  file: options/common/base.yml
  size:
    size: [250, 1000]
    multiple: 2
The 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:
drawings:
  file: 'options/common/drawings.yml'
The drawings file defines a weighted list of composition strategies:
  • 3layered — A full comic-style composition with three independent Krita layers (up, middle, down), each populated with lineart, 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.
Each drawing type within a composition specifies its own brush selection (category, size range), point counts, and probability flags. Brush names are resolved at runtime from Krita’s loaded resource list, filtered by category and the disableBrushesWithPixelatedEdges flag.
The 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-fieldDescription
nameHuman-readable label for the degradation pipeline.
output.cleanDirectory path for ground-truth (clean) images.
output.degradedDirectory path for degraded images.
output.optionsOptional directory path to save the resolved options snapshot for each image.
inKritaArray of Krita-side steps. Currently supports type: halftone.
inNodeArray of Node.js-side steps: resize, jpeg, webp, avif, jxl, blur, rotate, group.
inNodePromiseAllWhen true, all inNode steps run in parallel. Incompatible with if conditions when singleRun is disabled.
checkSizesWhen true, validates that the clean image dimensions equal the degraded dimensions multiplied by scale. Pairs that fail are discarded.
Halftone step (inKrita):
inKrita:
  - type: halftone
    prob: 1.0
    singleRun: true      # Run halftone once and reuse the result for all degraded variants
    sameInAllLayers: true
    file: options/common/halftone-hard.yml
Setting 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):
inNode:
  - type: resize
    prob: 1
    both: false          # Apply only to the degraded image (not the clean one)
    scale: 0.5
    kernel: [linear, cubic, mitchell, lanczos2, lanczos3]
When 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:
  - type: jpeg
    prob: 0.5
    quality: [30, 100]

  - type: webp
    prob: 0.05
    quality: [30, 100]

  - type: avif
    prob: 0.1
    quality: [30, 100]

  - type: jxl
    prob: 0.1
    quality: [30, 100]
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.file: includes in inNode:
  - file: 'options/common/blur.yml'
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.

Minimal Custom Options File

The following is a minimal working options file derived from options/template.yml. It generates 500 clean images, each with 10 degraded variants, using the hard-halftone descreen pipeline:
seed: 42
resume: true
images: 500
degradedImagesPerCleanImage: 10
format: jpg

base:
  disableBrushesWithPixelatedEdges: true
  file: options/common/base.yml
  size:
    size: [512, 1024]
    multiple: 4

drawings:
  file: 'options/common/drawings.yml'

degradations:

  - name: my-descreen-dataset
    output:
      clean: datasets/my-descreen-dataset/clean
      degraded: datasets/my-descreen-dataset/degraded
      options: datasets/my-descreen-dataset/options
    inKrita:

      - type: halftone
        prob: 1.0
        singleRun: false
        sameInAllLayers: false
        file: options/common/halftone-hard.yml

    inNodePromiseAll: false
    inNode:

      - type: resize
        prob: 0.8
        both: true
        scale:
          - value: [0.20, 0.999]
            weight: 4.0
          - value: [1.001, 1.20]
            weight: 1.0
        kernel: [linear, cubic, mitchell, lanczos2, lanczos3]

      - type: jpeg
        prob: 0.4
        quality: [50, 100]

      - file: 'options/common/blur.yml'

    checkSizes: true

Build docs developers (and LLMs) love