Skip to content

sd2R

Stable Diffusion Image Generation

v0.1.7 · Mar 30, 2026 · MIT + file LICENSE

Description

Provides Stable Diffusion image generation in R using the 'ggmlR' tensor library. Supports text-to-image and image-to-image generation with multiple model versions (SD 1.x, SD 2.x, 'SDXL', Flux). Implements the full inference pipeline including CLIP text encoding, 'UNet' noise removal, and 'VAE' encoding/decoding. Unified sd_generate() entry point with automatic strategy selection (direct, tiled sampling, high-resolution fix) based on output resolution and available 'VRAM'. High-resolution generation (2K, 4K+) via tiled 'VAE' decoding, tiled diffusion sampling ('MultiDiffusion'), and classic two-pass refinement (text-to-image, then upscale with image-to-image). Multi-GPU parallel generation via sd_generate_multi_gpu(). Multi-GPU model parallelism via 'device_layout' in sd_ctx(): distribute diffusion, text encoders, and 'VAE' across separate 'Vulkan' devices. Built-in profiling (sd_profile_start(), sd_profile_summary()) for per-stage timing of text encoding, sampling, and 'VAE' decode. Supports CPU and 'Vulkan' GPU. No 'Python' or external API dependencies required. Cross-platform: Linux, macOS, Windows.

Downloads

78

Last 30 days

23567th

78

Last 90 days

78

Last year

CRAN Check Status

2 ERROR
1 NOTE
9 OK
Show all 12 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang ERROR
r-devel-linux-x86_64-fedora-gcc ERROR
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-x86_64 NOTE
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (4 non-OK)
ERROR r-devel-linux-x86_64-fedora-clang

whether package can be installed

Installation failed.
See ‘/data/gannet/ripley/R/packages/tests-clang/sd2R.Rcheck/00install.out’ for details.
ERROR r-devel-linux-x86_64-fedora-gcc

whether package can be installed

Installation failed.
See ‘/data/gannet/ripley/R/packages/tests-devel/sd2R.Rcheck/00install.out’ for details.
NOTE r-oldrel-macos-x86_64

for GNU extensions in Makefiles

GNU make is a SystemRequirements.
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 59.5Mb
  sub-directories of 1Mb or more:
    libs   56.3Mb
    vocab   2.8Mb

Additional Issues

M1mac Details →
M1mac Details →
clang-ASAN Details →
gcc-ASAN Details →

Check History

ERROR 4 OK · 1 NOTE · 0 WARNING · 2 ERROR · 0 FAILURE Mar 31, 2026
ERROR r-devel-linux-x86_64-fedora-clang

whether package can be installed

Installation failed.
See ‘/data/gannet/ripley/R/packages/tests-clang/sd2R.Rcheck/00install.out’ for details.
ERROR r-devel-linux-x86_64-fedora-gcc

whether package can be installed

Installation failed.
See ‘/data/gannet/ripley/R/packages/tests-devel/sd2R.Rcheck/00install.out’ for details.
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 59.5Mb
  sub-directories of 1Mb or more:
    libs   56.3Mb
    vocab   2.8Mb

Dependency Network

Dependencies Reverse dependencies Rcpp ggmlR sd2R

Version History

new 0.1.7 Mar 30, 2026