Files
sorryhyun-ComfyUI-EasyContr…/tests
Seunghyun JiandClaude Fable 5 2b978ba03e fix image-swap OOM: evict stale cond KV caches + reserve VRAM up front
The ~0.9GB per-apply cond KV cache had two OOM paths on tight cards:
- swapping the reference image left the previous MODEL output (and its
  cache) alive in ComfyUI's execution cache while the new one built —
  _build_cond_kv now evicts every other state's cache first (they rebuild
  lazily if that model is sampled again);
- the cache is allocated lazily inside the first DiT forward, where
  comfy's memory manager can no longer make room — a PREPARE_SAMPLING
  wrapper now enforces a free-VRAM floor (cache*1.25 + 768MB) before
  sampling, partially unloading model weights instead of OOMing.

Verified: headless A->B->A swap run logs 'evicted 1 stale cond KV
cache(s)' per swap, no OOM, outputs clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 09:44:29 +09:00
..
2026-06-02 19:54:05 +09:00