Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Доступны в регионе
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • ИИ для бизнеса
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Партнёрская программа
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Тарифы Yandex Cloud
    • Промоакции и free tier
    • Правила тарификации
  • Истории успеха
  • Документация
  • Блог
Проект Яндекса
© 2025 ТОО «Облачные Сервисы Казахстан»
Yandex AI Studio
  • Начало работы с Model Gallery
    • О сервисе Yandex AI Studio
    • Yandex Workflows
    • Квоты и лимиты
    • Термины и определения
  • Переход с AI Assistant API на Responses API
  • Совместимость с OpenAI
  • Управление доступом
  • Правила тарификации
  • Аудитные логи Audit Trails
  • Публичные материалы
  • История изменений

В этой статье:

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

Domain

Статья создана
Yandex Cloud
Обновлена 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

Была ли статья полезна?

Проект Яндекса
© 2025 ТОО «Облачные Сервисы Казахстан»