Prerequisites
First, install Stable Diffusion WebUI.
Then, open GitHub
: https://github.com/Mikubill/sd-webui-controlnet.
Click the Extensions tab in Stable Diffusion WebUI
, select “Install from URL,” enter the GitHub URL, and click “Install. “
After installation, it’s recommended to restart Stable Diffusion WebUI.
Installing the ControlNet extension alone isn’t enough; you also need to download the corresponding model.
Model address:
https://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main
. After downloading the model, place the model files (.pth and .yaml) in the extensions\sd-webui-controlnet\models folder.
The extensions folder is located in the root directory of stable-diffusion-webui.
Then, restart Stable Diffusion WebUI again.
Image converted to line art
Text-based image mode
- model:
txt2img - Sampler (Sampling method):
DPM++ 2M - Schedule type:
Karras - Number of sampling steps:
20 - CFG Scale:
7 - Width:
832 - Height:
576 - Batch count:
1 - Batch size:
1 - Seed:
-1(Random)
Prompt
line art, clean outlines, white background, black ink, no color, pencil sketch style <lora:Sketch_20230919203655:1>
Negative Prompt
colored, shading, gray, background, messy lines, noise
illustrate:
- This combination of prompts is used to generate clean, shadow-free line art.
Sketch_20230919203655It’s a line art enhancement LoRA that improves the clarity of black lines.
ControlNet settings
ControlNet Unit 0
- Enabled : Enabled
- Low VRAM : Not enabled (recommended to be disabled for higher quality).
- Pixel Perfect : Enabled (automatically matches resolution aspect ratio)
- Control Type:
Lineart - Preprocessor:
lineart_coarse - Model:
control_v11p_sd15_lineart [43d4be0d] - Control Weight:
1 - Starting Control Step:
0 - Ending Control Step:
1 - Control Mode:
Balanced - Resize Mode:
Just Resize - Script:
None
If the generated lines are inverted (white lines on a black background), do not check “invert”.If you input an original image with a white background and black lines, ControlNet will prompt:”Set the preprocessor to [invert] If your image has a white background and black lines.”You can ignore this (keep the option unchecked) to output white lines on a black background.
Other notes
- Lora :
Sketch_20230919203655
Recommended weight0.7~1.0; the higher the weight, the more pronounced the lines. - Model combination : DreamShaper + Lineart ControlNet + Sketch LoRA
is a classic combination for generating “line art/sketch style”.
The red box indicates the Lora model related to sketches or line art.
The key to converting an original photo into line art is Lora.
Special Note
Upload the original image you want to convert in the ControlNet area
. Click the exploded button next to Preprocessor to view the preview.
Click the arrow in the upper right corner of Allow Preview to synchronize the image size to the text-to-image configuration (so you don’t have to change the image size yourself).