{"record":{"id":"87f2aa162a457702","repo":"sgl-project/sglang","slug":"prediction-type-given-as-self-config-prediction-t-87f2aa","errorCode":null,"errorMessage":"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, `sample`, `v_prediction`, or `flow_prediction` for the UniPCMultistepScheduler.","messagePattern":"prediction_type given as (.+?) must be one of `epsilon`, `sample`, `v_prediction`, or `flow_prediction` for the UniPCMultistepScheduler\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py","lineNumber":756,"sourceCode":"                \"1.0.0\",\n                \"Passing `timesteps` is deprecated and has no effect as model output conversion is now handled via an internal counter `self.step_index`\",\n            )\n\n        sigma = self.sigmas[self.step_index]\n        alpha_t, sigma_t = self._sigma_to_alpha_sigma_t(sigma)\n\n        if self.predict_x0:\n            if self.config.prediction_type == \"epsilon\":\n                x0_pred = (sample - sigma_t * model_output) / alpha_t\n            elif self.config.prediction_type == \"sample\":\n                x0_pred = model_output\n            elif self.config.prediction_type == \"v_prediction\":\n                x0_pred = alpha_t * sample - sigma_t * model_output\n            elif self.config.prediction_type == \"flow_prediction\":\n                sigma_t = self.sigmas[self.step_index]\n                x0_pred = sample - sigma_t * model_output\n            else:\n                raise ValueError(\n                    f\"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, `sample`, \"\n                    \"`v_prediction`, or `flow_prediction` for the UniPCMultistepScheduler.\"\n                )\n\n            if self.config.thresholding:\n                x0_pred = self._threshold_sample(x0_pred)\n\n            return x0_pred\n        else:\n            if self.config.prediction_type == \"epsilon\":\n                return model_output\n            elif self.config.prediction_type == \"sample\":\n                epsilon = (sample - alpha_t * model_output) / sigma_t\n                return epsilon\n            elif self.config.prediction_type == \"v_prediction\":\n                epsilon = alpha_t * model_output + sigma_t * sample\n                return epsilon\n            else:","sourceCodeStart":738,"sourceCodeEnd":774,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py#L738-L774","documentation":"In convert_model_output (x0-prediction branch, predict_x0=True / flow models), config.prediction_type must be 'epsilon', 'sample', 'v_prediction', or 'flow_prediction'; any other value cannot be converted to a clean-image prediction x0.","triggerScenarios":"Scheduler config with prediction_type='sample_prediction', 'x0', or set for a flow model but missing 'flow_prediction' (e.g. 'v' instead of 'v_prediction'), then calling step().","commonSituations":"Loading v-prediction or flow-matching checkpoints with a mismatched scheduler config; hand-edited configs using shorthand prediction names.","solutions":["Set prediction_type to one of 'epsilon','sample','v_prediction','flow_prediction' matching how the model was trained","For flow-matching models use 'flow_prediction' with use_flow_sigmas=True","Reload the original scheduler_config.json that shipped with the model"],"exampleFix":"// before\nUniPCMultistepScheduler.from_config(cfg, prediction_type=\"v\")\n// after\nUniPCMultistepScheduler.from_config(cfg, prediction_type=\"v_prediction\")","handlingStrategy":"validation","validationCode":"assert cfg[\"prediction_type\"] in {\"epsilon\", \"sample\", \"v_prediction\", \"flow_prediction\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match prediction_type to how the checkpoint was trained","Flow models need 'flow_prediction' with predict_x0=True"],"tags":["scheduler","diffusion","prediction-type","unipc"],"backgroundTag":"unsupported-parameter-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}