What retires, and when
Microsoft's Foundry retirement schedule lists four Black Forest Labs models, all at the GA stage, with a retirement date and no replacement named.1
| Model | Retirement date | Days from 2026-11-15 | Replacement listed |
|---|---|---|---|
| FLUX-1.1-pro | 2027-01-05 | 51 | none |
| FLUX.1-Kontext-pro | 2027-01-05 | 51 | none |
| FLUX.2-flex | 2027-01-20 | 66 | none |
| FLUX.2-pro | 2027-01-20 | 66 | none |
Three facts from the lifecycle policy shape the plan. Retired models return 410 Gone on every inference request.2 Microsoft picks an official replacement roughly 90–120 days before retirement, and where it names one that is also the auto-upgrade target;2 for FLUX, none is listed, so assume nothing upgrades for you. And the migration guidance states that retirement dates are not extendable and there is no exception process.3
Re-read the schedule before you commit to a target. It is a living page, and a replacement may appear after the date on which this article was checked.
Two request shapes may be in your codebase
Foundry exposes FLUX through two routes, and which one your code uses depends on the model.4
- The BFL provider-specific API supports all four models and accepts extra parameters:
guidance,steps,seed,aspect_ratio,safety_toleranceandoutput_format. Its URL path uses a model path (flux-2-pro,flux-2-flex,flux-kontext-pro,flux-pro-1.1) that is not identical to the model id. - The Image API is an OpenAI-compatible endpoint available only for FLUX.1-Kontext-pro and FLUX-1.1-pro, taking
nandsizeand returning a URL.
So a team on FLUX.2-pro is likely calling a BFL-shaped body (width, height, num_images, input_image, input_image_2), while a team on FLUX-1.1-pro may be calling client.images.generate. If call sites across services build these bodies themselves, a retirement is a multi-repo change. That is the real cost to remove: not the model swap but the number of places that know a vendor's body.
The fix is the usual one. Define one internal image request, make a single module the only code that talks to a backend, and let a config value pick the backend. The rest of this guide assumes that boundary exists, or that you build it first.
The stable shape: one request in, one result out
Keep the internal shape small and in your own vocabulary. Anything a backend cannot honor should fail loudly in the adapter rather than be silently dropped.
from dataclasses import dataclass, field
@dataclass
class ImageJob:
prompt: str
width: int = 1024
height: int = 1024
n: int = 1
seed: int | None = None
fmt: str = "png" # "png" | "jpeg"
refs: list[bytes] = field(default_factory=list) # reference images
tags: dict = field(default_factory=dict) # feature, tenant, canary arm
@dataclass
class ImageResult:
images: list[bytes]
backend: str # which backend actually served it
width: int
height: int
fmt: str
def to_azure_bfl(job: ImageJob, model_id: str) -> dict:
body = {
"model": model_id, # e.g. "FLUX.2-pro"
"prompt": job.prompt,
"width": job.width,
"height": job.height,
"num_images": job.n,
"output_format": job.fmt,
}
if job.seed is not None:
body["seed"] = job.seed
for i, ref in enumerate(job.refs): # input_image, input_image_2, ...
key = "input_image" if i == 0 else f"input_image_{i + 1}"
body[key] = ref.decode("ascii") # base64 text already
return body
def to_gateway(job: ImageJob, model: str) -> dict:
body = {
"model": model, # a model id or a route slug
"prompt": job.prompt,
"n": job.n,
"size": f"{job.width}x{job.height}",
"response_format": "url",
}
if job.seed is not None:
body["seed"] = job.seed
return bodyThe first adapter follows the body Microsoft documents for FLUX.2 [pro], including numbered reference-image fields.4 The second targets INFRO's /v1/images/generations shape, where the model is a vendor/model id like bfl/flux-2-pro or the slug of a route.5 Only the adapter changes when the backend does.
Parameter mapping
The same intent is spelled differently on each surface. This table maps the fields a typical FLUX caller uses.
| Intent | Foundry BFL API | Foundry Image API | INFRO /v1/images |
|---|---|---|---|
| Prompt | prompt | prompt | prompt (up to 32,000 characters) |
| Dimensions | width, height, aspect_ratio | size | size, or resolution plus aspect_ratio, not both |
| Count | num_images | n | n, 1–10 |
| Format | output_format | not set in the documented examples | response_format: url or b64_json |
| Seed | seed | not shown | seed, forwarded only where the model takes it |
| Guidance, steps | guidance, steps (FLUX.2 [flex] example) | not available | no universal field; check the model's settings |
| Safety level | safety_tolerance | not shown | not a universal field |
| References | input_image, input_image_2… | images/edits (Kontext only) | /v1/images/edits |
Sources for the columns: Foundry's FLUX page for the first two,4 and INFRO's image docs for the third.5
Two mapping details cause most surprises. First, INFRO passes size to the provider unchanged, and a resolution tier or aspect ratio the model cannot render on a target is refused before that target is called.5 That is useful, since you learn about an unsupported ratio from a 400 and not from a wrongly cropped image, but it means your adapter should send exact pixels or tiers deliberately. Second, quality is sent only where a model has a quality setting and is dropped elsewhere, so a FLUX-era caller that never set it will not see a difference, while one that expects it to matter on a GPT Image target will.5
Fields with no portable equivalent, such as guidance, steps and safety_tolerance, should live in a per-backend options dict in your config, not in the shared shape. If you rely on them for look, you are tuning to FLUX, and the new backend needs its own tuning.
Output differences to check
A swap that returns HTTP 200 can still break downstream code. The migration guidance says a different model can quietly shift formatting and output shape and break code that depends on the old behavior.3 For images, check these:
- Dimensions and format. FLUX.2 [flex] outputs one image as PNG or JPG with a maximum of 4 MP;4 a new target may round sizes, cap resolution or return a different container. Assert width, height and MIME type on every result in the canary.
- Count. INFRO sends
nto the provider as-is, a provider may return fewer, andusage.imagescounts what came back.5 Do not assumelen(images) == n. - Delivery. Foundry's BFL responses carry a URL or base64 data.4 INFRO's default returns a signed link to a copy it stores for 24 hours, and
b64_jsonreturns the image inline, at several megabytes each.5 Download and keep what you need; do not store the link as the asset. - Reference images. FLUX.2 [pro] takes up to eight and FLUX.2 [flex] up to 10 reference images,4 and a different model may take fewer or none. A request with more references than the target takes must fail in the adapter, not be truncated.
- Seeds. Seeds are best-effort and forwarded only where supported.5 A fixed seed on a new backend gives you a stable draw within that backend, not the old images.
- Moderation. Refusal behavior differs by model. Track refusal rate per arm; a prompt set that always passed on FLUX may not on the target.
Choosing a target without a listed replacement
With no official replacement, you choose. The options, without ranking them:
- Another host of the same FLUX family. INFRO's docs give
bfl/flux-2-proas an example model id and say image requests can be served by connections to providers including OpenAI, Azure OpenAI, Google AI, Vertex AI, Together AI, OpenRouter, Runway, KIE, LaoZhang API, fal.ai, Replicate and OpenAI-compatible endpoints.5 Which models each of those serves for your account is in the catalog, and a model is available only if one of your own connections serves it.6 Same family keeps prompt style, but you take on a new vendor contract and a new credential. - A non-FLUX model that stays on Azure. The same schedule shows gpt-image-2 at 2027-10-21 and gpt-image-2.5-flare and -sunburst at 2027-09-09, among other image models.1 That keeps your Azure contract and data path, but it is a different model with different prompt conventions and no FLUX-specific parameters.
- Another vendor's image model through your own connection. The widest quality search, and the largest prompt rework.
Whichever you pick, follow Microsoft's own advice: evaluate on your application, prompts and representative data, comparing quality, latency and cost together, and confirm API compatibility, regional availability, capacity and quota.2 Replay your current configuration unchanged on the target first, then tune, so you can separate what the model changed from what you changed.3
Cost belongs in that comparison, but this article does not quote rates: none were confirmed. Use the vendor's own price page for each candidate, apply your negotiated rate if you have one, and project from your historical image counts and size mix.
A canary plan that fits the calendar
You have roughly 51 days to the first date. Work backwards and leave a week of slack, since a retired model returns 410 Gone.2
- Freeze a prompt set. Pull a few hundred real prompts, stratified by feature, with and without reference images and with text in the image. Do not edit it mid-migration; Microsoft's guidance is to keep inputs and success criteria fixed or you cannot compare.3 Production content capture is opt-in and never retroactive, so turn it on now if it is off.
- Shadow run. Send the set to the target offline. Check the contract: dimensions, format, count, refusals, latency. Fix adapter errors here.
- Blind review. Have reviewers choose between old and new outputs without labels. Use pairwise preference per feature, not one global score.
- Weighted canary. Move live traffic in steps behind one name. INFRO's weighted route picks the first target at random in proportion to its weight and still falls through the rest if it fails; a target at weight 0 is a standby.7 The route name is what your application sends as
model, so the code does not change between steps.7 - Hold the old path as standby until the retirement date, then remove it.
Rules on a route can carry a request-level condition such as has_images, feature or end_user_id,7 which lets you canary reference-image edits separately from plain text-to-image, or keep an internal team on the new backend first. Fallbacks and connection failover act only before the response starts, and the response names the model, provider and connection that served it,8 so tag every result with its arm and compare the arms from the log, not from memory.
What a gateway does and does not do here
A control plane can carry this migration but cannot make two models equal. In INFRO, image requests share one shape across providers, the route holds the backend choice in configuration, and each response records the serving provider and estimated provider cost in usage.cost.5 INFRO records vendor retirements and refuses a retired model from its shutdown date with an error naming the replacement, but its docs say Azure runs its own schedule and is covered only when Azure's own date is recorded,6 so confirm the Foundry FLUX dates in the console and do not rely on a refusal as your cutover trigger. INFRO never answers with a different model on your behalf.6
The checks above (frozen prompt set, blind review, per-arm metrics) stay your job, with or without a gateway.
Checklist
- List every service and repo that calls a FLUX deployment, and which of the two Foundry routes it uses.
- Route all of them through one module with the internal request shape.
- Re-read the retirement schedule for a newly named replacement.
- Shortlist two targets and confirm region, quota and contract for each.
- Freeze a prompt set, including reference-image and text-in-image slices.
- Assert dimensions, MIME type and image count in the adapter.
- Run a shadow pass, then blind pairwise review.
- Canary in steps with the old path kept as standby.
- Remove the FLUX deployments after cutover and update your docs and runbooks.
- Finish before 2027-01-05 for FLUX-1.1-pro and Kontext, and before 2027-01-20 for FLUX.2.
