Python class
PixelGenerationPipeline
PixelGenerationPipeline
class max.pipelines.PixelGenerationPipeline(pipeline_config, pipeline_model, cache_config=None)
Bases: Pipeline[PixelGenerationInputs[PixelGenerationContextType], GenerationOutput], Generic[PixelGenerationContextType]
Pixel generation pipeline for diffusion models.
-
Parameters:
-
- pipeline_config (PipelineConfig) – Configuration for the pipeline and runtime behavior.
- pipeline_model (type[DiffusionPipeline] | type[PipelineExecutor[Any, Any, Any]]) – The diffusion pipeline model class to instantiate.
- cache_config (DenoisingCacheConfig | None)
execute()
execute(inputs)
Runs the pixel generation pipeline for the given inputs.
-
Parameters:
-
inputs (PixelGenerationInputs[PixelGenerationContextType])
-
Return type:
pipeline_config
property pipeline_config: PipelineConfig
Return the pipeline configuration.
prepare_batch()
prepare_batch(batch)
Prepare model inputs for pixel generation execution.
Delegates to the pipeline model for model-specific input preparation.
-
Parameters:
-
batch (dict[RequestID, PixelGenerationContextType]) – Dictionary mapping request IDs to their PixelContext objects.
-
Returns:
-
- Model inputs ready for execution, or None if batch is empty.
- list: Flattened batch as (request_id, context) tuples for response mapping.
-
Return type:
-
A tuple of
-
Raises:
-
ValueError – If batch size is larger than 1 (not yet supported).
release()
release(request_id)
Release resources associated with a request.
-
Parameters:
-
request_id (RequestID) – The request ID to release resources for.
-
Return type:
-
None
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!