Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform
Foundry exposes FLUX models through a provider-specific BFL API endpoint, but the behavior is constrained by how the model is integrated into Azure. In the provided documentation, input_image is only explicitly described for FLUX.1 Kontext [pro] in the provider-specific API, and it is documented as an image input (with parameters like input_image, aspect_ratio, etc.), not as a URL string.
For FLUX.2 models in Foundry (including FLUX.2-pro):
- The BFL provider-specific API is the supported route for fine-grained control.
- The documentation calls out that these models accept text and image input and that multi-reference image editing uses base64-encoded images passed alongside the prompt.
- The error returned by the Foundry endpoint (
"input_image is a not valid base64 encoded image") indicates that the Foundry-hosted FLUX.2-pro endpoint expectsinput_imageto be a valid base64-encoded image payload, not a URL.
Because of this, using a direct image URL for input_image is not supported on the Foundry-hosted FLUX.2-pro endpoint. The integration requires base64-encoded image data in the request body.
To make the request succeed against the Foundry FLUX.2-pro endpoint:
- Fetch the image in the backend (for example, in the Supabase edge function).
- Convert the binary image data to a base64 string.
- Pass that base64 string as the
input_image(or reference image field) in the JSON payload to the Foundry BFL endpoint.
If multiple reference images are needed, follow the documented multi-reference pattern for FLUX.2 models (up to eight reference images for FLUX.2-pro), each provided as base64-encoded image data.
References: