sketchkit.colorization.controlnet_scribble.ControlNetScribbleModel

class sketchkit.colorization.controlnet_scribble.ControlNetScribbleModel(device: str = 'cuda', controlnet_model: str = 'xinsir/controlnet-scribble-sdxl-1.0', sd_model: str = 'stabilityai/stable-diffusion-xl-base-1.0', vae_model: str = 'madebyollin/sdxl-vae-fp16-fix', torch_dtype: dtype = torch.float16, safety_checker: bool = False, **kwargs: Any)[source]

ControlNet model with scribble conditioning for sketch colorization using SDXL.

pipeline

The loaded diffusers pipeline.

Type:

StableDiffusionXLControlNetPipeline

device

Computation device.

Type:

str

__init__(device: str = 'cuda', controlnet_model: str = 'xinsir/controlnet-scribble-sdxl-1.0', sd_model: str = 'stabilityai/stable-diffusion-xl-base-1.0', vae_model: str = 'madebyollin/sdxl-vae-fp16-fix', torch_dtype: dtype = torch.float16, safety_checker: bool = False, **kwargs: Any)[source]

Initializes the SDXL ControlNet Scribble pipeline.

Parameters:
  • device (str) – Hardware device to run the model on. Defaults to “cuda”.

  • controlnet_model (str) – HuggingFace hub path or local path for the ControlNet.

  • sd_model (str) – HuggingFace hub path or local path for the base SDXL model.

  • vae_model (str) – HuggingFace hub path or local path for the VAE model.

  • torch_dtype (torch.dtype) – PyTorch data type for model weights.

  • safety_checker (bool) – Whether to enable the NSFW safety checker.

  • **kwargs (Any) – Additional kwargs passed to diffusers loading methods.

Raises:

RuntimeError – If model initialization fails.

Methods

__init__([device, controlnet_model, ...])

Initializes the SDXL ControlNet Scribble pipeline.

generate(control_image, prompt[, size, ...])

Generates an image from a scribble sketch using SDXL ControlNet.