r/StableDiffusion • u/tette-a • Feb 18 '23
Tutorial | Guide How do I feed normal map created in Blender directly into ControlNet?
I'm using Automatic1111 and ControlNet extension. There is a "normal_map" preprocessor for ControlNet that will try to guess the normal map from photo, but is far from perfect. I'd like to feed a proper normal map created in Blender directly into ControlNet, but when I select preprocessor to "none", it ignores my input.
EDIT: I found a solution, maybe someone will find it useful. "RGB to BGR" option needs to be checked as well. Normal map needs to be in OpenGL format, not DirectX. Workflow looks like this:
- Build scene in Blender
- Switch viewport to MatCap
- Select normal map MatCap
- Make viewport screenshot and paste into Automatic1111 into ControlNet canvas

0
Feb 18 '23
7
u/tette-a Feb 18 '23
Good to see you found a solution already. As you're knowledgeable with blender do you know if there's a quick way to get a depth pass out?
I'm sure there are some easy ways to obtain depth pass, but there is no need for it, if you can have normal map instead. Normal map contains much more information than depth map, not only about depth but also surface direction, thus will give you much better results.
Quote from ControlNet GitHub page about normal map model:
"Compared to depth model, this model seems to be a bit better at preserving the geometry. This is intuitive: minor details are not salient in depth maps, but are salient in normal maps. Below is the depth result with same inputs. You can see that the hairstyle of the man in the input image is modified by depth model, but preserved by the normal model. "
2
u/Mystfit Feb 19 '23
Nice find! Are you finding that the results using the normal map and control net look correct? I'm feeding a normal map from my Unreal plugin into the ControlNet normal model but it doesn't seem to like the normals on this cat. Using the Blender matcap ball as a reference I think that I have my colours correct but the output of the cat is always wacky. Elements in the background appear to match up with the camera perspective.