[Bugfix][Diffusion] Canonicalize cache_backend=None to "none" (#7041)

Signed-off-by: summer <128961079+zhang-keliang@users.noreply.github.com>
Co-authored-by: Alicia <115451386+congw729@users.noreply.github.com>
This commit is contained in:
summerandAlicia authored and GitHub committed 2026-09-07 15:56:51 +08:00
1 parent b78c31eda6
commit 4b81f692d1
4 files changed
+23 -3

No files matched your search

+5
View File
@@ -91,6 +91,11 @@ def normalize_omni_diffusion_kwargs(kwargs: Mapping[str, Any]) -> dict[str, Any]
if "cache_backend" not in normalized:
cache_backend = os.environ.get("DIFFUSION_CACHE_BACKEND") or os.environ.get("DIFFUSION_CACHE_ADAPTER")
normalized["cache_backend"] = cache_backend.lower() if cache_backend else "none"
elif normalized["cache_backend"] is None:
# Callers (e.g. example CLIs with `default=None`) pass an explicit
# None for "no cache"; canonicalize it so every consumer sees the
# declared `str` value instead of relying on per-model None handling.
normalized["cache_backend"] = "none"
# Convert optional YAML null values to empty containers.
for key in ("diffusers_load_kwargs", "diffusers_call_kwargs"):