lshqqytiger / stable-diffusion-webui-amdgpu

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

[Bug]: Wrong in new version #318

Closed CodeingJack closed 4 months ago

CodeingJack commented 8 months ago

Is there an existing issue for this?

What happened?

I am sorry about my English is not good. I use this SDXL model to draw picture.(It website is Chinese) go there At the end of August ,It is ok. Then I reinstall Stable Diffusion becaues I move python's path at the end of October。 After that, before draw picture,I need to wait about 5-10 min. Then Stable Diffusion is writing, GPU usage rate looks not good(Some times it is only 20%,but some times is 90%)

useage

(VRAM is not full, but Memory is full, I think it is wrong)

CMD: CMD

I use this to draw

1girl, (large breasts:1.4), school uniform, blue eyes, blue hair, Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 1556741477, Size: 512x768, Model hash: d07e219101, Model: Everyone XL_mk1, Denoising strength: 0.7, Hires upscale: 2, Hires steps: 2, Hires upscaler: R-ESRGAN 4x+ Anime6B, Version: 1.6.1

After draw,the output is only black 00000-1556741477

I start with these

set COMMANDLINE_ARGS=--opt-sub-quad-attention --lowvram --disable-nan-check --ckpt-dir D:\model --no-gradio-queue

The Stable Diffusion is on SSD. The Model is on HDD. My CPU is Intel E3 1230 v3. My memory is DDR3 8G My GPU is RX5500XT 8G (PCIE 4) My motherboard is soyo SY-H81N FS (PCIE2) My GPU Driver version is AMD Software: Adrenalin Edition 23.11.1

I tried updata GPU Driver, moving Stable Diffusion to SSD and use git push before run it. But it didn't work

Steps to reproduce the problem

  1. Go to Stable Diffusion
  2. Input something
  3. Press start drawing

What should have happened?

Vram is full After loading model,draw start right away. GPU useage rate is 90%-100%

Sysinfo

sysinfo-2023-11-11-13-29.txt

What browsers do you use to access the UI ?

Microsoft Edge

Console logs

venv "C:\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: 1.6.1
Commit hash: 03eec1791be011e087985ae93c1f66315d5a250e
loading WD14-tagger reqs from C:\stable-diffusion-webui-directml\extensions\stable-diffusion-webui-wd14-tagger-master\requirements.txt
Checking WD14-tagger requirements.
Launching Web UI with arguments: --opt-sub-quad-attention --lowvram --disable-nan-check --ckpt-dir D:model --no-gradio-queue
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
== WD14 tagger /gpu:0, uname_result(system='Windows', node='USER-20220401RI', release='10', version='10.0.19045', machine='AMD64') ==
Loading weights [d07e219101] from D:model\Everyone XL_mk1.safetensors
C:\stable-diffusion-webui-directml\extensions\stable-diffusion-webui-wd14-tagger-master\tagger\settings.py:17: GradioDeprecationWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components
  return gr.Slider(**kwargs)
C:\stable-diffusion-webui-directml\modules\gradio_extensons.py:25: GradioDeprecationWarning: `optional` parameter is deprecated, and it has no effect
  res = original_IOComponent_init(self, *args, **kwargs)
C:\stable-diffusion-webui-directml\extensions\stable-diffusion-webui-images-browser-main\scripts\image_browser.py:1156: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  image_gallery = gr.Gallery(show_label=False, elem_id=f"{tab.base_tag}_image_browser_gallery").style(columns=opts.image_browser_page_columns, height=("max-content" if opts.image_browser_height_auto else None))
Creating model from config: C:\stable-diffusion-webui-directml\repositories\generative-models\configs\inference\sd_xl_base.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 52.6s (prepare environment: 6.5s, import torch: 18.4s, import gradio: 1.6s, setup paths: 2.1s, initialize shared: 2.8s, other imports: 0.8s, setup codeformer: 0.2s, load scripts: 5.6s, initialize extra networks: 0.2s, create ui: 13.4s, gradio launch: 0.9s).
Applying attention optimization: sub-quadratic... done.
Model loaded in 642.3s (load weights from disk: 13.0s, create model: 1.4s, apply weights to model: 604.7s, apply half(): 7.8s, apply dtype to VAE: 0.1s, load VAE: 0.5s, load weights from state dict: 1.3s, move model to device: 1.6s, hijack: 1.6s, load textual inversion embeddings: 2.5s, scripts callbacks: 0.2s, calculate empty prompt: 7.3s).
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [22:50<00:00, 68.54s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [18:16<00:00, 54.84s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [18:16<00:00,  9.21s/it]

Additional information

No response

songib commented 7 months ago

Remove this "--opt-sub-quad-attention" and use "Doggettx" in optimization settings

CodeingJack commented 6 months ago

Now I have solved the problem. I added these

set COMMANDLINE_ARGS=--medvram --precision full --no-half --no-half-vae --opt-split-attention-v1 --opt-sub-quad-attention --disable-nan-check --ckpt-dir "D:\model"

Now it's OK, and the drawing speed has increased. Now my RX5500XT 8G can be 10it/s in 512*512 image.

Thanks!