sketchkit.stylization.NeuralBrushstroke

class sketchkit.stylization.NeuralBrushstroke(model_name: str = 'style2', style_id: str = 'playdoh10', models_dir: str | Path | None = None, device: str = 'cuda', auto_download: bool = True, **kwargs: Any)[source]

A class for stylizing sketches using the Neural Brushstroke Engine (NeuBE).

This class provides functionality to convert vector sketches into stylized images using various brushstroke styles from the NeuBE model.

model_name

The model name to use (‘style1’ or ‘style2’).

Type:

str

style_id

The style ID to use for stylization.

Type:

str

models_dir

Directory containing the models.

Type:

Path

device

Device to use (for future use, currently not used).

Type:

str

__init__(model_name: str = 'style2', style_id: str = 'playdoh10', models_dir: str | Path | None = None, device: str = 'cuda', auto_download: bool = True, **kwargs: Any)[source]

Initialize the NeuralBrushstroke.

Parameters:
  • model_name – The model name to use. Options: ‘style1’, ‘style2’. Defaults to ‘style2’.

  • style_id – The style ID to use for stylization. Defaults to ‘playdoh10’.

  • models_dir – Directory containing the models. If None, uses default location.

  • device – Device to use (currently not used, kept for API consistency).

  • auto_download – If True, automatically download models if not found.

  • **kwargs – Additional parameters (currently unused).

Methods

__init__(*args, **kwargs)

Initialize self.