Bing-su / adetailer

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

[Bug]: generate white image with directml + fp16 #722

Closed ChiaYen-Kan closed 10 hours ago

ChiaYen-Kan commented 14 hours ago

Describe the bug

i use SD.Next adetailer version is v24.8.0 when use directml + fp16 to fix face is generate white image but use directml + fp32 is ok i test the v24.9.0, but is also generate white image

Screenshots

fp16 fp16-20240917201107-ad-before fp16-20240917201107

fp32 fp32-20240917195751-ad-before fp32-20240917195752

Console logs, from start to end.

fp16 log fp16.txt

fp32 log fp32.txt

Platform:
cpu: AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD (amd ryzen 5 5600g without other gpu)
system: Windows
release: Windows-10-10.0.19045-SP0
python: 3.11.9
torch: 2.3.1
dosubot[bot] commented 14 hours ago

@ChiaYen-Kan Hello there! I'm here to help you with any bugs, questions, or contributions you may have. Let's work together to solve the issue you're facing.

The issue you're experiencing with generating white images when using DirectML with fp16 in the adetailer module is not documented in the repository. However, there are a few steps you can take to troubleshoot and potentially resolve this issue:

  1. Check for Updates: Ensure that both the adetailer module and the SD.Next framework are up-to-date. Sometimes, bugs are fixed in newer versions.

  2. Compare Logs: Examine the logs for both fp16 and fp32 to identify any differences or errors that might indicate why fp16 is failing. The logs you provided might contain useful information.

  3. Fallback to fp32: If fp16 is not critical for your use case, you might want to continue using fp32 as a temporary workaround.

  4. Report the Issue: Since this seems to be a bug, consider reporting it to the maintainers of the adetailer module with detailed logs and steps to reproduce the issue. This will help them investigate and potentially fix the problem in future releases.

Unfortunately, there is no specific documentation or known issues related to DirectML and fp16 in the adetailer module that could provide a direct solution to this problem [1][2].

To continue talking to Dosu, mention @dosu.

Bing-su commented 12 hours ago

Adetailer generates the mask, and requests inpainting back to the backend. These hardware-specific issues are specific to that backend, and not something I can fix.