Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ollm/opencomic-ai-models/llms.txt

Use this file to discover all available pages before exploring further.

The core integration pattern for opencomic-ai-models is straightforward: retrieve the absolute path to the bundled models directory from this package, then pass it as the model path flag (-m) to an upscaler binary alongside a model ID. The companion package ollm/opencomic-ai-bin provides pre-built binaries for all three supported upscaler backends — upscayl (ESRGAN-based), realcugan-ncnn-vulkan, and waifu2x-ncnn-vulkan.
opencomic-ai-models only provides the model weight files. The upscaler binary paths must be resolved separately — either via ollm/opencomic-ai-bin or from a system-installed copy of the respective tool. Make sure the binary is executable and accessible before calling execFile.
For best results, run artifact removal or descreening passes before upscaling. Process the image through an artifact-removal or descreen model first, then feed the cleaned output into your chosen upscale model.

upscayl / ESRGAN-based models

The upscayl backend is used for all ESRGAN-derived models, including upscale models such as realesrgan-x4plus and realesrgan-x4plus-anime, as well as all artifact-removal and descreen models. Pass the models directory with -m and the model ID (without file extension) with -n.
import { execFile } from 'child_process';
import OpenComicAIModels from 'opencomic-ai-models';

const { path: modelsPath } = OpenComicAIModels;

// Path to the upscayl-bin binary (resolve via opencomic-ai-bin or system install)
const upscaylBin = '/path/to/upscayl-bin';

// Example: upscale with RealESRGAN x4 Plus
execFile(
  upscaylBin,
  [
    '-i', '/path/to/input.png',
    '-o', '/path/to/output.png',
    '-m', modelsPath,
    '-n', 'realesrgan-x4plus',
    '-s', '4',
  ],
  (error, stdout, stderr) => {
    if (error) {
      console.error('upscayl error:', stderr);
      return;
    }
    console.log('Done:', stdout);
  }
);

// Example: artifact removal (same binary, different model ID)
execFile(
  upscaylBin,
  [
    '-i', '/path/to/input.png',
    '-o', '/path/to/cleaned.png',
    '-m', modelsPath,
    '-n', 'opencomic-ai-artifact-removal',
    '-s', '1',
  ],
  (error, stdout, stderr) => {
    if (error) {
      console.error('upscayl error:', stderr);
      return;
    }
    console.log('Done:', stdout);
  }
);

realcugan-ncnn-vulkan

The realcugan-ncnn-vulkan backend is used for the realcugan upscale model. Pass the models directory with -m.
import { execFile } from 'child_process';
import OpenComicAIModels from 'opencomic-ai-models';

const { path: modelsPath } = OpenComicAIModels;

// Path to the realcugan-ncnn-vulkan binary
const realcuganBin = '/path/to/realcugan-ncnn-vulkan';

execFile(
  realcuganBin,
  [
    '-i', '/path/to/input.png',
    '-o', '/path/to/output.png',
    '-m', modelsPath,
    '-n', 'realcugan',
    '-s', '2',
  ],
  (error, stdout, stderr) => {
    if (error) {
      console.error('realcugan error:', stderr);
      return;
    }
    console.log('Done:', stdout);
  }
);

waifu2x-ncnn-vulkan

The waifu2x-ncnn-vulkan backend is used for the Waifu2x model families: waifu2x-models-cunet (higher quality, slower) and waifu2x-models-upconv (faster, lower memory). Pass the models directory with -m and the model folder name with -n.
import { execFile } from 'child_process';
import OpenComicAIModels from 'opencomic-ai-models';

const { path: modelsPath } = OpenComicAIModels;

// Path to the waifu2x-ncnn-vulkan binary
const waifu2xBin = '/path/to/waifu2x-ncnn-vulkan';

// Example: Waifu2x CUnet (high quality)
execFile(
  waifu2xBin,
  [
    '-i', '/path/to/input.png',
    '-o', '/path/to/output.png',
    '-m', modelsPath,
    '-n', 'waifu2x-models-cunet',
    '-s', '2',
  ],
  (error, stdout, stderr) => {
    if (error) {
      console.error('waifu2x error:', stderr);
      return;
    }
    console.log('Done:', stdout);
  }
);

// Example: Waifu2x UpConv (faster)
execFile(
  waifu2xBin,
  [
    '-i', '/path/to/input.png',
    '-o', '/path/to/output.png',
    '-m', modelsPath,
    '-n', 'waifu2x-models-upconv',
    '-s', '2',
  ],
  (error, stdout, stderr) => {
    if (error) {
      console.error('waifu2x error:', stderr);
      return;
    }
    console.log('Done:', stdout);
  }
);

Companion package: opencomic-ai-bin

ollm/opencomic-ai-bin is the companion package that supplies pre-built, platform-specific binaries for upscayl-bin, realcugan-ncnn-vulkan, and waifu2x-ncnn-vulkan. Using it together with opencomic-ai-models provides a fully self-contained, Node.js-managed image processing pipeline without requiring any system-level tool installation.

Build docs developers (and LLMs) love