npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

opencomic-ai-bin

v1.0.6

Published

Upscale and dehalftone images using AI models like Real-CUGAN, Real-ESRGAN, Waifu2x and Upscayl.

Downloads

841

Readme

opencomic-ai-bin

This package provides pre-built binaries (realcugan, waifu2x, and upscayl) through a simple Node.js API.

Model files are not included, they are downloaded automatically when needed.

If you prefer to install all models upfront, use the opencomic-ai-models package.

Installation

npm install opencomic-ai-bin

Methods

This package can be used using CommonJS or ES Module.

// CommonJS
const OpenComicAI = require('opencomic-ai-bin');

// ES Module
import OpenComicAI from 'opencomic-ai-bin';

Simple example of package usage

import OpenComicAI from 'opencomic-ai-bin';

(async () => {

	// Set the base directory for binary paths, for example change to app.asar.unpacked path in Electron apps
	OpenComicAI.setDirname(OpenComicAI.__dirname.replace(/app(-(?:arm64|x64))?\.asar/, 'app$1.asar.unpacked'));

	// Models path, if the model is not found in this folder, it will be downloaded
	OpenComicAI.setModelsPath('./models');

	await OpenComicAI.pipeline('./input.jpg', './output.jpg', [
		{
			model: '1x_halftone_patch_060000_G',
		},
		{
			model: 'realcugan',
			scale: 4,
			noise: 0,
		}
	], (progress) => {

		console.log(`Processing: ${Math.round(progress * 100)}%`);

	}, {
		start: () => {

			console.log(`Start download`);

		},
		progress: (progress) => {

			console.log(`Downloading: ${Math.round(progress * 100)}%`);

		},
		end: () => {

			console.log(`End download`);

		},
	});

})();

OpenComicAI.setDirname

Set the base directory for binary paths.

OpenComicAI.setDirname(dirname: string): void

OpenComicAI.setModelsPath

Set the directory where models will be downloaded and stored.

OpenComicAI.setModelsPath(path: string): void

OpenComicAI.__dirname

Get the base directory for binary paths.

OpenComicAI.__dirname: string

OpenComicAI.models

Object containing all available models organized by type (upscale, descreen, artifact-removal).

OpenComicAI.models: Record<ModelType, Record<string, ModelObject>>

OpenComicAI.modelsList

Array of all available model keys.

OpenComicAI.modelsList: Model[]

OpenComicAI.modelsTypeList

Models organized by type.

OpenComicAI.modelsTypeList: Record<ModelType, Model[]>

OpenComicAI.modelsPath

Current path where models are stored.

OpenComicAI.modelsPath: string | undefined

OpenComicAI.binary

Get the path to the binary executable for a model.

OpenComicAI.binary(model: Model): string

OpenComicAI.model

Get detailed information about a specific model.

OpenComicAI.model(model: Model): ModelObject

OpenComicAI.pipeline

Process an image through one or more AI models.

OpenComicAI.pipeline(
	source: string,
	dest: string,
	steps: OpenComicAIOptions[],
	progress?: (progress: number) => void,
	downloading?: Downloading
): Promise<string>

OpenComicAI.closest

Returns the value in the array closest to the target value.

OpenComicAI.closest(array: number[], target: number): number

Types

Model

type Model =
	| 'realcugan'
	| 'realesr-animevideov3'
	| 'realesrgan-x4plus'
	...

ModelType

type ModelType = 'upscale' | 'descreen' | 'artifact-removal';

Upscaler

type Upscaler = 'realcugan' | 'upscayl' | 'waifu2x';

Speed

type Speed = 'Very Fast' | 'Fast' | 'Medium' | 'Slow' | 'Very Slow';

OpenComicAIOptions

interface OpenComicAIOptions {
	model?: Model;
	noise?: 0 | 1 | 2 | 3;
	scale?: number;
	tileSize?: number;
	gpuId?: string;
	threads?: number;
	tta?: boolean;
}

ModelObject

interface ModelObject {
	key?: Model;
	name: string;
	upscaler: Upscaler;
	type?: ModelType;
	scales: number[];
	noise: number[] | undefined;
	latency: number; // From 0.5 (Fatest model) to 10 (Slowest model)
	speed?: Speed;
	folder: string;
	path?: string;
	files: string[];
	supportCurrentPlatform?: boolean;
}

Downloading

interface Downloading {
	start?: () => void;
	progress?: (progress: number) => void;
	end?: () => void;
}

Models Info

Artifact removal

Model | Name | Upscaler | Source ------|------|----------|------- 1x_NMKD-Jaywreck3-Lite_320k | NMKD Jaywreck3 Lite | upscayl | NMKD.de 1x_NMKD-Jaywreck3-Soft-Lite_320k | NMKD Jaywreck3 Soft Lite | upscayl | NMKD.de 1x-SaiyaJin-DeJpeg | SaiyaJin DeJpeg | upscayl | OpenModelDB 1x_JPEGDestroyerV2_96000G | JPEG Destroyer V2 | upscayl | Hugging Face

Descreen

Model | Name | Upscaler | Source ------|------|----------|------- 1x_halftone_patch_060000_G | Halftone Patch 060000 G | upscayl | NMKD.de 1x_wtp_descreenton_compact | WTP DescreenTon Compact | upscayl | OpenModelDB

Upscale

Model | Name | Upscaler | Source ------|------|----------|------- realcugan | RealCUGAN | realcugan | Moebytes/waifu2x realesr-animevideov3 | RealESR AnimeVideo v3 | upscayl | xinntao/Real-ESRGAN realesrgan-x4plus | RealESRGAN x4 Plus | upscayl | xinntao/Real-ESRGAN realesrgan-x4plus-anime | RealESRGAN x4 Plus Anime | upscayl | xinntao/Real-ESRGAN realesrnet-x4plus | RealESRNet x4 Plus | upscayl | xinntao/Real-ESRGAN waifu2x-models-cunet | Waifu2x CUnet | waifu2x | Moebytes/waifu2x waifu2x-models-upconv | Waifu2x UpConv | waifu2x | Moebytes/waifu2x 4x-WTP-ColorDS | WTP ColorDS | upscayl | OpenModelDB remacri-4x | Remacri | upscayl | upscayl/upscayl ultramix-balanced-4x | Ultramix Balanced | upscayl | upscayl/upscayl ultrasharp-4x | Ultrasharp | upscayl | upscayl/upscayl 4xInt-RemAnime | Int-RemAnime | upscayl | Phhofm/models AI-Forever_x4plus | AI-Forever x4plus | upscayl | Hugging Face 4xNomosWebPhoto_esrgan | Nomos Web Photo ESRGAN | upscayl | OpenModelDB 4xHFA2k | HFA2k | upscayl | upscayl/custom-models 4xLSDIRCompactC3 | LSDIR Compact C3 | upscayl | upscayl/custom-models 4xLSDIRplusC | LSDIR Plus C | upscayl | upscayl/custom-models 4x_NMKD-Siax_200k | NMKD Siax | upscayl | upscayl/custom-models 4xNomos8kSC | Nomos 8k SC | upscayl | upscayl/custom-models RealESRGAN_General_WDN_x4_v3 | RealESRGAN General WDN v3 | upscayl | upscayl/custom-models RealESRGAN_General_x4_v3 | RealESRGAN General v3 | upscayl | upscayl/custom-models uniscale_restore_x4 | Uniscale Restore x4 | upscayl | upscayl/custom-models unknown-2.0.1 | Unknown 2.0.1 | upscayl | upscayl/custom-models

Credits

This project uses the following AI models and upscalers: