Skip to content

Commit 1fbc526

Browse files
committed
fix links
1 parent 9cea2f6 commit 1fbc526

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

docs/source/en/modular_diffusers/modular_diffusers_states.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ specific language governing permissions and limitations under the License.
1212

1313
# Block states
1414

15-
Blocks rely on the [`PipelineState`] and [`BlockState`] data structures for communicating and sharing data.
15+
Blocks rely on the [`~modular_pipelines.PipelineState`] and [`~modular_pipelines.BlockState`] data structures for communicating and sharing data.
1616

1717
| State | Description |
1818
|-------|-------------|
19-
| `PipelineState` | Maintains the overall data required for a pipeline's execution and allows blocks to read and update its data. |
20-
| `BlockState` | Allows each block to perform its computation with the necessary data from `inputs` and `intermediate_inputs` |
19+
| [`~modular_pipelines.PipelineState`] | Maintains the overall data required for a pipeline's execution and allows blocks to read and update its data. |
20+
| [`~modular_pipelines.BlockState`] | Allows each block to perform its computation with the necessary data from `inputs` and `intermediate_inputs` |
2121

2222
This guide explains how states work and how they connect blocks.
2323

2424
## PipelineState
2525

26-
The [`PipelineState`] is a global state container for all pipeline blocks. It maintains the complete runtime state of the pipeline and provides a structured way for blocks to read from and write to shared data.
26+
The [`~modular_pipelines.PipelineState`] is a global state container for all pipeline blocks. It maintains the complete runtime state of the pipeline and provides a structured way for blocks to read from and write to shared data.
2727

28-
There are two dict's in [`PipelineState`] for structuring data.
28+
There are two dict's in [`~modular_pipelines.PipelineState`] for structuring data.
2929

