Diffusers documentation

Pipeline states

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.34.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Pipeline states

PipelineState

class diffusers.modular_pipelines.PipelineState

< >

( values: typing.Dict[str, typing.Any] = <factory> kwargs_mapping: typing.Dict[str, typing.List[str]] = <factory> )

PipelineState stores the state of a pipeline. It is used to pass data between pipeline blocks.

get

< >

( keys: typing.Union[str, typing.List[str]] default: typing.Any = None ) Union[Any, Dict[str, Any]]

Parameters

  • keys (Union[str, List[str]]) — Key or list of keys for the values
  • default (Any) — The default value to return if not found

Returns

Union[Any, Dict[str, Any]]

Single value if keys is str, dictionary of values if keys is list

Get one or multiple values from the pipeline state.

get_by_kwargs

< >

( kwargs_type: str ) Dict[str, Any]

Parameters

  • kwargs_type (str) — The kwargs_type to filter by

Returns

Dict[str, Any]

Dictionary of values with matching kwargs_type

Get all values with matching kwargs_type.

set

< >

( key: str value: typing.Any kwargs_type: str = None )

Parameters

  • key (str) — The key for the value
  • value (Any) — The value to store
  • kwargs_type (str) — The kwargs_type with which the value is associated

Add a value to the pipeline state.

to_dict

< >

( )

Convert PipelineState to a dictionary.

BlockState

class diffusers.modular_pipelines.BlockState

< >

( **kwargs )

Container for block state data with attribute access and formatted representation.

as_dict

< >

( ) Dict[str, Any]

Returns

Dict[str, Any]

Dictionary containing all attributes of the BlockState

Convert BlockState to a dictionary.

< > Update on GitHub