> For the complete documentation index, see [llms.txt](https://yunaeecy.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yunaeecy.gitbook.io/wiki/artificial-intelligence/stable-diffusion.md).

# Stable Diffusion

Stable Diffusion is an advanced AI text-to-image synthesis algorithm that can generate very coherent images based on a text prompt.

&#x20;It is commonly used for generating artistic images but can also generate images that look more like photos or sketches. Stable Diffusion is good at generating faces and realistic 3D scenes.

&#x20;It is also good at mashing up concepts to create entirely novel images.&#x20;

Stable Diffusion is entirely <mark style="color:red;">**open source**</mark>, and users can even train their own models based on their own dataset to get it to generate exactly the kind of images they want.

#### ControlNet

ControlNet is a <mark style="color:green;">**neural network architecture**</mark> designed to <mark style="color:green;">**manage diffusion models**</mark> by incorporating additional conditions. It duplicates the weights of neural network blocks into a "locked" copy and a "trainable" copy. The <mark style="color:green;">**"trainable" copy**</mark> learns the **desired condition,** while the <mark style="color:green;">**"locked" copy**</mark>**&#x20;preserves the original model**. This approach ensures that training with small datasets of image pairs does not compromise the integrity of production-ready diffusion models. The "zero convolution" is a 1×1 convolution with both weight and bias initialized to zero. Before training, all zero convolutions produce zero output, preventing any distortion caused by ControlNet. No layer is trained from scratch; the process is still fine-tuning, keeping the original model secure. This method enables training on small-scale or even personal devices.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://yunaeecy.gitbook.io/wiki/artificial-intelligence/stable-diffusion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
