Thursday, February 5, 2026

Accelerating your advertising and marketing ideation with generative AI – Half 2: Generate customized advertising and marketing pictures from historic references


Advertising groups face main challenges creating campaigns in at this time’s digital atmosphere. They need to navigate via advanced information analytics and quickly altering client preferences to supply partaking, customized content material throughout a number of channels whereas sustaining model consistency and dealing inside tight deadlines. Utilizing generative AI can streamline and speed up the artistic course of whereas sustaining alignment with enterprise aims. Certainly, in keeping with McKinsey’s “The State of AI in 2023” report, 72% of organizations now combine AI into their operations, with advertising and marketing rising as a key space of implementation.

Constructing upon our earlier work of advertising and marketing marketing campaign picture technology utilizing Amazon Nova basis fashions, on this publish, we display improve picture technology by studying from earlier advertising and marketing campaigns. We discover combine Amazon Bedrock, AWS Lambda, and Amazon OpenSearch Serverless to create a complicated picture technology system that makes use of reference campaigns to take care of model pointers, ship constant content material, and improve the effectiveness and effectivity of recent marketing campaign creation.

The worth of earlier marketing campaign data

Historic marketing campaign information serves as a robust basis for creating efficient advertising and marketing content material. By analyzing efficiency patterns throughout previous campaigns, groups can determine and replicate profitable artistic components that constantly drive greater engagement charges and conversions. These patterns may embrace particular colour schemes, picture compositions, or visible storytelling methods that resonate with goal audiences. Earlier marketing campaign property additionally function confirmed references for sustaining constant model voice and visible identification throughout channels. This consistency is essential for constructing model recognition and belief, particularly in multi-channel advertising and marketing environments the place coherent messaging is crucial.

On this publish, we discover use historic marketing campaign property in advertising and marketing content material creation. We enrich reference pictures with useful metadata, together with marketing campaign particulars and AI-generated picture descriptions, and course of them via embedding fashions. By integrating these reference property with AI-powered content material technology, advertising and marketing groups can remodel previous successes into actionable insights for future campaigns. Organizations can use this data-driven method to scale their advertising and marketing efforts whereas sustaining high quality and consistency, leading to extra environment friendly useful resource utilization and improved marketing campaign efficiency. We’ll display how this systematic methodology of utilizing earlier marketing campaign information can considerably improve advertising and marketing methods and outcomes.

Resolution overview

In our earlier publish, we carried out a advertising and marketing marketing campaign picture generator utilizing Amazon Nova Professional and Amazon Nova Canvas. On this publish, we discover improve this answer by incorporating a reference picture search engine that makes use of historic marketing campaign property to enhance technology outcomes. The next structure diagram illustrates the answer:

The principle structure elements are defined within the following listing:

  1. Our system begins with a web-based UI that customers can entry to start out the creation of recent advertising and marketing marketing campaign pictures. Amazon Cognito handles person authentication and administration, serving to to make sure safe entry to the platform.
  2. The historic advertising and marketing property are uploaded to Amazon Easy Storage Service (Amazon S3) to construct a related reference library. This add course of is initiated via Amazon API Gateway. On this publish, we use the publicly obtainable COCO (Frequent Objects in Context) dataset as our supply of reference pictures.
  3. The picture processing AWS Step Features workflow is triggered via API Gateway and processes pictures in three steps:
    1. A Lambda operate (DescribeImgFunction) makes use of the Amazon Nova Professional mannequin to explain the pictures and determine their key components.
    2. A Lambda operate (EmbedImgFunction) transforms the pictures into embeddings utilizing the Amazon Titan Multimodal Embeddings basis mannequin.
    3. A Lambda operate (IndexDataFunction) shops the reference picture embeddings in an OpenSearch Serverless index, enabling fast similarity searches.
  4. This step bridges asset discovery and content material technology. When customers provoke a brand new marketing campaign, a Lambda operate (GenerateRecommendationsFunction) transforms the marketing campaign necessities into vector embeddings and performs a similarity search within the OpenSearch Serverless index to determine probably the most related reference pictures. The descriptions of chosen reference pictures are then included into an enhanced immediate via a Lambda operate (GeneratePromptFunction). This immediate powers the creation of recent marketing campaign pictures utilizing Amazon Bedrock via a Lambda operate (GenerateNewImagesFunction). For detailed details about the picture technology course of, see our earlier weblog.

Our answer is accessible in GitHub. To deploy this challenge, comply with the directions obtainable within the README file.

Process

On this part, we study the technical elements of our answer, from reference picture processing via closing advertising and marketing content material technology.

Analyzing the reference picture dataset

Step one in our AWS Step Features workflow is analyzing reference pictures utilizing the Lambda Perform DescribeImgFunction. This useful resource makes use of Amazon Nova Professional 1.0 to generate two key elements for every picture: an in depth description and a listing of components current within the picture. These metadata elements will likely be built-in into our vector database index later and used for creating new marketing campaign visuals.

For implementation particulars, together with the entire immediate template and Lambda operate code, see our GitHub repository. The next is the structured output generated by the operate when introduced with a picture:

Baseball outfielder in white uniform catching a ball during a game with coach nearby on a natural field with trees in background

{
  "statusCode": 201,
  "physique": {
    "labels_list": [
      "baseball player in white t-shirt",
      "baseball player in green t-shirt",
      "blue helmet",
      "green cap",
      "baseball glove",
      "baseball field",
      "trees",
      "grass"
    ],
    "description": "A picture displaying two folks taking part in baseball. The particular person in entrance, sporting a white t-shirt and blue helmet, is operating in the direction of the bottom. The particular person behind, sporting a inexperienced t-shirt and inexperienced cap, is holding a baseball glove in his proper hand, presumably getting ready to catch the ball. The background features a lush inexperienced space with timber and a mud baseball subject.",
    "msg": "success"
  }
}

Producing reference picture embeddings

The Lambda operate EmbedImgFunction encodes the reference pictures into vector representations utilizing the Amazon Titan Multimodal Embeddings mannequin. This mannequin can embed each modalities right into a joint house the place textual content and pictures are represented as numerical vectors in the identical dimensional house. On this unified illustration, semantically related objects (whether or not textual content or pictures) are positioned nearer collectively. The mannequin preserves semantic relationships inside and throughout modalities, enabling direct comparisons between any mixture of pictures and textual content. This permits highly effective capabilities equivalent to text-based picture search, picture similarity search, and mixed textual content and picture search.

The next code demonstrates the important logic for changing pictures into vector embeddings. For the entire implementation of the Lambda operate, see our GitHub repository.

with open(image_path, "rb") as image_file:
    input_image = base64.b64encode(image_file.learn()).decode('utf8')

response = bedrock_runtime.invoke_model(
    physique=json.dumps({
        "inputImage": input_image,
        "embeddingConfig": {
            "outputEmbeddingLength": dimension
        }
    }),
    modelId=model_id
)
json.masses(response.get("physique").learn())

The operate outputs a structured response containing the picture particulars and its embedding vector, as proven within the following instance.

{
    'filename': '000000000872.jpg',
    'file_path': '{AMAZON_S3_PATH}',
    'embedding': [
        0.040705927,
        -0.007597826,
        -0.013537944,
        -0.038679842,
        ... // 1,024-dimensional vector by default, though this can be adjusted
    ]
}

Index reference pictures with Amazon Bedrock and OpenSearch Serverless

Our answer makes use of OpenSearch Serverless to allow environment friendly vector search capabilities for reference pictures. This course of entails two foremost steps: establishing the search infrastructure after which populating it with reference picture information.

Creation of the search index

