# Подключение Stable Diffusion

### Как подключить API Stable Diffusion

#### Шаг 1. Получите API-ключ Stability AI

1. Перейдите в руководство Stability AI (официальная инструкция <https://platform.stability.ai/docs/getting-started>).
2. Создайте и скопируйте ваш API-ключ.

<figure><img src="/files/KJO9XfCpINHn85oLoMFe" alt=""><figcaption></figcaption></figure>

***

#### Шаг 2. Добавьте API-ключ в скрипт CMS Ai

1. В админ-панели откройте API интеграции *→ Stable Diffusion*.
2. Вставьте API-ключ в поле *StableDiffusion API Secret*.
3. Выберите язык по умолчанию для Stable Diffusion.
4. Нажмите *Сохранить*.

***

#### Шаг 3. Проверьте работу API

Нажмите кнопку *Проверить API-ключ*.\
Если в новом окне появится сообщение *SUCCESS* — всё работает корректно.

***

### Как использовать Stable Diffusion для генерации изображений

1. Перейдите в раздел *AI-Изображения* в админ-панели скрипта CMS Ai.
2. Над полем ввода выберите генератор изображений:\
   → *DALL-E* или *Stable Diffusion*

Выбирайте нужный вариант перед генерацией.

***

<figure><img src="/files/SnfdmzHAwSLIgAJjW5Xn" alt=""><figcaption></figcaption></figure>

* Изображения, созданные через *DALL-E*, отмечаются значком *DE*.
* Изображения, созданные через *Stable Diffusion*, отмечаются значком *SD*.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.it-marketplace.ru/ai-premium/integraciya-ii-provaiderov/podklyuchenie-stable-diffusion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
