{"record":{"id":"95c0a05bc9da96c9","repo":"sgl-project/sglang","slug":"expected-hunyuan3d2pipelineconfig-got-type-confi","errorCode":null,"errorMessage":"Expected Hunyuan3D2PipelineConfig, got {type(config)}","messagePattern":"Expected Hunyuan3D2PipelineConfig, got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines/hunyuan3d_pipeline.py","lineNumber":505,"sourceCode":"            )\n            components[\"delight_scheduler\"] = (\n                EulerAncestralDiscreteScheduler.from_config(delight_scheduler_config)\n            )\n\n        return components\n\n    # Module loading override\n    def load_modules(\n        self,\n        server_args: ServerArgs,\n        loaded_modules: dict[str, torch.nn.Module] | None = None,\n    ) -> dict[str, Any]:\n        \"\"\"Load Hunyuan3D shape and optional texture components.\"\"\"\n        del loaded_modules\n\n        config = server_args.pipeline_config\n        if not isinstance(config, Hunyuan3D2PipelineConfig):\n            raise TypeError(f\"Expected Hunyuan3D2PipelineConfig, got {type(config)}\")\n\n        model_path = config.shape_model_path or server_args.model_path\n\n        logger.info(\"Loading Hunyuan3D shape models from %s\", model_path)\n\n        config_path, ckpt_path = self._resolve_shape_dir(\n            model_path,\n            config.shape_subfolder,\n            config.shape_use_safetensors,\n            config.shape_variant,\n        )\n\n        with open(config_path, \"r\") as f:\n            model_config = yaml.safe_load(f)\n\n        ckpt = self._load_and_split_checkpoint(ckpt_path, config.shape_use_safetensors)\n\n        dtype = torch.float16","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines/hunyuan3d_pipeline.py#L487-L523","documentation":"Raised by Hunyuan3D2Pipeline.load_modules when server_args.pipeline_config is not a Hunyuan3D2PipelineConfig instance. The pipeline reads component paths (shape model, texture model) exclusively from this typed config, so any other config type (or None) is rejected early with a TypeError rather than failing later with attribute errors.","triggerScenarios":"Calling load_modules(server_args) on the Hunyuan3D pipeline when server_args.pipeline_config is None, a generic PipelineConfig, or a config belonging to a different model family; e.g. launching the server with --pipeline hunyuan3d but without constructing Hunyuan3D2PipelineConfig in server args.","commonSituations":"Server args built programmatically or reused from another model's launch path; a default pipeline_config left as None; tests instantiating the pipeline with bare ServerArgs; version changes that renamed or moved the config class so an old import produces a lookalike object.","solutions":["Set server_args.pipeline_config to a Hunyuan3D2PipelineConfig instance before launching the Hunyuan3D pipeline (configure shape_model_path/texture settings on it)","If constructing ServerArgs manually, import the config from the same module/version of sglang as the pipeline to avoid class-identity mismatches","Add an isinstance assertion in your launcher right after assigning pipeline_config to fail fast with your own message"],"exampleFix":"// before\nserver_args.pipeline_config = None  # or generic config\npipeline.load_modules(server_args)\n\n// after\nfrom sglang.multimodal_gen.runtime.pipelines.hunyuan3d_pipeline import Hunyuan3D2PipelineConfig\nserver_args.pipeline_config = Hunyuan3D2PipelineConfig(shape_model_path=...)\nassert isinstance(server_args.pipeline_config, Hunyuan3D2PipelineConfig)\npipeline.load_modules(server_args)","handlingStrategy":"type-guard","validationCode":"from sglang.multimodal_gen.runtime.pipelines.hunyuan3d_pipeline import Hunyuan3D2PipelineConfig\nif not isinstance(server_args.pipeline_config, Hunyuan3D2PipelineConfig):\n    server_args.pipeline_config = Hunyuan3D2PipelineConfig(shape_model_path=server_args.model_path)","typeGuard":"def is_hunyuan3d_config(cfg: object) -> TypeGuard[Hunyuan3D2PipelineConfig]:\n    return isinstance(cfg, Hunyuan3D2PipelineConfig)","tryCatchPattern":null,"preventionTips":["Always construct the typed pipeline config in the same launch function that selects the pipeline","Add an isinstance assertion on pipeline_config right after building ServerArgs","Import config classes from the same sglang version as the pipeline to avoid identity mismatch"],"tags":["hunyuan3d","pipeline-config","type-mismatch","sglang"],"backgroundTag":"pipeline-config-type-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}