{"record":{"id":"fde90796931fc47f","repo":"BerriAI/litellm","slug":"unsupported-size-value-size-use-a-known-size-fde907","errorCode":null,"errorMessage":"Unsupported size value: '{size}'. Use a known size (e.g., '1024x1024') or a custom 'WIDTHxHEIGHT' string.","messagePattern":"Unsupported size value: '(.+?)'\\. Use a known size \\(e\\.g\\., '1024x1024'\\) or a custom 'WIDTHxHEIGHT' string\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/image_generation/mai_transformation.py","lineNumber":188,"sourceCode":"            \"1792x1024\": (1792, 1024),\n            \"1024x1792\": (1024, 1792),\n            \"512x512\": (512, 512),\n            \"256x256\": (256, 256),\n        }\n\n        if size in size_mapping:\n            width, height = size_mapping[size]\n            optional_params[\"width\"] = width\n            optional_params[\"height\"] = height\n        elif \"x\" in size:\n            try:\n                width, height = map(int, size.lower().split(\"x\"))\n                optional_params[\"width\"] = width\n                optional_params[\"height\"] = height\n            except ValueError:\n                raise ValueError(f\"Invalid size format: '{size}'. Expected format 'WIDTHxHEIGHT' (e.g., '1024x1024').\")\n        else:\n            raise ValueError(\n                f\"Unsupported size value: '{size}'. \"\n                f\"Use a known size (e.g., '1024x1024') or a custom 'WIDTHxHEIGHT' string.\"\n            )\n\n    def transform_image_generation_response(\n        self,\n        model: str,\n        raw_response: httpx.Response,\n        model_response: ImageResponse,\n        logging_obj: \"LiteLLMLoggingObj\",\n        request_data: dict,\n        optional_params: dict,\n        litellm_params: dict,\n        encoding: Any,\n        api_key: str | None = None,\n        json_mode: bool | None = None,\n    ) -> ImageResponse:\n        try:","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/azure_ai/image_generation/mai_transformation.py#L170-L206","documentation":"Error \"Unsupported size value: '{size}'. Use a known size (e.g., '1024x1024') or a custom 'WIDTHxHEIGHT' string.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/image_generation/mai_transformation.py:188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a known size or a valid 'WIDTHxHEIGHT' string."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}