krita-ai-diffusion icon indicating copy to clipboard operation
krita-ai-diffusion copied to clipboard

Qwen Nunchaku LoRA loader nodes

Open Danamir opened this issue 2 months ago • 2 comments

I tested the custom nodes available at https://github.com/ussoewwin/ComfyUI-QwenImageLoraLoader since the Nunchaku team seems quite overloaded at the time.

Those works really well with Qwen-Image, Qwen-Image-Edit and Qwen-Image-Edit-2509 !

Danamir avatar Nov 16 '25 13:11 Danamir

Yes... the situation isn't ideal, I don't really want to add another custom nodes dependency for what is likely to be a temporary solution.

Acly avatar Nov 17 '25 10:11 Acly

Yes of course, this was more of an info for anyone still waiting for this support on Nunchaku's side.

For anyone with a custom ComfyUI installation and adventurous enough to alter his local krita-ai-diffusion files, the patch is pretty simple. Start by installing the custom nodes, then :

In worfklow.py replace :

        elif arch.is_qwen_like and model_info.quantization is Quantization.svdq:
            raise RuntimeError("Lora are not yet supported with quantized Qwen models")

by :

        elif arch.is_qwen_like and model_info.quantization is Quantization.svdq:
            model = w.nunchaku_load_qwen_lora(model, lora.name, lora.strength)

And in comfy_workflow.py add this method:

    def nunchaku_load_qwen_lora(self, model: Output, name: str, strength: float):
        return self.add(
            "NunchakuQwenImageLoraLoader",
            1,
            model=model,
            lora_name=name,
            lora_strength=strength,
            cpu_offload="auto"
        )

Danamir avatar Nov 17 '25 15:11 Danamir

I edit comfy_workflow.py with NunchakuQwenImageLoraLoader as in your method, but Krita keeps crashing after 20 seconds running any job. So I replace it with NunchakuQwenImageLoraStack and it works.

CatnipCoder avatar Nov 29 '25 21:11 CatnipCoder