Skip to content

Backport: fix(bfl): use 'image' field instead of 'input_image' for fill pro model#15530

Merged
aayush-kapoor merged 1 commit into
release-v6.0from
backport-pr-15525-to-release-v6.0
May 21, 2026
Merged

Backport: fix(bfl): use 'image' field instead of 'input_image' for fill pro model#15530
aayush-kapoor merged 1 commit into
release-v6.0from
backport-pr-15525-to-release-v6.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

This is an automated backport of #15525 to the release-v6.0 branch. FYI @aayush-kapoor

…el (#15525)

## Background

reported in #14351

when using the model id `flux-pro-1.0-fill`, the BFL api expects the the
field `image` instead of `input_image`

this is also logged in their docs in the request sent
[here](https://docs.bfl.ml/flux_tools/flux_1_fill#create-a-request)

## Summary

change just that field for the mode id `flux-pro-1.0-fill` based on a
conditional check

## Manual Verification

verified by running the repro: 

<details>
<summary>repro </summary>

```ts
import {
  blackForestLabs,
  type BlackForestLabsImageModelOptions,
} from '@ai-sdk/black-forest-labs';
import { generateImage } from 'ai';
import sharp from 'sharp';
import { run } from '../../lib/run';
import { presentImages } from '../../lib/present-image';

run(async () => {
  const image = await sharp({
    create: {
      width: 256,
      height: 256,
      channels: 3,
      background: { r: 120, g: 180, b: 255 },
    },
  })
    .png()
    .toBuffer();
  const mask = await sharp({
    create: {
      width: 256,
      height: 256,
      channels: 3,
      background: { r: 255, g: 255, b: 255 },
    },
  })
    .png()
    .toBuffer();

  console.log(
    'Running BFL fill inpainting with a 256x256 input image and mask.',
  );

  const result = await generateImage({
    model: blackForestLabs.image('flux-pro-1.0-fill'),
    prompt: {
      text: 'Replace the masked area with a red square.',
      images: [image],
      mask,
    },
    aspectRatio: '1:1',
    providerOptions: {
      blackForestLabs: {
        outputFormat: 'png',
        steps: 25,
        guidance: 7.5,
      } satisfies BlackForestLabsImageModelOptions,
    },
  });

  await presentImages(result.images);
});
```
</details>

## Checklist

- [x] All commits are signed (PRs with unsigned commits cannot be
merged)
- [x] Tests have been added / updated (for bug fixes / features)
- [ ] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)

## Related Issues

fixes #14351
@github-actions github-actions Bot enabled auto-merge (squash) May 21, 2026 20:49
auto-merge was automatically disabled May 21, 2026 21:03

Pull request was closed

@aayush-kapoor aayush-kapoor reopened this May 21, 2026
@aayush-kapoor aayush-kapoor enabled auto-merge (squash) May 21, 2026 21:04
@aayush-kapoor aayush-kapoor merged commit ba41851 into release-v6.0 May 21, 2026
47 checks passed
@aayush-kapoor aayush-kapoor deleted the backport-pr-15525-to-release-v6.0 branch May 21, 2026 21:10
@github-actions
Copy link
Copy Markdown
Contributor Author

🚀 Published in:

Package Version
@ai-sdk/black-forest-labs 1.0.34 github npm
@ai-sdk/mcp 1.0.43 github npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants