4 Commits
Author SHA1 Message Date
xiaolibai-sys 164896ed78 bump v1.1.4: nvfp4 support, GPU LoRA fold, loader I/O pipeline, async D2H, unified logging
- nvfp4: _quantization_metadata -> comfy_quant synthesis, SlotEntry extra params (block_scale), dual-scale LoRA fold, orig_dtype fixup
- LoRA: plain-mode block LoRAs no longer silently dropped; folded on GPU after weights land
- loader: parallel positioned reads, pipelined group load, no per-tensor clone, header-only dtype probes
- block swap: read_block intra-block parallel + disk_workers node option; async D2H write-back on transfer stream; lazy evict_all skips wasted write-back
- arch: split models/loader.py out of wan_model.py; single utils/keys.py; LoRA folding consolidated in utils/lora.py; global utils/log.py ([BerniniR][Tag] format, BERNINI_LOG_LEVEL)
2026-07-21 14:07:05 +08:00
xiaolibai-sys bec4164798 LoraBlockReader: warn on unknown suffix keys (no silent skip) 2026-07-18 00:40:51 +08:00
xiaolibai-sys 4f510d6dd0 bump v1.1.2: unified slot architecture + LoraBlockReader on-demand LoRA
- Unified (block, lora) slot: SlotEntry carries co-located LoRA payload;
  fold consumes slot.lora -> None (no external bookkeeping).
- Resident mode: LoRA loaded into RAM, co-located per-block during
  streaming loop, pool freed after load (no change, already working).
- Lazy mode: new LoraBlockReader reads per-block LoRA on demand from
  disk via offset plan (no RAM pool). Same RandomAccessBlockReader data
  pipeline architecture.
- LoraBlockReader supports both Diffusers (lora_A/lora_B) and
  Kohya (lora_down/lora_up) key formats + DoRA (diff/diff_b) + alpha.
- DiskPrefetcher _attach_block_lora uses LoraBlockReader instead of
  model._lora_groups RAM dict, eliminating 1.5GB global LoRA pool
  in lazy mode.
- _normalize_unet_key extracted as shared module-level function.
- LoraTensorEntry dataclass moved to utils/types.py.
- Updated all BlockSwapManager/DiskHome call sites with lora_reader
  parameter threading.
2026-07-18 00:36:39 +08:00
xiaolibai-sys 1f0c475126 v1.1.0
Core
- Fix: p.data = d is a no-op on __torch_wrapper_subclass__ (QuantizedTensor).
  Replace with SlotEntry + module._parameters[key] reassignment, bypassing
  PyTorch's wrapper-subclass .data assignment interception.
- Fix: VAE decoder gray/NaN output caused by QuantizedTensor weight remaining
  on CPU during fp8 Linear forward.
- Fix: CUDA OOM on Windows when pin_memory=True — reduce pin pool size to
  prefetch_count (default 3) instead of W+prefetch (23); only use pin pool
  for prefetch loads (non_blocking=True).
- Fix: black output with pin_memory=True — run H2D copies on the transfer
  stream, sync before assign_to, so weights are fully written before forward.
- Fix: BlockSwap shutdown crash ("size 5120 vs 0") — offload_block copies
  GPU→home directly from slot entries, not through freed block params.
- Fix: Model switch RAM/VRAM leak — clear_pools() drops all pool tensor
  references; shutdown sets _blocks = [] and _home = None.
- Fix: update SlotEntry.empty_like to propagate pin_memory for QuantizedTensor
  _qdata and _params.scale (was silently unpinned).
- Remove dead code: pinned_pool.py, block_ortho.py (unreferenced).
- Audit utils/ for dead imports (PinnedBlockPool) and stale comments.

Architecture
- SlotEntry: unified data type for ring-buffer slot pool, abstracts regular
  Tensor and QuantizedTensor (fp8). copy_from() copies weight data; assign_to()
  rewires module._parameters with a fresh GPU QuantizedTensor.
- Ring buffer (cursor % N) replaces free-list for GPU slot allocation.
- PinStage @dataclass: standalone pinned CPU staging ring, built lazily from
  GPU entry metadata (safe device-independent construction).
- _detect_model_config(): merge duplicated ~80-line config detection in
  load_bernini_model (was written twice for safetensors vs full-SD paths).
- BlockSwapConfig: unified config path. model.load() accepts BerniniBlockSwap
  dataclass; model stores it as self._block_swap_config; pre_forward reads it
  directly instead of via transformer_options.

Features
- loading_mode dropdown (Full / Streaming) in BerniniR_BlockSwapArgs node.
- Block swap node exposes pin_memory, loading_mode selections.

Context window
- Fix: compatibility with differential diffusion (color blocks, artifacts) —
  correct mask accumulation and crossfade when edit_mask is active.
2026-07-17 11:28:18 +08:00