sd_download_model: Download a Stable Diffusion model from Kaggle Models

View source: R/kaggle.R

sd_download_modelR Documentation

Download a Stable Diffusion model from Kaggle Models

Description

Downloads a model bundle from the public Kaggle Models registry and unpacks it into dest. Mirrors the behaviour of the Python kagglehub package (kagglehub.model_download("owner/model/framework/variation")) but uses only base R – no Python dependency.

Usage

sd_download_model(
  handle = "lbsbmsu/flux-2/gguf/default",
  dest,
  version = NULL,
  files = NULL,
  verbose = FALSE
)

Arguments

handle

Model handle in kagglehub form "owner/model/framework/variation". Defaults to "lbsbmsu/flux-2/gguf/default" – a ready-to-use FLUX 2 (GGUF) model, so newcomers can call sd_download_model(dest = "models/flux2").

dest

Destination directory for the unpacked files. Created if it does not exist. Required.

version

Integer version number. If NULL (default) the latest version is resolved automatically from Kaggle.

files

Optional character vector of file names to extract from the bundle. If NULL (default) all files are extracted.

verbose

Logical; print progress messages. Defaults to FALSE.

Details

Kaggle serves each model version as a single .tar.gz bundle; the whole bundle is downloaded even when only some files are needed. Only public models are supported.

Value

The path to dest (invisibly), containing the model files.


sd2R documentation built on June 19, 2026, 9:08 a.m.