diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Magcache Support.

Open Meatfucker opened this issue 1 month ago • 2 comments

Id like to see magcache acceleration supported if possible. My own testing shows it to cut video generation times in half with almost no quality loss at all. It seems to be considerably better quality than something like teacache or more efficient attention mechanisms.

https://github.com/Zehong-Ma/MagCache

Kandinsky5 I2V Normal inference: 1168 seconds

https://github.com/user-attachments/assets/3404e1bc-8dfc-4303-b189-c49f549eafab

Kandinsky5 I2V Magcache Inference: 592 seconds

https://github.com/user-attachments/assets/4106a91c-bc4a-44a4-b1b7-4c4a34840551

@leffff @Zehong-Ma

Meatfucker avatar Nov 22 '25 03:11 Meatfucker

Hi! We have a MagCache version in our main repo.

@sayakpaul hiw can we integrate MagCache into Diffusers pipeline?

leffff avatar Nov 24 '25 09:11 leffff

We support a bunch of caching techniques in Diffusers: https://huggingface.co/docs/diffusers/main/en/api/cache

I think we could ship MagCache in a similar manner. Good reference would be FirstBlock cache: https://huggingface.co/docs/diffusers/main/en/api/cache#diffusers.FirstBlockCacheConfig

sayakpaul avatar Nov 24 '25 09:11 sayakpaul