Commit Graph

3 Commits

Author SHA1 Message Date
Kohya S
f6a679e491 fix: enhance architecture detection to support InferSdxlUNet2DConditionModel for gen_img.py 2026-02-23 18:43:46 +09:00
Kohya S
aff4a2e732 feat: Enhance LoHa and LoKr modules with Tucker decomposition support
- Added Tucker decomposition functionality to LoHa and LoKr modules.
- Implemented new methods for weight rebuilding using Tucker decomposition.
- Updated initialization and weight handling for Conv2d 3x3+ layers.
- Modified get_diff_weight methods to accommodate Tucker and non-Tucker modes.
- Enhanced network base to include unet_conv_target_modules for architecture detection.
2026-02-15 23:35:17 +09:00
Kohya S
ba72f3b665 feat: Add LoHa/LoKr network support for SDXL and Anima
- networks/network_base.py: shared AdditionalNetwork base class with architecture auto-detection (SDXL/Anima) and generic module injection
- networks/loha.py: LoHa (Low-rank Hadamard Product) module with HadaWeight custom autograd, training/inference classes, and factory functions
- networks/lokr.py: LoKr (Low-rank Kronecker Product) module with factorization, training/inference classes, and factory functions
- library/lora_utils.py: extend weight merge hook to detect and merge LoHa/LoKr weights alongside standard LoRA

Linear and Conv2d 1x1 layers only; Conv2d 3x3 (Tucker decomposition) support will be added separately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:50:50 +09:00