BerriAI/litellm · error · BlackForestLabsError

No image provided

Error message

No image provided

What it means

Request guard in the BFL image-edit handler: 'image' was provided as a list but the list is empty, so there is no source image for flux-kontext editing and the API call is rejected before it is sent.

Solutions

  1. Attach the image to edit in the request.
  2. Verify the image field is populated and readable.
  3. Check the client sends the image with correct encoding.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:127 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/d31626afa1679317. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:127

            api_key=api_key,
            headers=image_edit_optional_request_params.get("extra_headers", {}) or {},
            model=model,
        )
        if extra_headers:
            headers.update(extra_headers)

        # Get complete URL
        complete_url: Final = self.config.get_complete_url(
            model=model,
            api_base=api_base,
            litellm_params=litellm_params_dict,
        )

        # Transform request
        # Handle image list vs single image
        if isinstance(image, list):
            if not image:
                raise BlackForestLabsError(status_code=400, message="No image provided")
            image_input = image[0]
        else:
            image_input = image
        data, _ = self.config.transform_image_edit_request(
            model=model,
            prompt=prompt or "",
            image=image_input,
            image_edit_optional_request_params=image_edit_optional_request_params,
            litellm_params=litellm_params_dict,
            headers=headers,
        )

        # Logging
        logging_obj.pre_call(
            input=prompt,
            api_key="",
            additional_args={
                "complete_input_dict": data,

View on GitHub (pinned to 77b7c6c40c)