3030
- The `inputs` dict is an **immutable** state containing a copy of user provided values. A value added to `inputs` cannot be changed. Blocks can read from `inputs` but cannot write to it.
3131
- The `intermediates` dict is a **mutable** state containing variables that are passed between blocks and can be modified by them.
@@ -46,7 +46,7 @@ PipelineState(
4646

4747
## BlockState
4848

49-
The [`BlockState`] is a local view of the relevant variables, `inputs` and `intermediate_inputs`, that an individual pipeline block needs from [`PipelineState`] for performing it's computations.
49+
The [`~modular_pipelines.BlockState`] is a local view of the relevant variables, `inputs` and `intermediate_inputs`, that an individual pipeline block needs from [`~modular_pipelines.PipelineState`] for performing it's computations.
5050

5151
You can access these variables directly as attributes like `block_state.image`.
5252

@@ -56,7 +56,7 @@ BlockState(
5656
)
5757
```
5858

59-
When a block's `__call__` method is executed, it retrieves the [`BlockState`] with `self.get_block_state(state)`, performs it's operations, and updates [`PipelineState`] with `self.set_block_state(state, block_state)`.
59+
When a block's `__call__` method is executed, it retrieves the [`BlockState`] with `self.get_block_state(state)`, performs it's operations, and updates [`~modular_pipelines.PipelineState`] with `self.set_block_state(state, block_state)`.
6060

6161
```py
6262
def __call__(self, components, state):
@@ -72,13 +72,13 @@ def __call__(self, components, state):
7272

7373
## State interaction
7474

75-
[`PipelineState`] and [`BlockState`] interaction is defined by a block's `inputs`, `intermediate_inputs`, and `intermediate_outputs`.
75+
[`~modular_pipelines.PipelineState`] and [`BlockState`] interaction is defined by a block's `inputs`, `intermediate_inputs`, and `intermediate_outputs`.
7676

77-
- `inputs`, a block can modify an input - like `block_state.image` - but the change is local to the [`BlockState`] and won't affect the original image in [`PipelineState`].
78-
- `intermediate_inputs`, is often values created from a previous block. When a block modifies `intermediate_inputs` - like `batch_size` - this change is reflected in both the [`BlockState`] and [`PipelineState`]. Any subsequent blocks are also affected.
77+
- `inputs`, a block can modify an input - like `block_state.image` - but the change is local to the [`~modular_pipelines.BlockState`] and won't affect the original image in [`~modular_pipelines.PipelineState`].
78+
- `intermediate_inputs`, is often values created from a previous block. When a block modifies `intermediate_inputs` - like `batch_size` - this change is reflected in both the [`~modular_pipelines.BlockState`] and [`~modular_pipelines.PipelineState`]. Any subsequent blocks are also affected.
7979

8080
If a previous block doesn't provide an `intermediate_inputs`, then the pipeline makes it available as a user input. However, the value is still a mutable intermediate state.
8181

82-
- `intermediate_outputs`, is a new variable that a block creates from `intermediate_inputs`. It is added to the [`PipelineState`]'s `intermediates` dict and available as an `intermediate_inputs` for subsequent blocks or accessed by users as a final output from the pipeline.
82+
- `intermediate_outputs`, is a new variable that a block creates from `intermediate_inputs`. It is added to the [`~modular_pipelines.PipelineState`]'s `intermediates` dict and available as an `intermediate_inputs` for subsequent blocks or accessed by users as a final output from the pipeline.
8383

84-
If a variable is modified in `block_state` but not declared as an `intermediate_outputs`, it won't be added to [`PipelineState`].
84+
If a variable is modified in `block_state` but not declared as an `intermediate_outputs`, it won't be added to [`~modular_pipelines.PipelineState`].

docs/source/en/modular_diffusers/pipeline_block.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ specific language governing permissions and limitations under the License.
1212

1313
# PipelineBlock
1414

15-
[`PipelineBlock`] is the basic block for building a [`ModularPipeline`]. It defines what components, inputs/outputs, and computation a block should perform for a specific step in a pipeline. A [`PipelineBlock`] connects with other blocks, using [state](./modular_diffusers_states), to enable the modular construction of workflows.
15+
[`~modular_pipelines.PipelineBlock`] is the basic block for building a [`ModularPipeline`]. It defines what components, inputs/outputs, and computation a block should perform for a specific step in a pipeline. A [`~modular_pipelines.PipelineBlock`] connects with other blocks, using [state](./modular_diffusers_states), to enable the modular construction of workflows.
1616

17-
A [`PipelineBlock`] on it's own can't be run to generate anything. It is a blueprint for what a step should do in a pipeline. To actually run and execute a pipeline, the [`PipelineBlock`] needs to be converted into a [`ModularPipeline`].
17+
A [`~modular_pipelines.PipelineBlock`] on it's own can't be run to generate anything. It is a blueprint for what a step should do in a pipeline. To actually run and execute a pipeline, the [`~modular_pipelines.PipelineBlock`] needs to be converted into a [`ModularPipeline`].
1818

19-
This guide will show you how to create a [`PipelineBlock`].
19+
This guide will show you how to create a [`~modular_pipelines.PipelineBlock`].
2020

2121
## Inputs and outputs
2222

2323
> [!TIP]
2424
> Refer to the [Block states](./modular_diffusers_states) guide if you aren't familiar with how state works in Modular Diffusers.
2525
26-
A [`PipelineBlock`] requires `inputs`, `intermediate_inputs`, and `intermediate_outputs`.
26+
A [`~modular_pipelines.PipelineBlock`] requires `inputs`, `intermediate_inputs`, and `intermediate_outputs`.
2727

28-
- `inputs` are values provided by a user and they are retrieved from the [`PipelineState`], which means `inputs` can't be modified. This is useful because some workflows resize an image, but the original image is still required. The [`PipelineState`] maintains the original image.
28+
- `inputs` are values provided by a user and they are retrieved from the [`~modular_pipelines.PipelineState`], which means `inputs` can't be modified. This is useful because some workflows resize an image, but the original image is still required. The [`~modular_pipelines.PipelineState`] maintains the original image.
2929

3030
Use `InputParam` to define `inputs`.
3131

@@ -47,7 +47,7 @@ A [`PipelineBlock`] requires `inputs`, `intermediate_inputs`, and `intermediate_
4747
]
4848
```
4949

50-
- `intermediate_outputs` are new values created by a block and added to the [`PipelineState`]. The `intermediate_outputs` are available as `intermediate_inputs` for subsequent blocks or available as the final output from running the pipeline.
50+
- `intermediate_outputs` are new values created by a block and added to the [`~modular_pipelines.PipelineState`]. The `intermediate_outputs` are available as `intermediate_inputs` for subsequent blocks or available as the final output from running the pipeline.
5151

5252
Use `OutputParam` to define `intermediate_outputs`.
5353

@@ -65,9 +65,9 @@ The intermediate inputs and outputs work together to connect blocks by sharing d
6565

6666
The computation a block performs is defined in the `__call__` method which follows a specific structure.
6767

68-
1. Retrieve the [`BlockState`] to get a local view of the `inputs` and `intermediate_inputs` it needs from [`PipelineState`].
68+
1. Retrieve the [`~modular_pipelines.BlockState`] to get a local view of the `inputs` and `intermediate_inputs` it needs from [`~modular_pipelines.PipelineState`].
6969
2. Implement the computation logic on the `inputs` and `intermediate_inputs`.
70-
3. Update [`PipelineState`] to push changes from the local [`BlockState`] back to the global [`PipelineState`].
70+
3. Update [`~modular_pipelines.PipelineState`] to push changes from the local [`~modular_pipelines.BlockState`] back to the global [`~modular_pipelines.PipelineState`].
7171
4. Return the components and state which becomes available to the next block.
7272

7373
```py
@@ -86,10 +86,10 @@ def __call__(self, components, state):
8686

8787
### Components and Configs
8888

89-
The components and pipeline-level configs a block needs are specified in [`ComponentSpec`] and [`ConfigSpec`].
89+
The components and pipeline-level configs a block needs are specified in [`ComponentSpec`] and [`~modular_pipelines.ConfigSpec`].
9090

9191
- [`ComponentSpec`] contains the expected components used by a block. You need the `name` of the component and ideally a `type_hint` that specifies exactly what the component is.
92-
- [`ConfigSpec`] contains pipeline-level settings that control behavior across all blocks.
92+
- [`~modular_pipelines.ConfigSpec`] contains pipeline-level settings that control behavior across all blocks.
9393

9494
```py
9595
from diffusers import ComponentSpec, ConfigSpec

0 commit comments

Comments
 (0)