Buckets:

rtrm's picture
|
download
raw
9.31 kB

Pipeline blocks

ModularPipelineBlocks[[diffusers.ModularPipelineBlocks]]

class diffusers.ModularPipelineBlocksdiffusers.ModularPipelineBlockshttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L230[]

Base class for all Pipeline Blocks: PipelineBlock, AutoPipelineBlocks, SequentialPipelineBlocks, LoopSequentialPipelineBlocks

ModularPipelineBlocks provides method to load and save the definition of pipeline blocks.

> This is an experimental feature and is likely to change in the future.

combine_inputsdiffusers.ModularPipelineBlocks.combine_inputshttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L434[{"name": "*named_input_lists", "val": ": typing.List[typing.Tuple[str, typing.List[diffusers.modular_pipelines.modular_pipeline_utils.InputParam]]]"}]- named_input_lists -- List of tuples containing (block_name, input_param_list) pairs0List[InputParam]Combined list of unique InputParam objects

Combines multiple lists of InputParam objects from different blocks. For duplicate inputs, updates only if current default value is None and new default value is not None. Warns if multiple non-None default values exist for the same input.

combine_outputsdiffusers.ModularPipelineBlocks.combine_outputshttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L477[{"name": "*named_output_lists", "val": ": typing.List[typing.Tuple[str, typing.List[diffusers.modular_pipelines.modular_pipeline_utils.OutputParam]]]"}]- named_output_lists -- List of tuples containing (block_name, output_param_list) pairs0List[OutputParam]Combined list of unique OutputParam objects

Combines multiple lists of OutputParam objects from different blocks. For duplicate outputs, keeps the first occurrence of each output name.

get_block_statediffusers.ModularPipelineBlocks.get_block_statehttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L377[{"name": "state", "val": ": PipelineState"}] Get all inputs and intermediates in one dictionary

init_pipelinediffusers.ModularPipelineBlocks.init_pipelinehttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L356[{"name": "pretrained_model_name_or_path", "val": ": typing.Union[str, os.PathLike, NoneType] = None"}, {"name": "components_manager", "val": ": typing.Optional[diffusers.modular_pipelines.components_manager.ComponentsManager] = None"}, {"name": "collection", "val": ": typing.Optional[str] = None"}]

create a ModularPipeline, optionally accept modular_repo to load from hub.

SequentialPipelineBlocks[[diffusers.modular_pipelines.SequentialPipelineBlocks]]

class diffusers.modular_pipelines.SequentialPipelineBlocksdiffusers.modular_pipelines.SequentialPipelineBlockshttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L781[]- block_classes -- List of block classes to be used

  • block_names -- List of prefixes for each block0

A Pipeline Blocks that combines multiple pipeline block classes into one. When called, it will call each block in sequence.

This class inherits from ModularPipelineBlocks. Check the superclass documentation for the generic methods the library implements for all the pipeline blocks (such as loading or saving etc.)

> This is an experimental feature and is likely to change in the future.

from_blocks_dictdiffusers.modular_pipelines.SequentialPipelineBlocks.from_blocks_dicthttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L825[{"name": "blocks_dict", "val": ": typing.Dict[str, typing.Any]"}, {"name": "description", "val": ": typing.Optional[str] = None"}]- blocks_dict -- Dictionary mapping block names to block classes or instances0A new SequentialPipelineBlocks instance Creates a SequentialPipelineBlocks instance from a dictionary of blocks.

LoopSequentialPipelineBlocks[[diffusers.modular_pipelines.LoopSequentialPipelineBlocks]]

class diffusers.modular_pipelines.LoopSequentialPipelineBlocksdiffusers.modular_pipelines.LoopSequentialPipelineBlockshttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L1136[]- block_classes -- List of block classes to be used

  • block_names -- List of prefixes for each block0

A Pipeline blocks that combines multiple pipeline block classes into a For Loop. When called, it will call each block in sequence.

This class inherits from ModularPipelineBlocks. Check the superclass documentation for the generic methods the library implements for all the pipeline blocks (such as loading or saving etc.)

> This is an experimental feature and is likely to change in the future.

from_blocks_dictdiffusers.modular_pipelines.LoopSequentialPipelineBlocks.from_blocks_dicthttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L1288[{"name": "blocks_dict", "val": ": typing.Dict[str, typing.Any]"}]- blocks_dict -- Dictionary mapping block names to block instances0A new LoopSequentialPipelineBlocks instance

Creates a LoopSequentialPipelineBlocks instance from a dictionary of blocks.

AutoPipelineBlocks[[diffusers.modular_pipelines.AutoPipelineBlocks]]

class diffusers.modular_pipelines.AutoPipelineBlocksdiffusers.modular_pipelines.AutoPipelineBlockshttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/modular_pipelines/modular_pipeline.py#L524[]- block_classes -- List of block classes to be used

  • block_names -- List of prefixes for each block
  • block_trigger_inputs -- List of input names that trigger specific blocks, with None for default0

A Pipeline Blocks that automatically selects a block to run based on the inputs.

This class inherits from ModularPipelineBlocks. Check the superclass documentation for the generic methods the library implements for all the pipeline blocks (such as loading or saving etc.)

> This is an experimental feature and is likely to change in the future.

Xet Storage Details

Size:
9.31 kB
·
Xet hash:
2e2abe93841dde951a6cd16be8dc20431d46657097a7e2a6c7c7129f888bb0e7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.