I need help with a transformers error
Im trying to use the stable-diffusion webui with the dreambooth extension on my windows pc, but I keep getting this errorImportError:diffusersrequires transformers >= 4.25.1 to function correctly, but 4.21.0 was found in your environment. You can upgrade it with pip: 'pip install transformers --upgrade'but when I use thepip install transformers --upgradecommand, it says I already have version 4.25.1
2022-12-08T21:16:49Z
Same issue here. It seems it’s a bug or something.
2022-12-08T21:17:20Z
I have the same issue
2022-12-08T22:09:10Z
same here! Anyone found a solution? I’m on OSX M1
2022-12-08T22:37:49Z
I started having the same issue out of nowhere today as well. I have no clue what I’m doing though so I’m glad I’m not the only one experiencing this. Also my dreambooth extension no longer shows up as a result…is that everyone else’s issue also?
2022-12-08T23:05:57Z
Yeah, having the same. I tried to update the requirements.txt to reflect the higher version but it did not trigger an update when executing the bat…
2022-12-08T23:38:31Z
what version of diffusers is installed?  I had to downgrade to 0.9.0 to get my system working today.
2022-12-09T00:12:30Z
Here is the solution, until they’ll come up with some official one,it is very important to keep tabs consistent and the same!!!:Open launch.py with text editorfind this line and the next line:xformers = '--xformers' in sys.argv
ngrok = '--ngrok' in sys.argvadd this afterskipUpdate = '--skip' in sys.argvfind this line(skip to point 4 for full code)git_clone(stable_diffusion_repo, repo_dir('stable-diffusion-stability-ai'), "Stable Diffusion", stable_diffusion_commit_hash)add this before it:if not skipUpdate:find this:if update_check:
            version_check(commit)add after:else:
        print("Skipping updates...")you need to tab everything insidethe whole section will look like this (copy and replace this part):Full code after replacement, copy with spaces and tabs!if not skipUpdate:
        git_clone(stable_diffusion_repo, repo_dir('stable-diffusion-stability-ai'), "Stable Diffusion", stable_diffusion_commit_hash)
        git_clone(taming_transformers_repo, repo_dir('taming-transformers'), "Taming Transformers", taming_transformers_commit_hash)
        git_clone(k_diffusion_repo, repo_dir('k-diffusion'), "K-diffusion", k_diffusion_commit_hash)
        git_clone(codeformer_repo, repo_dir('CodeFormer'), "CodeFormer", codeformer_commit_hash)
        git_clone(blip_repo, repo_dir('BLIP'), "BLIP", blip_commit_hash)

        if not is_installed("lpips"):
            run_pip(f"install -r {os.path.join(repo_dir('CodeFormer'), 'requirements.txt')}", "requirements for CodeFormer")
        
        run_pip(f"install -r {requirements_file}", "requirements for Web UI")
        
        run_extensions_installers(settings_file=args.ui_settings_file)
        
        if update_check:
            version_check(commit)
    else:
        print("Skipping updates...")Open this file: modules/shared.py and find this line:parser.add_argument("--xformers", action='store_true', help="enable xformers for cross attention layers")add this line bellowparser.add_argument("--skip", action='store_true', help="skip updates")save everythingnow open up a cmd window in the stable-diffusion folder and typevenv\Scripts\activate.battype this command next:pip install transformers --upgradenow lunch webui.bat with argument --skip to skip updates (downgrades) to transformersIt will download some new weights (~2GB), not sure what module is updating, probably dreamboothAlso --skip will make it start faster, skips downloading/checking for updatesEdit: Found the updated fileC:\Users\XXXX.cache\huggingface\hub\models–openai–clip-vit-large-patch14\snapshots\8d052a0f05efbaefbc9e8786ba291cfdf93e5bff\pytorch_model.binLooks like it’s the CLIP model probably updated, not sure
2022-12-09T08:10:04Z
Thanks for this but I am having an issue and my python skills really suck…Traceback (most recent call last):
  File "C:\Users\nbock\Documents\AI\stable-diffusion-webui\launch.py", line 238, in <module>
    if not skipUpdate:
