Skip to content

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

Merged
AUTOMATIC1111 merged 2 commits intoAUTOMATIC1111:devfrom
huchenlei:bias_backup
Jun 8, 2024
Merged

[Performance 5/6] Prevent unnecessary extra networks bias backup#15816
AUTOMATIC1111 merged 2 commits intoAUTOMATIC1111:devfrom
huchenlei:bias_backup

Conversation

@huchenlei
Copy link
Contributor

@huchenlei huchenlei commented May 16, 2024

Description

According to lllyasviel/stable-diffusion-webui-forge#716 (comment) , 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 huchenlei requested a review from AUTOMATIC1111 as a code owner May 16, 2024 15:44
@AG-w
Copy link

AG-w commented May 16, 2024

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

@huchenlei
Copy link
Contributor Author

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?

@AG-w
Copy link

AG-w commented May 17, 2024

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

@altoiddealer
Copy link

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

Absolutely amazing.

@AUTOMATIC1111 AUTOMATIC1111 merged commit 816bc42 into AUTOMATIC1111:dev Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants