Skip to main content
Sets a custom directory path where OpenComic AI models are stored. This is useful when you want to manage models in a different location than the default.

Syntax

OpenComicAI.setModelsPath(path: string): void

Parameters

path
string
required
Absolute or relative path to the models directory. The path must exist or an error will be thrown.

Returns

void - This method does not return a value.

Behavior

  • The path is resolved to an absolute path automatically
  • Validates that the directory exists before setting
  • Throws an error if the specified path does not exist

Example

import OpenComicAI from '@opencomic/ai-bin';

// Set custom models directory
OpenComicAI.setModelsPath('./custom-models');

// Or use an absolute path
OpenComicAI.setModelsPath('/usr/local/opencomic/models');

Error handling

try {
  OpenComicAI.setModelsPath('/path/to/models');
} catch (error) {
  console.error('Models path does not exist:', error.message);
}

Source

Defined in index.mts:758-767

Build docs developers (and LLMs) love