Earlier than indexing our reference pictures, we have to arrange the suitable search infrastructure. When our stack is deployed, it provisions a vector search assortment in OpenSearch Serverless, which routinely handles scaling and infrastructure administration. Inside this assortment, we create a search index utilizing the Lambda operate CreateOpenSearchIndexFn.

Our index mappings configuration, proven within the following code, defines the vector similarity algorithm and the marketing campaign metadata fields for filtering. We use the Hierarchical Navigable Small World (HNSW) algorithm, offering an optimum stability between search pace and accuracy. The marketing campaign metadata consists of an goal subject that captures marketing campaign objectives (equivalent to clicks, consciousness, or likes) and a node subject that identifies goal audiences (equivalent to followers, prospects, or new prospects). By filtering search outcomes utilizing these fields, we might help make sure that reference pictures come from campaigns with matching aims and goal audiences, sustaining alignment in our advertising and marketing method.

{
    "mappings": {
        "properties": {
            "outcomes": {"kind": "float"},
            "node": {"kind": "key phrase"},
            "goal": {"kind": "key phrase"},
            "image_s3_uri": {"kind": "textual content"},
            "image_description": {"kind": "textual content"},
            "img_element_list": {"kind": "textual content"},
            "embeddings": {
                "kind": "knn_vector",
                "dimension": 1024,
                "methodology": {
                    "engine": "nmslib",
                    "space_type": "cosinesimil",
                    "identify": "hnsw",
                    "parameters": {"ef_construction": 512, "m": 16}
                }
            }
        }
    }
}

For the entire implementation particulars, together with index settings and extra configurations, see our GitHub repository.

Indexing reference pictures

With our search index in place, we are able to now populate it with reference picture information. The Lambda operate IndexDataFunction handles this course of by connecting to the OpenSearch Serverless index and storing every picture’s vector embedding alongside its metadata (marketing campaign aims, audience, descriptions, and different related data). We are able to use this listed information later to shortly discover related reference pictures when creating new advertising and marketing campaigns. Beneath is a simplified implementation, with the entire code obtainable in our GitHub repository:

# Initialize the OpenSearch consumer
oss_client = OpenSearch(
    hosts=[{'host': OSS_HOST, 'port': 443}],
    http_auth=AWSV4SignerAuth(boto3.Session().get_credentials(), area, 'aoss'),
    use_ssl=True,
    verify_certs=True,
    connection_class=RequestsHttpConnection
)
# Put together doc for indexing
doc = {
    "id": image_id,
    "node": metadata['node'],
    "goal": metadata['objective'],
    "image_s3_uri": s3_url,
    "image_description": description,
    "img_element_list": components,
    "embeddings": embedding_vector
}
# Index doc in OpenSearch
oss_response = oss_client.index(
    index=OSS_EMBEDDINGS_INDEX_NAME,
    physique=doc
)

Combine the search engine into the advertising and marketing campaigns picture generator

The picture technology workflow combines marketing campaign necessities with insights from earlier reference pictures to create new advertising and marketing visuals. The method begins when customers provoke a brand new marketing campaign via the net UI. Customers present three key inputs: a textual content description of their desired marketing campaign, its goal, and its node. Utilizing these inputs, we carry out a vector similarity search in OpenSearch Serverless to determine probably the most related reference pictures from our library. For these chosen pictures, we retrieve their descriptions (created earlier via Lambda operate DescribeImgFunction) and incorporate them into our immediate engineering course of. The ensuing enhanced immediate serves as the muse for producing new marketing campaign pictures that align with each: the person’s necessities and profitable reference examples. Let’s study every step of this course of intimately.

Get picture suggestions

When a person defines a brand new marketing campaign description, the Lambda operate GetRecommendationsFunction transforms it right into a vector embedding utilizing the Amazon Titan Multimodal Embeddings mannequin. By remodeling the marketing campaign description into the identical vector house as our picture library, we are able to carry out exact similarity searches and determine reference pictures that intently align with the marketing campaign’s aims and visible necessities.

