Krea2ControlNetLoraLoader with an SDXL LLLite/ControlNet file (e.g.
kohya_controllllite_xl_openpose_anime_v2.safetensors) produced a generic
'No block LoRA patches matched' RuntimeError because the file has no
*.lora_A/*.lora_B pairs at all. Add a fast sanity check in the openpose
route that raises an actionable message naming the file type mismatch and
the correct Krea2 openpose LoRA to load.
Replicates the krea2_controlnet_pose.json reference workflow inside this node
(ostris nodes are no longer required):
- _krea2_make_ref_kv_forward: replaces diffusion_model.forward so reference
latents run in isolated kv_cache mode — one t=0 ref-only pass precomputes
every block's K/V (refs attend only to each other), reused as extra
attention keys each denoising step. This matches the ai-toolkit kv_cache
training convention the openpose control LoRA was trained with
- New helpers: _krea2_patchify, _krea2_ref_pack (RoPE axis-0 index i+1),
_krea2_ref_attn_kv (K/V capture/inject), _krea2_ref_block_forward,
_krea2_ref_precompute_kv, _krea2_forward_with_cached_refs,
_krea2_ref_fingerprint (content-keyed cache)
- New optional node input use_kv_cache (default True); when False the stock
joint-mode ref path is used instead
- extra_conds ref injection retained: skipped when conditioning already
carries reference_latents (TextEncodeKrea2OstrisEdit compat), so the VLM
vision path can still be combined without double injection
- depth / zimage / nunchaku_qwenimage / qwenimage_standard routes unchanged
The openpose control LoRA is a Kontext-style conditioning LoRA (blocks +
txtfusion, no expanded first projection). The previous openpose path only
applied the LoRA patches and never injected the pose image, so generation had
no pose control at all.
- _apply_krea2_openpose_control now VAE-encodes the control image (fit ~1MP,
snapped /16, ai-toolkit convention) and injects it as a reference latent
via patched extra_conds / extra_conds_shapes with
ref_latents_method=index_timestep_zero (native Krea2 ref pathway)
- Injection is skipped when the conditioning already carries
reference_latents (e.g. TextEncodeKrea2OstrisEdit), so the VLM vision path
wins and no double injection occurs
- depth / zimage / nunchaku_qwenimage / qwenimage_standard routes unchanged
- Add _classify_krea2_control_type() to detect depth vs openpose by first.weight presence
- Add _apply_krea2_openpose_control() for pure block LoRA (no first projection, no control latent)
- Route txtfusion.* keys in _krea2_target_key for layerwise/refiner blocks
- Split krea2 route into depth (unchanged) / openpose (new) exclusive branches
- No changes to zimage/nunchaku/qwenimage_standard routes or loader node
\Add a dedicated Krea2 ControlNet LoRA loader node and register it in node mappings. Keep control logic in the existing controlnet patcher and add Krea2 model detection there.\