# はじめに

## stable-diffusion-for-unityで出来ること

現在(2023年4月時点) stable-diffusion-for-unityでは

* 画像生成AI（StableDiffusion）による画像アセットの生成

が出来ます。

<div><figure><img src="/files/hfTrbi8vateUJvtYOaAP" alt=""><figcaption></figcaption></figure> <figure><img src="/files/g8cq01z0uwgxGHoctDuL" alt=""><figcaption></figcaption></figure></div>

下記のコンポーネントを用意しておりタイトルから各要素の使い方を確認可能です。

<table><thead><tr><th width="169.33333333333331">タイトル</th><th width="359">概要</th><th>コンポーネント名</th></tr></thead><tbody><tr><td><a href="/pages/UcEiWFRGeJRuFhPCTpcF">Text to Image</a></td><td>テキストプロンプトのみによる画像生成</td><td>Text2Img.cs</td></tr><tr><td><a href="/pages/LnoZYzZEHRc0joLdSMmJ">Image to Image</a></td><td>画像またはUnity内のカメラ情情報を元とした画像生成</td><td>Img2Img.cs</td></tr><tr><td><a href="/pages/riVo8g0CCBfqDyCEy6EW">Depth to Image</a></td><td>Unity内カメラから取得したDepthを用いた画像生成</td><td>Depth2Img.cs</td></tr></tbody></table>

これらの機能を学習済みモデルを切替えることで一貫性をもった生成が出来るようになっています。

## 推奨環境

下記環境にて動作確認を行っています。機能によって必用スペックが異なります。

* OS: Windows
* VRAM: 8GB以上
* Unityバージョン: Unity2021.3.18f1\~ Unity2021台 ※2022以降でURP対応未確認
  * レンダーパイプライン：URP

## システム構成とOSSについて

本システムでは Stable Diffusion web UI を[フォークしたリポジトリ](https://github.com/witchpot-studio/stable-diffusion-webui)のコードをインストールして利用しています。この部分について改変等を行う場合は GPL v3ライセンスを適用してください。

また本プロジェクトのメインであるstable-diffusion-for-unityのリポジトリについてはAPI通信により通信を行っておりMITライセンスで利用可能です。


---

# 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.witchpot.com/settoappu/hajimeni.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.
