Generate Stunning Images with BoobAI Cognitive Actions

In the realm of artificial intelligence, image generation has become a powerful tool for developers aiming to create visually appealing content. The BoobAI-v2.0-Alpha specification offers a robust set of Cognitive Actions designed to generate high-quality images based on textual prompts. With customizable parameters and advanced detection capabilities, these actions can be seamlessly integrated into your applications, enabling you to unleash creativity like never before.
Prerequisites
Before diving into the Cognitive Actions, ensure you have the following:
- An API key for accessing the BoobAI Cognitive Actions platform.
- Basic knowledge of JSON and HTTP requests.
Authentication is typically handled by passing your API key in the request headers, allowing you to securely interact with the service.
Cognitive Actions Overview
Generate Images with BoobAI
Description: This action generates high-quality images based on a textual prompt, utilizing the BoobAI-v2.0-Alpha model. It allows customization of various parameters, including image dimensions, batch size, and scheduling algorithms. Complex prompt weighting helps enhance output control, and options for face, hand, and person detection using YOLO models add further flexibility.
Input
The input schema for this action includes several fields, as outlined below:
{
"seed": -1,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"pagScale": 0,
"batchSize": 1,
"scheduler": "Euler a",
"clipLayerSkip": 2,
"visualEncoder": "default",
"modelSelection": "BoobAI-v2.0-Alpha",
"negativePrompt": "nsfw, naked",
"useFaceYoloV9c": true,
"useHandYoloV9c": false,
"generationSteps": 30,
"guidanceRescale": 1,
"prependPrePrompt": true,
"configurationScale": 7,
"usePersonYoloV8MSeg": false
}
Key Fields:
- seed (integer): Sets the seed for random number generation. Use -1 for a random seed.
- width (integer): Image width in pixels (1 to 4096).
- height (integer): Image height in pixels (1 to 4096).
- prompt (string): The textual prompt for image generation.
- batchSize (integer): Number of images to generate per request (1 to 4).
- scheduler (string): Scheduling algorithm for the generation process.
- negativePrompt (string): Elements to avoid during generation.
Output
Upon successful execution, the action typically returns a URL to the generated image:
[
"https://assets.cognitiveactions.com/invocations/a7851ea8-c646-4bbc-a93d-71f6e5abdc53/f55d5553-bbd0-4799-a68d-0872448d6ce2.png"
]
Conceptual Usage Example (Python)
Here's how a developer might call the Cognitive Actions execution endpoint to generate an image using the provided parameters:
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 = "fab59f9a-2625-46d9-b658-54884ce3e2ca" # Action ID for Generate Images with BoobAI
# Construct the input payload based on the action's requirements
payload = {
"seed": -1,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"pagScale": 0,
"batchSize": 1,
"scheduler": "Euler a",
"clipLayerSkip": 2,
"visualEncoder": "default",
"modelSelection": "BoobAI-v2.0-Alpha",
"negativePrompt": "nsfw, naked",
"useFaceYoloV9c": True,
"useHandYoloV9c": False,
"generationSteps": 30,
"guidanceRescale": 1,
"prependPrePrompt": True,
"configurationScale": 7,
"usePersonYoloV8MSeg": False
}
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 code snippet, you replace the placeholder API key and endpoint with your actual credentials. The payload structure aligns with the input schema requirements, and the response handling ensures you capture any potential errors effectively.
Conclusion
The BoobAI-v2.0-Alpha Cognitive Actions offer developers a powerful way to generate stunning images tailored to specific prompts. By leveraging customizable parameters and advanced detection capabilities, you can enhance your applications and provide visually engaging content. Start experimenting with these actions today, and unlock new creative possibilities in your projects!