{"record":{"id":"ac2e84844a0e7a28","repo":"mudler/LocalAI","slug":"pipeline-class-pipeline-class-name-does-not","errorCode":null,"errorMessage":"Pipeline class {pipeline_class.__name__} does not support from_single_file(). Use from_pretrained() instead.","messagePattern":"Pipeline class (.+?) does not support from_single_file\\(\\)\\. Use from_pretrained\\(\\) instead\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/python/diffusers/diffusers_dynamic_loader.py","lineNumber":489,"sourceCode":"    # Resolve the pipeline class\n    pipeline_class = resolve_pipeline_class(\n        class_name=class_name,\n        task=task,\n        model_id=model_id\n    )\n\n    # If no model_id provided but we have a class, we can't load\n    if model_id is None:\n        raise ValueError(\"model_id is required to load a pipeline\")\n\n    # Load the pipeline\n    try:\n        if from_single_file:\n            # Check if the class has from_single_file method\n            if hasattr(pipeline_class, 'from_single_file'):\n                return pipeline_class.from_single_file(model_id, **kwargs)\n            else:\n                raise ValueError(\n                    f\"Pipeline class {pipeline_class.__name__} does not support from_single_file(). \"\n                    f\"Use from_pretrained() instead.\"\n                )\n        else:\n            return pipeline_class.from_pretrained(model_id, **kwargs)\n\n    except Exception as e:\n        # Provide helpful error message\n        available = get_available_pipelines()\n        raise RuntimeError(\n            f\"Failed to load pipeline '{pipeline_class.__name__}' from '{model_id}': {e}\\n\"\n            f\"Available pipelines: {', '.join(available[:20])}...\"\n        ) from e\n\n\ndef get_pipeline_info(class_name: str) -> Dict[str, Any]:\n    \"\"\"\n    Get information about a specific pipeline class.","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/python/diffusers/diffusers_dynamic_loader.py#L471-L507","documentation":"Raised by load_diffusers_pipeline when from_single_file=True was requested but the resolved pipeline class lacks a from_single_file() method. Only single-file-capable pipelines (ckpt/safetenders checkpoints) implement it; the error tells you to use from_pretrained() with a diffusers-layout model directory instead.","triggerScenarios":"Loading a .ckpt/.safetensors single checkpoint file with from_single_file=True where the resolved class (e.g. a newer pipeline like FluxPipeline in some versions, or a custom subclass) does not implement from_single_file.","commonSituations":"Pointing the single-file flag at a model that only ships in diffusers directory format, an older diffusers version where from_single_file had limited class coverage, or resolving to the generic DiffusionPipeline fallback class which may not expose the method.","solutions":["If the model is a diffusers-format directory, drop from_single_file and pass the directory as model_id (uses from_pretrained).","Upgrade diffusers — from_single_file coverage widened over versions.","Pick a pipeline class known to support single-file loading (StableDiffusionPipeline, StableDiffusionXLPipeline).","Convert the checkpoint to diffusers layout once and always load via from_pretrained."],"exampleFix":"# before\nload_diffusers_pipeline(class_name=\"FluxPipeline\", model_id=\"model.safetensors\", from_single_file=True)\n\n# after\nload_diffusers_pipeline(class_name=\"FluxPipeline\", model_id=\"/models/flux-diffusers\")","handlingStrategy":"validation","validationCode":"cls = resolve_pipeline_class(class_name=class_name)\nsupports_single_file = hasattr(cls, 'from_single_file')\nassert not from_single_file or supports_single_file, f\"{cls.__name__} cannot load single files\"","typeGuard":"def supports_single_file(class_name: str) -> bool:\n    cls = resolve_pipeline_class(class_name=class_name)\n    return hasattr(cls, \"from_single_file\")","tryCatchPattern":"try:\n    pipe = load_diffusers_pipeline(class_name=c, model_id=m, from_single_file=True)\nexcept ValueError as e:\n    if \"does not support from_single_file\" in str(e):\n        pipe = load_diffusers_pipeline(class_name=c, model_id=m)  # dir-format fallback\n    else:\n        raise","preventionTips":["Detect checkpoint format up front: single .ckpt/.safetensors file vs diffusers directory.","Only set from_single_file for classes known to implement it.","Prefer diffusers-layout models to sidestep the distinction entirely."],"tags":["diffusers","single-file","pipeline-loading","checkpoint-format"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}