Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions nunchaku/lora/qwenimage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
Qwen Image LoRA module for Nunchaku.

This module provides utilities for loading, converting, and composing LoRA weights
for Qwen Image models in Nunchaku's quantized inference framework.

Main Functions
--------------
- :func:`to_diffusers` : Convert LoRA to Diffusers format
- :func:`to_nunchaku` : Convert LoRA to Nunchaku format
- :func:`compose_lora` : Compose multiple LoRAs
- :func:`is_nunchaku_format` : Check if LoRA is in Nunchaku format
- :func:`convert_to_nunchaku_qwenimage_lowrank_dict` : Convert full model LoRA

Example Usage
-------------
>>> from nunchaku.lora.qwenimage import to_nunchaku, compose_lora
>>> # Convert a single LoRA
>>> lora_nunchaku = to_nunchaku("lora.safetensors", output_path="lora_nunchaku.safetensors")
>>> # Compose multiple LoRAs
>>> composed = compose_lora([("lora1.safetensors", 0.8), ("lora2.safetensors", 0.6)])
>>> # Convert the composed LoRA to Nunchaku format
>>> lora_nunchaku = to_nunchaku(composed, output_path="composed_nunchaku.safetensors")
"""

from .compose import compose_lora
from .diffusers_converter import to_diffusers
from .nunchaku_converter import convert_to_nunchaku_qwenimage_lowrank_dict, fuse_vectors, to_nunchaku
from .utils import is_nunchaku_format

__all__ = [
"to_diffusers",
"to_nunchaku",
"compose_lora",
"convert_to_nunchaku_qwenimage_lowrank_dict",
"fuse_vectors",
"is_nunchaku_format",
]
411 changes: 411 additions & 0 deletions nunchaku/lora/qwenimage/compose.py

Large diffs are not rendered by default.

Loading