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/loop_sequential_pipeline_blocks.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License.
12
12
13
13
# LoopSequentialPipelineBlocks
14
14
15
-
[`~modular_pipelines.LoopSequentialPipelineBlocks`] are a multi-block type that composes other [`~modular_pipelines.ModularPipelineBlocks`] together in a loop. Data flows circularly, using `intermediate_inputs` and `intermediate_outputs`, and each block is run iteratively. This is typically used to create a denoising loop which is iterative by default.
15
+
[`~modular_pipelines.LoopSequentialPipelineBlocks`] are a multi-block type that composes other [`~modular_pipelines.ModularPipelineBlocks`] together in a loop. Data flows circularly, using `inputs` and `intermediate_outputs`, and each block is run iteratively. This is typically used to create a denoising loop which is iterative by default.
16
16
17
17
This guide shows you how to create [`~modular_pipelines.LoopSequentialPipelineBlocks`].
18
18
@@ -21,7 +21,6 @@ This guide shows you how to create [`~modular_pipelines.LoopSequentialPipelineBl
21
21
[`~modular_pipelines.LoopSequentialPipelineBlocks`], is also known as the *loop wrapper* because it defines the loop structure, iteration variables, and configuration. Within the loop wrapper, you need the following variables.
22
22
23
23
-`loop_inputs` are user provided values and equivalent to [`~modular_pipelines.ModularPipelineBlocks.inputs`].
24
-
-`loop_intermediate_inputs` are intermediate variables from the [`~modular_pipelines.PipelineState`] and equivalent to [`~modular_pipelines.ModularPipelineBlocks.intermediate_inputs`].
25
24
-`loop_intermediate_outputs` are new intermediate variables created by the block and added to the [`~modular_pipelines.PipelineState`]. It is equivalent to [`~modular_pipelines.ModularPipelineBlocks.intermediate_outputs`].
26
25
-`__call__` method defines the loop structure and iteration logic.
27
26
@@ -90,4 +89,4 @@ Add more loop blocks to run within each iteration with [`~modular_pipelines.Loop
Copy file name to clipboardExpand all lines: docs/source/en/modular_diffusers/pipeline_block.md
+5-15Lines changed: 5 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,17 +37,7 @@ A [`~modular_pipelines.ModularPipelineBlocks`] requires `inputs`, and `intermedi
37
37
]
38
38
```
39
39
40
-
-`intermediate_inputs` are values typically created from a previous block but it can also be directly provided if no preceding block generates them. Unlike `inputs`, `intermediate_inputs` can be modified.
41
-
42
-
Use `InputParam` to define `intermediate_inputs`.
43
-
44
-
```py
45
-
user_intermediate_inputs = [
46
-
InputParam(name="processed_image", type_hint="torch.Tensor", description="image that has been preprocessed and normalized"),
47
-
]
48
-
```
49
-
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.
40
+
-`intermediate_outputs` are new values created by a block and added to the [`~modular_pipelines.PipelineState`]. The `intermediate_outputs` are available as`inputs`for subsequent blocks or available as the final output from running the pipeline.
51
41
52
42
Use `OutputParam` to define `intermediate_outputs`.
53
43
@@ -65,8 +55,8 @@ The intermediate inputs and outputs share data to connect blocks. They are acces
65
55
66
56
The computation a block performs is defined in the `__call__` method and it follows a specific structure.
67
57
68
-
1. Retrieve the [`~modular_pipelines.BlockState`] to get a local view of the `inputs`and`intermediate_inputs`.
69
-
2. Implement the computation logic on the `inputs`and`intermediate_inputs`.
58
+
1. Retrieve the [`~modular_pipelines.BlockState`] to get a local view of the `inputs`
59
+
2. Implement the computation logic on the `inputs`.
70
60
3. Update [`~modular_pipelines.PipelineState`] to push changes from the local [`~modular_pipelines.BlockState`] back to the global [`~modular_pipelines.PipelineState`].
71
61
4. Return the components and state which becomes available to the next block.
Copy file name to clipboardExpand all lines: docs/source/en/modular_diffusers/sequential_pipeline_blocks.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,11 @@ specific language governing permissions and limitations under the License.
12
12
13
13
# SequentialPipelineBlocks
14
14
15
-
[`~modular_pipelines.SequentialPipelineBlocks`] are a multi-block type that composes other [`~modular_pipelines.ModularPipelineBlocks`] together in a sequence. Data flows linearly from one block to the next using `intermediate_inputs` and `intermediate_outputs`. Each block in [`~modular_pipelines.SequentialPipelineBlocks`] usually represents a step in the pipeline, and by combining them, you gradually build a pipeline.
15
+
[`~modular_pipelines.SequentialPipelineBlocks`] are a multi-block type that composes other [`~modular_pipelines.ModularPipelineBlocks`] together in a sequence. Data flows linearly from one block to the next using `inputs` and `intermediate_outputs`. Each block in [`~modular_pipelines.SequentialPipelineBlocks`] usually represents a step in the pipeline, and by combining them, you gradually build a pipeline.
16
16
17
17
This guide shows you how to connect two blocks into a [`~modular_pipelines.SequentialPipelineBlocks`].
18
18
19
-
Create two [`~modular_pipelines.ModularPipelineBlocks`]. The first block, `InputBlock`, outputs a `batch_size` value and the second block, `ImageEncoderBlock` uses `batch_size` as `intermediate_inputs`.
19
+
Create two [`~modular_pipelines.ModularPipelineBlocks`]. The first block, `InputBlock`, outputs a `batch_size` value and the second block, `ImageEncoderBlock` uses `batch_size` as `inputs`.
20
20
21
21
<hfoptionsid="sequential">
22
22
<hfoptionid="InputBlock">
@@ -110,4 +110,4 @@ Inspect the sub-blocks in [`~modular_pipelines.SequentialPipelineBlocks`] by cal
0 commit comments