{"record":{"id":"e302c0a0af4638fa","repo":"unslothai/unsloth","slug":"lora-is-not-supported-for-state-family-name-on-t","errorCode":null,"errorMessage":"LoRA is not supported for {state.family.name} on the native sd.cpp engine.","messagePattern":"LoRA is not supported for (.+?) on the native sd\\.cpp engine\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/inference/sd_cpp_backend.py","lineNumber":2112,"sourceCode":"                # Publish an active (step 0) state before the slow pre-generate setup so a reload probe does not read idle while this holds _generate_lock.\n                self._gen = _SdGen(total_steps = int(steps))\n            try:\n                if seed is None:\n                    seed = int.from_bytes(os.urandom(6), \"big\") & ((1 << 53) - 1)\n                else:\n                    seed = int(seed)\n                cfg_scale, flux_guidance = _map_guidance(state.family, guidance)\n                # Resolve selected LoRAs up front (a bad id gives a clear 400). Drop weight-0 rows BEFORE the support gate so an only-disabled request stays a no-op.\n                lora_resolved: list = []\n                active_loras = [(i, w) for (i, w) in (loras or []) if w != 0]\n                if active_loras:\n                    if not diffusion_lora.supports_lora(\n                        engine = \"sd_cpp\",\n                        family = state.family.name,\n                        model_kind = \"gguf\",\n                        transformer_quant = None,\n                    ):\n                        raise ValueError(\n                            f\"LoRA is not supported for {state.family.name} on the native \"\n                            \"sd.cpp engine.\"\n                        )\n                    lora_resolved = diffusion_lora.resolve_specs(\n                        active_loras,\n                        family = state.family.name,\n                        hf_token = state.hf_token,\n                        cancel_event = cancel,\n                    )\n                if state.mode == \"server\" and state.server is not None:\n                    images, seeds = self._generate_server(\n                        state,\n                        prompt = prompt,\n                        negative_prompt = negative_prompt,\n                        width = width,\n                        height = height,\n                        steps = steps,\n                        seed = seed,","sourceCodeStart":2094,"sourceCodeEnd":2130,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/sd_cpp_backend.py#L2094-L2130","documentation":"ValueError: LoRA conditioning was requested (after weight-0 rows were dropped, so at least one active LoRA remains) but diffusion_lora.supports_lora reports no LoRA support for this family on the sd_cpp engine with gguf model kind. Zero-weight LoRAs are deliberately ignored before this gate so disable-only requests stay no-ops.","triggerScenarios":"generate() with loras=[(id, weight)] where weight != 0, on a family without sd.cpp LoRA support.","commonSituations":"Recipes recorded on a diffusers host (with LoRAs) replayed on a native sd.cpp host; UI carrying over a default LoRA selection when the engine switches.","solutions":["Remove the LoRAs (or set all weights to 0) for native generation on that family.","Run LoRA workflows on the diffusers engine/GPU where the family is supported.","Check the family's LoRA support matrix before building UI options for the native engine."],"exampleFix":"# before\nbackend.generate(prompt='a cat', loras=[('my-lora-id', 0.7)])\n\n# after\nbackend.generate(prompt='a cat', loras=[('my-lora-id', 0)])  # disabled; or use diffusers engine","handlingStrategy":"validation","validationCode":"from core.inference import diffusion_lora\n\nactive = [(i, w) for i, w in (loras or []) if w != 0]\nif active and not diffusion_lora.supports_lora(engine='sd_cpp', family=family_name, model_kind='gguf', transformer_quant=None):\n    loras = []  # drop unsupported LoRAs, or switch engine","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Query supports_lora before exposing LoRA controls for a family on the native engine.","Strip zero-weight LoRA rows client-side; the engine ignores them but explicit is clearer."],"tags":["capability","lora","validation","sd-cpp"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}