> For the complete documentation index, see [llms.txt](https://docs.witchpot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.witchpot.com/english/components/text-to-image-with-controlnet.md).

# Text to Image With ControlNet

Generate images based on depth or normal information obtained from the Unity camera

| Input                            | Depth                            | Normal                           |
| -------------------------------- | -------------------------------- | -------------------------------- |
| ![](/files/7MnTCGk4WvP7W8BaLAws) | ![](/files/uq9PYWav9nImi5VAhTMK) | ![](/files/II5an6MptgqIhihw8tSL) |

This makes it possible to use image generation in areas related to the game system where geometry is important.&#x20;

Note: ControlNet requires a large amount of VRAM. If you are unable to generate images due to insufficient VRAM, you may need to reduce the resolution.<br>

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

For generate image with Depth to Image, attach the Text2ImgWithControlNet.cs component to the object

Uncheck the CullingMask UI checkbox.&#x20;

If you do not do this, the UI element will also get the depth information of the nearest neighbor, so it will be affected by the following RawImage, etc.

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

It is assumed that the local server is up and running.&#x20;

Please refer to the following for StartServer before use.

{% content-ref url="/pages/lMqSgGDhqUVLFoLqfYMZ" %}
[About local server](/english/production-tips/about-local-server.md)
{% endcontent-ref %}

Set the base 3D models in the range of the camera

<figure><img src="/files/Ui80UINZYq6xp7S8BNHX" alt=""><figcaption><p>camera range</p></figcaption></figure>

<figure><img src="/files/OosyUG8Klx9E1Cnuetu8" alt=""><figcaption><p>place 3D model in the range of camera</p></figcaption></figure>

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

A parameter summary is shown below. Parameters that are adjusted frequently are bolded.

<table><thead><tr><th width="177">Parameter</th><th>Summary</th></tr></thead><tbody><tr><td><strong>Prompt</strong></td><td>Enter the words you want to generate in natural language</td></tr><tr><td><strong>NegativePrompt</strong></td><td>Input elements in natural language that you do not want to include in the generated image</td></tr><tr><td><strong>Size</strong></td><td>Width and hight of the generated image in pixels</td></tr><tr><td>Steps</td><td>Increase this parameter if the generated image looks blurry</td></tr><tr><td><strong>Cfg Scale</strong></td><td>Strength to follow prompts<br>Input larger value to strongly follow the prompt.</td></tr><tr><td>Seed</td><td><p>Fixing the seed value to generate a similar image</p><p>In case of -1, the image will be random</p></td></tr><tr><td><strong>Batch Count</strong></td><td><p>The number of images to be generated.</p><p>Select 1 to 100 images.</p><p>Generated images will be stored in StreamingAssets/StableDiffusion. Please check images by date sort in the explorer.</p></td></tr><tr><td><strong>Camera</strong></td><td>Set the camera with setting up for getting depth</td></tr><tr><td><strong>ControlType</strong></td><td>You can choose Depth or Normal</td></tr><tr><td><strong>Weight</strong></td><td>You can adjust the intensity of ControlNet's influence.</td></tr><tr><td>Sampler</td><td>Changing the nuances of the generated image</td></tr><tr><td><strong>Model</strong></td><td>Base trained model<br>See the "<a href="/pages/kXnr6Qlq0viYovRdupEd">Switch Models/LoRA</a>" to switch new model</td></tr><tr><td><strong>Lora</strong></td><td><p>Additional trained Lora to generate consitent specific pattern image</p><p>See the "<a href="/pages/kXnr6Qlq0viYovRdupEd">Switch Models/LoRA</a>" to switch new LoRA</p><p>If you select Lora, &#x3C;lora:filename:1>will be added to the Prompt and LoRA will be available</p></td></tr></tbody></table>
