AutoPipeline¶
AutoPipline은 이름이나 경로를 기반으로 비슷한 디퓨전 파이프라인 모델(가중치, 설정, 어휘 등)을 자동으로 불러옵니다. 이를 통해 사용자는 정확한 모델 아키텍처를 알지 못해도 모델을 쉽게 불러올 수 있습니다.
핵심 클래스¶
RBLNAutoPipelineForText2Image
: 문자에서 이미지를 생성하는 모델들을 위한 오토파이프라인RBLNAutoPipelineForImage2Image
: 이미지에서 이미지를 생성하는 모델들을 위한 오토파이프라인RBLNAutoPipelineForInpainting
: 채우기를 수행하는 모델을 위한 오토파이프라인
지원되는 파이프라인¶
- 텍스트-투-이미지 변환 (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 참조¶
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
|