Create Stunning Images with Akabane AI-Enhanced Cognitive Actions

22 Apr 2025
Create Stunning Images with Akabane AI-Enhanced Cognitive Actions

In the world of artificial intelligence, image generation has reached new heights with the advent of tools such as the Akabane All model. This powerful API enables developers to generate striking images based on descriptive prompts, facilitating creative applications in various domains. With enhanced capabilities for image-to-image (img2img) transformations and inpainting, Akabane offers a plethora of customization options that make it an invaluable resource for developers looking to integrate advanced image generation into their applications.

Prerequisites

To start using the Akabane AI-Enhanced Cognitive Actions, you'll need to acquire an API key from the Cognitive Actions platform. Once you have the key, it will typically be passed in the headers of your requests for authentication. This ensures that your actions are securely executed in the cloud.

Cognitive Actions Overview

Generate Akabane AI-Enhanced Images

This action allows you to leverage the Akabane All model to create images based on input prompts. The latest version enhances img2img and inpainting capabilities, offering options for improved resolution and refinement.

Category: image-generation

Input

The action requires a payload that can include a variety of fields. Here’s a detailed breakdown of the input schema along with an example:

  • mask (string, optional): URI for the input mask used in inpainting mode. Black regions will be preserved, while white regions will be inpainted.
  • seed (integer, optional): The seed for random number generation. Leave unset for a randomized seed.
  • image (string, optional): URI for the input image to be used in img2img or inpaint mode.
  • width (integer, optional, default: 1024): Width of the output image in pixels.
  • height (integer, optional, default: 1024): Height of the output image in pixels.
  • prompt (string, required, default: "An astronaut riding a rainbow unicorn"): The textual prompt guiding the image generation.
  • refine (string, optional, default: "no_refiner"): Specify the refinement style to use.
  • scheduler (string, optional, default: "K_EULER"): Select the scheduler type to determine the sampling method.
  • guidanceScale (number, optional, default: 7.5): Scalar multiplier for classifier-free guidance in image generation.
  • applyWatermark (boolean, optional, default: true): Indicates whether a watermark should be applied to generated images.
  • negativePrompt (string, optional): Negatively influences the image generation process based on the specified prompt.
  • promptStrength (number, optional, default: 0.8): Determines the influence of the prompt during img2img or inpaint operations.
  • numberOfOutputs (integer, optional, default: 1): Number of images to output.
  • highNoiseFraction (number, optional, default: 0.8): Specifies the fraction of noise applied in expert ensemble refiner mode.
  • loraAdjustmentScale (number, optional, default: 0.6): Adjustment scale for LoRA.
  • numberOfInferenceSteps (integer, optional, default: 50): Total number of steps used during the denoising process.

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "buildings and plants and people in Akabane",
  "refine": "no_refiner",
  "scheduler": "K_EULER",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "negativePrompt": "",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "highNoiseFraction": 0.8,
  "loraAdjustmentScale": 0.6,
  "numberOfInferenceSteps": 50
}

Output

The action will typically return a list of URLs pointing to the generated images. Here’s an example of what the output might look like:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/1cbb6dca-9c0e-4054-87ee-cf608e9a8752/ce488652-ff17-4e49-a56e-0caaf025bc34.png"
]

Conceptual Usage Example (Python)

Here’s a conceptual Python code snippet demonstrating how to invoke the Generate Akabane AI-Enhanced Images 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 = "18ff24fa-5a5c-483c-9c1e-9f037c137761"  # Action ID for Generate Akabane AI-Enhanced Images

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "buildings and plants and people in Akabane",
    "refine": "no_refiner",
    "scheduler": "K_EULER",
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "negativePrompt": "",
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "highNoiseFraction": 0.8,
    "loraAdjustmentScale": 0.6,
    "numberOfInferenceSteps": 50
}

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 will notice how the action ID and input payload are structured. The provided endpoint URL and request format are illustrative and should be adapted to the actual specifications of the Cognitive Actions platform.

Conclusion

The Akabane AI-Enhanced Cognitive Actions provide developers with a powerful tool for generating captivating images from textual prompts. By leveraging its advanced features such as img2img transformations and customizable settings, you can create unique visuals that meet your application’s needs. Whether you're building a creative project, enhancing user engagement, or exploring new artistic avenues, these Cognitive Actions pave the way for limitless possibilities. Start integrating them into your applications and unleash your creativity!