stable-diffusion-webui
stable-diffusion-webui copied to clipboard
add --skip-torch-cuda-test to argparser
Describe what this pull request is trying to achieve
Allows other extensions to import modules.scripts
for example in extension-specific tests.
Additional notes and description of your changes
When trying to import modules.scripts
and modules.shared
(to name a few) inside the webui tests, the argument parser raises an error because it does not recognize the --skip-torch-cuda-test
argument. Adding this option to the argparser prevents the unintended unexpected-option error.
An alternative would be to set the IGNORE_CMD_ARGS_ERRORS
env var when running tests. I assume adding the argument to the argparser is a better solution, feel free to close this if we don't want --skip-torch-cuda-test
to be a public cli option.
Environment this was tested in
- OS: Windows
- Browser: Firefox
- Graphics card: NVIDIA RTX 3080 10GB
Screenshots or videos of your changes
See the failing pipeline in the controlnet extension: https://github.com/Mikubill/sd-webui-controlnet/actions/runs/4419188125/jobs/7747296275
This was encountered while trying to add more tests to the extension: https://github.com/Mikubill/sd-webui-controlnet/pull/587
Let me know if I should add more information.
just a note, I fixed the crashing in https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/8638 still it's best practice to add the arguments to argparse to avoid printing "unknown arg" to console. a1111 arg parsing is a strange like that :)
The only change that let the cn tests pass without setting IGNORE_CMD_ARGS_ERRORS
was the change in this PR. @hananbeer if you could add the --skip-torch-cuda-test
cli argument to the argparser in your PR we could centralize the argarser changes. Otherwise I'll keep this open.
I just wanted to add this one line, ended up refactoring the entire arg parser since it was messy.
https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/8638
this is now in as a result of command-line parser rework i did some time ago