# Using Stable-diffusion

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

{% hint style="info" %} <mark style="color:red;">What is</mark> <mark style="color:red;"></mark><mark style="color:red;">**Stable Diffusion**</mark><mark style="color:red;">?</mark>

It's an image generation model based on deep learning technology.&#x20;

You can generate various images based on the given prompts and settings.
{% endhint %}

**What can you do with Stable Diffusion?**

✔️Generate high-quality images that are difficult to distinguish from reality.

✔️Create new images based on real images.

✔️Use your imagination to generate new images.

**Try Stable Diffusion now using the&#x20;**<mark style="background-color:yellow;">**template feature**</mark>**&#x20;provided by Runyour AI!**

***

## Step 1. Machine Rental / Template Selection&#x20;

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

* When you select your desired machine from the GPU Cloud list, you will proceed to the template selection step. \
  Choose the <mark style="background-color:yellow;">**Stable Diffusion**</mark> template and click the rent button at the top.
* You can view the rented machine on <mark style="background-color:yellow;">My Page > Dashboard</mark>.

## Step 2. Access to WebUI

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

* If you click on the rented machine, you can check the SSH / Web UI access function and the PEM key download function.

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

* Click the SSH / WEB button among the two buttons.

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

* Among the two access methods, click the 'HTTP' > 'Stable Diffusion Web' button to access the Web UI directly.

<figure><img src="/files/WdZM0MbS22ZtWZpn0YGB" alt=""><figcaption><p>Stable diffusion Web UI Screen</p></figcaption></figure>

{% hint style="info" %}
Please refer to the '[Remote Access via SSH](/eng-runyourai/tutorial/remote-access-via-ssh-common.md)' about the SSH access
{% endhint %}

* Access method differs by the user's OS, you can access referring to the following:

> 1\) In case of <mark style="color:red;">**Mac OS,**</mark> run the **Terminal**
>
> 2\) In case of <mark style="color:red;">**Window OS**</mark>, run the **CMD, Powershell or other terminal program.**

## Step 3. Run Stable Diffusion WebUI

### Utilize 'txt2img' feature

Let's generate an image using the prominent feature 'txt2img'.

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

<mark style="color:red;">**1) Enter instructions for generating the image in the Prompt.**</mark>&#x20;

For stable-diffusion-webui, it runs on port 7860 on the respective machine.

```
Prompt Example

A magical forest with glowing trees, ethereal creatures, sparkling fairy lights, and a misty atmosphere.
```

<mark style="color:red;">**2) In the Negative prompt, list elements that should be excluded from the image.**</mark>

```
Negative Prompt Example

Modern buildings, cars, dark shadows, blurry details, dull colors.
```

<mark style="color:red;">**3) Review detailed settings under Generation and click the Generate button at the top right to create the image.**</mark>

<figure><img src="/files/1gyT2dwknZtKVNXQMxbg" alt=""><figcaption></figcaption></figure>


---

# 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://runyourai.gitbook.io/eng-runyourai/tutorial/using-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.
