You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/en/modular_diffusers/getting_started.md
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ With Modular Diffusers, we introduce a unified pipeline system that simplifies h
21
21
In this guide, we will focus on how to build end-to-end pipelines using blocks we officially support at diffusers 🧨! We will show you how to write your own pipeline blocks and go into more details on how they work under the hood in this [guide](./write_own_pipeline_block.md). For advanced users who want to build complete workflows from scratch, we provide an end-to-end example in the [Developer Guide](./end_to_end.md) that covers everything from writing custom pipeline blocks to deploying your workflow as a UI node.
22
22
23
23
Let's get started! The Modular Diffusers Framework consists of three main components:
24
-
- ModularPipelineBlocks
25
-
- PipelineState & BlockState
26
-
- ModularPipeline
24
+
- ModularPipelineBlocks: Building blocks for your workflow, each block defines inputs/outputs and computation steps. These are just definitions and not runnable.
25
+
- PipelineState & BlockState: Store and manage data as it flows through the pipeline.
26
+
- ModularPipeline: Loads models and runs the computation steps. You convert blocks to pipelines to make them executable.
More commonly, you can create a `SequentialPipelineBlocks` using a block classes preset from 🧨 Diffusers.
71
+
More commonly, you need multiple blocks to build your workflow. You can create a `SequentialPipelineBlocks` using block class presets from 🧨 Diffusers.
72
+
73
+
`TEXT2IMAGE_BLOCKS` is a predefined dictionary containing all the blocks needed for a complete text-to-image pipeline (text encoding, denoising, decoding, etc.). We will see more details soon.
72
74
73
75
```py
74
76
from diffusers.modular_pipelines import SequentialPipelineBlocks
@@ -171,7 +173,7 @@ Note that both the block classes preset and the `sub_blocks` attribute are `Inse
171
173
172
174
**Add a block:**
173
175
```py
174
-
#Add a block class to the preset
176
+
#BLOCKS is a block class preset, you need to add class to it
175
177
BLOCKS.insert("block_name", BlockClass, index)
176
178
# Add a block instance to the `sub_blocks` attribute
The `init_pipeline()` method creates a ModularPipeline and loads component specifications from the repository's `modular_model_index.json` file, but doesn't load the actual models yet.
369
+
366
370
<Tip>
367
371
368
372
💡 We recommend using `ModularPipeline` with Component Manager by passing a `components_manager`:
0 commit comments