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

[Performance 5/6] Prevent unnecessary extra networks bias backup

Open huchenlei opened this issue 1 year ago • 4 comments

Description

According to https://github.com/lllyasviel/stable-diffusion-webui-forge/discussions/716#discussioncomment-9342622 , network_apply always incur some overhead on copying tensors even when no extra networks are enabled. This PR prevents this behaviour. The performance gain is about 25ms/it.

Previously unnecessary weight copy was prevented in https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12599/files . This PR is just a follow-up and apply the same approach on bias backup.

Screenshots/videos:

328731939-e0634017-9265-49ee-918d-6b3802ff9305

Checklist:

huchenlei avatar May 16 '24 15:05 huchenlei

is it possible to make this compatible with extension that changing lora weight during sampling?

https://github.com/cheald/sd-webui-loractl https://github.com/AG-w/sd-webui-lora-block-weight

AG-w avatar May 16 '24 16:05 AG-w

is it possible to make this compatible with extension that changing lora weight during sampling?

https://github.com/cheald/sd-webui-loractl https://github.com/AG-w/sd-webui-lora-block-weight

Do you mean that this change will cause dynamic lora weight not working?

huchenlei avatar May 16 '24 17:05 huchenlei

is it possible to make this compatible with extension that changing lora weight during sampling? https://github.com/cheald/sd-webui-loractl https://github.com/AG-w/sd-webui-lora-block-weight

Do you mean that this change will cause dynamic lora weight not working?

the latest commit fixed it, thanks

AG-w avatar May 17 '24 05:05 AG-w

Whoa baby, I am SO looking forward to Forge speeds + ability to use loractl extension.

Absolutely amazing.

altoiddealer avatar May 17 '24 13:05 altoiddealer