Generate Stunning Images with the Heller Software Wabbit Cognitive Actions

In the world of AI and image generation, the Heller Software Wabbit offers powerful Cognitive Actions that enable developers to create stunning images using advanced inpainting techniques. These actions are designed to enhance creative workflows, allowing for the generation of custom visuals tailored to specific prompts. This blog post will guide you through the capabilities of these actions, the required inputs, and how to integrate them into your applications.
Prerequisites
To use the Cognitive Actions, you will need:
- An API key for the Cognitive Actions platform.
- Basic understanding of JSON and RESTful APIs.
Authentication typically involves passing your API key in the request headers. With this set up, you are ready to explore the possibilities offered by the Wabbit actions.
Cognitive Actions Overview
Generate Inpainted Image
The Generate Inpainted Image action allows you to create images through inpainting with customizable resolution, aspect ratio, and output formats. You can optimize for quality or speed by selecting different models, such as the 'dev' model for high-quality outputs or the 'schnell' model for rapid image generation. This action offers a plethora of options for fine-tuning the output, including prompt intensity control and LoRA weight adjustments.
Input
The input schema for this action requires the following fields:
- prompt (required): A descriptive text that guides the image generation.
- mask (optional): URI of the image mask for inpainting mode.
- seed (optional): Random seed for reproducible outputs.
- image (optional): URI of the input image for image-to-image or inpainting mode.
- width (optional): Width of the generated image (when
aspect_ratioiscustom). - height (optional): Height of the generated image (when
aspect_ratioiscustom). - numOutputs (optional): Number of images to generate (1 to 4).
- inferenceModel (optional): Choose between 'dev' and 'schnell' models for inference.
Here’s an example of the JSON payload you might use:
{
"prompt": "A photorealistic scene of a rabbit WABBIT hopping through a frost-covered field under a stunning Northern Lights sky.",
"loraScale": 1,
"numOutputs": 2,
"guidanceScale": 3.5,
"outputQuality": 90,
"extraLoraScale": 1,
"inferenceModel": "dev",
"promptStrength": 0.8,
"imageAspectRatio": "9:16",
"imageOutputFormat": "jpg",
"numInferenceSteps": 28
}
Output
The action returns an array of URLs pointing to the generated images. For example:
[
"https://assets.cognitiveactions.com/invocations/feeeace0-0716-4bd6-af86-3f8269afbf37/e661f4bc-d2e9-4a9e-bd7f-e2f817c29832.jpg",
"https://assets.cognitiveactions.com/invocations/feeeace0-0716-4bd6-af86-3f8269afbf37/a6d21454-e5aa-4ac7-9c3c-861c7025c2f8.jpg"
]
Conceptual Usage Example (Python)
Here’s a conceptual Python code snippet demonstrating how you might invoke the Generate Inpainted Image 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 = "ac8f2d78-a617-4f01-8f63-d78f4590b54c" # Action ID for Generate Inpainted Image
# Construct the input payload based on the action's requirements
payload = {
"prompt": "A photorealistic scene of a rabbit WABBIT hopping through a frost-covered field under a stunning Northern Lights sky.",
"loraScale": 1,
"numOutputs": 2,
"guidanceScale": 3.5,
"outputQuality": 90,
"extraLoraScale": 1,
"inferenceModel": "dev",
"promptStrength": 0.8,
"imageAspectRatio": "9:16",
"imageOutputFormat": "jpg",
"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, you need to replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID for Generate Inpainted Image is also specified, and the input payload is structured according to the schema requirements.
Conclusion
The Heller Software Wabbit Cognitive Actions provide a robust framework for developers looking to integrate advanced image generation capabilities into their applications. With customizable prompts and flexible parameters, you can create visually stunning images tailored to your specific needs. Start experimenting with these actions today and unlock the potential of AI-driven creativity!