Skip to content

Commit 793d57b

Browse files
committed
update
1 parent 7aa2930 commit 793d57b

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

docs/source/en/modular_diffusers/modular_diffusers_states.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ The [`~modular_pipelines.PipelineState`] is a global state container for all blo
2727

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

30-
- The `values` dict is an **mutable** state containing a copy of user provided input values and intermediate output values generated by blocks. Blocks can read and write to their `inputs`. If a block modifies an `input`, it will be reflected in the `values` dict after calling `set_block_state`.
31-
- The `kwargs_type`
30+
- The `values` dict is a **mutable** state containing a copy of user provided input values and intermediate output values generated by blocks. If a block modifies an `input`, it will be reflected in the `values` dict after calling `set_block_state`.
3231

3332
```py
3433
PipelineState(
@@ -74,5 +73,3 @@ def __call__(self, components, state):
7473

7574
- `inputs`, a block can modify an input - like `block_state.image` - and this change can be propagated globally to [`~modular_pipelines.PipelineState`] by calling `set_block_state`.
7675
- `intermediate_outputs`, is a new variable that a block creates. It is added to the [`~modular_pipelines.PipelineState`]'s `values` dict and is available as for subsequent blocks or accessed by users as a final output from the pipeline.
77-
78-
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/sequential_pipeline_blocks.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class InputBlock(ModularPipelineBlocks):
3333
InputParam(name="num_images_per_prompt", type_hint=int, description="number of images per prompt"),
3434
]
3535

36-
@property
37-
def intermediate_inputs(self):
38-
return []
39-
4036
@property
4137
def intermediate_outputs(self):
4238
return [
@@ -68,11 +64,6 @@ class ImageEncoderBlock(ModularPipelineBlocks):
6864
def inputs(self):
6965
return [
7066
InputParam(name="image", type_hint="PIL.Image", description="raw input image to process"),
71-
]
72-
73-
@property
74-
def intermediate_inputs(self):
75-
return [
7667
InputParam(name="batch_size", type_hint=int),
7768
]
7869

@@ -89,6 +80,7 @@ class ImageEncoderBlock(ModularPipelineBlocks):
8980
def __call__(self, components, state):
9081
block_state = self.get_block_state(state)
9182
# Simulate processing the image
83+
# This will change the state of the image from a PIL image to a tensor for all blocks
9284
block_state.image = torch.randn(1, 3, 512, 512)
9385
block_state.batch_size = block_state.batch_size * 2
9486
block_state.image_latents = torch.randn(1, 4, 64, 64)

src/diffusers/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
"configuration_utils": ["ConfigMixin"],
3737
"guiders": [],
3838
"hooks": [],
39-
"image_processor": [
40-
"VaeImageProcessor"
41-
],
39+
"image_processor": ["VaeImageProcessor"],
4240
"loaders": ["FromOriginalModelMixin"],
4341
"models": [],
4442
"modular_pipelines": [],
@@ -64,9 +62,7 @@
6462
"is_unidecode_available",
6563
"logging",
6664
],
67-
"video_processor": [
68-
"VideoProcessor"
69-
],
65+
"video_processor": ["VideoProcessor"],
7066
}
7167

7268
try:

0 commit comments

Comments
 (0)