AutoPipeline¶
AutoPipeline은 이름이나 경로를 기반으로 비슷한 디퓨전 파이프라인 모델(가중치, 설정, 어휘 등)을 자동으로 불러옵니다. 정확한 모델 아키텍처를 지정하지 않아도 모델을 불러와 사용할 수 있습니다.
핵심 클래스¶
RBLNAutoPipelineForText2Image: 텍스트로 이미지를 생성하는 모델용 오토파이프라인RBLNAutoPipelineForImage2Image: 이미지로 이미지를 생성하는 모델용 오토파이프라인RBLNAutoPipelineForInpainting: 인페인팅 모델용 오토파이프라인
지원되는 파이프라인¶
- 텍스트-투-이미지 변환(Text2Image)
| Model | Model Architecture | AutoPipeline |
|---|---|---|
| Stable Diffusion | StableDiffusionPipeline | RBLNAutoPipelineForText2Image |
| Stable Diffusion + LoRA | StableDiffusionPipeline | RBLNAutoPipelineForText2Image |
| Stable Diffusion V3† | StableDiffusion3Pipeline | RBLNAutoPipelineForText2Image |
| Stable Diffusion XL | StableDiffusionXLPipeline | RBLNAutoPipelineForText2Image |
| Stable Diffusion XL + multi-LoRA | StableDiffusionXLPipeline | RBLNAutoPipelineForText2Image |
| 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 참조¶
RBLNAutoPipelineBase ¶
from_pretrained(model_id, *, export=None, rbln_config=None, **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 | str | Path | HF repo id or local path. For compiled models, this should point to a directory (optionally under | required |
export | bool | None | Force compilation from a Diffusers checkpoint. When | None |
rbln_config | dict[str, Any] | RBLNModelConfig | None | RBLN compilation/runtime configuration. May be provided as a dictionary or as an instance of the specific model's config class (e.g., | None |
kwargs | Any | Additional keyword arguments. - Arguments prefixed with | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNBaseModel | 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.
from_pretrained(model_id, *, export=None, rbln_config=None, **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 | str | Path | HF repo id or local path. For compiled models, this should point to a directory (optionally under | required |
export | bool | None | Force compilation from a Diffusers checkpoint. When | None |
rbln_config | dict[str, Any] | RBLNModelConfig | None | RBLN compilation/runtime configuration. May be provided as a dictionary or as an instance of the specific model's config class (e.g., | None |
kwargs | Any | Additional keyword arguments. - Arguments prefixed with | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNBaseModel | 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.
from_pretrained(model_id, *, export=None, rbln_config=None, **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 | str | Path | HF repo id or local path. For compiled models, this should point to a directory (optionally under | required |
export | bool | None | Force compilation from a Diffusers checkpoint. When | None |
rbln_config | dict[str, Any] | RBLNModelConfig | None | RBLN compilation/runtime configuration. May be provided as a dictionary or as an instance of the specific model's config class (e.g., | None |
kwargs | Any | Additional keyword arguments. - Arguments prefixed with | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNBaseModel | 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.
from_pretrained(model_id, *, export=None, rbln_config=None, **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 | str | Path | HF repo id or local path. For compiled models, this should point to a directory (optionally under | required |
export | bool | None | Force compilation from a Diffusers checkpoint. When | None |
rbln_config | dict[str, Any] | RBLNModelConfig | None | RBLN compilation/runtime configuration. May be provided as a dictionary or as an instance of the specific model's config class (e.g., | None |
kwargs | Any | Additional keyword arguments. - Arguments prefixed with | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNBaseModel | 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 |