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

[Fix] black images issues with diffusers SD2.1 #725

Merged
merged 4 commits into from
Mar 14, 2024

Conversation

lixiang007666
Copy link
Contributor

@lixiang007666 lixiang007666 commented Mar 13, 2024

@hjchen2
Copy link
Contributor

hjchen2 commented Mar 14, 2024

以前不是会自动根据upcast来设置这个环境变量的么,现在怎么重构没了

@lixiang007666
Copy link
Contributor Author

lixiang007666 commented Mar 14, 2024

以前不是会自动根据upcast来设置这个环境变量的么,现在怎么重构没了

我在 diffusers 里没找到外部判断 upcast 的方法,所以就直接不判断了。是不是因为 diffusers 更新,onediff 重构没了。

@hjchen2
Copy link
Contributor

hjchen2 commented Mar 14, 2024

def get_attention_scores(self, query, key, attention_mask=None):
if self.upcast_attention and parse_boolean_from_env(
"ONEFLOW_KERENL_FMHA_ENABLE_TRT_FLASH_ATTN_IMPL", True
):
set_boolean_env_var("ONEFLOW_KERENL_FMHA_ENABLE_TRT_FLASH_ATTN_IMPL", False)

应该是最近onediff的配置里把这个环境变量ONEFLOW_KERENL_FMHA_ENABLE_TRT_FLASH_ATTN_IMPL删掉导致的,你把onediff里所有的ONEFLOW_KERENL_FMHA_ENABLE_TRT_FLASH_ATTN_IMPL都改成ONEFLOW_ATTENTION_ALLOW_HALF_PRECISION_ACCUMULATION吧

@strint strint added this to the v0.13.0 milestone Mar 14, 2024
@lixiang007666 lixiang007666 merged commit cf16776 into main Mar 14, 2024
5 checks passed
@lixiang007666 lixiang007666 deleted the Fix_sd_2_1_overflow branch March 14, 2024 14:10
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.

3 participants