Load a diffusion model pipeline
Description
This function loads a diffusion model pipeline consisting of a UNet, VAE decoder, and text encoder. It initializes the models and sets up the environment for inference.
Usage
load_pipeline(model_name, m2d, i2i = FALSE, unet_dtype_str,
use_native_decoder = FALSE, use_native_text_encoder = FALSE,
use_native_unet = FALSE, ...)
Arguments
model_name: The name of the model to load.m2d: A list containing model-to-device mappings and configurations.i2i: Logical indicating whether to load the encoder for img2img().unet_dtype_str: A string representing the data type for the UNet model (e.g., “float32”, “float16”).use_native_decoder: Logical; if TRUE, uses native R torch decoder instead of TorchScript. Native decoder has better GPU compatibility (especially Blackwell).use_native_text_encoder: Logical; if TRUE, uses native R torch text encoder instead of TorchScript. Native text encoder has better GPU compatibility (especially Blackwell).use_native_unet: Logical; if TRUE, uses native R torch UNet instead of TorchScript. Native UNet has better GPU compatibility (especially Blackwell)....: Additional arguments passed to the model loading functions.
Value
An environment containing the loaded models and configuration.
Examples
pipeline <- load_pipeline("my_model", device = "cuda")