AutoPipeline¶
The AutoPipline automatically retrieves relevant diffusers pipeline models, including the weights, configurations, and vocabularies, based on their names or paths. This feature allows users to easily load and use models without needing to know their exact model architecture.
Key Classes¶
RBLNAutoPipelineForText2Image
: AutoPipeline for models that generate images from texts.RBLNAutoPipelineForImage2Image
: AutoPipeline for models that generate images from images.RBLNAutoPipelineForInpainting
: AutoPipeline for inpainting.
Supported Pipelines¶
- Text2Image
Model | Model Architecture | AutoPipeline |
---|---|---|
Stable Diffusion | StableDiffusionPipeline | RBLNAutoPipelineForText2Image |
Stable Diffusion + LoRA | StableDiffusionPipeline | RBLNAutoModelForText2Image |
Stable Diffusion V3† | StableDiffusion3Pipeline | RBLNAutoPipelineForText2Image |
Stable Diffusion XL | StableDiffusionXLPipeline | RBLNAutoPipelineForText2Image |
Stable Diffusion XL + multi-LoRA | StableDiffusionXLPipeline | RBLNAutoModelForText2Image |
SDXL-turbo | StableDiffusionXLPipeline | RBLNAutoPipelineForText2Image |
Stable Diffusion + ControlNet | StableDiffusionControlNetPipeline | RBLNAutoPipelineForText2Image |
Stable Diffusion XL + ControlNet | StableDiffusionXLControlNetPipeline | RBLNAutoPipelineForText2Image |
Kandinsky V2.2 | KandinskyV22CombinedPipeline | RBLNAutoPipelineForText2Image |
- Image2Image
Model | Model Architecture | AutoPipeline |
---|---|---|
Stable Diffusion | StableDiffusionImg2ImgPipeline | RBLNAutoPipelineForImage2Image |
Stable Diffusion V3† | StableDiffusion3Img2ImgPipeline | RBLNAutoPipelineForImage2Image |
Stable Diffusion XL | StableDiffusionXLImg2ImgPipeline | RBLNAutoPipelineForImage2Image |
SDXL-turbo | StableDiffusionXLImg2ImgPipeline | RBLNAutoPipelineForImage2Image |
Stable Diffusion + ControlNet | StableDiffusionControlNetImg2ImgPipeline | RBLNAutoPipelineForImage2Image |
Stable Diffusion XL + ControlNet | StableDiffusionXLControlNetImg2ImgPipeline | RBLNAutoPipelineForImage2Image |
Kandinsky V2.2 | KandinskyV22Img2ImgCombinedPipeline | RBLNAutoPipelineForImage2Image |
- Inpainting
Model | Model Architecture | AutoPipeline |
---|---|---|
Stable Diffusion | StableDiffusionInpaintPipeline | RBLNAutoPipelineForInpainting |
Stable Diffusion V3† | StableDiffusion3InpaintPipeline | RBLNAutoPipelineForInpainting |
Stable Diffusion XL | StableDiffusionXLInpaintPipeline | RBLNAutoPipelineForInpainting |
Kandinsky V2.2 | KandinskyV22InpaintCombinedPipeline | RBLNAutoPipelineForInpainting |
API Reference¶
Classes¶
RBLNAutoPipelineBase
¶
Functions¶
from_pretrained(model_id, *, export=None, rbln_config={}, **kwargs)
classmethod
¶
Load an RBLN-accelerated Diffusers pipeline from a pretrained checkpoint or a compiled RBLN artifact.
This method determines the concrete RBLN*
model class that corresponds to the
underlying Diffusers pipeline architecture and dispatches to that class's
from_pretrained()
implementation. If a compiled RBLN folder is detected at model_id
(or export=False
is explicitly passed), it loads the compiled artifacts; otherwise it
compiles from the original Diffusers checkpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id
|
Union[str, Path]
|
HF repo id or local path. For compiled models, this should point to a directory
(optionally under |
required |
export
|
bool
|
Force compilation from a Diffusers checkpoint. When |
None
|
rbln_config
|
Union[Dict[str, Any], RBLNModelConfig]
|
RBLN compilation/runtime configuration. May be provided as a dictionary or as an
instance of the specific model's config class (e.g., |
{}
|
kwargs
|
Any
|
Additional keyword arguments.
- Arguments prefixed with |
{}
|
Returns:
Name | Type | Description |
---|---|---|
RBLNBaseModel |
An instantiated RBLN model wrapping the Diffusers pipeline, ready for |
|
inference on RBLN NPUs. |
register(rbln_cls, exist_ok=False)
staticmethod
¶
Register a new RBLN model class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rbln_cls
|
Type[RBLNBaseModel]
|
The RBLN model class to register. |
required |
exist_ok
|
bool
|
Whether to allow registering an already registered model. |
False
|
RBLNAutoPipelineForText2Image
¶
Bases: RBLNAutoPipelineBase
, AutoPipelineForText2Image
Text2Image AutoPipeline for RBLN NPUs.
Functions¶
from_pretrained(model_id, *, export=None, rbln_config={}, **kwargs)
classmethod
¶
Load an RBLN-accelerated Diffusers pipeline from a pretrained checkpoint or a compiled RBLN artifact.
This method determines the concrete RBLN*
model class that corresponds to the
underlying Diffusers pipeline architecture and dispatches to that class's
from_pretrained()
implementation. If a compiled RBLN folder is detected at model_id
(or export=False
is explicitly passed), it loads the compiled artifacts; otherwise it
compiles from the original Diffusers checkpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id
|
Union[str, Path]
|
HF repo id or local path. For compiled models, this should point to a directory
(optionally under |
required |
export
|
bool
|
Force compilation from a Diffusers checkpoint. When |
None
|
rbln_config
|
Union[Dict[str, Any], RBLNModelConfig]
|
RBLN compilation/runtime configuration. May be provided as a dictionary or as an
instance of the specific model's config class (e.g., |
{}
|
kwargs
|
Any
|
Additional keyword arguments.
- Arguments prefixed with |
{}
|
Returns:
Name | Type | Description |
---|---|---|
RBLNBaseModel |
An instantiated RBLN model wrapping the Diffusers pipeline, ready for |
|
inference on RBLN NPUs. |
register(rbln_cls, exist_ok=False)
staticmethod
¶
Register a new RBLN model class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rbln_cls
|
Type[RBLNBaseModel]
|
The RBLN model class to register. |
required |
exist_ok
|
bool
|
Whether to allow registering an already registered model. |
False
|
RBLNAutoPipelineForImage2Image
¶
Bases: RBLNAutoPipelineBase
, AutoPipelineForImage2Image
Image2Image AutoPipeline for RBLN NPUs.
Functions¶
from_pretrained(model_id, *, export=None, rbln_config={}, **kwargs)
classmethod
¶
Load an RBLN-accelerated Diffusers pipeline from a pretrained checkpoint or a compiled RBLN artifact.
This method determines the concrete RBLN*
model class that corresponds to the
underlying Diffusers pipeline architecture and dispatches to that class's
from_pretrained()
implementation. If a compiled RBLN folder is detected at model_id
(or export=False
is explicitly passed), it loads the compiled artifacts; otherwise it
compiles from the original Diffusers checkpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id
|
Union[str, Path]
|
HF repo id or local path. For compiled models, this should point to a directory
(optionally under |
required |
export
|
bool
|
Force compilation from a Diffusers checkpoint. When |
None
|
rbln_config
|
Union[Dict[str, Any], RBLNModelConfig]
|
RBLN compilation/runtime configuration. May be provided as a dictionary or as an
instance of the specific model's config class (e.g., |
{}
|
kwargs
|
Any
|
Additional keyword arguments.
- Arguments prefixed with |
{}
|
Returns:
Name | Type | Description |
---|---|---|
RBLNBaseModel |
An instantiated RBLN model wrapping the Diffusers pipeline, ready for |
|
inference on RBLN NPUs. |
register(rbln_cls, exist_ok=False)
staticmethod
¶
Register a new RBLN model class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rbln_cls
|
Type[RBLNBaseModel]
|
The RBLN model class to register. |
required |
exist_ok
|
bool
|
Whether to allow registering an already registered model. |
False
|
RBLNAutoPipelineForInpainting
¶
Bases: RBLNAutoPipelineBase
, AutoPipelineForInpainting
Inpainting AutoPipeline for RBLN NPUs.
Functions¶
from_pretrained(model_id, *, export=None, rbln_config={}, **kwargs)
classmethod
¶
Load an RBLN-accelerated Diffusers pipeline from a pretrained checkpoint or a compiled RBLN artifact.
This method determines the concrete RBLN*
model class that corresponds to the
underlying Diffusers pipeline architecture and dispatches to that class's
from_pretrained()
implementation. If a compiled RBLN folder is detected at model_id
(or export=False
is explicitly passed), it loads the compiled artifacts; otherwise it
compiles from the original Diffusers checkpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id
|
Union[str, Path]
|
HF repo id or local path. For compiled models, this should point to a directory
(optionally under |
required |
export
|
bool
|
Force compilation from a Diffusers checkpoint. When |
None
|
rbln_config
|
Union[Dict[str, Any], RBLNModelConfig]
|
RBLN compilation/runtime configuration. May be provided as a dictionary or as an
instance of the specific model's config class (e.g., |
{}
|
kwargs
|
Any
|
Additional keyword arguments.
- Arguments prefixed with |
{}
|
Returns:
Name | Type | Description |
---|---|---|
RBLNBaseModel |
An instantiated RBLN model wrapping the Diffusers pipeline, ready for |
|
inference on RBLN NPUs. |
register(rbln_cls, exist_ok=False)
staticmethod
¶
Register a new RBLN model class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rbln_cls
|
Type[RBLNBaseModel]
|
The RBLN model class to register. |
required |
exist_ok
|
bool
|
Whether to allow registering an already registered model. |
False
|