AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
140.96k stars 26.67k forks source link

[Bug]: Throwing Up "webui.py: error: argument --use-cpu: invalid choice: 'bsrgan'" all of the sudden #3663

Closed jet3004 closed 1 year ago

jet3004 commented 1 year ago

Is there an existing issue for this?

What happened?

Since distinctly a few updates ago, occurring around last evening, my working Automatic environment ceased to open, throwing the following error "webui.py: error: argument --use-cpu: invalid choice: 'bsrgan' (choose from 'all', 'sd', 'interrogate', 'gfpgan', 'swinir', 'esrgan', 'scunet', 'codeformer')", out of nowhere. Never used a launch command before and trying the suggested did nothing – again, all completely out of nowhere after one of the recent pushes.

Is there a mismatch in the script because 'bsrgan' was recently removed? For good measure, I gutted and re-did my Miniconda and Auto installs and still got the same exact message. Figured I can't be alone, so wanted to report this.

Steps to reproduce the problem

  1. Go to ....Terminal
  2. Launch .... 'run_webui_mac.sh'
  3. Get Error... _To make your changes take effect please reactivate your environment Already up to date. usage: webui.py [-h] [--config CONFIG] [--ckpt CKPT] [--ckpt-dir CKPT_DIR] [--gfpgan-dir GFPGAN_DIR] [--gfpgan-model GFPGAN_MODEL] [--no-half] [--no-half-vae] [--no-progressbar-hiding] [--max-batch-count MAX_BATCH_COUNT] [--embeddings-dir EMBEDDINGS_DIR] [--hypernetwork-dir HYPERNETWORK_DIR] [--localizations-dir LOCALIZATIONS_DIR] [--allow-code] [--medvram] [--lowvram] [--lowram] [--always-batch-cond-uncond] [--unload-gfpgan] [--precision {full,autocast}] [--share] [--ngrok NGROK] [--ngrok-region NGROK_REGION] [--codeformer-models-path CODEFORMER_MODELS_PATH] [--gfpgan-models-path GFPGAN_MODELS_PATH] [--esrgan-models-path ESRGAN_MODELS_PATH] [--bsrgan-models-path BSRGAN_MODELS_PATH] [--realesrgan-models-path REALESRGAN_MODELS_PATH] [--scunet-models-path SCUNET_MODELS_PATH] [--swinir-models-path SWINIR_MODELS_PATH] [--ldsr-models-path LDSR_MODELS_PATH] [--xformers] [--force-enable-xformers] [--deepdanbooru] [--opt-split-attention] [--opt-split-attention-invokeai] [--opt-split-attention-v1] [--disable-opt-split-attention] [--use-cpu {all,sd,interrogate,gfpgan,swinir,esrgan,scunet,codeformer} [{all,sd,interrogate,gfpgan,swinir,esrgan,scunet,codeformer} ...]] [--listen] [--port PORT] [--show-negative-prompt] [--ui-config-file UI_CONFIG_FILE] [--hide-ui-dir-config] [--freeze-settings] [--ui-settings-file UI_SETTINGS_FILE] [--gradio-debug] [--gradio-auth GRADIO_AUTH] [--gradio-img2img-tool {color-sketch,editor}] [--opt-channelslast] [--styles-file STYLES_FILE] [--autolaunch] [--theme THEME] [--use-textbox-seed] [--disable-console-progressbars] [--enable-console-prompts] [--vae-path VAE_PATH] [--disable-safe-unpickle] [--api] [--nowebui] [--ui-debug-mode] [--device-id DEVICEID] webui.py: error: argument --use-cpu: invalid choice: 'bsrgan' (choose from 'all', 'sd', 'interrogate', 'gfpgan', 'swinir', 'esrgan', 'scunet', 'codeformer')

What should have happened?

Automatic launches normally.

Commit where the problem happens

3e15f8e

What platforms do you use to access UI ?

MacOS

What browsers do you use to access the UI ?

Apple Safari

Command Line Arguments

cd stable-diffusion-webui && ./run_webui_mac.sh

Additional information, context and logs

No response

yangrchen commented 1 year ago

@jet3004 I'm also using the UI on Mac. For now I opened up the run script in a code editor (I used VSCode) and removed the BSRGAN option in the "Run the webui" line. Running the script now runs successfully and I can still go through my normal workflow. Granted, I couldn't tell you immediately if removing the option breaks some other feature

Screenshot 2022-10-25 at 2 13 11 PM
jet3004 commented 1 year ago

@jet3004 I'm also using the UI on Mac. For now I opened up the run script in a code editor (I used VSCode) and removed the BSRGAN option in the "Run the webui" line. Running the script now runs successfully and I can still go through my normal workflow. Granted, I couldn't tell you immediately if removing the option breaks some other feature

Screenshot 2022-10-25 at 2 13 11 PM

Thanks! My comment update didn't submit but, yeah, I found out the same. I had never altered it so I guess it was just that -- remove "BSRGAN" from the line. Maybe "run_webui_mac.sh" can get updated to remove this because this must have impacted a lot of people who probably can't figure out why it suddenly won't launch?

yangrchen commented 1 year ago

Yeah the error might be an unintended side effect since BSRGAN is used for upscaling and I imagine you wouldn't want to leave it out. This could be listed as more a temporary fix until it's addressed in a more elegant way haha

brkirch commented 1 year ago

This will be addressed by dylancl/stable-diffusion-webui-mps#6, however that still won't fix the problem unless setup_mac.sh is redownloaded and run again.

To fix it now, you can either manually fix run_webui.sh or download an already up to date copy.

An updated run_webui.sh can be downloaded here (option-click on the "Raw" button to download), just remember to give it execution permission after downloading with chmod +x run_webui_mac.sh

If you'd prefer to manually fix run_webui_mac.sh, open it with any text editor and replace python webui.py --precision full --no-half --use-cpu Interrogate GFPGAN CodeFormer BSRGAN ESRGAN SCUNet $@ with python webui.py --precision full --no-half --use-cpu Interrogate GFPGAN CodeFormer $@