Our current example for image generation using the @ai-sdk/fireworks provider works when using accounts/fireworks/models/stable-diffusion-xl-1024-v1-0 as provider.
|
'accounts/fireworks/models/stable-diffusion-xl-1024-v1-0', |
But it fails when using accounts/fireworks/models/flux-kontext-pro. Unlike with the stable-diffusion model, flux-kontext-pro requests return a JSON object with a request_id which then needs to be sent repeatedly to https://docs.fireworks.ai/api-reference/get-generated-image-from-flux-kontex until it responds with result.status === 'Ready' and and result.result.sample set to an image URL, which then can be downloaded to retrieve the actual image.