NameError: name 'skipUpdate' is not definedBut I have added “skipUpdate = ‘–skip’ in sys.argv” in line 197 under ngrok…I’d say that variable is definedbut python disagrees :))Any idea?
2022-12-09T10:29:15Z
Spider853, that didn’t helpvenv "C:\Projects\Stable Diffusion\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 44c46f0ed395967cd3830dd481a2db759fda5b3b
Skipping updates...
Launching Web UI with arguments: --xformers --force-enable-xformers --skip
Error loading script: api.py
Traceback (most recent call last):
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\modules\scripts.py", line 184, in load_scripts
    module = script_loading.load_module(scriptfile.path)
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module
    exec(compiled, module.__dict__)
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\scripts\api.py", line 9, in <module>
    from extensions.sd_dreambooth_extension.dreambooth import dreambooth
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\dreambooth.py", line 9, in <module>
    from diffusers.utils import logging as dl
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\diffusers\__init__.py", line 26, in <module>
    raise ImportError(
ImportError: `diffusers` requires transformers >= 4.25.1 to function correctly, but 4.21.0 was found in your environment. You can upgrade it with pip: `pip install transformers --upgrade`

Error loading script: main.py
Traceback (most recent call last):
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\modules\scripts.py", line 184, in load_scripts
    module = script_loading.load_module(scriptfile.path)
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module
    exec(compiled, module.__dict__)
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\scripts\main.py", line 3, in <module>
    from extensions.sd_dreambooth_extension.dreambooth import dreambooth
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\dreambooth.py", line 13, in <module>
    from extensions.sd_dreambooth_extension.dreambooth.utils import reload_system_models, unload_system_models, printm, \
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\utils.py", line 12, in <module>
    from diffusers import StableDiffusionPipeline, EulerAncestralDiscreteScheduler
  File "C:\Projects\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\diffusers\__init__.py", line 26, in <module>
    raise ImportError(
ImportError: `diffusers` requires transformers >= 4.25.1 to function correctly, but 4.21.0 was found in your environment. You can upgrade it with pip: `pip install transformers --upgrade`

LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading weights [06c50424] from C:\Projects\Stable Diffusion\stable-diffusion-webui\model.ckpt
Applying xformers cross attention optimization.
Model loaded.
Loaded a total of 0 textual inversion embeddings.
Embeddings:
Running on local URL:  http://127.0.0.1:7861

To create a public link, set `share=True` in `launch()`.Looks like evenvenv\Scripts\activate.batandpip install transformers --upgradedidn’t update transformers. I even triedpip install transformers==4.25.1No luck…It automatically reinstalls it back to previous version during start-up:Installing requirements for Web UI
2022-12-09T16:32:43Z
Could you please update the "Installing requirements " scripts of Web UI to not force install a version oftransformers? Does someone have a link to the “automatic” installation file?
2022-12-09T16:39:02Z
@anton-lis doing a patch release now so that the scripts will work as expected. Should be ready in 1 hour.In general, though - I don’t think it’s a good idea to force install versions upon launch. The user should IMO have control over the installation of the different versions.
2022-12-10T04:24:23Z
Here are the files I’ve edited locallyfix.zip - Google Drive
2022-12-10T04:25:09Z
did you actually patched the py files? I’m actually using that locally without any issues, and it starts faster.Make sure to launch with skip parameter: webui.bat --skip
2022-12-12T00:34:55Z
If you getting this error on the Stable Diffusion WebUI then it’s because your Dreambooth extension is outdated. You need to run a update on your extensions.First do a git pull on Stable Diffusion web-gui for good measure.Then start SD and go to extensions tab and click on Check for Updates button. It will run a check on each extension you have installed. If it’s outdated it will list as “behind” with a ticked tick box.Now Apply and Restart should restart the web-gui and start the updates but mine didn’t closing the console windows and re-running the bat file to start Stable Diffusion started the update process.