The Lambda operate configures the search parameters, together with the variety of outcomes to retrieve and the ok worth for the k-NN algorithm. In our pattern implementation, we set ok to 5, retrieving the highest 5 most related pictures. These parameters might be adjusted to stability outcome range and relevance.

To assist guarantee contextual relevance, we apply filters to match each the node (audience) and goal of the brand new marketing campaign. This method ensures that really helpful pictures aren’t solely visually related but in addition aligned with the marketing campaign’s particular objectives and audience. We showcase a simplified implementation of our search question, with the entire code obtainable in our GitHub repository.

physique = {
    "measurement": ok,
    "_source": {"exclude": ["embeddings"]},
    "question":
        {
            "knn":
                {
                    "embeddings": {
                        "vector": embedding,
                        "ok": ok,
                    }
                }
        },
    "post_filter": {
        "bool": {
            "filter": [
                {"term": {"node": node}},
                {"term": {"objective": objective}}
            ]
        }
    }
}
res = oss_client.search(index=OSS_EMBEDDINGS_INDEX_NAME, physique=physique)

The operate processes the search outcomes, that are saved in Amazon DynamoDB to take care of a persistent document of campaign-image associations for environment friendly retrieval. Customers can entry these suggestions via the UI and choose which reference pictures to make use of for his or her new marketing campaign creation.

Enhancing the meta-prompting approach with reference pictures

The immediate technology section builds upon our meta-prompting approach launched in our earlier weblog. Whereas sustaining the identical method with Amazon Nova Professional 1.0, we now improve the method by incorporating descriptions from user-selected reference pictures. These descriptions are built-in into the template immediate utilizing XML tags (), as proven within the following instance.

You're a graphics designer named Joe that makes a speciality of creating visualizations aided by text-to-image basis fashions. Your colleagues come to you each time they need to craft environment friendly prompts for creating pictures with text-to-image basis fashions equivalent to Steady Difussion or Dall-E. 

You at all times reply to your colleagues requests with a really environment friendly immediate for creating nice visualizations utilizing text-to-image basis fashions.

These are some guidelines you'll comply with when interacting along with your colleagues:

* Your colleagues will focus on their concepts utilizing both Spanish or English, so please be versatile.
* Your solutions will at all times be in English whatever the language your colleague used to speak.
* Your immediate must be at most 512 characters. You're inspired to make use of all of them.
* Don't give particulars about or decision of the pictures within the immediate you'll generate.
* You'll at all times say out loud what you might be pondering
* You at all times purpose solely as soon as earlier than making a immediate
* It doesn't matter what you at all times present a immediate to your colleagues
* You'll create just one immediate
* If supplied with reference picture descriptions (will likely be in between  XML tags) rigorously stability the contributions of the campaigns description with the reference pictures to create the immediate
* By no means counsel so as to add textual content to the pictures

Listed here are some pointers you at all times comply with when crafting efficient picture prompts:

* Begin with a transparent imaginative and prescient: Have a transparent concept of the picture you need the AI to generate, picturing the scene or idea in your thoughts intimately.
* Select your topic: Clearly state the primary topic of your picture, guaranteeing it's prominently talked about within the immediate.
* Set the scene: Describe the setting or background, together with the atmosphere, time of day, or particular location.
* Specify lighting and environment: Use descriptive phrases for lighting and temper, like "bathed in golden hour gentle" or "mystical environment".
* Incorporate particulars and textures: Enrich your immediate with descriptions of textures, colours, or particular objects so as to add depth.
* Use unfavourable key phrases correctly: Embody particular components you need the AI to keep away from to refine the output.
* Be conscious of size and readability: Efficient prompts are usually detailed however not overly lengthy, offering key visible options, types, feelings or different descriptive components.
* Particular tokens might be added to offer higher-level steering like "photorealistic", "cinematic lighting" and so on. These act like key phrases for the mannequin.
* Logically order immediate components and use punctuation to point relationships. For instance, use commas to separate unbiased clauses or colons to steer into an outline.
* Assessment and revise: Test your immediate for accuracy and readability, revising as wanted to raised seize your concept.

