# Functional Interface to Diffusion Models in R

## Documentation for package ‘diffuseR’ version 0.2.2

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

A B C D E F G I J L M N O P Q R S T U V W Z

## -- A --

audio_encode_ltx23 | Audio Conditioning Frontend for LTX-2.3
audio_vae_ltx23 | LTX-2.3 Audio VAE
auto_devices | Auto-Configure Device Assignment

## -- B --

bpe_tokenizer | BPE Tokenizer

## -- C --

checkpoint_flux | FLUX Checkpoint Readers
checkpoint_ltx23 | LTX-2.3 Single-File Checkpoint Reader
clear_vram | Clear VRAM Cache
CLIPTokenizer | Tokenize a prompt
clip_pooled_output | Pooled CLIP output at the EOS position
condition_ltx23 | LTX-2.3 Prefix Conditioning (image-to-video, video continuation)
connectors_ltx23 | LTX-2.3 Text Embedding Connectors
convert_sd21_pt_to_diffusers | Convert cornball SD 2.1 TorchScript weights to a diffusers artifact

## -- D --

ddim_scheduler_create | Create a DDIM Scheduler
ddim_scheduler_step | Perform a DDIM scheduler step
decode_bpe | Decode token IDs to text
dit_flux | FLUX Transformer (MMDiT)
dit_flux2 | FLUX.2 Transformer (MMDiT)
dit_flux2_modules | FLUX.2 Transformer Building Blocks
dit_flux_modules | FLUX Transformer Building Blocks
dit_ltx23 | LTX-2.3 Audio-Video Diffusion Transformer
dit_ltx23_modules | LTX-2.3 Transformer Building Blocks
dit_zimage_modules | Z-Image Transformer Block Modules
download_component | Download a single TorchScript model component
download_flux | Download and Prepare FLUX.1-schnell Weights
download_flux1 | Download FLUX.1-schnell and build the quantized artifact
download_flux2 | Download and Prepare FLUX.2 Klein 4B Weights
download_flux2_klein | Download FLUX.2-klein-4B and build the quantized artifact
download_ltx2 | Download the LTX-2.3 checkpoint and build a quantized artifact
download_ltx23 | Download and Prepare LTX-2.3 Model Weights
download_model | Download TorchScript model files for Stable Diffusion
download_sd21 | Download the Stable Diffusion 2.1 diffusers weights
download_sdxl | Download the Stable Diffusion XL diffusers weights
download_zimage | Download and Prepare Z-Image-Turbo Weights
download_zimage_turbo | Download Z-Image-Turbo and build the quantized artifact

## -- E --

encode_bpe | Encode text to token IDs
encode_qwen | Encode prompts with the Qwen tokenizer
encode_unigram | Encode text with a Unigram tokenizer
encode_with_gemma3 | Encode text with Gemma3 for LTX-2
encode_with_qwen3 | Encode prompts with the Qwen3 encoder for FLUX.2
encode_with_t5 | Encode prompts with the T5 encoder

## -- F --

