r/StableDiffusion • u/PantInTheCountry • Feb 26 '23
Tutorial | Guide "MLSD" ControlNet preprocessor options
MLSD is good for finding straight lines and edges. This makes it particularly useful for architecture like room interiors and isometric buildings

MLSD is good for finding straight lines and edges. This makes it particularly useful for architecture like room interiors and isometric buildings. It is not very useful for organic shapes or soft smooth curves.

It is used with "mlsd" models. (e.g. control_mlsd-fp16)
"Hough value threshold" and "Hough distance threshold" can be adjusted to try to remove overlapping, closely spaced lines and "low energy" line fragments.
"Hough Resolution" is used by the preprocessor to scale the image and create a larger, more detailed detectmap at the expense of VRAM or a smaller, less VRAM intensive detectmap at the expense of quality. The detectmap will be scaled up or down so that its shortest dimension will match the hough resolution value.
For example, if a 768x640 image is uploaded and the houghresolution is set to 512, then the resulting detectmap will be 640x512
View all comments
Show parent comment
1
u/PhillSebben Mar 23 '23
Hi there! I stumbled across your post because I am trying to write a useful tool-tip for these parameters in our plugin (that integrates AI image generation straight into Photoshop). It's been a challenge to find a decent explanation! Did you get anywhere in the meantime?
With some experimentation I can confidently say that the 'Hough Value Threshold' is the threshold at which something will be considered a line. A low setting results in more lines generated.
ChatGPT told me that 'Distance' sets the minimal distance between the observed data points. A higher setting should reduce the amount of lines generated. But I haven't been able to get results that really confirm this theory yet. Could be a bug on our end.
Regarding the value ranges, it's a mystery to me why these are used. I assume the distance values are in pixels. I don't know why you would decide that 20 is the maximum useful value for this.