Bing-su / adetailer

Auto detecting, masking and inpainting with detection model.
GNU Affero General Public License v3.0
4.08k stars 316 forks source link

[Bug]: Million faces, it's not working. #687

Closed AdamKnappZ closed 3 days ago

AdamKnappZ commented 3 weeks ago

Describe the bug

Hi! I'm using stable diffusion locally, i installed the extension and i dont know, but it's not working properly. I added a screenshot to the post so you can see what's going on.

Steps to reproduce

a

Screenshots

Captura de pantalla 2024-08-17 193723

Console logs, from start to end.

a

List of installed extensions

a

dosubot[bot] commented 3 weeks ago

Hey @AdamKnappZ! I'm here to assist you with any bugs, questions, or contributions you have. Let's squash those bugs together! 🐞

The issue with the "Million faces" extension for stable diffusion, as shown in the screenshot with multiple overlapping blue bounding boxes labeled "face," is likely due to the detection model's confidence threshold settings or the mask settings. Here are some adjustments you can make in ADetailer to address this:

  1. Increase the Detection Model Confidence Threshold: This ensures only high-confidence detections are used for inpainting.

    | Detection model confidence threshold | Only objects with a detection model confidence above this threshold are used for inpainting. |

    The default value is 0.3 [1].

  2. Adjust Mask Min/Max Ratio: Filter out smaller or larger detections that may not be relevant.

    | Mask min/max ratio | Only use masks whose area is between those ratios for the area of the entire image. |

    The default values are 0.0 for min and 1.0 for max [1].

  3. Limit the Number of Detected Faces: Use the "Mask only the top k largest" setting to reduce the number of overlapping bounding boxes.

    | Mask only the top k largest | Only use the k objects with the largest area of the bbox. | 0 to disable |

    The default value is 0 [1].

By fine-tuning these settings, you can reduce the number of overlapping bounding boxes and improve the accuracy of the face detection [2].

To continue talking to Dosu, mention @dosu.

solss-bit commented 3 weeks ago

After I updated pytorch to 2.4 12.4 cuda, I had this issue, went back to 2.3.1 12.1 and the issue went away.

Bing-su commented 3 weeks ago

This issue appears to be with pytorch 2.4.0 when inferencing with CPU.

https://github.com/ultralytics/ultralytics/issues/15049

Until 2.4.1 is released, please use version 2.3.1.