Package: sd2R 0.2.1

sd2R: Stable Diffusion Image Generation

Provides Stable Diffusion image generation using the 'ggmlR' library, with no 'Python' or external API dependencies. Supports text-to-image and image-to-image generation for SD 1.x, SD 2.x, 'SDXL', and Flux. A single sd_generate() function handles the entire pipeline, including sampling and high-resolution output. Features multi-GPU support, a 'Shiny' GUI, and runs on CPU or 'Vulkan' GPU across Linux, macOS, and Windows.

Authors:Yuri Baramykov [aut, cre], Georgi Gerganov [ctb, cph], leejet [ctb, cph], stduhpf [ctb], Green-Sky [ctb], wbruna [ctb], akleine [ctb], Martin Raiber [cph], Rich Geldreich [cph], RAD Game Tools [cph], Valve Software [cph], Alex Evans [cph], Sean Barrett [cph], Jorge L Rodriguez [cph], Niels Lohmann [cph], Susumu Yata [cph], Kuba Podgorski [cph], Meta Platforms Inc. [cph], Google Inc. [cph]

sd2R_0.2.1.tar.gz
sd2R_0.2.1.zip(r-4.7)sd2R_0.2.1.zip(r-4.6)sd2R_0.2.1.zip(r-4.5)
sd2R_0.2.1.tgz(r-4.6-x86_64)sd2R_0.2.1.tgz(r-4.6-arm64)sd2R_0.2.1.tgz(r-4.5-x86_64)sd2R_0.2.1.tgz(r-4.5-arm64)
sd2R_0.2.1.tar.gz(r-4.7-arm64)sd2R_0.2.1.tar.gz(r-4.7-x86_64)sd2R_0.2.1.tar.gz(r-4.6-arm64)sd2R_0.2.1.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
card.svg |card.png
sd2R/json (API)
NEWS

# Install 'sd2R' in R:
install.packages('sd2R', repos = c('https://zabis13.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/zabis13/sd2r/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library

On CRAN:

Conda:

cppopenmp

4.30 score 4 stars 475 downloads 59 exports 4 dependencies

Last updated from:f7cceae2dd. Checks:12 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK220
linux-devel-x86_64OK233
source / vignettesOK303
linux-release-arm64OK243
linux-release-x86_64OK169
macos-release-arm64OK165
macos-release-x86_64OK451
macos-oldrel-arm64OK150
macos-oldrel-x86_64OK408
windows-develOK315
windows-releaseOK263
windows-oldrelOK247
wasm-releaseFAIL146

Exports:LORA_APPLY_MODEPREDICTIONPREVIEWRNG_TYPESAMPLE_METHODSCHEDULERsd_api_startsd_api_stopsd_appSD_CACHE_MODEsd_cache_paramssd_convertsd_ctxsd_decode_latentsd_default_paramssd_denoise_stepsd_encode_imagesd_encode_textsd_generatesd_generate_multi_gpusd_generate_multirefsd_image_to_arraysd_img2imgsd_inverse_noise_scalesd_list_modelssd_load_imagesd_load_modelsd_load_pipelinesd_nodesd_noise_scalesd_pipelinesd_preview_startsd_preview_stopsd_profile_getsd_profile_startsd_profile_stopsd_profile_summarysd_read_previewsd_register_modelsd_remove_modelsd_run_pipelinesd_samplesd_sample_stepwisesd_sampler_beginsd_sampler_endsd_sampler_sigmassd_save_imagesd_save_pipelinesd_scan_modelssd_supports_ref_imagessd_system_infosd_txt2imgsd_txt2img_highressd_txt2img_tiledSD_TYPEsd_unload_allsd_unload_modelsd_upscale_imagesd_vulkan_device_count

Dependencies:genericsggmlRR6Rcpp

Readme and manuals

Help Manual

Help pageTopics
LoRA apply modesLORA_APPLY_MODE
Prediction typesPREDICTION
Preview decode modesPREVIEW
RNG typesRNG_TYPE
Sampling methodsSAMPLE_METHOD
SchedulersSCHEDULER
Start sd2R REST API serversd_api_start
Stop sd2R REST API serversd_api_stop
Launch sd2R Shiny GUIsd_app
Cache modesSD_CACHE_MODE
Create cache configuration for step cachingsd_cache_params
Convert model to different quantization formatsd_convert
Create a Stable Diffusion contextsd_ctx
Decode a latent into a pixel image (low-level VAE decode)sd_decode_latent
Default generation parameterssd_default_params
Run a single denoise step (low-level)sd_denoise_step
Encode an image into a latent (low-level VAE encode)sd_encode_image
Encode a text prompt into conditioning (low-level)sd_encode_text
Generate images (unified entry point)sd_generate
Parallel generation across multiple GPUssd_generate_multi_gpu
Generate an image conditioned on multiple reference imagessd_generate_multiref
Convert SD image to R numeric arraysd_image_to_array
Generate images with img2imgsd_img2img
Undo final-step latent scaling (low-level)sd_inverse_noise_scale
List registered modelssd_list_models
Load image from file as SD imagesd_load_image
Load a registered modelsd_load_model
Load pipeline from JSONsd_load_pipeline
Create a pipeline nodesd_node
Scale noise into the starting latent (low-level)sd_noise_scale
Create a pipeline from nodessd_pipeline
Enable live generation previewssd_preview_start
Disable live generation previewssd_preview_stop
Get raw profile eventssd_profile_get
Start profilingsd_profile_start
Stop profilingsd_profile_stop
Build a profile summary from raw eventssd_profile_summary
Read the current preview framesd_read_preview
Register a model in the sd2R model registrysd_register_model
Remove a model from the registrysd_remove_model
Run a pipelinesd_run_pipeline
Run the sampling loop (low-level)sd_sample
Run the sampling loop step-by-step in R (low-level)sd_sample_stepwise
Open / close a step-wise sampling window (low-level)sd_sampler_begin sd_sampler_end
Sigma schedule for a sampler (low-level)sd_sampler_sigmas
Save SD image to PNG filesd_save_image
Save pipeline to JSONsd_save_pipeline
Scan a directory for models and register themsd_scan_models
Does the loaded model support reference images?sd_supports_ref_images
Get system informationsd_system_info
Generate images from text promptsd_txt2img
High-resolution image generation via patch-based pipelinesd_txt2img_highres
Tiled diffusion sampling (MultiDiffusion)sd_txt2img_tiled
Weight types (ggml quantization types)SD_TYPE
Unload all models from memorysd_unload_all
Unload a model from memorysd_unload_model
Upscale an image using ESRGANsd_upscale_image
Get number of Vulkan GPU devicessd_vulkan_device_count