HaozheLiu-ST / T-GATE

T-GATE: Temporally Gating Attention to Accelerate Diffusion Model for Free!
MIT License
345 stars 23 forks source link

Attempted to implement a comfyui node. #8

Closed JettHu closed 5 months ago

JettHu commented 5 months ago

I tried to implement a version of comfyui's T-GATE but seemed to encounter some problems. The quality of the generated image declined after the apply the node. 企业微信截图_3ce8507a-d6ee-4b75-ad19-cf5d664d192d

企业微信截图_2ff2a874-3fc5-489f-b587-404615d7b684

this is the repo: https://github.com/JettHu/ComfyUI_TGate

WentianZhang-ML commented 5 months ago

Hi, thanks for your attention to our work.

I have gone through your repo. Please do not use TGATE on "attn1" and try again.

"attn1" refers to the self-attention when only_cross_attention is set as False (default config), but TGATE is only used to cache the cross-attention output

JettHu commented 5 months ago

Hi, thanks for your attention to our work.

I have gone through your repo. Please do not use TGATE on "attn1" and try again.

"attn1" refers to the self-attention when only_cross_attention is set as False (default config), but TGATE is only used to cache the cross-attention output

thx, i'll try it

JettHu commented 5 months ago

It works after I add a only_cross_attention switch! tgate_workflow_example

WentianZhang-ML commented 5 months ago

Sure, you can also set only_cross_attention as False and only use TGATE on attn2, which is closer to our pipeline.

JettHu commented 5 months ago

I'm going to close this issue