Skip to content

feat: introduce two LoKR variants - KronA and CDKA#2370

Open
gesen2egee wants to merge 13 commits into
kohya-ss:mainfrom
gesen2egee:feat/krona-support
Open

feat: introduce two LoKR variants - KronA and CDKA#2370
gesen2egee wants to merge 13 commits into
kohya-ss:mainfrom
gesen2egee:feat/krona-support

Conversation

@gesen2egee

@gesen2egee gesen2egee commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This PR introduces two Kronecker-product-based network adapter variants designed for parameter-efficient fine-tuning: KronA and CDKA.

KronA is inspired by the WACV-2025 paper "DiffuseKronA".
CDKA is an improved successor to KronA, operating with a default R=1 and adapted for LoKR structures.

These adapters achieve significant parameter reduction while enhancing anti-overfitting capabilities, making them highly effective for personalizing and fine-tuning diffusion models on small datasets.

Both modules share a unified isomorphic codebase architecture. By adjusting parameters and default configurations, they can easily convert into each other:

  • KronA: Supports custom Rank configurations as described in the original paper.
  • CDKA: Operating with a default rank constraint of $R=1$, adapted for LoKR structures, and supports the custom cdka_alpha scaling mechanism.

References

Extra Features Supported:

  • DoRA: Introduced weight decomposition support (weight_decompose=True) to decouple weight updates into magnitude and direction.

  • ALLoRA: Dynamically schedules layer-wise learning rates based on adapter weight norms. It automates learning rate balancing (like LoRA+) and prevents gradient collapse across deep layers.

Recommended Configurations

You can configure the network in your training configuration (e.g., .toml files) as follows.
And use any method that supports general LoKR to infer the trained model.

[network]
network_module = "networks.cdka"
network_args = [
    'exclude_patterns=["^(?=.*attn)(?!.*adaln).*$"]',
    "allora=True"
]
network_train_unet_only = true

A slightly higher learning rate than usual (e.g., 3e-4) can be used.

@gesen2egee
gesen2egee force-pushed the feat/krona-support branch from fb949c2 to 5996c84 Compare June 10, 2026 10:28
@gesen2egee gesen2egee changed the title feat: add KronA (Kronecker Product Adaption) network module feat: introduce two LoKR variants - KronA and CDKA Jun 10, 2026
Muffalo52 added a commit to Muffalo52/sd-scripts that referenced this pull request Jul 11, 2026
from kohya_ss/sd-scripts PR kohya-ss#2370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant