Create Stunning Visuals with Aimetaglasses Ads

In the digital marketing landscape, captivating visuals are essential for engaging audiences and enhancing brand recognition. The Aimetaglasses Ads service offers a powerful toolset through its Cognitive Actions that enables developers to generate high-quality, AI-enhanced images tailored to specific marketing needs. By leveraging advanced features like inpainting and customizable parameters, developers can produce intricate visuals that resonate with their target audiences quickly and efficiently.
Imagine needing to create eye-catching promotional materials for a new product launch or social media campaign. With Aimetaglasses Ads, you can generate stunning visuals that align perfectly with your brand's aesthetic. This service not only saves time but also simplifies the creative process, allowing you to focus on strategy rather than getting bogged down in design details.
Prerequisites
To get started, you will need an Aimetaglasses Ads API key and a basic understanding of making API calls. This will enable you to harness the full potential of the Cognitive Actions provided.
Generate AI-Enhanced Images
The primary action within Aimetaglasses Ads is the ability to generate AI-enhanced images. This action allows you to create customized visuals by inputting a descriptive text prompt, which the AI uses to produce high-resolution images tailored to your specifications.
Purpose
This action solves the challenge of creating unique and high-quality images quickly. Instead of relying on stock photos or manual editing, developers can generate images that are specific to their marketing requirements, enhancing their campaigns' effectiveness.
Input Requirements
To use this action, you will need to provide several parameters:
- Prompt: A detailed text description that guides the image generation.
- Model: Choose between 'dev' for standard quality or 'schnell' for faster generation.
- Aspect Ratio: Specify the desired aspect ratio for the image.
- Output Format: Select the format for the final image (e.g., webp, jpg, png).
- Guidance Scale: Controls how closely the AI adheres to the prompt.
- Output Quality: Defines the quality level of the generated image.
- Number of Outputs: Specifies how many images to generate.
Example input might look like this:
{
"model": "dev",
"prompt": "Fashion photography, close portrait of AIMETAGLASSES worn by two albino twin sisters in red light at night club...",
"aspectRatio": "16:9",
"outputFormat": "webp",
"guidanceScale": 3.5,
"outputQuality": 90,
"numberOfOutputs": 1
}
Expected Output
The output will be a URL link to the generated image, allowing you to easily integrate the visual into your marketing materials.
Example output:
"https://assets.cognitiveactions.com/invocations/faabac71-7379-4bcc-9556-c38e7f926d8d/57566ed1-58bc-4823-8227-6a0133234f50.webp"
Use Cases for this Specific Action
- Product Launches: Create unique images that showcase your new products in engaging contexts.
- Social Media Campaigns: Generate attention-grabbing visuals that can be used across various platforms to increase engagement.
- Advertising Materials: Produce high-quality images for use in digital or print advertisements, tailored to specific marketing messages.
import requests
import json
# Replace with your actual Cognitive Actions API key and endpoint
# Ensure your environment securely handles the API key
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
# This endpoint URL is hypothetical and should be documented for users
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"
action_id = "de822c58-4e7e-486a-b76b-0fe1a38d5dfe" # Action ID for: Generate AI-Enhanced Images
# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
"model": "dev",
"prompt": " Fashion photography, close portrait of AIMETAGLASSES worn by two albino twin sisters in red light at night club, volumetric lighting, cinematic angle, glamour vibrant, highres, realistic photo, professional photography, cinematic angle, dynamic light back shining, bokeh,",
"aspectRatio": "16:9",
"outputFormat": "webp",
"guidanceScale": 3.5,
"outputQuality": 90,
"promptStrength": 0.8,
"loraWeightScale": 1,
"numberOfOutputs": 1,
"additionalLoraScale": 1,
"numberOfInferenceSteps": 28
}
headers = {
"Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
"Content-Type": "application/json",
# Add any other required headers for the Cognitive Actions API
}
# Prepare the request body for the hypothetical execution endpoint
request_body = {
"action_id": action_id,
"inputs": payload
}
print(f"--- Calling Cognitive Action: {action.name or action_id} ---")
print(f"Endpoint: {COGNITIVE_ACTIONS_EXECUTE_URL}")
print(f"Action ID: {action_id}")
print("Payload being sent:")
print(json.dumps(request_body, indent=2))
print("------------------------------------------------")
try:
response = requests.post(
COGNITIVE_ACTIONS_EXECUTE_URL,
headers=headers,
json=request_body
)
response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)
result = response.json()
print("Action executed successfully. Result:")
print(json.dumps(result, indent=2))
except requests.exceptions.RequestException as e:
print(f"Error executing action {action_id}: {e}")
if e.response is not None:
print(f"Response status: {e.response.status_code}")
try:
print(f"Response body: {e.response.json()}")
except json.JSONDecodeError:
print(f"Response body (non-JSON): {e.response.text}")
print("------------------------------------------------")
Conclusion
The Aimetaglasses Ads service empowers developers to create stunning, custom visuals that enhance marketing efforts and drive engagement. By simplifying the image creation process, it allows for rapid iteration and adaptation to changing campaign needs. If you’re ready to elevate your marketing strategies with AI-generated visuals, start integrating Aimetaglasses Ads into your projects today!