stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Minor fix

Open Sakura-Luna opened this issue 1 year ago • 5 comments

This PR tries to close https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/10331

Sakura-Luna avatar May 14 '23 14:05 Sakura-Luna

Changing --extra-index-url to --index-url makes the install fail for the first time user when it tries to find packages required by torch and fails because we only have nvidia-torch url available.

As for the question mark in image names, I'd rather remove the question mark than downgrade gradio for it.

AUTOMATIC1111 avatar May 14 '23 18:05 AUTOMATIC1111

In the previous pr, there was an example where extra-index-url did not work but index-url worked. But this is just consistent with the official one. image

Sakura-Luna avatar May 14 '23 18:05 Sakura-Luna

Well, I tried --index-url on an empty install and it failed for me.

AUTOMATIC1111 avatar May 14 '23 18:05 AUTOMATIC1111

Not sure what PyTorch does, both look like they only index pytorch.org.

Sakura-Luna avatar May 14 '23 19:05 Sakura-Luna

As for the question mark in image names, I'd rather remove the question mark than downgrade gradio for it.

I checked it and it has nothing to do with Gradio and WebUI, it's an environment related issue.

Sakura-Luna avatar May 15 '23 06:05 Sakura-Luna

All right. There is a problem. Tests here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/6b51cc7530dd70037681c108a65c55d52ed918ef/.github/workflows/run_tests.yaml#LL26C11-L26C64 install CPU torch using the same command. So if the command is changed in the way this PR is suggesting, test will fail. We can edit edit tests to explicitly specify the command there, but then we'd have to keep torch version updated in two places: in launch and in tests. So the question is, is this fix really useful?

AUTOMATIC1111 avatar May 17 '23 17:05 AUTOMATIC1111

Changes from: torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118")

to

torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118")

It does not work? Still has problem of "RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install."

hyuan-kamuda avatar May 18 '23 02:05 hyuan-kamuda

It does not work? Still has problem of "RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install."

Try using the --reinstall-torch parameter, or remove venv.

Sakura-Luna avatar May 18 '23 02:05 Sakura-Luna

It does not work? Still has problem of "RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install."

Try using the --reinstall-torch parameter, or remove venv.

I moved old venv to "venvback" , and re-run .webui.sh (with modified launch.py as above suggested) , it will re-install venv, just got same result of "RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install."

hyuan-kamuda avatar May 18 '23 03:05 hyuan-kamuda

What are your startup parameters?

Sakura-Luna avatar May 18 '23 03:05 Sakura-Luna

What are your startup parameters?

Launching Web UI with arguments: --xformers --share --enable-insecure-extension-access --listen

hyuan-kamuda avatar May 18 '23 03:05 hyuan-kamuda

Try removing --xformers and remove venv, does it work?

Sakura-Luna avatar May 18 '23 03:05 Sakura-Luna

Try removing --xformers and remove venv, does it work?

Try removing --xformers and remove venv, does it work?

yeah, it can work . will it work for later launch adding --xformers back?

hyuan-kamuda avatar May 18 '23 04:05 hyuan-kamuda

yeah, it can work . will it work for later launch adding --xformers back?

This is caused by the incompatibility of xformers with the current PyTorch.

Sakura-Luna avatar May 18 '23 04:05 Sakura-Luna

To fix this, xformers needs to be upgraded to 0.0.20.dev539.

Sakura-Luna avatar May 18 '23 04:05 Sakura-Luna

To fix this, xformers needs to be upgraded to 0.0.20.dev539.

I see, thanks lot for explains!

hyuan-kamuda avatar May 18 '23 04:05 hyuan-kamuda

To fix this, xformers needs to be upgraded to 0.0.20.dev539.

I have xformers 0.0.17 as specified by repo and it works out of the box with no problems. Is this linux specific?

AUTOMATIC1111 avatar May 18 '23 05:05 AUTOMATIC1111

xformers did not update CI to PyTorch 2.0.1 until today. https://github.com/facebookresearch/xformers/commit/a721581f01812eae2f184238b072969b0e04110a

Sakura-Luna avatar May 18 '23 05:05 Sakura-Luna

At present, only dev539 should be effective, not sure if they update the old version.

Sakura-Luna avatar May 18 '23 05:05 Sakura-Luna

I noticed that Linux uses a different installation command, so the problem should only occur in Linux, and the solution is to modify the command. https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/9a9557ecfc824c4a005dc79466dba8f5884dbfb1/launch.py#L285-L295

Sakura-Luna avatar May 18 '23 09:05 Sakura-Luna

hi, I use the latest stable-diffusion-webui, and now I also encounter this error. how can i solve it image Whenever I encounter this error, I need to perform some steps to access the stable diffusion webui normally

  1. rm -rf venv/
  2. ./webui.sh I don't know what to do, please help me. Thanks @Sakura-Luna @AUTOMATIC1111

404-xianjin avatar May 26 '23 06:05 404-xianjin

hi, I use the latest stable-diffusion-webui, and now I also encounter this error. how can i solve it

master branch does not contain this fix, switch to dev or rc branch.

Sakura-Luna avatar May 26 '23 07:05 Sakura-Luna

image I checked the launch.py under stable diffusion and found that the command you modified is normally in this file. Even then, switch to dev or rc branch?

404-xianjin avatar May 26 '23 07:05 404-xianjin

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/96cba45d71cf25ab2f3bb7d7085347c8b6ef6d7d/launch.py#L296

You can clearly see that they are inconsistent, of course, you can also directly modify them to be the same, and then delete venv.

Sakura-Luna avatar May 26 '23 07:05 Sakura-Luna