Generate Stunning Images with Meepo Pro Player Invoker Cognitive Actions

In the realm of creative design and imagery, the Meepo Pro Player Invoker offers a robust set of Cognitive Actions aimed at generating images based on textual prompts and existing visuals. This API allows developers to harness the power of advanced image generation techniques, providing customizable parameters to tailor the output to specific needs. Whether you’re building an art application, a design tool, or an innovative marketing solution, these pre-built actions can significantly enhance your project's capabilities.
Prerequisites
To get started with the Meepo Pro Player Invoker Cognitive Actions, you'll need an API key for authentication. This key should be included in the headers of your API requests to ensure secure access to the service.
Cognitive Actions Overview
Generate Image from Prompt
The Generate Image from Prompt action enables the creation of images based on a given textual prompt and an existing image. This action utilizes a controlled guidance and style adherence approach, allowing for a high degree of customization. It falls into the category of image-generation.
Input
Here’s a breakdown of the required and optional fields for the input:
- Required Fields:
- image: A URI pointing to the input image.
- prompt: A textual description for the model to interpret.
- Optional Fields:
- seed: An integer for random number generation.
- negativePrompt: A prompt to specify what the model should avoid generating.
- numberOfSamples: Specifies how many samples to generate (1 or 4).
- numberOfSamplesPerBatch: Number of samples processed in each batch (1 or 4).
- controlGuidanceStart: Scale at which control guidance starts (0 to 1).
- controlGuidanceEnd: Scale at which control guidance ends (0 to 1).
- styleGuidanceScale: Scale for adherence to the specified style.
- numberOfInferenceSteps: Total steps for the inference process.
- controlnetConditioningScale: Scale for Controlnet conditioning.
Example Input
Here’s an example JSON payload to invoke the action:
{
"image": "https://replicate.delivery/pbxt/KUGFSlZVW1wUFmerVLpuY22zzxvFfg65TdaRhG5MZPs14x15/empty.jpg",
"prompt": "Modern minimal interior design, clean lines, minimalism, neutral colors, smart use of space and light integral to minimalist, simplicity, clean lines, reductive, uncluttered, monochromatic, simplicity, less is more, living room",
"negativePrompt": "empty room",
"numberOfSamples": "1",
"controlGuidanceEnd": 0.7,
"styleGuidanceScale": 9,
"controlGuidanceStart": 0,
"numberOfInferenceSteps": 50,
"numberOfSamplesPerBatch": "1",
"controlnetConditioningScale": 0.4
}
Output
The action returns an array of URIs pointing to the generated images. Here’s an example of what you might receive:
[
"https://assets.cognitiveactions.com/invocations/7ab168f2-28ec-408f-b3eb-a1b734fbeb7f/5b75269f-3f2d-4099-8b27-c69513059e19.png",
"https://assets.cognitiveactions.com/invocations/7ab168f2-28ec-408f-b3eb-a1b734fbeb7f/bad876c7-8133-43a2-9560-3427b222e36a.png"
]
Conceptual Usage Example (Python)
Here’s a conceptual Python snippet demonstrating how to invoke the Generate Image from Prompt action:
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 = "88d5b1f6-42f6-4f5c-9f17-ee8751977607" # Action ID for Generate Image from Prompt
# Construct the input payload based on the action's requirements
payload = {
"image": "https://replicate.delivery/pbxt/KUGFSlZVW1wUFmerVLpuY22zzxvFfg65TdaRhG5MZPs14x15/empty.jpg",
"prompt": "Modern minimal interior design, clean lines, minimalism, neutral colors, smart use of space and light integral to minimalist, simplicity, clean lines, reductive, uncluttered, monochromatic, simplicity, less is more, living room",
"negativePrompt": "empty room",
"numberOfSamples": "1",
"controlGuidanceEnd": 0.7,
"styleGuidanceScale": 9,
"controlGuidanceStart": 0,
"numberOfInferenceSteps": 50,
"numberOfSamplesPerBatch": "1",
"controlnetConditioningScale": 0.4
}
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 example, replace the COGNITIVE_ACTIONS_API_KEY with your actual API key. The payload is structured according to the action's requirements, ensuring you include all mandatory fields. The endpoint URL and request structure shown are illustrative and should be adapted to your actual API.
Conclusion
The Meepo Pro Player Invoker Cognitive Actions provide a powerful suite for developers looking to integrate advanced image generation capabilities into their applications. By leveraging these actions, you can enhance user experiences, create unique visuals, and automate design processes with ease. Explore the possibilities, and consider how these Cognitive Actions can fit into your next project!