Buckets:

rtrm's picture
|
download
raw
7.08 kB

Pipeline blocks

ModularPipelineBlocks[[diffusers.ModularPipelineBlocks]]

diffusers.ModularPipelineBlocks[[diffusers.ModularPipelineBlocks]]

Source

Base class for all Pipeline Blocks: ConditionalPipelineBlocks, 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_11636/src/diffusers/modular_pipelines/modular_pipeline.py#L437[{"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.

Parameters:

named_input_lists : List of tuples containing (block_name, input_param_list) pairs

Returns:

List[InputParam]

Combined list of unique InputParam objects

combine_outputs[[diffusers.ModularPipelineBlocks.combine_outputs]]

Source

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

Parameters:

named_output_lists : List of tuples containing (block_name, output_param_list) pairs

Returns:

List[OutputParam]

Combined list of unique OutputParam objects

get_block_state[[diffusers.ModularPipelineBlocks.get_block_state]]

Source

Get all inputs and intermediates in one dictionary

init_pipeline[[diffusers.ModularPipelineBlocks.init_pipeline]]

Source

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

SequentialPipelineBlocks[[diffusers.modular_pipelines.SequentialPipelineBlocks]]

diffusers.modular_pipelines.SequentialPipelineBlocks[[diffusers.modular_pipelines.SequentialPipelineBlocks]]

Source

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_11636/src/diffusers/modular_pipelines/modular_pipeline.py#L856[{"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.

Parameters:

block_classes : List of block classes to be used

block_names : List of prefixes for each block

Returns:

A new SequentialPipelineBlocks instance

get_execution_blocks[[diffusers.modular_pipelines.SequentialPipelineBlocks.get_execution_blocks]]

Source

Get the blocks that would execute given the specified inputs.

Example:

Get blocks for inpainting workflow blocks = pipeline.get_execution_blocks(prompt="a cat", mask=mask,

image=image)

Get blocks for text2image workflow blocks = pipeline.get_execution_blocks(prompt="a cat")

Parameters:

  • **kwargs : Input names and values. Only trigger inputs affect block selection. Pass any inputs that would be non-None at runtime.

Returns:

SequentialPipelineBlocks containing only the blocks that would execute

LoopSequentialPipelineBlocks[[diffusers.modular_pipelines.LoopSequentialPipelineBlocks]]

diffusers.modular_pipelines.LoopSequentialPipelineBlocks[[diffusers.modular_pipelines.LoopSequentialPipelineBlocks]]

Source

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_11636/src/diffusers/modular_pipelines/modular_pipeline.py#L1312[{"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.

Parameters:

block_classes : List of block classes to be used

block_names : List of prefixes for each block

Returns:

A new LoopSequentialPipelineBlocks instance

AutoPipelineBlocks[[diffusers.modular_pipelines.AutoPipelineBlocks]]

diffusers.modular_pipelines.AutoPipelineBlocks[[diffusers.modular_pipelines.AutoPipelineBlocks]]

Source

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

select_blockdiffusers.modular_pipelines.AutoPipelineBlocks.select_blockhttps://github.com/huggingface/diffusers/blob/vr_11636/src/diffusers/modular_pipelines/modular_pipeline.py#L804[{"name": "**kwargs", "val": ""}] Select block based on which trigger input is present (not None).

Xet Storage Details

Size:
7.08 kB
·
Xet hash:
737108663040f010d7c5b2d46a310800c3a4c2dd6090f6cc809c3dfe1210b026

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