sd_load_model: Load a registered model

View source: R/model_manager.R

sd_load_modelR Documentation

Load a registered model

Description

Loads a model by its registry id. Returns a cached context if already loaded, otherwise creates a new sd_ctx. Additional arguments override registry defaults.

Usage

sd_load_model(id, ...)

Arguments

id

Model identifier from registry

...

Additional arguments passed to sd_ctx, overriding registry defaults (e.g. vae_decode_only = FALSE)

Details

If loading fails due to insufficient VRAM, automatically unloads the least recently used model and retries.

Value

SD context (external pointer)

Examples

## Not run: 
ctx <- sd_load_model("flux-dev")
imgs <- sd_txt2img(ctx, "a cat in space")

# Override defaults
ctx <- sd_load_model("flux-dev", vae_decode_only = FALSE, verbose = TRUE)

## End(Not run)

sd2R documentation built on March 30, 2026, 5:08 p.m.