lshqqytiger / stable-diffusion-webui-amdgpu

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

[Bug]: Inpainting non-functional #9

Open briankeefe opened 1 year ago

briankeefe commented 1 year ago

Is there an existing issue for this?

What happened?

Inpainting does not return a new image, but does show progress towards a unique problem in the view finder

Steps to reproduce the problem

  1. Inpainting
  2. Add image
  3. Highlight any part of the image, I chose top of the head as a hat
  4. Hit generate
  5. Verify Same image

What should have happened?

It should have inpainted new content into the image

Commit where the problem happens

c88824995d87be36a62b110dd509ff7ccb6eeaa2

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox, Google Chrome, Microsoft Edge

Command Line Arguments

--medvram --autolaunch

List of extensions

No

Console logs

100%|██████████████████████████████████████████████████████████████████████████████████| 16/16 [00:24<00:00,  1.56s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 16/16 [00:24<00:00,  1.54s/it]

Additional information

want to emphasize that it does appear to be inpainting because I can see progress in the viewfinder, but the final image is always the original image with default inpainting settings

Video card 6700XT CPU 15-12400F OS Windows 11

GoZippy commented 1 year ago

confirm same issue with 6700xt in my case I am seeing error out of GPU video memory - but I show plenty available.

\tiger\stable-diffusion-webui-directml-master\modules\sd_hijack_optimizations.py", line 169, in einsum_op_slice_1 r[:, i:end] = einsum_op_compvis(q[:, i:end], k, v) RuntimeError: Could not allocate tensor with 9831040 bytes. There is not enough GPU video memory available!

briankeefe commented 1 year ago

@GoZippy do you have --medvram set?

VVo1fraM commented 1 year ago

same issue with 6600xt Ryzen 7 3700X OS Windows 10

Miraihi commented 1 year ago

After adding Commandline args --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 the inpainting became functional. Also got a MASSIVE speedup, practically 2-3 times faster (AMD RX 580).

FelipeLujan commented 1 year ago

I am experiencing this bug despite of having added these args --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1

ride5k commented 1 year ago

issue appears here too. no OOM errors, progress appears normal, output is identical to input.

ride5k commented 1 year ago

did some more testing... appears to be mask related, as inpainting UNMASKED region works properly, but MASKED region does not, at least in my case.

Martynas6ha4 commented 1 year ago

Christ how did I not think to check here before.

My system: 3600x CPU 6700xt GPU WIN 10

Can confirm I was having the same issues as described.

After adding --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 I can confirm it then became functional and the speedup is indeed MASSIVE

I have no idea what is going on, but best of luck to you all in fixing it.

Fullyottermatic commented 1 year ago

Can confirm, inpainting was nonfuctional until I added --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 As a bonus, I got a roughly 3x increase in speed, and I am now able to do 4 images in one batch instead of just 2.

System specs: Ryzen 5 5600 Ryzen RX 6750 XT Windows 10

briankeefe commented 1 year ago

I pulled the most recent commit and tried those launch options and I can't generate any images at all

UnrealSimulation commented 1 year ago

Christ how did I not think to check here before.

My system: 3600x CPU 6700xt GPU WIN 10

Can confirm I was having the same issues as described.

After adding --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 I can confirm it then became functional and the speedup is indeed MASSIVE

I have no idea what is going on, but best of luck to you all in fixing it.

I can confirm, adding this settings fix the bug AND it also fix an other bug where you can't generate outpainting without becoming blury. Thanks a lot! EDIT: I can't say what parameter is the one fixing the bug.

ZHANGBADAO commented 1 year ago

After adding Commandline args --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 the inpainting became functional. Also got a MASSIVE speedup, practically 2-3 times faster (AMD RX 580).

good!!! Solved my problem. Ryzen 5 3600 Ryzen RX 5600 XT Windows 11

eneskuluk commented 1 year ago

Also having same issue, using --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 solves the bug in inpaint but it doesn't speedup for me. Opposite, it slows down. I think this is expected since it basically disables optimizations. Using 6700 xt.

Miraihi commented 1 year ago

Also having same issue, using --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 solves the bug in inpaint but it doesn't speedup for me. Opposite, it slows down. I think this is expected since it basically disables optimizations. Using 6700 xt.

Play around with the arguments a bit. --no-half and --precision full are not always needed, it depends on the card. --opt-split-attention-v1 can be changed to --opt-split-attention if you're not that short on vram. --opt-sub-quad-attention can be complimented with the additional arguments --sub-quad-q-chunk-size 512 --sub-quad-kv-chunk-size 512 --sub-quad-chunk-threshold 80. --medvram is the best vram optimisation you can enable. Also adding set SAFETENSORS_FAST_GPU=1 just below the set COMMANDLINE_ARGS= line worked wonders for many people, including me.

eneskuluk commented 1 year ago

Also having same issue, using --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 solves the bug in inpaint but it doesn't speedup for me. Opposite, it slows down. I think this is expected since it basically disables optimizations. Using 6700 xt.

Play around with the arguments a bit. --no-half and --precision full are not always needed, it depends on the card. --opt-split-attention-v1 can be changed to --opt-split-attention if you're not that short on vram. --opt-sub-quad-attention can be complimented with the additional arguments --sub-quad-q-chunk-size 512 --sub-quad-kv-chunk-size 512 --sub-quad-chunk-threshold 80. --medvram is the best vram optimisation you can enable. Also adding set SAFETENSORS_FAST_GPU=1 just below the set COMMANDLINE_ARGS= line worked wonders for many people, including me.

Thanks, I'm already using medvram, that command line is life saver. set SAFETENSORS_FAST_GPU=1 haven't used this one but I'm not sure how this would helpful but every little optimization is appreciated :). 6700 XT only has 12GB vram and does not benefit from many vram optimizations like Nvidia cards do, so I'm kind of at short of memory. I have tried some of the commands you mentioned but I'll check them in-depth, thanks again!

thonsm06 commented 1 year ago

After adding --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 I can confirm it then became functional and the speedup is indeed MA

Works for me.

spec, R9 5950X RX 6900XT Windows 10

RomanSamozvan commented 1 year ago
Problem:

When I inpainted where I drew the mask, there was a problem: instead of redrawing, SD spread dirt

Run on commit 06296ff with flags --autolaunch --opt-split-attention --medvram Win11, RX 6850 xt, AMD Software 23.5.2

Screenshot ![image](https://github.com/lshqqytiger/stable-diffusion-webui-directml/assets/74590052/1c6e50ba-06ec-4879-ac50-942294ee61a6)
Solution:

Now changed to --autolaunch --medvram --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1

And it fixed the problem, thx!

upd:

exactly --no-half adding helped

dragos240 commented 1 year ago

Has this been fixed? I can confirm that --no-half fixes it on ba780a8e4fb27d1eb9595947380a63bd84fc419e but that was a while ago