Comfy-Org / Comfy-Org/ComfyUI

Token Merging doubles vram usage

Open
#1,626 0 comments 0 reactions 0 assignees View on GitHub
User Support
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

When using the `TomePatchModule` with a ratio of at least 0.01, the VRAM usage doubles. This increase is most noticeable when using high resolutions. In my case, VRAM usage is not doubled for resolutions below approximately 1260x1260. However, I suspect that even at lower resolutions, it still doubles but it's just barely noticeable. To reproduce this issue clearly, I recommend using a resolution of 2048x2048.

The red box in the graph represents VRAM usage when using Token Merging, while the blue box represents VRAM usage without it. I have also provided the workflow I followed for reference.

[workflow.txt](https://github.com/comfyanonymous/ComfyUI/files/12751179/workflow.txt)
![Screenshot 2023-09-28 165953](https://github.com/comfyanonymous/ComfyUI/assets/66958695/d7224110-df01-4b74-afe8-594f3622d4cd)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.