filename_from_prompt | Generate a filename from a prompt
flowmatch_calculate_shift | Calculate shift for dynamic shifting
flowmatch_scale_noise | Scale noise for flow matching forward process
flowmatch_scheduler_create | Create a FlowMatch Euler Discrete Scheduler
flowmatch_scheduler_step | Perform a FlowMatch scheduler step
flowmatch_set_timesteps | Set timesteps for inference
flux2_bn_normalize | Normalize patchified latents with the VAE BatchNorm statistics
flux2_double_block | FLUX.2 double-stream (MMDiT) block
flux2_empirical_mu | Empirical timestep shift for FLUX.2
flux2_feed_forward | FLUX.2 feed-forward (fused SwiGLU)
flux2_is_quant_key | Test whether a FLUX.2 key is in the quantization cast set
flux2_load_pipeline | Load the FLUX.2 klein pipeline
flux2_modulation | FLUX.2 shared modulation projection
flux2_pack_latents | Pack patchified FLUX.2 latents into tokens
flux2_parallel_self_attention | FLUX.2 parallel self-attention (single-stream)
flux2_patchify_latents | Patchify FLUX.2 latents (2x2 -> channels)
flux2_prepare_latent_ids | Build FLUX.2 latent position ids
flux2_prepare_text_ids | Build FLUX.2 text position ids
flux2_single_block | FLUX.2 single-stream block (parallel)
flux2_transformer | FLUX.2 transformer model
flux2_unpack_latents_with_ids | Unpack FLUX.2 tokens back to a latent grid via position ids
flux2_unpatchify_latents | Unpatchify FLUX.2 latents (channels -> 2x2)
flux2_vae_decoder | FLUX.2 VAE decoder
flux_ada_layer_norm_continuous | FLUX continuous adaLN (final norm)
flux_ada_layer_norm_zero | FLUX adaLN-Zero modulation (double-stream)
flux_ada_layer_norm_zero_single | FLUX adaLN-Zero modulation (single-stream)
flux_apply_rotary_emb | Apply FLUX rotary embeddings to a per-head tensor
flux_attention | FLUX joint attention
flux_double_block | FLUX double-stream (MMDiT) transformer block
flux_is_quant_key | Test whether a FLUX key is in the quantization cast set
flux_load_pipeline | Load the FLUX.1-schnell pipeline
flux_load_transformer | Load a FLUX transformer from any checkpoint format
flux_memory_profile | Resolve a FLUX memory profile
flux_open_checkpoint | Open a FLUX transformer checkpoint directory
flux_open_quantized | Open a quantized FLUX artifact directory
flux_pack_latents | Pack FLUX latents into a patch sequence
flux_pos_embed | Compute FLUX rotary frequencies from position ids
flux_prepare_latent_image_ids | Build FLUX latent image position ids
flux_quantize | Quantize a FLUX transformer to NF4 or fp8 shards
flux_single_block | FLUX single-stream transformer block
flux_transformer | FLUX transformer model
flux_unpack_latents | Unpack a FLUX patch sequence back into latents
fp8_ltx23 | FP8 Weight Storage for the LTX-2.3 Transformer

## -- G --

gemma3_config_ltx2 | Create Gemma3 configuration for LTX-2
gemma3_encode_batch | Batch-encode prompts with Gemma3, cached to disk
gemma3_quantize_nf4 | Quantize a Gemma3 text encoder to NF4 shards
gemma3_text_model | Gemma3 Text Model
gemma3_tokenizer | Gemma3 Tokenizer
get_required_components | Get required components for each model type

## -- I --

img2img | Image-to-Image Generation with Stable Diffusion
is_blackwell_gpu | Check if GPU is Blackwell Architecture

## -- J --

jit_ltx23 | LTX-2.3 JIT Block Stack
jit_vae_ltx23 | JIT-Traced Decode for the LTX-2.3 VAEs and Vocoder

## -- L --

