# モデル/LoRAの差し替え

作成したい絵柄を出力するために任意のモデルやLoRAを適用することが出来るようになっています。

## モデルLoRAの準備

※LoRAなどモデルの学習に許諾のない他人の画像を利用するなどの行為は規制が追い付いていない領域です。運営は一切の責任を負いません。クリエイター同士敬意を持って人の権利を侵害しないよう注意して使用してください。

自身の作成したい絵柄モデルを準備してください。ライセンスや著作権について十分ご注意ください

準備する方法としては

* 自身で学習する
* HuggingFaceなどで探す

などがあります。

Witchpotにて準備したLoRAのサンプルはこちらで配布しています

順次追加予定です。

{% embed url="<https://huggingface.co/Witchpot/icestage>" %}

現在Depth2ImgについてはControlNetを使っている影響でモデルがstable-diffusionの1.5系出ないと使用できません。

Text2Img, Image2Imageについては2.1系などでも使用可能です

## ファイルの配置

モデルやLoRAファイル(.ckpt, .safetensor)を用意したらそれぞれ下記のパスの下に配置してください

Unity上のメニューよりWitchpot > Utility > Open Installed Dir から、この親のパスをExplorerで開くことが出来ます

<div align="left"><figure><img src="/files/fpp3F7asldkCg8IgkQin" alt=""><figcaption></figcaption></figure></div>

<table><thead><tr><th width="107">対象</th><th>パス</th></tr></thead><tbody><tr><td>モデル</td><td><p><code>C:\Users\[User Name]\Witchpot\</code></p><p><code>StableDiffusion.WebUI@1.2.0\webui\models\Stable-diffusion</code></p></td></tr><tr><td>LoRA</td><td><p><code>C:\Users\[User Name]\Witchpot\</code></p><p><code>StableDiffusion.WebUI@1.2.0\webui\models\Lora</code></p></td></tr></tbody></table>

## Unity上でモデル/Loraを取得する

`Assets\Plugins\Witchpot\Packages\StableDiffusion\Runtime\Settings\StableDiffusionWebUISettings`

を開いて`ListModels`を押すと上記で配置したモデル・LoRAのリストを取得できます

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

ここで取得したリストが各Text2ImgWithControlNet.cs等の画像生成コンポーネントのModelやLoraで選択可能になります。

LoRAについては選択したLoRAがPromptに入力されることで反映されます。プルダウンで選択し続ける必要はありません

<figure><img src="/files/BbVhfvwZfvDWZDXn5kQm" 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://docs.witchpot.com/production/moderuloranoshie.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.
