Style Presets
Use style presets to customize the look and feel of your generated images.
Understanding style presets
Firefly offers a collection of style presets to use with the Generate Images API that can give generated images a specific visual style or mood. By indicating these presets in the API request, you have more control, beyond the prompt, to create image variations.
Style presets are defined in the presets array in the Generate Images API request. All presets in the array apply to the generated image. To influence the impact of the presets, add or adjust the strength value.
data-slots=heading, code
data-languages=JSON
// ... API request cURL ...
--data '{
"prompt": "a puppy dressed as a renaissance artist",
"numVariations": 4,
"style": {
// array of style presets for image variations
"presets": [
"bw", "fantasy", "dramatic_light"
],
"strength": 100
}
}'
Style Presets examples
Here are the style presets available and examples of the images they generate. Use these presets, in snake_case, in the API request.
Concepts in action
Let's use style presets to generate a few image variations.
data-variant=warning
data-slots=heading, text
- First, open a secure terminal and
exportyour Client ID and Access Token as environment variables:
export FIREFLY_SERVICES_CLIENT_ID=<your_Client_ID>
export FIREFLY_SERVICES_ACCESS_TOKEN=<your_Access_Token>
- Next, make the request to the Generate Images API. We'll use a prompt for a Shakespearean puppy, and enter a few presets so that they apply together:
curl --location 'https://firefly-api.adobe.io/v3/images/generate-async' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "x-api-key: $FIREFLY_SERVICES_CLIENT_ID" \
--header "Authorization: Bearer $FIREFLY_SERVICES_ACCESS_TOKEN" \
--data '{
"prompt": "a puppy dressed as a renaissance artist",
"numVariations": 4,
"style": {
"presets": [
"bw", "fantasy", "dramatic_light"
]
}
}'
The request returns a rapid response for the asynchronous job:
{
"jobId":"<YOUR_JOB_ID>",
"statusUrl":"https://firefly-epo854211.adobe.io/v3/status/urn:ff:jobs:...",
"cancelUrl":"https://firefly-epo854211.adobe.io/v3/cancel/urn:ff:jobs:..."
}
- Use the
jobIdto see the result:
data-variant=info
data-slots=heading, text
numVariations value creates four generated images that will be easy to compare. Four URLs are returned in the response.curl -X GET "https://firefly-api.adobe.io/v3/status/<YOUR_JOB_ID>" \
-H "x-api-key: $FIREFLY_SERVICES_CLIENT_ID" \
-H "Authorization: Bearer $FIREFLY_SERVICES_ACCESS_TOKEN" \
-H "Content-Type: application/json"
You'll see results similar to our example below. Notice that all the defined presets were applied to the prompt for a renaissance puppy!
Sample Result