Add SoftCache, a training-free caching method that adapts the step size
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- machine-learning, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 35k
- Forks
- 7.5k
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 58
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de huggingface/diffusers
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
huggingface/diffusers#15436 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omittedPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
huggingface/diffusers#15433 ·
Los mantenedores suelen responder en 1 día
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0Posiblemente ocupada @hparik11 la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
huggingface/diffusers#15423 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Docs: 13 docstrings document parameters their functions don't havePosiblemente ocupada @M-Colley la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
huggingface/diffusers#15363 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorPosiblemente ocupada @chessing234 la tomó hace 11 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
huggingface/diffusers#15337 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de huggingface/diffusers
Issues similares
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
MakazhanAlpamys/Soup#3589 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
ClickHouse/clickhouse-connect#1266 ·
Los mantenedores suelen responder en 1 día
-
AutoGrowth: new time column nameAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
biosustain/growthcurves_app#89 ·
Los mantenedores suelen responder en 1 día
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not existAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
canonical/loki-k8s-operator#695 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día