Add SoftCache, a training-free caching method that adapts the step size
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 22/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
研究方向
The change spans the SeaCache cache hook, CacheMixin (for a get_cache_step_size_factor() getter), FlowMatchEulerDiscreteScheduler.step (for a step_size_factor kwarg), and the Wan pipeline denoising loop. Read how the existing SeaCache hook decides refresh versus reuse, then check how the scheduler moves sigmas. Done means the proposed interface is agreed with maintainers and Wan T2V runs with enable_cache(SoftCacheConfig()). Wait for maintainer direction on the cache-scheduler interface before writing code.
由索引模型根據 Issue 內容生成。
描述
Is your feature request related to a problem? Please describe.
I'm the first author of SoftCache (https://arxiv.org/abs/2610.22369). It is a newer caching method that builds on the SeaCache signal. SeaCache uses the signal only to decide whether to refresh or reuse the cache. SoftCache also uses it to take larger sampler steps while the cache is still accurate. In the paper it is 3.5× to 6.9× faster on FLUX.1-dev, HunyuanVideo and Wan2.1 and is ahead of every baseline on all four fidelity metrics. I'd like to add it to diffusers and I'm happy to help with follow ups.
Describe the solution you'd like.
A SoftCacheConfig on top of the SeaCache hook, starting with Wan T2V.
pipe.scheduler = FlowMatchEulerDiscreteScheduler(shift=pipe.scheduler.config.flow_shift)
pipe.transformer.enable_cache(SoftCacheConfig())
video = pipe(prompt, num_inference_steps=50).frames[0]
Besides the hook, Wan needs three small changes.
- A
step_size_factorkwarg onFlowMatchEulerDiscreteScheduler.step. It moves the next sigma and re-spaces the rest of the schedule in place. - A
get_cache_step_size_factor()getter onCacheMixin, so the pipeline can read the step size from the cache. - Two lines in the Wan loop that pass the factor to the scheduler and skip the steps freed at the end.
I have a working prototype of this. On Wan2.1-1.3B it makes the same decision as our released code at every step and reaches the same quality. Are these changes OK with you, or would you rather the cache and the scheduler talk some other way?
Describe alternatives you've considered.
Running fewer steps on the default schedule. That speeds up every part of the trajectory equally, even where the cache is going stale. Keeping SoftCache as a separate package. That works today, but it needs its own sampling loop for each model, so it doesn't combine with the rest of diffusers.
Additional context.
Code https://github.com/ShimonMalnick/softcache (pip install softcache). Demo https://huggingface.co/spaces/ShimonM/softcache. One difference from the SeaCache hook is that SoftCache builds its signal from the first block's modulated input, as the official SeaCache Wan2.1 code does, rather than from the raw latent. Our code also runs SoftCache with Wan's default UniPC scheduler (solver="unipc"). In the hook that would need the same step_size_factor on UniPCMultistepScheduler. UniPC and FLUX would come in follow up PRs. I'll write the PR and disclose the AI assistance there, with the self-review notes.
- 主要語言
- Python
- 星號
- 35k
- 分支
- 7.5k
- 平均合併
- 2 天 22 小時
- 30 天內合併 PR
- 58
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
huggingface/diffusers 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
huggingface/diffusers#15436 · 1 則留言 ·
維護者通常 1 天內回覆
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omitted可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
huggingface/diffusers#15433 ·
維護者通常 1 天內回覆
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0可能已有人在做 @hparik11 於 3 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
huggingface/diffusers#15423 · 2 則留言 ·
維護者通常 1 天內回覆
-
Docs: 13 docstrings document parameters their functions don't have可能已有人在做 @M-Colley 於 3 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
huggingface/diffusers#15363 · 2 則留言 ·
維護者通常 1 天內回覆
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeError可能已有人在做 @chessing234 於 11 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 70/100
huggingface/diffusers#15337 · 3 則留言 ·
維護者通常 1 天內回覆
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount due可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 79/100
developmentseed/titiler-covjson#164 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
awslabs/visual-asset-management-system#2164 ·
維護者通常 1 天內回覆
-
needs-triage
難度 2/5 1-3 小時 新手友好度 86/100
MakazhanAlpamys/Soup#3589 ·
維護者通常 1 天內回覆
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocket未關閉
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