ControlNet configuration: Multiple combinations, automatic saving of features, etc

The ControlNet default settings are intentionally designed to be user-friendly. However, there are a number of advantageous settings that are frequently neglected by users. This article will provide a comprehensive explanation of these settings.

Multi-ControlNet: Utilizing Multiple ControlNet Models

What is Multi-ControlNet?

Multi-ControlNet is a functionality that allows you to utilize multiple ControlNet functions concurrently, such as OpenPose or reference only. This feature enables you to retain certain attributes while altering desired ones, resulting in the generation of images with diverse combinations of features.

What can you achieve with Multi-ControlNet?

Here are some specific examples of what you can accomplish with Multi-ControlNet:

  1. Maintain facial expression and clothing using reference only while modifying the pose with OpenPose.
  2. Preserve the face using reference only and change the facial expression using ControlNet inpaint.
  3. Control the entire body with OpenPose while employing Depth to manipulate hand shapes.

These are just a couple of simplified examples, but you can utilize as many ControlNet models as your PC’s specifications permit. However, in practical terms, setting up around three models should suffice.

How to set up Multi-ControlNet

  1. Go to the Settings tab.
  2. Select ControlNet from the sidebar.
  3. Choose the number of models you wish to use for Multi-ControlNet, using the “Multi-ControlNet” option (number of available models) and the “Model cache size” option (number of cached models).
  4. Click on Apply settings to implement the changes.
  5. Restart the Stable Diffusion Web UI.

After restarting, when you access the ControlNet menu on the homepage (txt2img), you will notice that the designated number of tabs has been added. Each tab functions similarly to a regular ControlNet, allowing you to apply as many ControlNet models as you have specified.

I would like to enable automatic saving of the extracted feature maps in ControlNet.

To save the extracted feature maps (such as pose, depth, etc.) automatically, please follow these instructions. This setup will allow you to easily reuse your favorite feature maps.

  1. Go to the “Setting” tab.
  2. Click on “ControlNet” in the sidebar.
  3. Specify the name of the destination folder. The default name is “detected_maps”. The path is output/txt2img/folder_name/OpenPose_XX/date.
  4. Enable the “Allow detectmap auto saving” option.
  5. Apply the settings by clicking on the “Apply” button.

Timing of feature image saving: Please note that feature images are not saved solely by extracting features.

The feature images are saved when an image is generated based on the feature map. They are not saved when the feature extraction button “💥” is clicked.

Other Setting Descriptions

In addition to the recommended settings, we will provide an overview of other settings available:

Extra Path for ControlNet Model Scanning (e.g. Training Output Directory): Use this setting to add additional paths for ControlNet model scanning.

Path to Directory Containing Annotator Model Directories (requires restart, overrides corresponding command line flag): Specify the path to the directory where feature extraction models used in preprocessors are stored. Leaving it blank is acceptable.

ControlNet Inpainting Gaussian Blur Sigma: This parameter determines the strength of the blur when using ControlNet for inpainting. The default value of 7 is generally sufficient, but you can decrease it to weaken the effect of ControlNet Inpaint, or increase it for a stronger effect.

Disable ControlNet during Highres Fix: Select this option if you do not want to apply highres fix when utilizing ControlNet.

Exclude Detectmap in Output: Check this box if you do not want to display the feature extraction image in the resulting output.

Enable External Script Control for this Extension: Check this box to enable scripting capabilities for ControlNet extensions. Some notable examples include ControlNet M2M.

Include ControlNet Parameters in Infotext: Check this box to include ControlNet information in the generated output displayed in txt2img and other processes. It is a matter of preference, but it is harmless to check.

Display Batch Images in Gradio Gallery Output: Gradio Gallery is the underlying UI framework for Stable Diffusion WebUI. Tick this box to show batch images during image generation.

Increment Seed after each ControlNet Batch Iteration: This setting allows for changing the seed value inside ControlNet when generating multiple images in batches using ControlNet. Since there is randomness in txt2img and img2img, there is little benefit in enabling this option, so it is safe to leave it unchecked.

Disable Control Type Selection: Choose whether to remove the Control Type field. Generally, there is no need to remove it as it provides convenience.

Disable OpenPose Edit: By adding an extension, you can modify the stick figure extracted by OpenPose from txt2img. This setting determines whether to remove the button for that feature. There is no specific reason to remove it, so it is recommended to keep it.

Ignore ControlNet Input Image Mask if Control Type is not Inpaint: This setting determines whether to ignore the mask in ControlNet when not using inpaint. In addition to inpainting, masks can also be applied. However, unintentional application of masks may occur frequently, and this setting allows you to ignore them. There may also be instances where you apply inpainting and then switch to another function, but the mask remains. If removing the mask in such cases is troublesome, it is recommended to enable this option.

コメント