-
Notifications
You must be signed in to change notification settings - Fork 109
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
sd-webui refactor, and support refiner model #930
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marigoold
commented
Jun 4, 2024
marigoold
commented
Jun 4, 2024
marigoold
commented
Jun 4, 2024
marigoold
commented
Jun 4, 2024
…ow/onediff into webui-refactor-support-refiner
…ow/onediff into webui-refactor-support-refiner
lijunliangTG
approved these changes
Jun 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
重构了 webui 插件,主要是把相同的代码函数挪到一起;支持了 refiner,之前用 refiner 会报错,并且第二次推理 base 不会加速。
关于 refiner:
refiner 其实可以看做是一个 unet,在推理的某个时刻替换 base 模型的 unet,使图像更高清。使用 base + refiner 推理的过程可以(不严谨地)看作是两个模型,在 n 个 step 的前 m 个 step 用第一个模型推理,剩下的 step 用第二个模型推理。
之前使用 onediff 跑 base + refiner 会报错,即使能跑起来也没有加速作用,原因如下:
unet是refiner -> oneflow 把 unet 替换成 graph -> webui 加载 base,再把 unet 替换成 base
这就导致用 base 推理时,base 是最后一步的 webui 加载进来的纯 torch model,没有加速效果
本 PR 解决了上面两个问题。
注意: