> For the complete documentation index, see [llms.txt](https://sogni.gitbook.io/sogni-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sogni.gitbook.io/sogni-docs/sogni-studio/creating-images/generation-settings/controlnet/preprocessors.md).

# Preprocessors

Positioned to the left of the image or video you have uploaded within the ControlNet field as shown above, you can see a selection of icons.

You can select from these to preprocess your image before selecting your ControlNet model.

The preprocessor you use will depend on the image or video you're working with and what you're trying to achieve.

### **Face Capture**

<div align="left"><figure><img src="/files/OnHKI18UnKGe4TQNLeYV" alt="" width="55"><figcaption></figcaption></figure></div>

Locates all faces in the input image, analyzes each face to detect facial features, and generates a facial landmarks map that can be used in conjunction with the OpenPose CN-model. This provides you with the ability to transfer facial expressions from one image to another. The Face Capture and Pose Capture preprocessors can be used simultaneously.

| Image within ControlNet                                             | After Face Capture Preprocessor                                     |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| <img src="/files/NVX3NcZ2O33a1tN4sZWE" alt="" data-size="original"> | <img src="/files/tojJ5eyCG7u7f8ar8aCF" alt="" data-size="original"> |

{% hint style="info" %}
By selecting Face Capture Preprocessor and then within the CN (ControlNet) Model dropdown selecting OpenPose, you can use the face positioning of your ControlNet image within new creations.\
\
Note : Face Capture works for one or more faces
{% endhint %}

\
Example creations made using the Face Capture Preprocessor with the OpenPose ControlNet Model :&#x20;

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

***

### **Pose Capture**

<div align="left"><figure><img src="/files/BlAVimzrVpgqhzn2LwAb" alt="" width="55"><figcaption></figcaption></figure></div>

This module locates human subjects in the input image, analyzes each one to capture their pose, and generates a 'bones-joints' type map that can be used in combination with the OpenPose CN-model. \
\
This gives you the ability to control the pose of subjects in your generated images.<br>

| Image within ControlNet                                             | Add Pose Capture Preprocessor                                       |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| <img src="/files/5ey4RqbjTLfZ7GjdHC4S" alt="" data-size="original"> | <img src="/files/faYIDqFkbk8vuCeZRFW1" alt="" data-size="original"> |

{% hint style="info" %}
By selecting Pose Capture Preprocessor and then within the CN (ControlNet) Model dropdown selecting OpenPose, you can use the pose positioning of your ControlNet image within new creations.
{% endhint %}

Example creations made using the Pose Capture Preprocessor with the OpenPose ControlNet Model :&#x20;

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

***

### **Sketch/Outline**

<div align="left"><figure><img src="/files/yah3Pl4x7579xsadp6Np" alt="" width="55"><figcaption></figcaption></figure></div>

Creates a sketch-style image from the reference image with the help of an AI model.

| Image within ControlNet                                             | Add Sketch/Outline Preprocessor                                     |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| <img src="/files/Tp0ofbwkfeS7OxGnjjNL" alt="" data-size="original"> | <img src="/files/33J9DTkaBel5HYwUlcRN" alt="" data-size="original"> |

{% hint style="info" %}
For the best results, it's recommended to invert the colours to be black with white lines. As shown in screen recording below 👇
{% endhint %}

<div align="left" data-full-width="false"><figure><img src="/files/Pm9MsF6IHTLmIvsdajLU" alt="" width="476"><figcaption></figcaption></figure></div>

For reference images with the Sketch Preprocessor applied, the following ControlNet Models work best: **Depth, LineArt, LineArt Anime, M-LSD, Normal Bae, Scribble, Segmentation & SoftEdge.**

Example creations made using the Sketch/Outline Preprocessor with the M-LSD ControlNet Model :&#x20;

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

***

### **Depth Map**

<div align="left"><figure><img src="/files/mDzpOJPKQ2vBFkVQmnzo" alt="" width="55"><figcaption></figcaption></figure></div>

Utilizes the MiDaS Depth model to generate a depth-map from the reference image.

<div align="left"><figure><img src="/files/B7uwsmkJyqK9ULjh01Pw" alt="" width="476"><figcaption></figcaption></figure></div>

\
For best results when using the Depth Map preprocessor, select the Depth ControlNet Model from the CN Model Dropdown\
\
Example creations made using the Depth Map Preprocessor with the Depth ControlNet Model : <br>

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

***

### **Segmentation**

<div align="left"><figure><img src="/files/aDwN9JvObiNlc3HXDfdv" alt="" width="55"><figcaption></figcaption></figure></div>

Utilizes the IS-Net and U2Net Segmentation models to generate a segmentation map from the reference image based on its distinct areas and subjects. \
\
When you select the Segmentation preprocessor, you also have the option to mask only subjects or backgrounds.&#x20;

<div align="left"><figure><img src="/files/2FuZBJ44xsyh56f4gxiW" alt="" width="474"><figcaption></figcaption></figure></div>

\
**Using Segmentation with Subject Only Mask**\
\
This allows you to take the subject of the reference image, use it as a reference and have full control over the background or environment.

<div align="left"><figure><img src="/files/sONKlb5fDnz7UeQIjxDM" alt="" width="314"><figcaption></figcaption></figure></div>

Example creations made using the Segmentation Preprocessor with Subject Only Mask, along with the Segmentation ControlNet Model :&#x20;

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

\
\
**Using Segmentation with Background Only Mask**\
\
This allows you to have full control over the contents of the Subject whilst maintaining strong references from the contents of the background.

<div align="left"><figure><img src="/files/F3WPSWh9ryEOzLjt9HkL" alt="" width="314"><figcaption></figcaption></figure></div>

Example creations made using the Segmentation Preprocessor with Background Only Mask, along with the Segmentation ControlNet Model :&#x20;

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

***

### Invert Colors

<div align="left"><figure><img src="/files/YAYg1sT0SLAeIuKawT3P" alt="" width="55"><figcaption></figcaption></figure></div>

Use this preprocessor to invert the colours of your active image (original, depth map, sketch etc)

<div align="left"><figure><img src="/files/fkX2DMV5CNOBAZGGC0aE" alt="" width="474"><figcaption></figcaption></figure></div>

## Next Step : ControlNet Models

Now we've got the hang of preprocessors, let's learn about each ControlNet model that's available at a click of a button within Sogni 👇

{% embed url="<https://docs.sogni.ai/basics/controlnet/controlnet-models>" %}

***

**Need help? Ask in our Discord!**

For any questions regarding the use of Sogni, tips, suggestions, bugs, sharing art, discussing AI and life, or simply hanging out... Join our Discord community!\
\
[Join Sogni Discord](https://discord.com/invite/2JjzA2zrrc) ✨<br>


---

# 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:

```
GET https://sogni.gitbook.io/sogni-docs/sogni-studio/creating-images/generation-settings/controlnet/preprocessors.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.
