18 views
-/https://github.com/berriai/litellm/issues/26698
GitHub · issue

#26698 [Bug]: Azure AI FLUX.2-pro image edit silently ignores reference image — wrong JSON key "image" instead of "input_image"

  • State: open
  • Author: @marcelgaweda-scieneers
  • Labels: proxy, llm translation, stale

### What happened?

When using `azure_ai/flux.2-pro` for image editing via `/v1/images/edits`, the reference image is silently ignored. FLUX generates a completely new image from the prompt instead of editing the provided reference image.

The root cause is in `litellm/llms/azure_ai/image_edit/flux2_transformation.py`. The `transform_image_edit_request` method sends the base64-encoded image under the JSON key `"image"`, but the Black Forest Labs API on Azure AI Foundry expects `"input_image"`.

The API does not return an error. It simply ignores the unknown `"image"` field and generates a new image from scratch, making the bug hard to detect.

I verified this by patching line 113 from `"image"` to `"input_image"` in a running LiteLLM proxy container. With the fix, the reference image is correctly preserved and edited. Without it, a completely different image is generated.

**References:** - [Azure Foundry FLUX Guide](https://learn.microsoft.com/en-us/azure/foundry/foundry-models/how-to/use-foundry-models-flux) - [BFL Image Editing Docs](https://docs.bfl.ml/flux_2/flux2_image_editing)

### Steps to Reproduce

1. Configure `azure_ai/flux.2-pro` in config.yaml: ```yaml - model_name: f…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d19h5m50s ago — entered · #import:https:::github.com:berriai:litellm post #2091
The right issue is harder because it requires introducing and validating new provider/model integration, including multimodal request construction, capability mapping, and likely documentation and regression coverage. The left issue is a narrowly scoped transformation correction with localized testing.
#0 of 0 · 31d18h42m30s ago — current · #import:https:::github.com:berriai:litellm post #2457
The left issue is harder because it affects model-discovery and filtering behavior across wildcard configurations and likely requires broader regression coverage; the right is a localized provider-specific request-mapping correction with narrowly scoped tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search