install.packages("diffuseR")
That works now! diffuseR 0.2.2 went up on 2026-08-08, its first CRAN release.
When I introduced diffuseR in June 2025, it did two models and I was upfront about the shortcut:
To get up and running quickly, I wrote the basic machinery of diffusers primarily in base R, while the heavy lifting of the pre-trained deep learning models (i.e. unet, vae, text_encoders) is provided by TorchScript files exported from Python.
The TorchScript was opaque. You couldn’t read it, patch it, or quantize it. It was a Python artifact surfaced in R, and I said at the time that “soon, hopefully,” it’d be replaced by standard torch objects.
That, and a bunch of other stuff, took 14 months. Now we have 6 models with native paths. Nothing you run touches a TorchScript file, unless you want to get nostalgic in legacy mode.
Images!
Every model now runs as a torch module reading standard safetensors off disk. Stable Diffusion 2.1, SDXL, FLUX.1-schnell, FLUX.2 Klein, and Z-Image-Turbo, all through one entry point:
library(diffuseR)
img <- txt2img("a cozy 1970s radio studio, warm tungsten light, analog dials and VU meters, photorealistic",
model_name = "flux2", seed = 5)
Here’s that call through two of the five, with nothing changed but model_name:
Left is SDXL at fp16, right is FLUX.2 Klein at fp8, both on the 16 GB card. Now you can decide for yourself which models you want to use! FYI, if you run that snippet yourself, expect a different picture. The call resolves precision for your machine, and a stock CRAN install renders Klein at nf4.
Videos!
There’s also video now too via LTX-2.3 and txt2vid_ltx2(). 22 billion parameters generating picture and sound together. It’s a great model and one that is now powering our various Top 40 countdown shows on YouTube.
As usual, the dependency list stayed small. Imports is torch, jsonlite, grid, png, jpeg. grid ships with R, so that’s four third-party packages, one of which is torch. No reticulate, no requirements.txt, no virtualenv to fat-finger.
What runs on your machine
This is the most important part for most users.
diffuseR ships a function called recommend() that reads your free VRAM, your host RAM, and what your installed safetensors can actually decode, then returns a configuration: weight precision, which component goes on which device, and whether to page-lock the host copies.
You can also ask it about a machine you don’t have, which is how I built the first two columns. Stock CRAN safetensors, and the resolutions are the auto-configuration’s own per-tier caps. Every RAM figure is host RAM, and in the last column you need both numbers at once rather than either one:
| model | 8 GB card | no GPU | best quality/performance |
|---|---|---|---|
| SD 2.1 | fp16, 1024x1024, 3 GB RAM | fp16, 512x512, 4 GB RAM | fp16, 6 GB VRAM + 4 GB RAM |
| SDXL | fp16 (UNet on GPU), 1024x1024, 8 GB RAM | fp16, 768x768, 10 GB RAM | fp16, 12 GB VRAM + 8 GB RAM |
| FLUX.2 Klein (4B) | nf4, 768x768, 10 GB RAM | nf4, 512x512, 12 GB RAM | bf16, 16 GB VRAM + 20 GB RAM |
| Z-Image-Turbo (6B) | nf4, 512x512, 12 GB RAM | nf4, 512x512, 14 GB RAM | bf16, 18 GB VRAM + 24 GB RAM |
| FLUX.1-schnell (12B) | nf4, 768x768, 17 GB RAM | nf4, 512x512, 28 GB RAM | bf16, 24 GB VRAM + 45 GB RAM |
| LTX-2.3 (22B video) | drops to CPU | nf4, 512x512, 40 GB RAM | fp8 streamed, 16 GB VRAM + 45 GB RAM |
Some details:
LTX-2.3 doesn’t fit an 8 GB card. Its nf4 GPU tier asks for 14 GB of VRAM, so an 8 GB card goes to the CPU. Video on a small card is going to be slow, and you should know that before you start a 46 GB download.
Everything else gets a GPU tier at 8 GB and a much slower CPU tier. That CPU tier includes nf4, which tends to surprise people, because the usual 4-bit implementations are CUDA-only. diffuseR’s quantize and dequantize are plain torch ops (
bucketize,index_select) with no custom kernels, so 4-bit weights run on a CPU too. Slowly, but they run.The resolutions are per-tier area budgets rather than hard ceilings, and they scale with what each model was trained for. That’s why SDXL’s CPU cap is higher than SD 2.1’s despite SDXL being the bigger model: SDXL is a native 1024 model, so every rung of its ladder sits higher.
That table is what you get when you state 8 GB.
recommend("flux2", vram_gb = 8)
Warning: recommend("flux2") is likely to return bad info! Fixed in 0.2.2.2.
nf4 is the default
It’s what is most likely to run for everyone, but you can quantize to whatever your machine can handle from the original weights. We’ve taken the liberty of hosting nf4 weights for FLUX.2 Klein and Z-Image-Turbo, the two whose licenses let us redistribute. SD 2.1 and SDXL have no quantized tier. Those we host as complete fp16 safetensors pipelines, with the 4.8 GB SDXL UNet resharded into three sub-2 GB pieces so stock CRAN safetensors can read it. Same sharding trick, no quantization involved. FLUX.1-schnell is a gated repo and LTX-2.3 is under the LTX-2 Community License, so those two you quantize yourself. One thing to be mindful of is the current version of CRAN safetensors has four bugs: it can’t read a file bigger than 2 GB, can’t write bfloat16, has no float8 support, and mishandles empty tensor names. We submitted fixes and got all four merged, but they didn’t make it onto CRAN before its summer closure. So in the meantime, if you want to dig in deep:
remotes::install_github("mlverse/safetensors")
Feel free to reach out if you have questions.
Get it
install.packages("diffuseR")
Source, issues, and the model download helpers are on GitHub. Start with vignette("performance-levers") if you’re trying to work out what your card can do.
One last thing about the logo up top. tiny, the corn kernel, is our existing mascot art, and the R is the genuine article from r-project.org, used under CC-BY-SA 4.0 courtesy of the R Foundation. The letters in between were drawn by diffuseR, Z-Image-Turbo at seed 33, then hand-assembled from two of its takes. Z-Image is the model in this lineup that can spell, which is how a diffusion model got a package name right and put a lit stick of dynamite where the i goes.
Thanks to Hugging Face for the original diffusers library, to Stability AI, Black Forest Labs, Tongyi, and Lightricks for the open weights, and to the R torch community for the foundation all of this stands on.