Listed here are some examples of prompts you may have created beforehand to assist your colleagues:

{Textual content to picture immediate examples}

A colleague of yours has come to you for assist in making a immediate for:

{textual content}

He additionally discovered the next picture descriptions that match what he want to create and he desires you to contemplate the for crafting your immediate:


{Descriptions of associated reference pictures}

Utilizing your data in text-to-image basis fashions craft a immediate to generate a picture to your colleague. You're inspired to assume out loud in your artistic course of however please write it down in a scratchpad.

Construction your output in a JSON object with the next construction:

{json_schema}

The immediate technology is orchestrated by the Lambda operate GeneratePromptFunction. The operate receives the marketing campaign ID and the URLs of chosen reference pictures, retrieves their descriptions from DynamoDB, and makes use of Amazon Nova Professional 1.0 to create an optimized immediate from the earlier template. This immediate is used within the subsequent picture technology section. The code implementation of the Lambda operate is accessible in our GitHub repository.

Picture technology

After acquiring reference pictures and producing an enhanced immediate, we use the Lambda operate GenerateNewImagesFunction to create the brand new marketing campaign picture. This operate makes use of Amazon Nova Canvas 1.0 to generate a closing visible asset that comes with insights from profitable reference campaigns. The implementation follows the picture technology course of we detailed in our earlier weblog. For the entire Lambda operate code, see our GitHub repository.

Creating a brand new advertising and marketing marketing campaign: An end-to-end instance

We developed an intuitive interface that guides customers via the marketing campaign creation course of. The interface handles the complexity of AI-powered picture technology, solely requiring customers to offer their marketing campaign description and fundamental particulars. We stroll via the steps to create a advertising and marketing marketing campaign utilizing our answer:

  1. Customers start by defining three key marketing campaign components:
    1. Marketing campaign description: An in depth temporary that serves as the muse for picture technology.
    2. Marketing campaign goal: The advertising and marketing goal (for instance, Consciousness) that guides the visible technique.
    3. Goal node: The precise viewers phase (for instance, Prospects) for content material concentrating on.

Definition of campaign elements

  1. Based mostly on the marketing campaign particulars, the system presents related pictures from earlier profitable campaigns. Customers can assessment and choose the pictures that align with their imaginative and prescient. These alternatives will information the picture technology course of.

Suggestions of relevant images from previous marketing campaigns

  1. Utilizing the marketing campaign description and chosen reference pictures, the system generates an enhanced immediate that serves because the enter for the ultimate picture technology step.

AI-generated prompt for marketing image creation

  1. Within the closing step, our system generates visible property based mostly on the immediate that might doubtlessly be used as inspiration for a whole marketing campaign briefing.

AI-generated marketing campaign images

How Bancolombia is utilizing Amazon Nova to streamline their advertising and marketing marketing campaign property technology

Bancolombia, considered one of Colombia’s main banks, has been experimenting with this advertising and marketing content material creation method for greater than a yr. Their implementation offers useful insights into how this answer might be built-in into established advertising and marketing workflows. Bancolombia has been capable of streamline their artistic workflow whereas guaranteeing that the generated visuals align with the marketing campaign’s strategic intent. Juan Pablo Duque, Advertising Scientist Lead at Bancolombia, shares his perspective on the impression of this expertise:

“For the Bancolombia crew, leveraging historic imagery was a cornerstone in constructing this answer. Our aim was to immediately sort out three main business ache factors:

  • Lengthy and dear iterative processes: By implementing meta-prompting methods and guaranteeing strict model pointers, we’ve considerably decreased the time customers spend producing high-quality pictures.
  • Issue sustaining context throughout artistic variations: By figuring out and locking in key visible components, we guarantee seamless consistency throughout all graphic property.
  • Lack of management over outputs: The suite of methods built-in into our answer offers customers with a lot larger precision and management over the outcomes.

And that is only the start. This train permits us to validate new AI creations towards our present library, guaranteeing we don’t over-rely on the identical visuals and conserving our model’s look recent and interesting.”

Clear up

To keep away from incurring future expenses, you need to delete all of the assets used on this answer. As a result of the answer was deployed utilizing a number of AWS CDK stacks, you need to delete them within the reverse order of deployment to correctly take away all assets. Comply with these steps to wash up your atmosphere:

  1. Delete the frontend stack:
  1. Delete the picture technology backend stack:
cd ../backend-img-generation
cdk destroy

  1. Delete the picture indexing backend stack:
cd ../backend-img-indexing
cdk destroy

  1. Delete the OpenSearch roles stack:
cd ../create-opensearch-roles
cdk destroy

The cdk destroy command will take away most assets routinely, however there is perhaps some assets that require handbook deletion equivalent to S3 buckets with content material and OpenSearch collections. Be sure that to verify the AWS Administration Console to confirm that every one assets have been correctly eliminated. For extra details about the cdk destroy command, see the AWS CDK Command Line Reference.

Conclusion

This publish has introduced an answer that enhances advertising and marketing content material creation by combining generative AI with insights from historic campaigns. Utilizing Amazon OpenSearch Serverless and Amazon Bedrock, we constructed a system that effectively searches and makes use of reference pictures from earlier advertising and marketing campaigns. The system filters these pictures based mostly on marketing campaign aims and goal audiences, serving to to make sure strategic alignment. These references then feed into our immediate engineering course of. Utilizing Amazon Nova Professional, we generate a immediate that mixes new marketing campaign necessities with insights from profitable previous campaigns, offering model consistency within the closing picture technology.

This implementation represents an preliminary step in utilizing generative AI for advertising and marketing. The entire answer, together with detailed implementations of the Lambda capabilities and configuration information, is accessible in our GitHub repository for adaptation to particular organizational wants.

For extra data, see the next associated assets:


Concerning the authors

María Fernanda Cortés is a Senior Knowledge Scientist on the Skilled Companies crew of AWS. She’s targeted on designing and growing end-to-end AI/ML options to deal with enterprise challenges for purchasers globally. She’s enthusiastic about scientific data sharing and volunteering in technical communities.

David Laredo is a Senior Utilized Scientist at Amazon, the place he helps innovate on behalf of shoppers via the appliance of state-of-the-art methods in ML. With over 10 years of AI/ML expertise David is a regional technical chief for LATAM who continuously produces content material within the type of blogposts, code samples and public talking classes. He at the moment leads the AI/ML professional group in LATAM.

Adriana Dorado is a Pc Engineer and Machine Studying Technical Subject Neighborhood (TFC) member at AWS, the place she has been for five years. She’s targeted on serving to small and medium-sized companies and monetary providers prospects to architect on the cloud and leverage AWS providers to derive enterprise worth. Outdoors of labor she’s enthusiastic about serving because the Vice President of the Society of Girls Engineers (SWE) Colombia chapter, studying science fiction and fantasy novels, and being the proud aunt of a wonderful niece.

Yunuen Piña is a Options Architect at AWS, specializing in serving to small and medium-sized companies throughout Mexico to rework their concepts into modern cloud options that drive enterprise progress.

Juan Pablo Duque is a Advertising Science Lead at Bancolombia, the place he merges science and advertising and marketing to drive effectivity and effectiveness. He transforms advanced analytics into compelling narratives. Captivated with GenAI in MarTech, he writes informative weblog posts. He leads information scientists devoted to reshaping the advertising and marketing panorama and defining new methods to measure.

Related Articles

Latest Articles