IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python class

ImageGenerationDetails

ImageGenerationDetails​

class max.pipelines.request.ImageGenerationDetails(*, width, height, megapixels, steps, image_count)

source

Bases: BaseModel

Image generation usage metadata.

Exposes the generated image dimensions, step count, and image count under usage so downstream consumers can attribute usage from the response instead of re-deriving it from request inputs.

Parameters:

from_images()​

classmethod from_images(pixel_data, *, steps)

source

Build image generation details from generated image data.

Parameters:

  • pixel_data (ndarray[tuple[Any, ...], dtype[uint8]]) – Generated images as a non-empty uint8 array of shape (image_count, H, W, C).
  • steps (int) – The number of denoising steps used to generate.

Returns:

An ImageGenerationDetails describing the generated images.

Raises:

ValueError – If pixel_data contains no images.

Return type:

ImageGenerationDetails

height​

height: int

source

image_count​

image_count: int

source

megapixels​

megapixels: float

source

model_config​

model_config: ClassVar[ConfigDict] = {'frozen': True}

source

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

steps​

steps: int

source

width​

width: int

source