{"record":{"id":"cc2d1d81fb86a804","repo":"unslothai/unsloth","slug":"controlnet-is-not-yet-supported-on-the-native-sd-c","errorCode":null,"errorMessage":"ControlNet is not yet supported on the native sd.cpp engine; run on a GPU (diffusers) for ControlNet conditioning.","messagePattern":"ControlNet is not yet supported on the native sd\\.cpp engine; run on a GPU \\(diffusers\\) for ControlNet conditioning\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/inference/sd_cpp_backend.py","lineNumber":2074,"sourceCode":"            or mask_image is not None\n            or reference_images\n            or (upscale is not None and upscale > 1)\n        ):\n            raise ValueError(\n                \"img2img / inpaint / reference / upscale are not yet supported on the native \"\n                \"sd.cpp engine; run on a GPU (diffusers) for image-conditioned workflows.\"\n            )\n        if prompts is not None or seeds is not None:\n            raise ValueError(\n                \"Batched prompt/seed lists are not supported on the native sd.cpp engine \"\n                \"(it renders serially); run on a GPU (diffusers) for batched generation, \"\n                \"or use batch_size for a serial native batch.\"\n            )\n        # strength 0/None disables ControlNet (matches diffusers), so no-op it rather than 400.\n        if controlnet is not None and controlnet[3] in (None, 0, 0.0):\n            controlnet = None\n        if controlnet is not None:\n            raise ValueError(\n                \"ControlNet is not yet supported on the native sd.cpp engine; run on a GPU \"\n                \"(diffusers) for ControlNet conditioning.\"\n            )\n\n        cancel = threading.Event()\n        with self._generate_lock:\n            with self._lock:\n                state = self._state\n                if state is None:\n                    raise RuntimeError(DIFFUSION_NOT_LOADED_MSG)\n                # A resident server can exit while idle; drop stale state and report not-loaded so the client gets the reload path, not a 500.\n                if (\n                    state.mode == \"server\"\n                    and state.server is not None\n                    and not state.server.is_alive()\n                ):\n                    self._state = None\n                    raise RuntimeError(DIFFUSION_NOT_LOADED_MSG)","sourceCodeStart":2056,"sourceCodeEnd":2092,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/sd_cpp_backend.py#L2056-L2092","documentation":"ValueError: ControlNet conditioning is not implemented on the native sd.cpp engine. Note the preceding no-op: controlnet tuples whose strength component (index 3) is None/0/0.0 are silently dropped (matching diffusers semantics), so this fires only for genuinely active ControlNet.","triggerScenarios":"generate() with controlnet not None and strength not in (None, 0, 0.0) on the native engine.","commonSituations":"Reusing diffusers-era request payloads that always attach a ControlNet; UI defaulting a control model on.","solutions":["Run ControlNet workflows on the diffusers engine (GPU).","Set the controlnet strength to 0/None (or omit controlnet) for native generation — it is treated as disabled."],"exampleFix":"# before\nbackend.generate(prompt='a cat', controlnet=(model, image, None, 0.8))\n\n# after\nbackend.generate(prompt='a cat', controlnet=(model, image, None, 0.0))  # no-op on native; or use diffusers","handlingStrategy":"validation","validationCode":"if controlnet is not None and controlnet[3] not in (None, 0, 0.0):\n    route_to_diffusers_engine(request)  # active ControlNet needs diffusers","typeGuard":"def controlnet_is_active(controlnet) -> bool:\n    return controlnet is not None and controlnet[3] not in (None, 0, 0.0)","tryCatchPattern":null,"preventionTips":["Default controlnet to None in client presets instead of carrying diffusers defaults over.","Strip strength-0 ControlNet rows client-side (the engine treats them as disabled anyway)."],"tags":["capability","validation","controlnet","sd-cpp"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}