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

[Bug]: Samplers DPM++ 2M SDE and DPM++ 2M SDE Karras do not show up on Mac, because webui-macos-env.sh has not been updated

Open blobbfobb opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

I have updated my installation to the most recent commit (394ffa7b0a7fff3ec484bcd084e673a8b301ccc8). The samplers DPM++ 2M SDE and DPM++ 2M SDE Karras are listed in sd_samplers_kdiffusion.py:

samplers_k_diffusion = [
    ('Euler a', 'sample_euler_ancestral', ['k_euler_a', 'k_euler_ancestral'], {"uses_ensd": True}),
    ...
    ('DPM++ 2M SDE', 'sample_dpmpp_2m_sde', ['k_dpmpp_2m_sde_ka'], {"brownian_noise": True}),
    ...
    ('DPM++ 2M SDE Karras', 'sample_dpmpp_2m_sde', ['k_dpmpp_2m_sde_ka'], {'scheduler': 'karras', "brownian_noise": True}),
]

But they do not show up in the sampler dropdown in the WebUI: current__

Steps to reproduce the problem

  1. On a Mac, update Automatic1111 WebUI from an older version to the current version using git pull.
  2. Start the WebUI.
  3. Look at the dropdown list of samplers.

What should have happened?

The dropdown list should have listed the two missing samplers, DPM++ 2M SDE and DPM++ 2M SDE Karras.

Version or Commit where the problem happens

394ffa7b0a7fff3ec484bcd084e673a8b301ccc8

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

MacOS

What device are you running WebUI on?

Other GPUs

Cross attention optimization

Automatic

What browsers do you use to access the UI ?

Mozilla Firefox, Apple Safari

Command Line Arguments

Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate

List of extensions

extensions

Console logs

Last login: Tue Jun 27 22:00:42 on ttys000
Restored session: Di 27 Jun 2023 22:03:54 CEST
USERNAME@Air-von-USERNAME ~ % bash

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ cd stable-diffusion-webui
bash-3.2$ ./webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on USERNAME user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.10.12 (main, Jun  7 2023, 00:38:32) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Version: v1.4.0
Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8
Installing requirements



Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
[-] ADetailer initialized. version: 23.6.3, num models: 13
2023-06-27 22:18:33,941 - ControlNet - INFO - ControlNet v1.1.227
ControlNet preprocessor location: /Users/USERNAME/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2023-06-27 22:18:33,975 - ControlNet - INFO - ControlNet v1.1.227
Image Browser: ImageReward is not installed, cannot be used.
Loading weights [ec41bd2a82] from /Users/USERNAME/stable-diffusion-webui/models/Stable-diffusion/photon_v1.safetensors
Creating model from config: /Users/USERNAME/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 5.7s (import torch: 0.7s, import gradio: 0.5s, import ldm: 0.2s, other imports: 0.4s, list SD models: 0.1s, load scripts: 2.7s, create ui: 0.6s, gradio launch: 0.3s).
preload_extensions_git_metadata for 15 extensions took 0.45s
Loading VAE weights specified in settings: /Users/USERNAME/stable-diffusion-webui/models/VAE/vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: InvokeAI... done.
Textual inversion embeddings loaded(27): Asian-Less-Neg, bad-hands-5, bad-image-v2-39000, bad-picture-chill-75v, bad_pictures, bad_prompt_version2, BadDream, badhandsv5-neg, badhandv4, BadNegAnatomyV1-neg, CyberRealistic_Negative-neg, easynegative, epiCNegative, kkw-ph1, kkw-ph1-neg, negative_hand-neg, NegfeetV2, ng_deepnegative_v1_75t, np_simple_negatives, PureErosFace_V1, realisticvision-negative-embedding, rmadanegative402_sd15-neg, rmadanegative4_sd15-neg, ulzzang-6500, UnrealisticDream, verybadimagenegative_v1.2-6400, verybadimagenegative_v1.3
Textual inversion embeddings skipped(7): PhotoHelper, nrealfixer, CinemaHelper, PortraitHelper, rmadanegative-neg, VintageHelper, nfixer
Model loaded in 2.6s (load weights from disk: 0.1s, create model: 0.9s, apply weights to model: 0.4s, apply half(): 0.3s, load VAE: 0.2s, move model to device: 0.5s, calculate empty prompt: 0.1s).
Saving backup of webui/extension state to /Users/USERNAME/stable-diffusion-webui/config_states/2023_06_27-22_26_52_Backup (pre-update).json.

################################################################
Launching launch.py...
################################################################
Python 3.10.12 (main, Jun  7 2023, 00:38:32) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Version: v1.4.0
Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8
Installing requirements



Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
[-] ADetailer initialized. version: 23.6.3, num models: 13
2023-06-27 22:26:59,763 - ControlNet - INFO - ControlNet v1.1.227
ControlNet preprocessor location: /Users/USERNAME/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2023-06-27 22:26:59,798 - ControlNet - INFO - ControlNet v1.1.227
Image Browser: ImageReward is not installed, cannot be used.
Loading weights [ec41bd2a82] from /Users/USERNAME/stable-diffusion-webui/models/Stable-diffusion/photon_v1.safetensors
Creating model from config: /Users/USERNAME/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 5.1s (import torch: 0.7s, import gradio: 0.5s, import ldm: 0.3s, other imports: 0.4s, list SD models: 0.1s, load scripts: 2.2s, initialize extra networks: 0.1s, create ui: 0.5s, gradio launch: 0.2s).
preload_extensions_git_metadata for 15 extensions took 0.31s
Loading VAE weights specified in settings: /Users/USERNAME/stable-diffusion-webui/models/VAE/vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: InvokeAI... done.
Textual inversion embeddings loaded(27): Asian-Less-Neg, bad-hands-5, bad-image-v2-39000, bad-picture-chill-75v, bad_pictures, bad_prompt_version2, BadDream, badhandsv5-neg, badhandv4, BadNegAnatomyV1-neg, CyberRealistic_Negative-neg, easynegative, epiCNegative, kkw-ph1, kkw-ph1-neg, negative_hand-neg, NegfeetV2, ng_deepnegative_v1_75t, np_simple_negatives, PureErosFace_V1, realisticvision-negative-embedding, rmadanegative402_sd15-neg, rmadanegative4_sd15-neg, ulzzang-6500, UnrealisticDream, verybadimagenegative_v1.2-6400, verybadimagenegative_v1.3
Textual inversion embeddings skipped(7): PhotoHelper, nrealfixer, CinemaHelper, PortraitHelper, rmadanegative-neg, VintageHelper, nfixer
Model loaded in 3.3s (load weights from disk: 0.1s, create model: 0.8s, apply weights to model: 0.4s, apply half(): 1.1s, load VAE: 0.2s, move model to device: 0.4s, calculate empty prompt: 0.1s).

