Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 8 min read Announcement mediumAdept

Remote VAEs for decoding with Inference Endpoints πŸ€—

Hugging Face's Diffusers team is piloting remote VAE decoding: a diffusion pipeline produces latents locally and sends them to a hosted Inference Endpoint for decoding, avoiding the VRAM spike that otherwise forces offloading (adding transfer latency) or tiling (which can hurt image quality and, for SD v1.5 at 1024x1024, raises decode time by roughly 60-100%). A `remote_decode` helper in diffusers supports SD v1, SDXL, Flux (packed latents need height/width) and HunyuanVideo (mp4 output), and a background thread with a queue lets generation overlap with decoding. Benchmark tables show local VAE decode memory reaching 93-96% of VRAM on RTX 3080/3070 for SDXL at 1024x1024.

Assumes: latent diffusion modelsPyTorch basicsDiffusers pipelines

Related posts

  • State of open video generation models in Diffusers

    Hugging Face mediumAdept

    Open video generation models such as HunyuanVideo, CogVideoX, LTX-Video, Mochi-1 and Allegro share a common architecture: T5-style text encoders, a DiT-based denoiser over 3D spatio-temporal tokens, a spatially and temporally compressing VAE, and a scheduler. Diffusers runs them in a few lines of code but they need a lot of memory, about 60 GB for HunyuanVideo at default settings. Benchmarks combining bitsandbytes/FP8 quantization, CPU and group offloading, VAE tiling and layerwise casting bring HunyuanVideo down to about 6.6 GB with little extra latency. Timestep and guidance distillation speed up generation, and the finetrainers repo supports LoRA fine-tuning.

  • Stable Diffusion with 🧨 Diffusers

    Hugging Face mediumAdept

    Stable Diffusion is a latent diffusion model that denoises compressed 64Γ—64 latents rather than pixels, combining a VAE, a text-conditioned U-Net with cross-attention, and a frozen CLIP text encoder. The Diffusers walkthrough covers running it in a few lines with StableDiffusionPipeline, including fp16 loading for GPUs under 10GB, seeded generators for determinism, and tuning num_inference_steps (50 recommended) and guidance_scale (7–8.5). It explains why the 8Γ— VAE compression (3Γ—512Γ—512 to 4Γ—64Γ—64) makes generation feasible on 16GB GPUs. It then shows how to build a custom inference pipeline by loading components individually and swapping in schedulers such as K-LMS.

  • Goodbye cold boot - how we made LoRA Inference 300% faster

    Hugging Face mediumAdept

    Hugging Face's Inference API now keeps Stable Diffusion base models warm and swaps LoRA adapters per request, so hundreds of distinct LoRAs share a few GPUs instead of each getting a dedicated deployment. Requests carrying a base_model attribute and a lora tag are routed to a shared backend that uses Diffusers' load_lora_weights/fuse_lora and unfuse_lora/unload_lora_weights to swap adapters in 2-4 seconds. Warm-up dropped from 25s to 3s and cold request latency from 35s to 13s, with hundreds of LoRAs served on fewer than 5 A10G GPUs. Fusing weights cuts inference time by 30%, and batched LoRA inference was skipped because diffusion throughput rose only 25% at batch size 8 while latency grew sixfold.

  • Diffusers welcomes Stable Diffusion 3.5 Large

    Hugging Face mediumAdept

    Stable Diffusion 3.5 Large (8B) and a timestep-distilled Turbo variant are now usable in Diffusers. The architecture matches SD3 Medium except for QK normalization and dual attention layers in the MMDiT blocks. Code covers bf16 inference, few-step (4-8 step) Turbo generation without classifier-free guidance, NF4 quantization via bitsandbytes with CPU offload for consumer GPUs, and single-file checkpoint loading. LoRA fine-tuning on 24GB GPUs works with the existing SD3 DreamBooth script, combined with peft's k-bit training preparation.

  • Exploring Quantization Backends in Diffusers

    Hugging Face mediumAdept

    Hugging Face Diffusers supports several quantization backends (bitsandbytes, torchao, Quanto, GGUF and native FP8 layerwise casting) that shrink large diffusion models such as Flux-dev, whose full BF16 pipeline needs about 31 GB. Benchmarks on an H100 put BnB 4-bit NF4 at about 12.6 GB after loading with no inference slowdown, while torchao and Quanto INT4 cut memory further but take roughly 109 seconds per image versus 12 seconds for BF16. Code examples apply PipelineQuantizationConfig to the transformer and T5 encoder, load pre-quantized GGUF files, and combine quantization with CPU offloading, group offloading and torch.compile. The 8-bit quality differences are usually hard to see, and NF4 is suggested as the best tradeoff.

The quest for software engineering knowledge.

Look:
Layout: