Style Reference Images
Use Style References images to generate variations based on specific styles, colors, artistic methods, or mood.
![]() Style Reference Image | ![]() Generated Image |
Using a Style Reference
Use an existing image as a Style Reference to guide the look and feel of generated image variations. Style reference can help develop a consistent look across a variety of generated assets.
This feature, along with a Structure Reference, gives you more control of image generation beyond the text prompt.
Specifying strength
To influence how strong your reference image's effect is during the image generation process, add a strength
value between 1
and 100
to your style object. When strength isn't specified, it defaults to a value of 50
.
Concepts in action
Let's use a style reference image to generate a few image variations.
Before you start
You'll need a Firefly Client ID and Access Token for this exercise. Learn how to retrieve them in the Authentication Guide. Securely store these credentials and never expose them in client-side or public code.
- Open a secure terminal and
export
your Client ID and Access Token as environment variables:
Copied to your clipboardexport FIREFLY_SERVICES_CLIENT_ID=<your_client_id>export FIREFLY_SERVICES_ACCESS_TOKEN=<your_access_token>
Save the image of the mountain at the top of this page to your computer's desktop as style-image-reference-mountain.webp. We'll generate a few image variations using this style.
Upload your saved image to Firefly's storage API by calling the endpoint below. Be sure to update the
--data-binary
path to point to your saved image:
Copied to your clipboardcurl --location 'https://firefly-api.adobe.io/v2/storage/image' \--header 'Content-Type: image/webp' \--header 'Accept: application/json' \--header "x-api-key: $FIREFLY_SERVICES_CLIENT_ID" \--header "Authorization: Bearer $FIREFLY_SERVICES_ACCESS_TOKEN" \--data-binary '@/Users/<YOUR_MACHINE_USERNAME>/Desktop/style-image-reference-mountain.webp'
You'll receive a response with an ID that looks like this:
Copied to your clipboard{"images":[{"id":"0eb8584a-b850-4c4c-a234-185d6378ecb6"}]}
- Export the
id
so that the next script can access it:
Copied to your clipboardexport FIREFLY_UPLOAD_ID=<your_upload_id>
- Generate a new image based on the uploaded image:
Copied to your clipboardcurl --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 '{"numVariations": 4,"prompt": "a friendly dog","style": {"imageReference": {"source": {"uploadId": "'$FIREFLY_UPLOAD_ID'"}}}}'
The request returns a rapid response for the asynchronous job:
Copied to your clipboard{"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
jobId
to see the result:
NOTE
The numVariations
value creates four generated images that will be easy to compare. Four URLs are returned in the response.
Copied to your clipboardcurl -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"