{"record":{"id":"c866d06869e2d4d6","repo":"unslothai/unsloth","slug":"gguf-lora-adapters-are-not-supported-on-the-diffus","errorCode":null,"errorMessage":"GGUF LoRA adapters are not supported on the diffusers engine ({', '.join(bad)}); use a .safetensors adapter, or the native engine.","messagePattern":"GGUF LoRA adapters are not supported on the diffusers engine \\((.+?)\\); use a \\.safetensors adapter, or the native engine\\.","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"studio/backend/core/inference/diffusion.py","lineNumber":4988,"sourceCode":"        cancel: Optional[threading.Event] = None,\n    ) -> tuple[tuple[str, str, float], ...]:\n        \"\"\"Resolve (id, weight) specs to a ``(name, path, weight)`` tuple set for diffusers.\n\n        Shared by the generation-time apply path and the quant load-time bake so both produce\n        IDENTICAL tuples for the same request (the no-op / weight-only comparisons depend on it).\n        \"\"\"\n        from core.inference import diffusion_lora\n\n        resolved = diffusion_lora.resolve_specs(\n            specs,\n            family = family,\n            hf_token = hf_token,\n            cancel_event = cancel,\n        )\n        # diffusers load_lora_weights takes safetensors only; reject a .gguf adapter as a clean 400.\n        bad = [r.id for r in resolved if r.fmt != \"safetensors\"]\n        if bad:\n            raise ValueError(\n                \"GGUF LoRA adapters are not supported on the diffusers engine \"\n                f\"({', '.join(bad)}); use a .safetensors adapter, or the native engine.\"\n            )\n        # Unique adapter names (diffusers requires distinct names; sanitized stems can collide).\n        uniq: list[tuple[str, str, float]] = []\n        seen: set[str] = set()\n        for r in resolved:\n            name = r.alias\n            n = 1\n            while name in seen:\n                n += 1\n                name = f\"{r.alias}_{n}\"\n            seen.add(name)\n            uniq.append((name, r.path, r.weight))\n        return tuple(uniq)\n\n    def _apply_loras(\n        self, state: Any, loras: Optional[list[tuple[str, float]]], cancel: threading.Event","sourceCodeStart":4970,"sourceCodeEnd":5006,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/diffusion.py#L4970-L5006","documentation":"Raised in `_resolve_lora_set` after `diffusion_lora.resolve_specs` resolves the requested LoRA specs: any adapter whose resolved format is not 'safetensors' (i.e. a .gguf LoRA) is rejected because diffusers' `load_lora_weights` accepts safetensors only. The offending adapter ids are joined into the message, and it is a ValueError so the API returns a clean 400 pointing at alternatives (.safetensors adapter or the native engine).","triggerScenarios":"Passing a `loras` spec list where at least one id resolves to a .gguf-format adapter (r.fmt != 'safetensors') while running on the diffusers engine; e.g. a GGUF-quantized LoRA from a Hub repo that only ships gguf artifacts.","commonSituations":"Users downloading GGUF LoRAs (common in the sd.cpp/llama.cpp ecosystem) and trying them in a diffusers-based studio; Hub repos that publish both formats with the GGUF first; mixing native-engine model packs into the diffusers engine.","solutions":["Find or request a .safetensors build of the same LoRA adapter and use that id.","Convert the GGUF LoRA back to safetensors with an external tool, then reference the converted file.","Switch the job to the native engine (sd_cpp), which accepts GGUF adapters."],"exampleFix":"# before\ndiffusion.generate(prompt=\"...\", loras=[(\"quant-lora:gguf\", 1.0)])\n# after\ndiffusion.generate(prompt=\"...\", loras=[(\"same-lora:safetensors\", 1.0)])","handlingStrategy":"validation","validationCode":"# Resolve adapter format before generate\nspecs = diffusion_lora.resolve_specs(lora_specs, family=family)\nif any(r.fmt != \"safetensors\" for r in resolved):\n    raise ValueError(\"pick .safetensors adapters for the diffusers engine\")","typeGuard":"def all_safetensors(resolved: list) -> bool:\n    \"\"\"Every resolved LoRA spec is a safetensors adapter the diffusers engine can load.\"\"\"\n    return all(r.fmt == \"safetensors\" for r in resolved)","tryCatchPattern":"try:\n    diffusion.generate(prompt=p, loras=loras)\nexcept ValueError as e:\n    if \"GGUF LoRA adapters are not supported\" in str(e):\n        loras = [to_safetensors_equivalent(l) for l in loras]\n        diffusion.generate(prompt=p, loras=loras)\n    else:\n        raise","preventionTips":["Curate LoRA sources to safetensors-only repos for the diffusers engine.","Check file extensions/format metadata when importing adapters into libraries.","Remember the native engine (sd_cpp) is the GGUF-adapter path."],"tags":["diffusion","lora","gguf","safetensors","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}