Create Stunning Heatmap Images with maison-meta-app/mm_heatmap Actions

In the world of image processing and generation, the maison-meta-app/mm_heatmap API offers an exciting way to create dreamy heatmap effects on images. This powerful set of Cognitive Actions allows developers to generate visually stunning images with a unique editorial fashion twist, utilizing features like blurred silhouettes and vibrant color gradients. By leveraging these pre-built actions, developers can easily integrate advanced image generation capabilities into their applications without the need for extensive machine learning expertise.
Prerequisites
Before you dive into using the Cognitive Actions from the maison-meta-app/mm_heatmap API, ensure you have the following:
- An API key to authenticate your requests to the Cognitive Actions platform. Typically, this involves including your API key in the headers of your requests.
- Basic knowledge of JSON structure, as you will be constructing input payloads in this format.
Cognitive Actions Overview
Generate Dreamy Heatmap Images
Action Purpose
This action creates dreamy, heatmap effects on images, incorporating blurred silhouettes and vibrant color gradients. It’s perfect for developers looking to add a creative flair to their image processing applications.
Input
The input schema for this action is structured as follows:
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text prompt for generating the image, rich in descriptive detail. |
mask | string | No | Image mask for inpainting mode. If provided, other size specifications are ignored. |
image | string | No | Input image for image-to-image or inpainting mode. |
model | string | No | Specifies the model used for inference, with options like "dev" and "schnell". |
width | integer | No | Width of the generated image, only applicable if 'aspect_ratio' is set to custom. |
height | integer | No | Height of the generated image, only applicable if 'aspect_ratio' is set to custom. |
goFast | boolean | No | Toggle for faster predictions with a speed-optimized model. |
aspectRatio | string | No | Sets the aspect ratio for the image, with predefined options or custom values. |
outputFormat | string | No | Format of the output images (e.g., "webp", "jpg", "png"). |
numOutputs | integer | No | Specifies how many output images to generate. |
guidanceScale | number | No | Adjusts guidance during the diffusion process. |
outputQuality | integer | No | Sets the output image quality from 0 to 100. |
numInferenceSteps | integer | No | Determines the number of denoising steps. |
Example Input
{
"model": "dev",
"goFast": false,
"prompt": "A blurred, heatmap style illustration silhouette on a soft, pastel background. The central figure is partially black, with bright neon or pastel gradients (pink, yellow, green, and blue) around the edges. The overall effect is dreamy, surreal, and somewhat psychedelic.",
"loraScale": 1,
"megapixels": "1",
"numOutputs": 4,
"aspectRatio": "1:1",
"outputFormat": "webp",
"guidanceScale": 3,
"outputQuality": 80,
"extraLoraScale": 1,
"promptStrength": 0.8,
"numInferenceSteps": 28
}
Output
The action typically returns an array of URLs pointing to the generated images. Here’s an example of what the output might look like:
[
"https://assets.cognitiveactions.com/invocations/0b53d420-c029-4a02-8808-eb7650016d15/00093b44-76bb-483a-bb8b-188ab21dbbe1.webp",
"https://assets.cognitiveactions.com/invocations/0b53d420-c029-4a02-8808-eb7650016d15/74e6a71a-49fe-418d-a61a-9d17a01d84f8.webp",
"https://assets.cognitiveactions.com/invocations/0b53d420-c029-4a02-8808-eb7650016d15/2f4d8d72-08f6-4953-9087-cb19182ed239.webp",
"https://assets.cognitiveactions.com/invocations/0b53d420-c029-4a02-8808-eb7650016d15/37ca58fb-59df-445a-bba7-282ff19112d3.webp"
]
Conceptual Usage Example (Python)
Here’s how you might call this action using a hypothetical Cognitive Actions execution endpoint in Python:
import requests
import json
# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute" # Hypothetical endpoint
action_id = "0b3751ac-6780-43d1-8221-1b9a81212e88" # Action ID for Generate Dreamy Heatmap Images
# Construct the input payload based on the action's requirements
payload = {
"model": "dev",
"goFast": False,
"prompt": "A blurred, heatmap style illustration silhouette on a soft, pastel background...",
"loraScale": 1,
"megapixels": "1",
"numOutputs": 4,
"aspectRatio": "1:1",
"outputFormat": "webp",
"guidanceScale": 3,
"outputQuality": 80,
"extraLoraScale": 1,
"promptStrength": 0.8,
"numInferenceSteps": 28
}
headers = {
"Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
"Content-Type": "application/json"
}
try:
response = requests.post(
COGNITIVE_ACTIONS_EXECUTE_URL,
headers=headers,
json={"action_id": action_id, "inputs": payload} # Hypothetical structure
)
response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)
result = response.json()
print("Action executed successfully:")
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: {e.response.text}")
In this snippet, the action_id corresponds to the "Generate Dreamy Heatmap Images" action. The payload is constructed based on the example input schema provided. Note that the endpoint URL and request structure are hypothetical and should be adjusted according to the actual API documentation.
Conclusion
The maison-meta-app/mm_heatmap API offers a powerful toolset for generating visually captivating heatmap images. By utilizing the "Generate Dreamy Heatmap Images" action, developers can effortlessly embed creative image generation capabilities into their applications. Whether you're aiming to enhance user experiences or create unique visual content, these Cognitive Actions provide an excellent starting point for your projects. Explore the possibilities and let your creativity flow!