---
title: "Introducing Modular Diffusers - Composable Building Blocks for Diffusion Pipelines"
description: "Modular Diffusers introduces a composable alternative to Diffusers’ existing DiffusionPipeline for building diffusion workflows from reusable blocks. A ModularPipeline can load a workflow definition, load model components separately with settings such as bfloat16, and preserve the familiar inference API, while blocks for text encoding, image encoding, denoising, and decoding can be inspected, run independently, or rearranged. Custom Python blocks declare components, inputs, outputs, and computation logic; the example adds a Depth Anything V2 depth processor to a Qwen Image ControlNet workflow, with data flowing between compatible blocks. Blocks and complete pipelines can be published to the Hub, and Mellon can generate node interfaces from their consistent definitions. The post presents the system as an early, flexible direction and says Mellon is not ready for production use."
---

# Introducing Modular Diffusers - Composable Building Blocks for Diffusion Pipelines

[Hugging Face](https://yomu.fyi/company/hugging-face) · YiYi Xu, Alvaro Somoza, Dhruv Nair, Sayak Paul · Mar 5, 2026

**Type:** Announcement

## Summary

Modular Diffusers introduces a composable alternative to Diffusers’ existing DiffusionPipeline for building diffusion workflows from reusable blocks. A ModularPipeline can load a workflow definition, load model components separately with settings such as bfloat16, and preserve the familiar inference API, while blocks for text encoding, image encoding, denoising, and decoding can be inspected, run independently, or rearranged. Custom Python blocks declare components, inputs, outputs, and computation logic; the example adds a Depth Anything V2 depth processor to a Qwen Image ControlNet workflow, with data flowing between compatible blocks. Blocks and complete pipelines can be published to the Hub, and Mellon can generate node interfaces from their consistent definitions. The post presents the system as an early, flexible direction and says Mellon is not ready for production use.

## Context

The existing DiffusionPipeline remains available, but the post introduces a more flexible and composable alternative for creating diffusion workflows. The stated motivation is to let users mix and match reusable blocks, build tailored workflows, and connect those workflows to a node-based interface.

## Approach / What changed

Modular Diffusers represents workflows as blocks with defined components, inputs, outputs, and computation logic. Blocks can be inspected, independently initialized as pipelines, added, removed, or rearranged; ComponentsManager handles memory across multiple pipelines. Custom blocks and complete pipeline definitions can be published to the Hub, while Mellon derives node interfaces from each block’s consistent properties.

## Takeaways

- A ModularPipeline separates workflow definition from component loading: from\_pretrained defines the workflow, while load\_components loads model weights and supports settings such as torch\_dtype and quantization.
- Custom blocks declare expected components, inputs, intermediate outputs, and \_\_call\_\_ computation. In the example, a Depth Anything V2 block supplies control\_image data to a Qwen Image ControlNet workflow.
- Mellon can load Hub-hosted custom blocks and generate their node interfaces from the block definition, but the integration is described as early development and not ready for production use.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Machine Learning](https://yomu.fyi/topic/machine-learning), [Open Source](https://yomu.fyi/topic/open-source), [Python](https://yomu.fyi/topic/python)

- Source: [Hugging Face](https://huggingface.co/blog/modular-diffusers)
- Source URL: https://huggingface.co/blog/modular-diffusers
- Ingested by Yomu: 2026-08-29T00:00:56.020Z

[Read original post](https://huggingface.co/blog/modular-diffusers)