latents_to_video | Create Video from Latents (Helper)
load_decoder_safetensors | Load HF safetensors VAE weights into the native decoder
load_decoder_weights | Load weights from TorchScript decoder into native decoder
load_flux2_vae_decoder | Load the FLUX.2 VAE decoder from safetensors
load_gemma3_nf4 | Load a Gemma3 text encoder from an NF4 artifact
load_gemma3_text_encoder | Load Gemma3 Text Model from safetensors
load_model_component | Load a specific component of a diffusion model
load_pipeline | Load a diffusion model pipeline
load_qwen3_text_encoder | Load a Qwen3 encoder from a transformers directory
load_t5_text_encoder | Load a T5 encoder from a transformers directory
load_text_encoder2_safetensors | Load HF safetensors weights into the native SDXL text encoder 2
load_text_encoder2_weights | Load weights from TorchScript text encoder 2 into native encoder
load_text_encoder_safetensors | Load HF safetensors weights into the native CLIP text encoder
load_text_encoder_weights | Load weights from TorchScript text encoder into native encoder
load_to_gpu | Load Module to GPU
load_unet_safetensors | Load HF safetensors weights into the native SD21 UNet
load_unet_sdxl_safetensors | Load HF safetensors weights into the native SDXL UNet
load_unet_sdxl_weights | Load weights from TorchScript SDXL UNet into native SDXL UNet
load_unet_weights | Load weights from TorchScript UNet into native UNet
ltx23_adain_filter_latent | Adaptive instance normalization between latent tensors
ltx23_ada_layer_norm_single | Adaptive layer norm single (adaLN-single)
ltx23_antialias_act1d | Anti-aliased activation
ltx23_apply_interleaved_rotary_emb | Apply interleaved rotary embeddings
ltx23_apply_split_rotary_emb | Apply split rotary embeddings
ltx23_attention | LTX-2 attention layer
ltx23_audio_causal_conv2d | Causal 2D convolution for audio spectrograms
ltx23_audio_decoder | LTX-2.3 audio VAE decoder
ltx23_audio_downsample | LTX audio downsampler
ltx23_audio_encoder | LTX-2.3 audio VAE encoder
ltx23_audio_mel_frontend | Build the 16 kHz log-mel frontend for audio conditioning
ltx23_audio_resnet_block | LTX audio ResNet block
ltx23_audio_upsample | LTX audio upsampler
ltx23_audio_vae | LTX-2.3 audio VAE
ltx23_causal_conv3d | Causal 3D convolution
ltx23_census | Summarize checkpoint key coverage
ltx23_connector_transformer_1d | 1D connector transformer
ltx23_denormalize_latents | Denormalize latents with the VAE's per-channel statistics
ltx23_distilled_sigmas | Official distilled sigma schedule
ltx23_downsample1d | Anti-aliasing 1D downsampler (low-pass then stride)
ltx23_encode_audio | Encode audio into normalized, packed conditioning latents
ltx23_encode_video_frames | Encode pixel frames to normalized video latents
ltx23_feed_forward | LTX feed-forward layer
ltx23_fp8_linear | FP8 linear layer
ltx23_get_timestep_embedding | Sinusoidal timestep embedding
ltx23_is_fp8_cast_key | Test whether a mapped DiT key is in the official fp8 cast set
ltx23_kaiser_sinc_filter1d | Kaiser sinc low-pass filter kernel
ltx23_latent_upsampler | LTX-2.3 latent upsampler model
ltx23_load_group | Stream a checkpoint key group into a module
ltx23_load_pipeline | Load the LTX-2.3 generation components from a single-file checkpoint
ltx23_load_transformer_fp8 | Load the LTX-2.3 transformer with FP8 weights
ltx23_load_transformer_nf4 | Load the LTX-2.3 transformer with resident NF4 weights
ltx23_load_upsampler | Load the LTX-2.3 spatial upscaler weights
ltx23_map_audio_vae_key | Map an official audio VAE checkpoint key to the R module name
ltx23_map_connector_key | Map an official connectors checkpoint key to the R module name
ltx23_map_dit_key | Map an official DiT checkpoint key to the R module name
ltx23_map_vae_key | Map an official VAE checkpoint key to the R module name
ltx23_map_vocoder_key | Map an official vocoder checkpoint key to the R module name
ltx23_mel_stft | Causal log-mel spectrogram with checkpoint-loaded bases
ltx23_memory_profile | Get an LTX-2.3 memory profile
ltx23_nf4_dequantize | Dequantize NF4 data to a float tensor
ltx23_nf4_linear | NF4 linear layer
ltx23_nf4_quantize | Quantize a tensor to NF4
ltx23_normalize_latents | Normalize latents with the VAE's per-channel statistics
ltx23_open_checkpoint | Open an LTX-2.3 checkpoint
ltx23_open_fp8_checkpoint | Open an FP8 shard directory as a checkpoint
ltx23_per_channel_rms_norm | Per-channel RMS normalization
ltx23_per_token_rms_norm | Per-token RMS normalization over the channel axis
ltx23_prepare_conditioned_latents | Build conditioned initial latents and the conditioning mask
ltx23_preprocess_frames | Preprocess an image (or frame stack) for VAE encoding
ltx23_quantize_fp8 | Quantize an LTX-2.3 checkpoint to FP8 shards
ltx23_quantize_nf4 | Quantize an LTX-2.3 checkpoint to NF4 shards
ltx23_read_audio | Read an audio file as 16 kHz stereo PCM
ltx23_read_tail_frames | Read the trailing frames of a video file
ltx23_release_dequant_buffers | Release the NF4 dequantization buffers
ltx23_rms_norm | RMS normalization
ltx23_rotary_pos_embed | LTX-2.3 audio/video rotary position embedder
ltx23_rotary_pos_embed_1d | 1D rotary embeddings for the text connectors
ltx23_set_attn_chunk | Set the attention query-chunk size across a transformer
ltx23_snake_beta | SnakeBeta activation
ltx23_split_keys | Split checkpoint keys by component
ltx23_stage2_distilled_sigmas | Stage-2 distilled sigma schedule (two-stage refinement)
ltx23_tail_latents | Slice the trailing latent frames of a generation for chaining
ltx23_text_connectors | LTX-2.3 text connectors
ltx23_tone_map_latents | Sigmoid tone mapping for latents
ltx23_transformer | LTX-2.3 video transformer model
ltx23_transformer_block | LTX-2 transformer block
ltx23_tune_gc | Tune the torch CUDA allocator for large-resident inference
ltx23_upsample1d | Anti-aliasing 1D upsampler (transposed low-pass)
ltx23_video_decoder3d | LTX-2.3 video decoder
ltx23_video_downsampler3d | Pixel-unshuffle 3D downsampler
ltx23_video_down_block3d | LTX video down block
ltx23_video_encoder3d | LTX-2.3 video encoder
ltx23_video_mid_block3d | LTX video mid block
ltx23_video_resnet_block3d | LTX 3D ResNet block
ltx23_video_upsampler3d | Pixel-shuffle 3D upsampler
ltx23_video_up_block3d | LTX video up block
ltx23_video_vae | LTX-2.3 video VAE
ltx23_vocoder | LTX-2.3 vocoder stage
ltx23_vocoder_resblock | Vocoder ResNet block (AMP)
ltx23_vocoder_with_bwe | LTX-2.3 vocoder with bandwidth extension

