Skip to content

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

Hugging Face 8 min read Announcement mediumAdept

Introducing Modular Diffusers - Composable Building Blocks for Diffusion Pipelines

Modular Diffusers lets diffusion pipelines be assembled from reusable, self-contained blocks (text encoding, VAE encoding, denoising, decoding) instead of monolithic DiffusionPipeline classes, while keeping the same call API. Blocks declare expected components, inputs and intermediate outputs, so they can be popped out, run independently, inserted or swapped, and data flows automatically between them; ComponentsManager handles CPU offloading across pipelines. Code examples cover running FLUX.2 Klein, writing a Depth Anything V2 preprocessing block and inserting it into a Qwen-Image ControlNet workflow, publishing blocks to the Hub, and modular repositories that reference components from other repos. The consistent block interface also powers Mellon, an early-stage node-graph UI that auto-generates nodes from block definitions.

Assumes: Diffusion models basicsPyTorchHugging Face Diffusers

Related posts

  • Diffusers welcomes FLUX-2

    Hugging Face hardMaster

    FLUX.2 from Black Forest Labs is a new image generation and editing model, not a drop-in replacement for Flux.1. It uses a single Mistral Small 3.1 text encoder that stacks intermediate-layer outputs, bias-free DiT layers, shared AdaLayerNorm-Zero modulation, and fully parallel single-stream blocks with SwiGLU MLPs, shifting to 8 double-stream and 48 single-stream blocks in the 32B model. Running it unmodified needs over 80GB of VRAM. Diffusers code covers CPU offload (~62GB), Flash Attention 3, NF4 4-bit quantization (~20GB), a remote text encoder (18GB), group offloading (8GB VRAM), multi-image references, structured JSON prompting and LoRA fine-tuning.

  • Welcome FLUX.3 Image Klein in Diffusers

    Hugging Face mediumAdept

    FLUX.3 Image Klein from Black Forest Labs is supported in Diffusers from launch. It is a single model for text-to-image, multi-reference image-to-image, and bounding-box layout control, where regions are written as JSON with normalized 0–1000 boxes to place new content or move content from a reference image. The distilled checkpoint renders 1024×1024 in about 1.9 s on an H100 in 16 steps without CFG. Reference images roughly double the time because each adds 4,096 tokens to the transformer sequence. The post also covers FP8 and NVFP4 single-file variants that cut peak memory to about 15–16 GiB, DreamBooth LoRA training scripts, the VAE tokenization (one token per 16×16 patch), and Modular Diffusers pipeline usage.

  • 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.

  • Generate Images Locally with Docker Model Runner and Open WebUI

    Docker mediumAdept

    Docker Model Runner can now serve diffusion image models locally through an OpenAI-compatible /v1/images/generations endpoint. Paired with Open WebUI, that gives you private, offline image generation from a chat interface. Models are distributed as DDUF single-file artifacts via Docker Hub, `docker model launch openwebui` wires up the UI, and an admin setting points image generation at the diffusers endpoint. The walkthrough also covers calling the API directly with curl, including negative prompts, inference steps, guidance scale and seeds. Under the hood, the backend unpacks the DDUF into a Diffusers pipeline served by a version-pinned FastAPI server.

  • VQ-Diffusion

    Hugging Face hardMaster

    VQ-Diffusion is a conditional latent diffusion model whose noising and denoising run over a discrete VQ-VAE codebook rather than Gaussian noise. Each token can stay, be uniformly resampled, or become permanently masked, and a CLIP-conditioned encoder-decoder transformer predicts the full distribution of un-noised latents in one pass. Compared with autoregressive image transformers, it avoids raster-order directional bias and error accumulation, and its inference cost scales with diffusion steps rather than latent pixels, roughly a 10x big-O gain on 32x32 ITHQ latents and up to 15x faster in practice. The model can be run in a few lines with the Diffusers VQDiffusionPipeline.

The quest for software engineering knowledge.

Look:
Layout: