{"record":{"id":"c6eb535d920a796a","repo":"mudler/LocalAI","slug":"resolution-must-be-480p-or-720p","errorCode":null,"errorMessage":"resolution must be 480p or 720p","messagePattern":"resolution must be 480p or 720p","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/python/longcat-video/backend.py","lineNumber":167,"sourceCode":"            if not self.torch.cuda.is_available():\n                return self._fail(\n                    context,\n                    grpc.StatusCode.FAILED_PRECONDITION,\n                    \"longcat-video requires an NVIDIA CUDA GPU\",\n                )\n            if request.TensorParallelSize > 1:\n                return self._fail(\n                    context,\n                    grpc.StatusCode.UNIMPLEMENTED,\n                    \"longcat-video currently supports one GPU per backend process\",\n                )\n            self._import_runtime()\n\n            attention_name = str(options.get(\"attention_backend\", \"sdpa\")).lower()\n            attention_overrides(attention_name)\n            resolution = str(options.get(\"resolution\", \"480p\")).lower()\n            if resolution not in {\"480p\", \"720p\"}:\n                raise ValueError(\"resolution must be 480p or 720p\")\n\n            use_distill_default = model_kind == MODEL_KIND_AVATAR\n            use_distill = require_bool(\n                options.get(\"use_distill\", use_distill_default),\n                \"use_distill\",\n            )\n            use_int8 = require_bool(options.get(\"use_int8\", False), \"use_int8\")\n            if model_kind == MODEL_KIND_BASE and use_int8:\n                raise ValueError(\n                    \"use_int8 is supported only by LongCat-Video-Avatar-1.5\"\n                )\n\n            self.options = {\n                **options,\n                \"attention_backend\": attention_name,\n                \"resolution\": resolution,\n                \"use_distill\": use_distill,\n                \"use_int8\": use_int8,","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/python/longcat-video/backend.py#L149-L185","documentation":"ValueError raised during longcat-video model loading when the 'resolution' option is anything other than '480p' or '720p' (case-insensitive, default '480p'). LongCat-Video pipelines are compiled/trained at fixed resolutions, so the value is validated and normalized before being stored into self.options.","triggerScenarios":"LoadModel with options {\"resolution\": \"1080p\"} or \"480\" or \"hd\"; passing a numeric resolution like \"854x480\"; a typo such as \"720P \" is fine (lowercased) but \"720\" is not.","commonSituations":"User assumes arbitrary resolutions are supported because other video backends accept width/height; copy-pasting resolution strings from diffusion configs.","solutions":["Set resolution to exactly '480p' or '720p' (any casing) or omit it to get the 480p default","Remove custom resolution strings like widthxheight from longcat-video options"],"exampleFix":"# before\noptions:\n  resolution: 1080p\n\n# after\noptions:\n  resolution: 720p","handlingStrategy":"validation","validationCode":"VALID_RESOLUTIONS = {\"480p\", \"720p\"}\n\ndef normalize_resolution(options: dict) -> dict:\n    res = str(options.get(\"resolution\", \"480p\")).strip().lower()\n    if res not in VALID_RESOLUTIONS:\n        raise ValueError(f\"resolution must be one of {sorted(VALID_RESOLUTIONS)}, got {options.get('resolution')!r}\")\n    return {**options, \"resolution\": res}","typeGuard":"def is_valid_resolution(value) -> bool:\n    return isinstance(value, str) and value.strip().lower() in {\"480p\", \"720p\"}","tryCatchPattern":"try:\n    stub.LoadModel(model_options)\nexcept grpc.RpcError as e:\n    if \"resolution must be\" in (e.details() or \"\"):\n        model_options[\"options\"][\"resolution\"] = \"480p\"\n        stub.LoadModel(model_options)\n    else:\n        raise","preventionTips":["Treat resolution as an enum in your config layer, not free-form text","Centralize longcat-video option normalization in one helper used by every model config"],"tags":["python","longcat-video","video-generation","configuration","validation"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}