## -- M --

memory_flux | FLUX Memory Profiles
memory_ltx23 | LTX-2.3 Memory Profiles and CUDA GC Tuning
models2devices | models2devices

## -- N --

nf4_ltx23 | NF4 Weight Storage for the LTX-2.3 Transformer

## -- O --

offload_to_cpu | Offload Module to CPU

## -- P --

post_quant_conv | Post Quant Conv
preprocess_image | Preprocess image for Stable Diffusion
print.bpe_tokenizer | Print BPE Tokenizer
print.diffuseR_resident | Print a resident handle

## -- Q --

quantize_flux | FLUX Transformer Quantization and Loading
quant_conv | Quant Conv
qwen3_encoder | Qwen3 encoder stack
qwen3_text_encoder | Qwen3 Text Encoder
qwen_bpe_tokenizer | Load a Qwen2 byte-level BPE tokenizer

## -- R --

recommend | Recommend a precision and device configuration for a model
reshard_safetensors | Re-shard a large safetensors file into sub-2 GB shards
resident_activate | Bring a resident pipeline onto the GPU
resident_deactivate | Release a resident pipeline's VRAM
resident_generate | Generate from an active resident pipeline
resident_load | Load a diffusion pipeline as a resident handle
resident_status | Status of a resident handle
resident_unload | Drop a resident handle entirely
rope_flux | FLUX Rotary Positional Embeddings
rope_flux2 | FLUX.2 Position Ids and Empirical Shift
rope_ltx23 | LTX-2.3 Rotary Positional Embeddings
rope_zimage | Z-Image Rotary Positional Embeddings and Patchify Helpers

## -- S --

