All types described on this page are exported from the package’s compiled declarations file,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.
dist/index.d.ts, referenced by the types field in package.json. Import them directly into TypeScript projects to get full type safety when configuring or extending the OpenComic AI Training pipeline.
Random-value types
These types form the building blocks for every randomisable field in the config. A field typedRand can be a plain scalar, an array range, a weighted choice list, or a probability-gated value — all resolved at runtime by the rand module.
RandGenerator
The runtime random-number generator produced by rand.randByKey() or rand.uniqueRand(). It wraps a pure-rand xoroshiro128+ generator and exposes two high-level helpers.
RandGenerator instances are keyed by string in an internal map so the same
key always returns the same generator object, preserving reproducible
sequences across calls within a single run._Rand
The set of plain (non-object) values that a randomisable field may resolve to. This type is internal but underlies every public Rand variant.
ProbObject
An object that enables a value with an explicit numeric probability. When prob is evaluated the value is returned if the RNG fires, otherwise false is returned.
RandObject
A weighted or conditionally-gated value that can be placed in an array for weighted random selection.
Rand
The top-level union of all valid randomisable value shapes. Any config field typed as Rand is resolved through rand.generate() before use.
Prob
A probability gate. true/false bypass the RNG entirely; a number in [0, 1] is compared against the next RNG float.
Drawing and processing types
Drawing
Union of all recognised procedural drawing layer types.
Processing
Union of all recognised post-processing operation types.
Degradation
The two supported lossy compression formats for the TypeScript type. Note that the runtime inNode pipeline in sharp.mts also handles 'avif', 'jxl', 'rotate', and 'resize' as degradation operation types, but those are not part of the TypeScript Degradation union.
Kernel
Re-export of sharp’s KernelEnum, used by ProcessingOption.kernel.
DegradationObject
Configures a single compression-based degradation step that can be applied with a probability gate.
ProcessingOption
Describes a single post-processing or final-processing step in the pipeline. The type determines which sharp operation is invoked.
Main options type
Options
The top-level configuration object loaded from a YAML file by options.load(). All Rand fields are resolved per-image by options.randomize() before drawing begins.
Runtime fields (
mainRand, imageSeed, currentImageRand, currentImage,
currentImagePalette, groupLayer, groupLayers) are injected by
options.load() and options.setCurrentImageRand(). They are undefined
until those functions have been called.Color and palette types
Color
An RGBA color value. The optional gray channel is used to set all three RGB channels to the same value when a grayscale shorthand is needed.
ColorObject
An entry in a colour palette, combining a palette index, a display name, and the resolved Color.
ColorGroup
A lazily evaluated colour accessor. Calling color() returns a Color at resolution time, enabling deferred palette lookups.
Layer and area types
Area
The vertical region of a document that a layer occupies. Used with 3layered drawing mode.
Layers
A sparse record mapping each Area to an arbitrary key-value map of per-area drawing results (e.g. lineart point arrays, halftone configs).