Skip to content

Commit adfef62

Browse files
authored
feat: add generic DiT support to spectrum cache (#1336)
1 parent 6fa7ca9 commit adfef62

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples/cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Generation Options:
139139
--high-noise-skip-layers (high noise) layers to skip for SLG steps (default: [7,8,9])
140140
-r, --ref-image reference image for Flux Kontext models (can be used multiple times)
141141
--cache-mode caching method: 'easycache' (DiT), 'ucache' (UNET), 'dbcache'/'taylorseer'/'cache-dit' (DiT block-level),
142-
'spectrum' (UNET Chebyshev+Taylor forecasting)
142+
'spectrum' (UNET/DiT Chebyshev+Taylor forecasting)
143143
--cache-option named cache params (key=value format, comma-separated). easycache/ucache:
144144
threshold=,start=,end=,decay=,relative=,reset=; dbcache/taylorseer/cache-dit: Fn=,Bn=,threshold=,warmup=;
145145
spectrum: w=,m=,lam=,window=,flex=,warmup=,stop=. Examples:

examples/common/common.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,11 +1513,11 @@ struct SDGenerationParams {
15131513
on_ref_image_arg},
15141514
{"",
15151515
"--cache-mode",
1516-
"caching method: 'easycache' (DiT), 'ucache' (UNET), 'dbcache'/'taylorseer'/'cache-dit' (DiT block-level)",
1516+
"caching method: 'easycache' (DiT), 'ucache' (UNET), 'dbcache'/'taylorseer'/'cache-dit' (DiT block-level), 'spectrum' (UNET/DiT Chebyshev+Taylor forecasting)",
15171517
on_cache_mode_arg},
15181518
{"",
15191519
"--cache-option",
1520-
"named cache params (key=value format, comma-separated). easycache/ucache: threshold=,start=,end=,decay=,relative=,reset=; dbcache/taylorseer/cache-dit: Fn=,Bn=,threshold=,warmup=. Examples: \"threshold=0.25\" or \"threshold=1.5,reset=0\"",
1520+
"named cache params (key=value format, comma-separated). easycache/ucache: threshold=,start=,end=,decay=,relative=,reset=; dbcache/taylorseer/cache-dit: Fn=,Bn=,threshold=,warmup=; spectrum: w=,m=,lam=,window=,flex=,warmup=,stop=. Examples: \"threshold=0.25\" or \"threshold=1.5,reset=0\"",
15211521
on_cache_option_arg},
15221522
{"",
15231523
"--cache-preset",

examples/server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Default Generation Options:
129129
--skip-layers layers to skip for SLG steps (default: [7,8,9])
130130
--high-noise-skip-layers (high noise) layers to skip for SLG steps (default: [7,8,9])
131131
-r, --ref-image reference image for Flux Kontext models (can be used multiple times)
132-
--cache-mode caching method: 'easycache' (DiT), 'ucache' (UNET), 'dbcache'/'taylorseer'/'cache-dit' (DiT block-level)
132+
--cache-mode caching method: 'easycache' (DiT), 'ucache' (UNET), 'dbcache'/'taylorseer'/'cache-dit' (DiT block-level), 'spectrum' (UNET/DiT Chebyshev+Taylor forecasting)
133133
--cache-option named cache params (key=value format, comma-separated). easycache/ucache:
134134
threshold=,start=,end=,decay=,relative=,reset=; dbcache/taylorseer/cache-dit: Fn=,Bn=,threshold=,warmup=. Examples:
135135
"threshold=0.25" or "threshold=1.5,reset=0"

src/stable-diffusion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,9 +1797,9 @@ class StableDiffusionGGML {
17971797
}
17981798
}
17991799
} else if (cache_params->mode == SD_CACHE_SPECTRUM) {
1800-
bool spectrum_supported = sd_version_is_unet(version);
1800+
bool spectrum_supported = sd_version_is_unet(version) || sd_version_is_dit(version);
18011801
if (!spectrum_supported) {
1802-
LOG_WARN("Spectrum requested but not supported for this model type (only UNET models)");
1802+
LOG_WARN("Spectrum requested but not supported for this model type (only UNET and DiT models)");
18031803
} else {
18041804
SpectrumConfig spectrum_config;
18051805
spectrum_config.w = cache_params->spectrum_w;

0 commit comments

Comments
 (0)