Closed huchenlei closed 4 months ago
According to https://github.com/lllyasviel/stable-diffusion-webui-forge/discussions/716#discussioncomment-9348247 , the check of whether the model is sdxl inpaint is calling state_dict on every sampling step. state_dict is a very expensive function that costs ~40ms. This overhead is for all inference regardless of model type, which is dumb.
state_dict
This PR precomputes is_sdxl_inpaint flag so that we do not call state_dict on every sampling step.
is_sdxl_inpaint
Original PR that introduce this change: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14390
Description
According to https://github.com/lllyasviel/stable-diffusion-webui-forge/discussions/716#discussioncomment-9348247 , the check of whether the model is sdxl inpaint is calling
state_dict
on every sampling step.state_dict
is a very expensive function that costs ~40ms. This overhead is for all inference regardless of model type, which is dumb.This PR precomputes
is_sdxl_inpaint
flag so that we do not callstate_dict
on every sampling step.Original PR that introduce this change: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14390
Screenshots/videos:
Checklist: