techfreakworm commited on
Commit
e168977
·
unverified ·
1 Parent(s): fc74e8b

fix(models): subfolder= on Kijai VAE/text-encoder entries

Browse files

Kijai/LTX2.3_comfy keeps its files in vae/, text_encoders/, etc. The
three entries missing subfolder= were 404ing on hf_hub_download. The
exception fallback then rglobbed the cache and matched HF's
.no_exist/ marker stubs — 0-byte files. Symlinking those to
comfyui/models/vae/ left ComfyUI loading a 0-byte safetensors which
crashes with "Error while deserializing header: header too small".

Also harden the fallback to skip .no_exist/ paths and any file under
64 bytes so this class of stub-induced corruption can't recur.

Files changed (1) hide show
  1. models.py +24 -6
models.py CHANGED
@@ -64,11 +64,16 @@ MODEL_REGISTRY: dict[str, ModelEntry] = {
64
  comfy_type="text_encoders",
65
  subfolder="gemma-3-12b-it",
66
  ),
67
- # Kijai's LTX 2.3 ComfyUI assets
68
- "LTX23_video_vae_bf16.safetensors": ModelEntry("Kijai/LTX2.3_comfy", comfy_type="vae"),
69
- "LTX23_audio_vae_bf16.safetensors": ModelEntry("Kijai/LTX2.3_comfy", comfy_type="vae"),
 
 
 
 
 
70
  "ltx-2.3_text_projection_bf16.safetensors": ModelEntry(
71
- "Kijai/LTX2.3_comfy", comfy_type="text_encoders"
72
  ),
73
  # IC-LoRAs
74
  "ltx-2.3-22b-ic-lora-union-control-ref0.5.safetensors": ModelEntry(
@@ -270,8 +275,21 @@ def ensure_models(filenames: set[str]) -> Iterator[DownloadEvent]:
270
  except Exception as exc:
271
  # Fall back to scanning the cache for a matching file (test mode +
272
  # offline mode). Look for either the workflow filename OR the
273
- # HF-side filename both might exist locally as symlinks.
274
- candidates = list(cache_dir.rglob(filename)) or list(cache_dir.rglob(hf_filename))
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  if not candidates:
276
  logger.warning(
277
  "could not download or locate %r (hf=%r) in HF cache: %s; skipping",
 
64
  comfy_type="text_encoders",
65
  subfolder="gemma-3-12b-it",
66
  ),
67
+ # Kijai's LTX 2.3 ComfyUI assets — files live in vae/ and text_encoders/
68
+ # subfolders within the repo, not at root.
69
+ "LTX23_video_vae_bf16.safetensors": ModelEntry(
70
+ "Kijai/LTX2.3_comfy", subfolder="vae", comfy_type="vae"
71
+ ),
72
+ "LTX23_audio_vae_bf16.safetensors": ModelEntry(
73
+ "Kijai/LTX2.3_comfy", subfolder="vae", comfy_type="vae"
74
+ ),
75
  "ltx-2.3_text_projection_bf16.safetensors": ModelEntry(
76
+ "Kijai/LTX2.3_comfy", subfolder="text_encoders", comfy_type="text_encoders"
77
  ),
78
  # IC-LoRAs
79
  "ltx-2.3-22b-ic-lora-union-control-ref0.5.safetensors": ModelEntry(
 
275
  except Exception as exc:
276
  # Fall back to scanning the cache for a matching file (test mode +
277
  # offline mode). Look for either the workflow filename OR the
278
+ # HF-side filename. Skip `.no_exist/` markers and 0-byte stubs
279
+ # the HF lib leaves those after a 404, and symlinking them past
280
+ # safetensors yields a confusing "header too small" error
281
+ # downstream.
282
+ def _viable(path):
283
+ try:
284
+ return ".no_exist" not in path.parts and path.stat().st_size > 64
285
+ except OSError:
286
+ return False
287
+
288
+ candidates = [
289
+ p for p in cache_dir.rglob(filename) if _viable(p)
290
+ ] or [
291
+ p for p in cache_dir.rglob(hf_filename) if _viable(p)
292
+ ]
293
  if not candidates:
294
  logger.warning(
295
  "could not download or locate %r (hf=%r) in HF cache: %s; skipping",