Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompute is_sdxl_inpaint flag #4

Merged
merged 1 commit into from
May 15, 2024
Merged

Precompute is_sdxl_inpaint flag #4

merged 1 commit into from
May 15, 2024

Conversation

huchenlei
Copy link
Owner

Description

According to lllyasviel/stable-diffusion-webui-forge#716 (comment) , 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 call state_dict on every sampling step.

Original PR that introduce this change: AUTOMATIC1111#14390

Screenshots/videos:

image

Checklist:

@huchenlei huchenlei merged commit b7b2bdc into all_perf May 15, 2024
5 of 6 checks passed
huchenlei added a commit that referenced this pull request May 15, 2024
huchenlei added a commit that referenced this pull request May 15, 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.

1 participant