Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex AI Studio
    • About Yandex AI Studio
    • Yandex Workflows
    • Quotas and limits
    • Terms and definitions
  • Compatibility with OpenAI
  • Access management
  • Pricing policy
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • class yandex_cloud_ml_sdk._models.image_generation.function.ImageGeneration
  • class yandex_cloud_ml_sdk._models.image_generation.model.ImageGenerationModel

Domain

Written by
Yandex Cloud
Updated at August 25, 2025
  • class yandex_cloud_ml_sdk._models.image_generation.function.ImageGeneration
  • class yandex_cloud_ml_sdk._models.image_generation.model.ImageGenerationModel

class yandexcloudmlsdk.models.imagegeneration.function.ImageGenerationclass yandex_cloud_ml_sdk._models.image_generation.function.ImageGeneration

A class for image generation models.

It provides the functionality to call an image generation model by constructing the appropriate URI based on the provided model name and version.

Returns a model’s object through which requests to the backend are made.

>>> model = sdk.models.image_generation('yandex-art')  # this is how the model is created

__call__(model_name, *, model_version='latest')

Call the image generation model with the specified name and version.

Constructs the URI for the model based on the provided model’s name and version. If the name contains ://, it is treated as a complete URI. Otherwise, it looks up the model name in the well-known names dictionary. But after this, in any case, we construct a URI in the form art://<folder_id>//.

Parameters

  • model_name (str) – the name or URI of the model to call.
  • model_version (str) – the version of the model to use. Defaults to ‘latest’.

Model

class yandexcloudmlsdk.models.imagegeneration.model.ImageGenerationModelclass yandex_cloud_ml_sdk._models.image_generation.model.ImageGenerationModel

A class of the one, concrete model. This model encapsulates the URI and configuration.

run_deferred(messages, *, timeout=60)

Executes the image generation operation asynchronously and returns an operation representing the ongoing image generation process.

Parameters

  • messages (ImageMessage | ImageMessageDict | AnyMessage | str | Iterable[ImageMessage | ImageMessageDict | AnyMessage | str]) – the input messages for image generation.
  • timeout (float) – the timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.

Return type

Operation[ImageGenerationModelResult]

attach_deferred(operation_id, timeout=60)

Attaches to an ongoing image generation operation.

Parameters

  • operation_id (str) – the ID of the operation to attach to.
  • timeout (float) – the timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.

Return type

Operation[ImageGenerationModelResult]

property config: ConfigTypeT

configure(*, seed=Undefined, width_ratio=Undefined, height_ratio=Undefined, mime_type=Undefined)

Configures the image generation model with specified parameters and returns the configured instance of the model.

Parameters

  • seed (int | Undefined) – a random seed for generation.
  • width_ratio (int | Undefined) – the width ratio for the generated image.
  • height_ratio (int | Undefined) – the height ratio for the generated image.
  • mime_type (str | Undefined) – the MIME type of the generated image. Read more on what MIME types exist in the documentation.

Return type

Self

property uri: str

Was the article helpful?

© 2025 Direct Cursus Technology L.L.C.