save_frames | Save Video Frames as Individual Images
save_image | Save and Display an Image from a Torch Tensor
save_video | Save Video to File
save_video_ltx23 | Save an LTX video (optionally with audio) to MP4
scheduler_add_noise | Add noise to latents using DDIM scheduler
sdxl_memory_profile | Get SDXL Memory Profile
sdxl_pipeline_from_safetensors | Assemble a native SDXL pipeline from a diffusers safetensors directory
sdxl_pipeline_safetensors | Native SDXL pipeline from diffusers safetensors
sd_pipeline_from_safetensors | Assemble a native SD pipeline from a diffusers safetensors directory
sd_pipeline_safetensors | Native Stable Diffusion pipelines from diffusers safetensors
serve | Serve diffuseR over HTTP
setup_dtype | Set up dtype based on device configuration
staging | Pinned Staging for Phase-Sequential Components
staging_ltx23 | Pinned Staging for Phase-Sequential Components
standardize_devices | Standardize devices configuration
st_caps | safetensors read-capability probes and fork messaging

## -- T --

t5_encoder | T5 encoder stack
t5_text_encoder | T5 Text Encoder (T5-v1.1)
text_encoder2_native | Native CLIP Text Encoder 2 (OpenCLIP ViT-bigG for SDXL)
text_encoder2_native_from_safetensors | Build a native SDXL text encoder 2 from a diffusers safetensors directory
text_encoder_native | Native CLIP Text Encoder
text_encoder_native_from_safetensors | Build a native CLIP text encoder from a diffusers safetensors directory
tokenizer_qwen | Qwen2 Byte-Level BPE Tokenizer
tokenizer_unigram | SentencePiece Unigram Tokenizer
tokenize_gemma3 | Tokenize text for Gemma3
txt2img | Generate an image from a text prompt using a diffusion pipeline
txt2img_flux | Generate an image with FLUX.1-schnell
txt2img_flux2 | Generate an image with FLUX.2 klein
txt2img_sd21 | Generate an image from a text prompt using a diffusion pipeline
txt2img_sdxl | Generate an image from a text prompt using SDXL
txt2img_zimage | Generate an image with Z-Image-Turbo
txt2vid_ltx2 | Generate video (and audio) with LTX-2.3
txt2vid_ltx23 | LTX-2.3 Text-to-Video Pipeline

## -- U --

unet_native | Native UNet for Stable Diffusion
unet_native_from_safetensors | Build a native SD21 UNet from a diffusers safetensors directory
unet_native_from_torchscript | Create native UNet from TorchScript
unet_safetensors | Load HF safetensors weights into the native SD/SDXL UNet
unet_sdxl_native | Native SDXL UNet
unet_sdxl_native_from_safetensors | Build a native SDXL UNet from a diffusers safetensors directory
unet_sdxl_native_from_torchscript | Create native SDXL UNet from TorchScript
unigram_tokenizer | Load a Unigram tokenizer from tokenizer.json
upsampler_ltx23 | LTX-2.3 Spatial Latent Upsampler

## -- V --

vae_decoder_native | Native VAE Decoder
vae_decoder_native_from_safetensors | Build a native VAE decoder from a diffusers safetensors directory
vae_flux2 | FLUX.2 Latent Layout and VAE Helpers
vae_ltx23 | LTX-2.3 Causal Video VAE
vae_ltx23_modules | LTX-2.3 Video VAE Building Blocks
vocab_size | Get vocabulary size
vocoder_ltx23 | LTX-2.3 Vocoder with Bandwidth Extension
vram | VRAM Detection and Management Utilities
vram_report | Report VRAM Usage

## -- W --

write_wav | Write a 16-bit PCM WAV file

## -- Z --

zimage_block | Z-Image transformer block
zimage_cap_pos_ids | Build Z-Image caption position ids
zimage_feed_forward | Z-Image feed-forward (SwiGLU with separate gate weights)
zimage_final_layer | Z-Image final layer
zimage_img_pos_ids | Build Z-Image latent image position ids
zimage_is_quant_key | Test whether a Z-Image key is in the quantization cast set
zimage_load_pipeline | Load the Z-Image-Turbo pipeline
zimage_patchify | Patchify a latent image to Z-Image tokens
zimage_pos_embed | Compute Z-Image rotary frequencies from position ids
zimage_transformer | Z-Image Transformer
zimage_t_embedder | Z-Image timestep embedder
zimage_unpatchify | Unpatchify Z-Image tokens back to a latent image