{"record":{"id":"69eebfa948d9782a","repo":"BerriAI/litellm","slug":"flux-2-image-edit-requires-a-prompt","errorCode":null,"errorMessage":"FLUX 2 image edit requires a prompt.","messagePattern":"FLUX 2 image edit requires a prompt\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/image_edit/flux2_transformation.py","lineNumber":105,"sourceCode":"        return headers\n\n    def transform_image_edit_request(\n        self,\n        model: str,\n        prompt: str | None,\n        image: FileTypes | None,\n        image_edit_optional_request_params: dict,\n        litellm_params: GenericLiteLLMParams,\n        headers: dict,\n    ) -> tuple[dict, RequestFiles]:\n        \"\"\"\n        Transform image edit request for FLUX 2.\n\n        FLUX 2 uses the same endpoint for generation and editing,\n        with the image passed as base64 in the JSON body.\n        \"\"\"\n        if prompt is None:\n            raise ValueError(\"FLUX 2 image edit requires a prompt.\")\n\n        if image is None:\n            raise ValueError(\"FLUX 2 image edit requires an image.\")\n\n        image_b64: Final = self._convert_image_to_base64(image)\n\n        # Build request body with required params\n        request_body: Final[dict[str, Any]] = {\n            \"prompt\": prompt,\n            \"image\": image_b64,\n            \"model\": model,\n        }\n\n        # Add mapped optional params (already filtered by map_openai_params)\n        request_body.update(image_edit_optional_request_params)\n\n        # Return JSON body and empty files list (FLUX 2 doesn't use multipart)\n        return request_body, []","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/azure_ai/image_edit/flux2_transformation.py#L87-L123","documentation":"Error \"FLUX 2 image edit requires a prompt.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/image_edit/flux2_transformation.py:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a prompt for the FLUX 2 image edit request."],"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"}