{"record":{"id":"1639f3a84623f9e7","repo":"sgl-project/sglang","slug":"use-fast-use-fast-conflicts-with-image-processor","errorCode":null,"errorMessage":"use_fast={use_fast} conflicts with image_processor_backend={backend!r}.","messagePattern":"use_fast=(.+?) conflicts with image_processor_backend=(.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/hf_transformers/processor.py","lineNumber":82,"sourceCode":"    if getattr(mm_config, \"disable_fast_image_processor\", False):\n        return \"pil\"\n    return getattr(mm_config, \"image_processor_backend\", \"auto\")\n\n\ndef _normalize_image_processor_backend(\n    image_processor_backend: Optional[str], use_fast: Optional[bool]\n) -> str:\n    backend = image_processor_backend or \"auto\"\n    if backend not in _IMAGE_PROCESSOR_BACKENDS:\n        raise ValueError(\n            f\"Unsupported image processor backend: {backend}. \"\n            f\"Expected one of {sorted(_IMAGE_PROCESSOR_BACKENDS)}.\"\n        )\n\n    if use_fast is not None:\n        legacy_backend = \"torchvision\" if use_fast else \"pil\"\n        if backend not in {\"auto\", legacy_backend}:\n            raise ValueError(\n                f\"use_fast={use_fast} conflicts with \"\n                f\"image_processor_backend={backend!r}.\"\n            )\n        backend = legacy_backend\n    return backend\n\n\ndef _apply_image_processor_backend(\n    processor,\n    tokenizer_name,\n    args,\n    trust_remote_code,\n    revision,\n    backend,\n    kwargs,\n):\n    \"\"\"Apply an explicit backend only to the image sub-processor.\n","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/hf_transformers/processor.py#L64-L100","documentation":"The legacy use_fast boolean conflicts with the explicitly chosen image_processor_backend: use_fast=True maps to torchvision and use_fast=False to pil, so any other explicit backend (e.g. flash) plus use_fast is contradictory.","triggerScenarios":"Passing both --use-fast/--no-use-fast and --image-processor-backend <non-matching> to get_processor.","commonSituations":"Old scripts that set use_fast are extended with a new backend flag without removing the legacy one.","solutions":["Remove the use_fast flag and keep only image_processor_backend","Or keep use_fast and set backend to auto so it derives from the boolean"],"exampleFix":"# before\n--image-processor-backend flash --use-fast\n# after\n--image-processor-backend flash","handlingStrategy":"validation","validationCode":"if use_fast is not None and image_processor_backend not in (None,'auto','torchvision' if use_fast else 'pil'):\n    raise ConfigError('conflicting tokenizer/image processor flags')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the new image_processor_backend flag exclusively; drop legacy use_fast"],"tags":["multimodal","image-processor","conflicting-args"],"backgroundTag":"conflicting-config-options","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}