Additional information

(see the following comment)

blobbfobb avatar Jun 27 '23 20:06 blobbfobb

I realized that webui-macos-env.sh has not been updated to contain the current k-diffusion commit hash. The K_DIFFUSION_COMMIT_HASH in launch_utils.py is c9fe758757e022f05ca5a53fa8fac28889e4f1cf, the K_DIFFUSION_COMMIT_HASH in webui-macos-env.sh is 51c9778f269cedb55a4d88c79c0246d35bdadb71.

@brkirch You seem to have worked on webui-macos-env.sh in the past. Could you please take a look?

blobbfobb avatar Jun 29 '23 07:06 blobbfobb

I edited webui-macos-env.sh and changed

export K_DIFFUSION_REPO="https://github.com/brkirch/k-diffusion.git"
export K_DIFFUSION_COMMIT_HASH="51c9778f269cedb55a4d88c79c0246d35bdadb71"

to

export K_DIFFUSION_REPO="https://github.com/crowsonkb/k-diffusion.git"
export K_DIFFUSION_COMMIT_HASH="c9fe758757e022f05ca5a53fa8fac28889e4f1cf"

So far everything works fine and I can now use DPM++ 2M SDE and DPM++ 2M SDE Karras. Unfortunately I'll have to undo and then redo this edit manually every time I update the Automatic1111 WebUI.

blobbfobb avatar Jul 01 '23 11:07 blobbfobb

``

I edited webui-macos-env.sh and changed

export K_DIFFUSION_REPO="https://github.com/brkirch/k-diffusion.git"
export K_DIFFUSION_COMMIT_HASH="51c9778f269cedb55a4d88c79c0246d35bdadb71"

to

export K_DIFFUSION_REPO="https://github.com/crowsonkb/k-diffusion.git"
export K_DIFFUSION_COMMIT_HASH="c9fe758757e022f05ca5a53fa8fac28889e4f1cf"

So far everything works fine and I can now use DPM++ 2M SDE and DPM++ 2M SDE Karras. Unfortunately I'll have to undo and then redo this edit manually every time I update the Automatic1111 WebUI.

I followed your method and tried, but the program couldn't start. It will give the following error.

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on kay user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.10.11 (main, Apr  7 2023, 07:24:47) [Clang 14.0.0 (clang-1400.0.29.202)]
Version: v1.5.1
Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a
Fetching updates for K-diffusion...
Checking out commit for K-diffusion with hash: c9fe758757e022f05ca5a53fa8fac28889e4f1cf...
致命错误:引用不是一个树:c9fe758757e022f05ca5a53fa8fac28889e4f1cf
Traceback (most recent call last):
  File "/Users/kay/IdeaProjects/stable-diffusion-webui/launch.py", line 39, in <module>
    main()
  File "/Users/kay/IdeaProjects/stable-diffusion-webui/launch.py", line 30, in main
    prepare_environment()
  File "/Users/kay/IdeaProjects/stable-diffusion-webui/modules/launch_utils.py", line 347, in prepare_environment
    git_clone(k_diffusion_repo, repo_dir('k-diffusion'), "K-diffusion", k_diffusion_commit_hash)
  File "/Users/kay/IdeaProjects/stable-diffusion-webui/modules/launch_utils.py", line 156, in git_clone
    run(f'"{git}" -C "{dir}" checkout {commithash}', f"Checking out commit for {name} with hash: {commithash}...", f"Couldn't checkout commit {commithash} for {name}", live=True)
  File "/Users/kay/IdeaProjects/stable-diffusion-webui/modules/launch_utils.py", line 113, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't checkout commit c9fe758757e022f05ca5a53fa8fac28889e4f1cf for K-diffusion.
Command: "git" -C "/Users/kay/IdeaProjects/stable-diffusion-webui/repositories/k-diffusion" checkout c9fe758757e022f05ca5a53fa8fac28889e4f1cf
Error code: 128

CKPeng avatar Aug 12 '23 06:08 CKPeng

It should be mentioned to only use the "fix" mentioned above if you know what you're doing. The separate repo is used because it has fixes specifically for MPS. Changing it to the original repo essentially removes all those fixes.

There's also a big note within that file mentioning you should set those values in webui-user.sh instead (which takes priority over webui-macos-env.sh). https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/68f336bd994bed5442ad95bad6b6ad5564a5409a/webui-macos-env.sh#L2-L5

catboxanon avatar Aug 12 '23 06:08 catboxanon

https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12526 fixed this now, closing.

catboxanon avatar Aug 13 '23 18:08 catboxanon