Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Automatic1111 to 1.5.1 in Dockerfile, install generative-models to add compatibility for SDXL #560

Merged
merged 3 commits into from
Jul 30, 2023

Conversation

mashb1t
Copy link
Contributor

@mashb1t mashb1t commented Jul 27, 2023

@mashb1t
Copy link
Contributor Author

mashb1t commented Jul 27, 2023

there still seems to be an issue with accelerate, but it seems to run fine after it automatically restarts once after the error.

2023-07-27 20:33:05 [notice] To update, run: pip install --upgrade pip
2023-07-27 20:33:06 /stable-diffusion-webui
2023-07-27 20:33:07 Traceback (most recent call last):
2023-07-27 20:33:07 File "/stable-diffusion-webui/webui.py", line 39, in
2023-07-27 20:33:07 import pytorch_lightning # noqa: F401 # pytorch_lightning should be imported after torch, but it re-enables warnings on import so import once to disable them
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/pytorch_lightning/init.py", line 35, in
2023-07-27 20:33:07 from pytorch_lightning.callbacks import Callback # noqa: E402
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/pytorch_lightning/callbacks/init.py", line 14, in
2023-07-27 20:33:07 from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/pytorch_lightning/callbacks/batch_size_finder.py", line 24, in
2023-07-27 20:33:07 from pytorch_lightning.callbacks.callback import Callback
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/pytorch_lightning/callbacks/callback.py", line 25, in
2023-07-27 20:33:07 from pytorch_lightning.utilities.types import STEP_OUTPUT
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/pytorch_lightning/utilities/types.py", line 27, in
2023-07-27 20:33:07 from torchmetrics import Metric
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/torchmetrics/init.py", line 14, in
2023-07-27 20:33:07 from torchmetrics import functional # noqa: E402
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/torchmetrics/functional/init.py", line 82, in
2023-07-27 20:33:07 from torchmetrics.functional.text.bleu import bleu_score
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/torchmetrics/functional/text/init.py", line 30, in
2023-07-27 20:33:07 from torchmetrics.functional.text.bert import bert_score # noqa: F401
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/torchmetrics/functional/text/bert.py", line 24, in
2023-07-27 20:33:07 from torchmetrics.functional.text.helper_embedding_metric import (
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/torchmetrics/functional/text/helper_embedding_metric.py", line 26, in
2023-07-27 20:33:07 from transformers import AutoModelForMaskedLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizerBase
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/transformers/init.py", line 26, in
2023-07-27 20:33:07 from . import dependency_versions_check
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/transformers/dependency_versions_check.py", line 57, in
2023-07-27 20:33:07 require_version_core(deps[pkg])
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/transformers/utils/versions.py", line 117, in require_version_core
2023-07-27 20:33:07 return require_version(requirement, hint)
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/transformers/utils/versions.py", line 111, in require_version
2023-07-27 20:33:07 _compare_versions(op, got_ver, want_ver, requirement, pkg, hint)
2023-07-27 20:33:07 File "/usr/local/lib/python3.10/site-packages/transformers/utils/versions.py", line 44, in _compare_versions
2023-07-27 20:33:07 raise ImportError(
2023-07-27 20:33:07 ImportError: accelerate>=0.20.3 is required for a normal functioning of this module, but found accelerate==0.18.0.
2023-07-27 20:33:07 Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main

@cloudaxes
Copy link
Contributor

Looks like stable-diffusion-webui requires accelerate==0.18.0 (https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/68f336bd994bed5442ad95bad6b6ad5564a5409a/requirements_versions.txt#L3C1) and transformers requires accelerate>=0.20.3 (https://github.com/huggingface/transformers/blob/05cda5df3405e6a2ee4ecf8f7e1b2300ebda472e/setup.py#L101).

This issue should probably be kicked upstairs to Automatic1111, so he can update his accelerate version. I'm surprised no one there has mentioned it. For what it's worth, I ran your commit, and I did not experience this error.

@cloudaxes
Copy link
Contributor

Oh ... Stable-Diffusion-Webui requires transformers v4.25.1 which in turn only needs accelerate>=0.10.0 (https://github.com/huggingface/transformers/blob/31d452c68b34c2567b62924ee0df40a83cbc52d5/setup.py#L100) This wouldn't be the source of the conflict. @mashb1t, is it possible the error you experienced came from one of your extensions requiring the accelerate?

@AbdBarho
Copy link
Owner

AbdBarho commented Jul 30, 2023

thank you, I will download and test these now.

what are the GPU requirements?

we can hard-code a version of accelerate in the docker container for now, that's fine. (Unless it is some extension)

@mashb1t
Copy link
Contributor Author

mashb1t commented Jul 30, 2023

I already tested it with no extensions enabled and also no extensions in the folder at all due to the error only appearing on first container start and installation, not restarts after it has started once.
Turned out that this was an issue with my docker image, running docker compose --profile auto build again fixed it.
It's hard to pinpoint where exactly the issue was caused as i didn't change any commit hashes, but maybe a library in the background somehow changed their requirements, can't tell.

@cloudaxes thank you for testing and providing feedback!
@AbdBarho i don't see a need to pin the accelerate version as it most likely was a local issue of mine.

@mashb1t
Copy link
Contributor Author

mashb1t commented Jul 30, 2023

what are the GPU requirements?

@AbdBarho SDXL recommended GPU VRAM is 8GB if that's what you asked for.

"SDXL 1.0 should work effectively on consumer GPUs with 8GB VRAM"
source: https://stability.ai/blog/stable-diffusion-sdxl-1-announcement

@AbdBarho
Copy link
Owner

AbdBarho commented Jul 30, 2023

Tested and it worked locally with the base model on a 6GB 1060 with --medvram.

Gonna merge and create a new release

Thanks @mashb1t!

@xwings
Copy link

xwings commented Jul 30, 2023

i tried install and add new extension. it seems like we need pip3 install gradio_client==0.2.7

@AbdBarho
Copy link
Owner

@xwings which extension? this is maybe an extension problem?

@xwings
Copy link

xwings commented Jul 30, 2023

@xwings which extension? this is maybe an extension problem?

i was referering to, when you click on the extenstion tab. it did not show the installed component and nothing work in the extension tab

after fix the gradio_client version. it work now

@AbdBarho
Copy link
Owner

hmmm, weird, I did not have this problem at all.

@AbdBarho AbdBarho merged commit def7629 into AbdBarho:master Jul 30, 2023
sf666 added a commit to sf666/sd that referenced this pull request Aug 7, 2023
* Abd_master:
  Update Automatic1111 to 1.5.1 to add compatibility for SDXL (AbdBarho#560)
  Add startup script for comfy (AbdBarho#552)
  Upgrade k-diffusion to Release 0.0.15 to get access to DPM++ (2M) SDE sampler. (AbdBarho#537)
GuillaumePugnet added a commit to GuillaumePugnet/stable-diffusion-webui-docker that referenced this pull request Aug 10, 2023
Update Automatic1111 to 1.5.1 to add compatibility for SDXL (AbdBarho#560)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants