sd-webui-controlnet/tests
Chenlei Hu 648025ba6b
Depth Anything V2 Support (#2977)
* Add depth_anything_v2.py

* Update preprocessor_compiled.py

Added depth_anything_v2 preprocessor

* Update processor.py

Added depth_anything_v2 preprocessor

* Update depth_test.py

Added depth_anything_v2 to general_depth_modules

* Update modules_test.py

Added depth_anything_v2 to expected_module_names & expected_module_alias

* Update install.py

Added depth_anything_v2 to install.py

* Update README.md

* Fix model URL

---------

Co-authored-by: Mackinations.Ai <133395980+MackinationsAi@users.noreply.github.com>
2024-07-03 13:28:40 -04:00
..
annotator_tests/openpose_tests Add Animal Pose Preprocessor (RTMPose AP-10K) (#2293) 2023-12-23 15:55:21 -05:00
cn_script Validate ControlNetUnit using pydantic (#2847) 2024-05-06 15:40:34 -04:00
external_code_api Validate ControlNetUnit using pydantic (#2847) 2024-05-06 15:40:34 -04:00
images Add effective_region_mask for ipadapter [API] (#2785) 2024-04-26 23:24:23 -04:00
web_api Depth Anything V2 Support (#2977) 2024-07-03 13:28:40 -04:00
README.md 🔧 Support SDXL in tests (#2254) 2023-11-12 14:12:54 -05:00
conftest.py Migrate detect_test and improve coverage (#2715) 2024-03-30 15:33:57 -04:00
utils.py 🐛 Handle None controlnet model in version check (#2272) 2023-11-19 23:51:39 -05:00

README.md

Tests

There are 2 types of tests:

  • unittest: backend based tests that directly import A1111 shared modules
  • api test: test functionality through A1111 web API

Run tests locally

Make sure the current working directory is A1111 root.

Install test dependencies

pip install -r requirements-test.txt

Start test server

python -m coverage run
          --data-file=.coverage.server
          launch.py
          --skip-prepare-environment
          --skip-torch-cuda-test
          --test-server
          --do-not-download-clip
          --no-half
          --disable-opt-split-attention
          --use-cpu all
          --api-server-stop

Setting environment variables

Setting CONTROLNET_TEST_SD_VERSION for stable diffusion model family used during testing.

  • 1 for SD1.x
  • 2 for SD2.x
  • 3 for SDXL

Run test

python -m pytest -vv --junitxml=test/results.xml --cov ./extensions/sd-webui-controlnet --cov-report=xml --verify-base-url ./extensions/sd-webui-controlnet/tests

Check code coverage

Text report

python -m coverage report -i

HTML report

python -m coverage html -i