Need Support | Firefly image fill APIs | Community
Skip to main content
avesh_narang
Level 4
March 17, 2026
Solved

Need Support | Firefly image fill APIs

  • March 17, 2026
  • 1 reply
  • 23 views

I am trying to edit the image by utilizing the masking and the original source image. While using the Firefly image fill APIs, I encountered a problem indicating that Firefly is unable to read or process the images.

I have already experimented with various images, including those created by Firefly itself, but the issue persists.

Has anyone else faced a similar challenge?

Please advise me on what I might be overlooking !

Attached is a screenshot of the Postman collection and the error encountered.

 

 

Thanks in Advance !

Best answer by AmitVishwakarma

Hi ​@avesh_narang 

Your error in the screenshot:

  • means the bytes stored for that uploadId are not a valid PNG/JPEG/WebP image. This almost always comes from how the upload call is done, not from the /v3/images/fill body.

1. Upload source and mask correctly

For each file (source + mask) call the upload endpoint and send raw binary, not base64, not form‑data with boundaries, not JSON.
With curl:

curl --location 'https://firefly-api.adobe.io/v2/storage/image' \
--header 'x-api-key: <CLIENT_ID>' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: image/png' \
--data-binary '@/path/to/source.png'

Same for the mask:

curl --location 'https://firefly-api.adobe.io/v2/storage/image' \
--header 'x-api-key: <CLIENT_ID>' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: image/png' \
--data-binary '@/path/to/mask.png'

In Postman:

Method: POST  URL: https://firefly-api.adobe.io/v2/storage/image
Headers:

  • Authorization: Bearer <token>
  • X-Api-Key: <client_id>
  • Content-Type: image/png (or correct type)

Body tab:

  • Select binary
  • Click "Select File" and choose the PNG/JPG directly
  • Do NOT use:
    • raw + base64 text
    • form-data with image=@file (that introduces multipart boundaries)
    • JSON wrapper around the file

Response should be like:

{"images":[{"id":"e42cf05b-d013-479c-9bff-aeb45ed57588"}]}

Keep those id values as your uploadId.

2. Call the Fill API with those IDs

Once you have two valid IDs (one for source, one for mask):

{
"numVariations": 1,
"size": { "width": 2048, "height": 2048 },
"prompt": "your prompt here",
"image": {
"source": { "uploadId": "SOURCE_IMAGE_ID" },
"mask": { "uploadId": "MASK_IMAGE_ID" }
}
}

Headers:

  • Authorization: Bearer <token>
  • X-Api-Key: <client_id>
  • Content-Type: application/json

POST to:  https://firefly-api.adobe.io/v3/images/fill

If both uploads were truly binary, the UnidentifiedImageError will disappear and the fill call will succeed.

1 reply

AmitVishwakarma
Community Advisor
AmitVishwakarmaCommunity AdvisorAccepted solution
Community Advisor
March 18, 2026

Hi ​@avesh_narang 

Your error in the screenshot:

  • means the bytes stored for that uploadId are not a valid PNG/JPEG/WebP image. This almost always comes from how the upload call is done, not from the /v3/images/fill body.

1. Upload source and mask correctly

For each file (source + mask) call the upload endpoint and send raw binary, not base64, not form‑data with boundaries, not JSON.
With curl:

curl --location 'https://firefly-api.adobe.io/v2/storage/image' \
--header 'x-api-key: <CLIENT_ID>' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: image/png' \
--data-binary '@/path/to/source.png'

Same for the mask:

curl --location 'https://firefly-api.adobe.io/v2/storage/image' \
--header 'x-api-key: <CLIENT_ID>' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: image/png' \
--data-binary '@/path/to/mask.png'

In Postman:

Method: POST  URL: https://firefly-api.adobe.io/v2/storage/image
Headers:

  • Authorization: Bearer <token>
  • X-Api-Key: <client_id>
  • Content-Type: image/png (or correct type)

Body tab:

  • Select binary
  • Click "Select File" and choose the PNG/JPG directly
  • Do NOT use:
    • raw + base64 text
    • form-data with image=@file (that introduces multipart boundaries)
    • JSON wrapper around the file

Response should be like:

{"images":[{"id":"e42cf05b-d013-479c-9bff-aeb45ed57588"}]}

Keep those id values as your uploadId.

2. Call the Fill API with those IDs

Once you have two valid IDs (one for source, one for mask):

{
"numVariations": 1,
"size": { "width": 2048, "height": 2048 },
"prompt": "your prompt here",
"image": {
"source": { "uploadId": "SOURCE_IMAGE_ID" },
"mask": { "uploadId": "MASK_IMAGE_ID" }
}
}

Headers:

  • Authorization: Bearer <token>
  • X-Api-Key: <client_id>
  • Content-Type: application/json

POST to:  https://firefly-api.adobe.io/v3/images/fill

If both uploads were truly binary, the UnidentifiedImageError will disappear and the fill call will succeed.

Amit Vishwakarma - Adobe Commerce Champion 2025 | 16x Adobe certified | 4x Adobe SME
avesh_narang
Level 4
March 18, 2026

Thanks ​@AmitVishwakarma 

Rightly directed , issue is in storage part that is https://firefly-api.adobe.io/v2/storage/image

I was sending the parameters as form-body which is the roto cause.

Thanks for the guidance and prompt reply.