vipshop / vipshop/cache-dit

Assertion error when supporting non-diffusers' models.

Open
#511 4 comments 0 reactions 1 assignee View on GitHub

@DefTruth is already working on this.

Since Dec 2, 2025.

Dominant language
Python
Stars
1.3k
Forks
88
Avg merge
1d 4h
Merged PRs (30d)
14

Description

When integrating cache-dit into sglang, we encountered an assertion error.
It appears that this happens because sglang’s FluxTransformer2DModel is not compatible with diffusers’ FluxTransformer2DModel, which the current adapter code assumes.

Image After temporarily commenting out the assertion, the integration can run without issues:

https://github.com/Brain97/cache-dit/blob/b6a9648156e8fa42e713adf11b69a5b45a3a7547/src/cache_dit/caching/block_adapters/__init__.py#L19

From the latest version, it looks like the adapter still only supports diffusers’ FLUX*Model:

https://github.com/vipshop/cache-dit/blob/ed9a226a061cd8b82043c0df0c4088bb344e7a33/src/cache_dit/caching/block_adapters/__init__.py#L27

Would it be possible to add support for sglang’s Flux implementation, or make the adapter interface more flexible?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.