Home

Awesome

ComfyUI_TGate

<p align="center"> <a href="./README.md">English</a> | <a href="./README.zh-CN.md">简体中文</a> </p>

ComfyUI reference implementation for T-GATE.

T-GATE could brings 10%-50% speed up for different diffusion models, only slightly reduces the quality of the generated images and maintains the original composition.

Some monkey patch is used for current implementation. If any error occurs, make sure you have the latest version.

If my work helps you, consider giving it a star.

Some of my other projects that may help you.

:star2: Changelog

:books: Example workflows

The examples directory has workflow example. There are images generated with and without T-GATE in the assets folder.

example

Origin resultT-GATE result
origin_resulttgate_result

T-GATE result image comes from the workflow included in the example image.

Compare to AutomaticCFG

AutomaticCFG is another ComfyUI plugin: Your CFG won't be your CFG anymore. It is turned into a way to guide the CFG/final intensity/brightness/saturation, and it adds a 30% speed increase.

env: T4-8G

OriginT-GATE 0.5AutomaticCFGT-GATE 0.35AutomaticCFG fatest
resultorigin_resulttgate_resultauto_cfg_boosttgate_0_35auto_cfg_fatest
speed4.59it/s5.68it/s5.62it/s6.13it/s6.13it/s

T-GATE performs best when maintaining the original composition. However, if you don't need to maintain composition, AutomaticCFG fatest also brings about the same performance improvement.

:green_book: INSTALL

git clone https://github.com/JettHu/ComfyUI_TGate
# that's all!

:orange_book: Major Features

:book: Nodes reference

TGate Apply

Inputs

Configuration parameters

TGate Apply Advanced

Inputs

Configuration parameters

Optional configuration

TGate Apply(Deprecated)

This node is already deprecated, and will be removed after few version.

Inputs

Configuration parameters

Optional configuration

:rocket: Performance (from T-GATE)

ModelMACsParamLatencyZero-shot 10K-FID on MS-COCO
SD-1.516.938T859.520M7.032s23.927
SD-1.5 w/ TGATE9.875T815.557M4.313s20.789
SD-2.138.041T865.785M16.121s22.609
SD-2.1 w/ TGATE22.208T815.433 M9.878s19.940
SD-XL149.438T2.570B53.187s24.628
SD-XL w/ TGATE84.438T2.024B27.932s22.738
Pixart-Alpha107.031T611.350M61.502s38.669
Pixart-Alpha w/ TGATE65.318T462.585M37.867s35.825
DeepCache (SD-XL)57.888T-19.931s23.755
DeepCache w/ TGATE43.868T-14.666s23.999
LCM (SD-XL)11.955T2.570B3.805s25.044
LCM w/ TGATE11.171T2.024B3.533s25.028
LCM (Pixart-Alpha)8.563T611.350M4.733s36.086
LCM w/ TGATE7.623T462.585M4.543s37.048

The latency is tested on a 1080ti commercial card.

The MACs and Params are calculated by calflops.

The FID is calculated by PytorchFID.

:memo: TODO

:mag: Common promblem

2024.4.26-29Updated on 2024.4.29
before_fixedafter_fixed