Skip to content

diffuseR

0.2.2Package record

Functional Interface to Diffusion Models in R

0packages depend
731downloads / year
7.3%test coverage
13/13flavors OK

Overview

About

A native R implementation of diffusion models providing a functional interface to state-of-the-art generative AI. Inspired by the 'Python' library 'diffusers' from 'Hugging Face' https://huggingface.co/, 'diffuseR' generates and manipulates images from text prompts using models such as 'Stable Diffusion', with no 'Python' dependency. Supports multiple diffusion schedulers and device acceleration.

Changes in 0.2.2
  • Every precision recommend() can return is now reachable. bf16 was advertised for flux1 at 24 GB and flux2/zimage at 16-24 GB while no loader accepted it; the flux-family loaders take precision = "bf16", which resolves the unquantized transformer out of the hfhub cache rather than an artifact directory (bf16 is the source the quantizers read, not something built). recommend() explains the tier instead of returning a bare string. On a 16 GB card, flux2 at bf16 renders 1024x1024 in 6.4 s against 9.1 s at fp8 - the highest-quality tier is also the fastest, since nothing dequantizes per layer; it costs the 7.8 GB source staying on disk.
  • download_ltx2() gains precision = c("nf4", "fp8") and defaults to nf4, which is what recommend("ltx") returns for any card with 14 GB or more. It previously built only fp8, so the recommended tier had to be built by hand with ltx23_quantize_nf4(). Asking for fp8 without float8 write support now warns and builds nf4 instead of failing inside the quantizer.
Show all changes in 0.2.2Hide the rest of the changes in 0.2.2
  • Quantized artifacts stay locally built. Prebuilt weights are not hosted for any model: only flux2 and zimage could be redistributed (Apache-2.0 and ungated), while LTX-2.3 is under the LTX-2 Community License and FLUX.1-schnell is gated, so hosting would cover half the catalog and leave two models on a different workflow.
  • Model residency: resident_load(), resident_activate(), resident_deactivate(), resident_generate(), resident_status() and resident_unload() keep a pipeline's weights page-locked on the host and treat the GPU copy as disposable, so handing a small card between models is a DMA transfer rather than a full reload. Same contract as whisper and chatterbox, with no gpu.ctl dependency. This sits above the per-generation phase offloading in the txt2img_* functions: those swap one component at a time within a render, residency decides who owns the card between renders. For a phase-offloading pipeline (the default) activation is the ownership claim and the transfers stay per-phase; only a pipeline loaded with phase_offload = FALSE is copied to the card wholesale, and that path is checked against free VRAM first. resident_status() reports components_on_gpu alongside state, because the two legitimately disagree: a render returns every component to pinned host memory as its phase ends, so an active handle can hold nothing. Verified on an RTX 5060 Ti (16 GB) against local artifacts: flux2 (11.22 GB pinned, 9.1 s render), flux1 (15.73 GB, 40.1 s), zimage (13.45 GB, 19.5 s) and ltx (18.41 GB across 5 components). All three image models reproduce bit-for-bit across a deactivate/activate cycle. FLUX.1 and LTX both have pinned sets larger than the card, so they exercise the refusal path rather than bulk onload.

Addressing the CRAN review of the 0.2.0 submission:

  • Every exported .Rd with a \usage block now documents its return value: 50 @return tags added, chiefly to the nn_module generators for the FLUX, FLUX.2, Z-Image, LTX-2.3 and Gemma3 ports.
  • Examples: 14 of the 23 \dontrun{} blocks now run during check, and were rewritten to be self-contained instead of referencing undefined objects. The 9 that remain need model weights on disk and are itemised in cran-comments.md.
  • ddim_scheduler_create() was uncallable at its documented defaults: beta_schedule was never passed through match.arg(), so switch() errored on the length-3 default, and the device default was a length-2 vector that torch_tensor() rejects. ddim_scheduler_step() had the same missing match.arg() on prediction_type. Every internal caller passed these explicitly, so the broken defaults went unnoticed. device now defaults to torch_device("cpu").
  • DESCRIPTION: software names single-quoted ('Python', 'Stable Diffusion', 'Hugging Face' with its URL) and the trailing whitespace that had been folding into double spaces since the first commit removed.
  • save_video()'s mp4 example is no longer live: the encoder inherits the session's stdin, which R CMD check --as-cran uses to feed the example script to R, so it consumed part of the script.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.5 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OKNow
  • OK6 OK2026-08-09
Advisories

none known

Documentation

In release 0.2.2
READMEYes · 1,206 wordsVignettesYes · 1 · staticNEWSYes · 67% structured · mentions 0.2.2Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
344 (62 internal)
Examples that run
64%16 run in a plain check · 9 never run
Exported functions with examples
11%
Documented parameters
89%
Return-value docs
100%
Help pages citing references
1%
Vignettes (1)

Downloads

731
CRAN downloads in the past year
Rank #17,691 · ~2/day · ~61/mo
Daily download trend is not available in this view yet.
24830 days
73190 days
7311 year
Compare downloads with other packages →
Also on21 r2u2 autocran

Repository

48Stars
3Forks
3Open issues
0Open PRs
0Releases
127Commits
2Commit identities
127 commits · Last activity 2026-10-23 · 0% stars, 30d · Default branch at 0.2.2.13, ahead of CRAN 0.2.2 (checked 2026-10-22)
Responsiveness
How these are sampled
PRs merged (all time)
87%
Median days to close, 50 most recently updated closed issues
2
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2026-08-09 · 472026-09-21 · 48
PracticesBeta

3 development-tooling and community-health practices detected across 3 families in the upstream repository

Checks run against github.com/cornball-ai/diffuser on 2026-10-22.

Continuous integration (1)
GitHub Actions
CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-01-09
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: .claude, CLAUDE.md
    Commits: at least 35 crediting it in the message
From outside contributors
  • Claude Code
    Pull requests: 5 from outside contributors, first on 2026-02-27
Models named in its commits
  • Claude Opus 4.535 commits · Jan 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
9 external dependencies (excludes base and recommended)

Installing diffuseR adds 26 packages (14 with compiled code, 11 MB of source tarballs). Heaviest: torch 1.9 MB, Rcpp 1.8 MB, farver 1.2 MB.

Depends (0)
none
Imports (5)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (4)
Author, Maintainer since 0.2.2 (2026)
Copyright holder
LTX checkpoint layout and pipeline constants; see inst/COPYRIGHTS
Copyright holder
portions ported from the diffusers library (Apache-2.0); see inst/COPYRIGHTS
Copyright holder
Releases (1)
  • 0.2.2Latest
    2026-08-08 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-08-08
Total releases
1 / 1 yrs
License
Apache License (>= 2)
Download size
1.1 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("diffuseR")
Hernandez, T., Lightricks Ltd., The HuggingFace Team, & cornball.ai. (2026). diffuseR: Functional Interface to Diffusion Models in R (Version 0.2.2) [Computer software]. https://doi.org/10.32614/CRAN.package.diffuseR

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for diffuseR version 0.2.2 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy