Firefly Services: Firefly SDK Reference
- ApiError
- BaseInputImage
- ExpandImageRequest
- ExpandImageResponse
- ExpandInputImage
- FillImageRequest
- FillImageResponse
- GenerateImagesRequest
- GenerateImagesResponse
- GenerateObjectCompositeRequest
- GenerateObjectCompositeResponse
- GenerateSimilarImagesRequest
- GenerateSimilarImagesResponse
- InputImage
- ObjectCompositeInputImage
- OutputImage
- Placement
- PlacementAlignment
- PlacementInset
- PublicBinaryInput
- PublicBinaryOutput
- Size
- StructureImageReference
- StructureReference
- Styles
- StylesImageReference
- UploadResponse
- UploadedResource
- ValidationErrorMessage
Ƭ ApiError: Object
The error within the error response.
Name | Type |
---|---|
error_code |
ErrorCode |
message? |
string |
validation_errors? |
ValidationErrorMessage [] |
Ƭ BaseInputImage: Object
Source image which will be used to generate similar images
Name | Type | Description |
---|---|---|
source |
PublicBinaryInput |
Source of the reference image used to generate similar images. You can either use a url or an uploadId as the source for the uploaded image. Note: Only allow listed domains are allowed to be accepted as input URL in the request. The allow-listed domains are as follows:
|
Ƭ ExpandImageRequest: Object
Images expand payload
Name | Type | Description |
---|---|---|
image |
ExpandInputImage |
The image to be expanded. You can either use a url or an uploadId as the source for the uploaded image. Note: Only allow listed domains are allowed to be accepted as input URL in the request. The allow-listed domains are as follows:
|
numVariations? |
number |
The number of variations to generate. numVariations will default to the number of seeds, or to 1 if seeds is not specified. |
placement? |
Placement |
Specifies how the source image will be positioned and sized in the final generation. The value should describe the placement and dimensions of the image within the output. Note: Placement for source images cannot be used when a mask image is being applied. |
prompt? |
string |
The prompt used to generate the image. The longer the prompt - the better |
seeds? |
number [] |
Array of seed(s) that ensure consistent image generation across multiple API calls. For example, you can use the same seed to generate a similar image with different styles. If specified alongside with numVariations, the number of seeds must be the equal to numVariations |
size? |
Size |
Specifies the desired width and height for the final, expanded image. |
Ƭ ExpandImageResponse: Object
Images expand response
Name | Type | Description |
---|---|---|
outputs |
OutputImage [] |
Each image will have a storage item. |
size |
Size |
If size was passed as input, this value should be the same as the one passed as input. |
Ƭ ExpandInputImage: Object
Name | Type | Description |
---|---|---|
mask? |
PublicBinaryInput |
Defines the expanding area where the source image should expand towards. Mask has to be larger than the source image, and the target size has to match the size of the mask, or it will be inferred from the mask. |
source |
PublicBinaryInput |
Source of the image to be expanded. |
Ƭ FillImageRequest: Object
Fill images payload
Name | Type | Description |
---|---|---|
image |
InputImage |
Input image to fill with generative content. You can either use a url or an uploadId as the source for the uploaded image. Note: Only allow listed domains are allowed to be accepted as input URL in the request. The allow-listed domains are as follows:
|
negativePrompt? |
string |
Inference will try to generate against this prompt |
numVariations? |
number |
The number of variations to generate. numVariations will default to the number of seeds, or to 1 if seeds is not specified. |
prompt? |
string |
The prompt used to generate the image. The longer the prompt - the better |
promptBiasingLocaleCode? |
string |
A hyphen-separated string combining the ISO 639-1 language code and the ISO 3166-1 region, such as "en-US". When a locale is set, the prompt will be biased to generate more relevant content for that region. The locale will be auto-detected if not specified based on the user's profile and Accept-Language header. |
seeds? |
number [] |
Array of seed(s) that ensure consistent image generation across multiple API calls. For example, you can use the same seed to generate a similar image with different styles. If specified alongside with numVariations, the number of seeds must be the equal to numVariations |
Ƭ FillImageResponse: Object
Fill images response.
Name | Type | Description |
---|---|---|
outputs |
OutputImage [] |
Each image will have a storage item. |
size |
Size |
If size was passed as input, this value should be the same as the one passed as input. |
Ƭ GenerateImagesRequest: Object
Name | Type | Description |
---|---|---|
contentClass? |
ContentClass |
Will guide the generation to being more photographic or more like art. |
negativePrompt? |
string |
Inference will try to generate against this prompt. |
numVariations? |
number |
The number of variations to generate. numVariations will default to the number of seeds, or to 1 if seeds is not specified. |
prompt |
string |
The prompt used to generate the image. The longer the prompt - the better. |
promptBiasingLocaleCode? |
string |
A hyphen-separated string combining the ISO 639-1 language code and the ISO 3166-1 region, such as "en-US". When a locale is set, the prompt will be biased to generate more relevant content for that region. The locale will be auto-detected if not specified based on the user's profile and Accept-Language header. |
seeds? |
number [] |
Array of seed(s) that ensure consistent image generation across multiple API calls. For example, you can use the same seed to generate a similar image with different styles. If specified alongside with numVariations, the number of seeds must be the equal to numVariations. |
size? |
Size |
The size of the requested generations. The supported dimensions for image generations are: | Dimensions | Description | | -----------| ----- | | { "width": 2048, "height": 2048} | Square (1:1) | | { "width": 2304, "height": 1792 } | Landscape (4:3) | | { "width": 1792, "height": 2304 } | Portrait (3:4) | | { "width": 2688, "height": 1536 } | Widescreen (16:9) | | { "width": 1344, "height": 768 } |(7:4) | |{ "width": 1152, "height": 896 } |(9:7) | |{ "width": 896, "height": 1152 } |(7:9) | | { "width": 1024, "height": 1024} | Square (1:1) | |
structure? |
StructureReference |
Use structure to ensure the generated image maintains a similar layout and organization as the reference image, providing a cohesive and visually balanced result. |
style? |
Styles |
You can specify a preset, a reference image or both. |
tileable? |
boolean |
An image is tileable if it can be repeated infinitely in any direction without showing visible seams or edges. |
visualIntensity? |
number |
Adjusts the overall intensity of your photo's existing visual characteristics. |
Ƭ GenerateImagesResponse: Object
text-to-image response
Name | Type | Description |
---|---|---|
contentClass? |
ContentClass |
Will be same as input, if input was specified |
outputs |
OutputImage [] |
Each image will have a storage item. |
promptHasBlockedArtists? |
boolean |
The user may see that the generation does not comply to its full prompt |
promptHasDeniedWords? |
boolean |
The user may see that the generation does not comply to its full prompt |
size |
Size |
If size was passed as input, this value should be the same as the one passed as input. |
Ƭ GenerateObjectCompositeRequest: Object
Generating object composite from prompt
Name | Type | Description |
---|---|---|
contentClass? |
ContentClass |
Will guide the generation to being more photographic or more like art |
image |
ObjectCompositeInputImage |
An image of an object that needs to be rendered on a scene. You can either use a url or an uploadId as the source for the uploaded image. Note: Only allow listed domains are allowed to be accepted as input URL in the request. The allow-listed domains are as follows:
|
numVariations? |
number |
The number of variations to generate. numVariations will default to the number of seeds, or to 1 if seeds is not specified. |
placement? |
Placement |
Specifies how the image will be positioned and sized in the final generation. You can specify both inset and alignment, only inset, only alignment or none of them. |
prompt |
string |
The prompt used to generate the image. The longer the prompt - the better |
seeds? |
number [] |
Array of seed(s) that ensure consistent image generation across multiple API calls. For example, you can use the same seed to generate a similar image with different styles. If specified alongside with numVariations, the number of seeds must be the equal to numVariations |
size? |
Size |
The size of the requested generations. The supported dimensions for image generations are: | Dimensions | Description | | -----------| ----- | | { "width": 2048, "height": 2048} | Square (1:1) | | { "width": 2304, "height": 1792 } | Landscape (4:3) | | { "width": 1792, "height": 2304 } | Portrait (3:4) | | { "width": 2688, "height": 1536 } | Widescreen (16:9) | | { "width": 1344, "height": 768 } |(7:4) | |{ "width": 1152, "height": 896 } |(9:7) | |{ "width": 896, "height": 1152 } |(7:9) | | { "width": 1024, "height": 1024} | Square (1:1) | |
style? |
Styles |
You can specify a preset, a reference image or both |
Ƭ GenerateObjectCompositeResponse: Object
Generating object composite from prompt response
Name | Type | Description |
---|---|---|
contentClass? |
ContentClass |
Will be same as input, if input was specified |
outputs |
OutputImage [] |
Each image will have a storage item. |
size |
Size |
If size was passed as input, this value should be the same as the one passed as input. |
Ƭ GenerateSimilarImagesRequest: Object
Generating similar images from a reference image
Name | Type | Description |
---|---|---|
image |
BaseInputImage |
Firefly will generate similar variations based on the reference input image. |
numVariations? |
number |
The number of variations to generate. numVariations will default to the number of seeds, or to 1 if seeds is not specified. |
seeds? |
number [] |
Array of seed(s) that ensure consistent image generation across multiple API calls. For example, you can use the same seed to generate a similar image with different styles. If specified alongside with numVariations, the number of seeds must be the equal to numVariations |
size? |
Size |
The size of the requested generations. The supported dimensions for image generations are: | Dimensions | Description | | -----------| ----- | | { "width": 2048, "height": 2048} | Square (1:1) | | { "width": 2304, "height": 1792 } | Landscape (4:3) | | { "width": 1792, "height": 2304 } | Portrait (3:4) | | { "width": 2688, "height": 1536 } | Widescreen (16:9) | | { "width": 1344, "height": 768 } |(7:4) | |{ "width": 1152, "height": 896 } |(9:7) | |{ "width": 896, "height": 1152 } |(7:9) | | { "width": 1024, "height": 1024} | Square (1:1) | |
tileable? |
boolean |
An image is tileable if it can be repeated infinitely in any direction without showing visible seams or edges. |
Ƭ GenerateSimilarImagesResponse: Object
Generating similar images response
Name | Type | Description |
---|---|---|
outputs |
OutputImage [] |
Each image will have a storage item. |
size |
Size |
If size was passed as input, this value should be the same as the one passed as input. |
Ƭ InputImage: Object
Name | Type | Description |
---|---|---|
mask |
PublicBinaryInput |
Mask image which will be used replace the background of the image. Note: The minimum accepted size for the larger side of the image is 600 px. |
source |
PublicBinaryInput |
Upload an image you want to fill. |
Ƭ ObjectCompositeInputImage: Object
Name | Type | Description |
---|---|---|
mask? |
PublicBinaryInput |
Provide a mask that hides part of the object like the background. |
source |
PublicBinaryInput |
An image of an object that needs to be rendered on a scene. |
Ƭ OutputImage: Object
Name | Type | Description |
---|---|---|
image |
PublicBinaryOutput |
A valid storage item containing a pre-signed URL. The pre-signed URL will expire in one hour. |
seed |
number |
Identifier used to customize image generation processes. |
Ƭ Placement: Object
Name | Type | Description |
---|---|---|
alignment? |
PlacementAlignment |
Specifies how the image will be anchored within the available space for each direction. For horizontal, (0,1,2)=(center, left, right). For vertical, (0,1,2)=(center, top, bottom). |
inset? |
PlacementInset |
Defines the inward displacement applied to the image's edges. This parameter specifies the distance by which each edge of the image will be pushed inward, thereby reducing the visible area by the specified amount on all sides. |
Ƭ PlacementAlignment: Object
Name | Type |
---|---|
horizontal? |
AlignmentHorizontal |
vertical? |
AlignmentVertical |
Ƭ PlacementInset: Object
Margin values in target size
Name | Type | Description |
---|---|---|
bottom? |
number |
The space between bottom edge of the result image and bottom edge of the placed object image. |
left? |
number |
The space between left edge of the result image and left edge of the placed object image. |
right? |
number |
The space between right edge of the result image and right edge of the placed object image. |
top? |
number |
The space between top edge of the result image and top edge of the placed object image. |
Ƭ PublicBinaryInput: Object
You can either use a url
or an uploadId
as the source for the uploaded image.
Name | Type | Description |
---|---|---|
uploadId? |
string |
UUID of the uploaded object |
url? |
string |
This URL of an uploaded image. |
Ƭ PublicBinaryOutput: Object
A valid storage item containing a pre-signed URL. The pre-signed URL will expire in one hour.
Name | Type | Description |
---|---|---|
url? |
string |
The reference to signed url of the image. |
Ƭ Size: Object
Dimensions of the generated image
Dimensions | Description |
---|---|
{ "width": 2048, "height": 2048} | Square (1:1) |
{ "width": 2304, "height": 1792 } | Landscape (4:3) |
{ "width": 1792, "height": 2304 } | Portrait (3:4) |
{ "width": 2688, "height": 1536 } | Widescreen (16:9) |
Name | Type |
---|---|
height |
number |
width |
number |
Ƭ StructureImageReference: Object
Name | Type |
---|---|
source? |
PublicBinaryInput |
Ƭ StructureReference: Object
Name | Type | Description |
---|---|---|
imageReference? |
StructureImageReference |
An image with a structure you want to use as a reference for generating image variations. Note: Only allow listed domains are allowed to be accepted as input URL in the request. The allow-listed domains are as follows:
|
strength? |
number |
Control the amount of adherence to the reference image when generating the image variations. 0 means no adherence. 100 means full adherence. |
Ƭ Styles: Object
Name | Type | Description |
---|---|---|
imageReference? |
StylesImageReference |
Firefly will detect the style in the image and apply the same style in the generated image. Note: Only allow listed domains are allowed to be accepted as input URL in the request. The allow-listed domains are as follows:
|
presets? |
string [] |
You can specify a preset ID for a style. Refer to Image Model Styles under Concepts for the list of supported Preset IDs . |
strength? |
number |
The strength of the style to be applied. |
Ƭ StylesImageReference: Object
Name | Type |
---|---|
source? |
PublicBinaryInput |
Ƭ UploadResponse: Object
Upload response
Name | Type | Description |
---|---|---|
images? |
UploadedResource [] |
Array of objects containing asset ID |
Ƭ UploadedResource: Object
Uploaded Media Details
Name | Type | Description |
---|---|---|
id |
string |
ID associated with the asset (generate this ID using the upload API). |
Ƭ ValidationErrorMessage: Object
Validation error message
Name | Type |
---|---|
ctx? |
Record <string , any > |
loc |
number | string [] |
msg |
string |
type |
string |