{"id":21550,"library":"lycoris-lora","title":"LyCORIS","description":"LyCORIS is a PyTorch library implementing advanced LoRA variants (LoRA, LoHa, LoKr, (IA)^3, Diag-OFT, BOFT) for parameter-efficient fine-tuning, particularly for Stable Diffusion. Current version 3.4.0, requires Python >=3.10. Active development with monthly releases.","status":"active","version":"3.4.0","language":"python","source_language":"en","source_url":"https://github.com/KohakuBlueleaf/LyCORIS","tags":["lora","loha","lokr","parameter-efficient","fine-tuning","stable-diffusion","pytorch"],"install":[{"cmd":"pip install lycoris-lora","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core tensor computation and autograd.","package":"torch","optional":false},{"reason":"Integration for Stable Diffusion model loading and inference.","package":"diffusers","optional":true}],"imports":[{"note":"In v3, LycorisNetwork is exposed at top-level. The old submodule path is deprecated.","wrong":"from lycoris.network import LycorisNetwork","symbol":"LycorisNetwork","correct":"from lycoris import LycorisNetwork"},{"note":"Utility functions moved to lycoris.utils in v3.","wrong":"from lycoris import create_lycoris_from_weights","symbol":"create_lycoris_from_weights","correct":"from lycoris.utils import create_lycoris_from_weights"}],"quickstart":{"code":"import torch\nfrom lycoris import LycorisNetwork, create_lycoris\n\nmodel = LycorisNetwork(\n    in_features=768,\n    out_features=768,\n    rank=4,\n    algo='lora'  # 'lora', 'loha', 'lokr', 'ia3', 'diyag-oft', 'boft'\n)\nlycoris = create_lycoris(model, multiplier=1.0)\nprint('LyCORIS module created successfully.')","lang":"python","description":"Create a basic LyCORIS network with LoRA algorithm."},"warnings":[{"fix":"Update imports to top-level `lycoris` module.","message":"In v3.0.0, the import paths changed. `from lycoris.network import LycorisNetwork` is deprecated; use `from lycoris import LycorisNetwork`.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use `create_lycoris(model, ...)` instead of `model.apply_to(...)`.","message":"The `LycorisNetwork` API changed: `create_lycoris` replaced the old `LycorisNetwork.apply_to` method.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Always use provided save/load methods, not torch.save on the network directly.","message":"LyCORIS modules are not serializable by default. Use `lycoris.save_weights()` and `lycoris.load_weights()` for checkpointing.","severity":"gotcha","affected_versions":"all"},{"fix":"Prefer 'loha' or 'boft' for new projects.","message":"The 'lora' algorithm is considered stable but 'lokr' may be deprecated in future releases.","severity":"deprecated","affected_versions":">=3.4.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Replace `from lycoris.network import LycorisNetwork` with `from lycoris import LycorisNetwork`.","cause":"Old import path from v2 or earlier.","error":"ModuleNotFoundError: No module named 'lycoris.network'"},{"fix":"Use `from lycoris import create_lycoris; lycoris = create_lycoris(model, ...)`.","cause":"API changed in v3. `apply_to` was removed.","error":"AttributeError: 'LycorisNetwork' object has no attribute 'apply_to'"},{"fix":"Set `num_workers=0` in DataLoader or wrap LyCORIS module in a proper nn.Module.","cause":"PyTorch DataLoader multiprocessing conflict with LyCORIS internal state.","error":"RuntimeError: DataLoader worker (pid(s) ...) exited unexpectedly"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}