sd-webui-controlnet icon indicating copy to clipboard operation
sd-webui-controlnet copied to clipboard

[Bug]: mlsd module does not work using Automatic1111 and posting to /controlnet/detect API

Open frafdez opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

Using Automatic1111's API, I can't get the mid mask using controlnet/detect. I get an "info" "Success" with a black image. If I try using another module like canny or hed, everything works fine. If I use msd from the webui, it's fine too. Only using the API do I run into the problem. This was tested on Ubuntu 22.04

Steps to reproduce the problem

  1. Launch Automatic1111 webui.sh --api
  2. Navigate to: http://127.0.0.1:7860/docs
  3. Expand the /controlnet/detect accoridan and fill in the json object and make sure your controlnet_module is set to mlsd
  4. Click on Execute
  5. You'll find that it will succeed and the returned image will be solid black.
  6. Try it again with canny, you'll see that it will succeed and the mask will be correct for canny.

What should have happened?

I should have receved the mlsd mask as I do when I run webui.sh without the --api argument and use the UI.

Commit where the problem happens

webui: master/0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 controlnet: main/e5ed9fccdc4fbbe5ec4aae134371683528f7bd60

What browsers do you use to access the UI ?

Google Chrome, Apple Safari

Command Line Arguments

. webui.sh --app

Console logs

There are not console logs but here is the response:

{
  "images": [
    "iVBORw0KGgoAAAANSUhEUgAAAsAAAAIACAAAAACprIWHAAABdElEQVR4nO3BMQEAAADCoPVP7W8GoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAN4JLAAGBmhxGAAAAAElFTkSuQmCC"
  ],
  "info": "Success"
}

Additional information

No response

frafdez avatar Mar 11 '23 00:03 frafdez

Try setting controlnet_threshold_a = 0 and controlnet_threshold_a = 0. I think that they are 64 by default which does result in a black image.

kft334 avatar Mar 11 '23 05:03 kft334

Try setting controlnet_threshold_a = 0 and controlnet_threshold_a = 0. I think that they are 64 by default which does result in a black image.

Thanks, that worked! Sorry for the trouble.

frafdez avatar Mar 11 '23 13:03 frafdez

@kft334 I tried setting the thresh_a = 0 and thresh_b=0 once and both as 0.1 another time. But in both cases it was not following the mlsd detected lines

HG2407 avatar Dec 26 '23 11:12 HG2407