Custom Models

Use Firefly's Custom Models API to generate brand-aligned image variations at scale. This page explains concepts relevant to custom models.

Overview

With custom models, you can capture and replicate distinctive brand aesthetics, characters, objects, or compositional arrangements. These models are trained and referenced when generating new images, helping to scale brand-consistent visuals.

Training modes

Custom models are configured to learn different aspects of visual design:

Asset IDs

Custom models are assets hosted securely by Adobe, offering easy organization, versioning, and reuse. Each custom model has a unique asset ID.

With Asset IDs you can manage multiple models by tracking updates and maintaining a clear record of styles, subjects, or structures captured in versions over time.

Provide the asset ID in your API requests so that the generated images include the appropriate model's learned characteristics.

Image generation with a custom model

Leverage a custom model to generate images by using the /v3/images/generate-async endpoint and including the header x-model-version. This specifies the model version used for generating the image.

Example requests

data-slots=heading, code
data-repeat=3
data-languages=bash, Python, JavaScript

cURL

curl --request POST 'https://firefly-api.adobe.io/v3/images/generate-async' \
--header 'x-model-version: image3_custom' \
...
--data "{
    \"prompt\": \"An almond seed in a warm setting\",
    \"customModelId\": \"${CUSTOM_MODEL_ID}\"
  }"

Python

def generate_images_with_custom_model(access_token, custom_model_id):
    url = 'https://firefly-api.adobe.io/v3/images/generate-async'
    headers = {
      'x-model-version':'image3_custom',
      ...
    }

    data = {
        "prompt": "An almond seed in a warm setting",
        "customModelId": custom_model_id
    }

    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()
    result = response.json()
    print("Generate Image Response:", result)
    return result

JavaScript

async function generateImagesWithCustomModel(accessToken, customModelId) {
  const config = {
    method: "post",
    url: "https://firefly-api.adobe.io/v3/images/generate-async",
    headers: {
    "x-model-version":"image3_custom",
    ...
  },
  data: JSON.stringify({
      "prompt": "An almond seed in a warm setting",
      "customModelId": customModelId
    })
  };

  const response = await axios.request(config);
  return response.data;
}