huchenlei / stable-diffusion-webui

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

Bias backup #7

Closed huchenlei closed 2 months ago

huchenlei commented 2 months ago

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: