Create Stunning AKIRA-Style Images with the doriandarko/sdxl-akira Cognitive Actions

24 Apr 2025
Create Stunning AKIRA-Style Images with the doriandarko/sdxl-akira Cognitive Actions

The doriandarko/sdxl-akira API offers an innovative way to generate striking images inspired by the iconic style of the cult movie AKIRA. Utilizing advanced machine learning techniques, this API provides developers with Cognitive Actions that can create visually captivating artwork based on custom prompts and parameters. By integrating these pre-built actions into your applications, you can enhance user experiences with evocative imagery that resonates with fans of the original film.

Prerequisites

To get started with the Cognitive Actions in the doriandarko/sdxl-akira API, you'll need an API key for authentication. This key should be passed in the headers of your API requests. Ensure you have the necessary setup to make HTTP requests in the programming language of your choice.

Cognitive Actions Overview

Generate Image in AKIRA Style

This action creates images in the distinctive style of the AKIRA movie using the SDXL model, allowing for customization through prompts and parameters to achieve unique results.

Category: Image Generation

Input

The input schema for this action requires the following fields, with some being optional:

  • mask (string, optional): URI for the input mask in inpaint mode.
  • seed (integer, optional): Random seed for generation. Leaving this blank will result in a randomized seed.
  • image (string, optional): URI of the input image for img2img or inpaint modes.
  • width (integer, default: 1024): Width of the output image in pixels.
  • height (integer, default: 1024): Height of the output image in pixels.
  • prompt (string, default: "An astronaut riding a rainbow unicorn"): Text prompt for generating the image.
  • refine (string, default: "no_refiner"): Refinement method for image generation.
  • loraScale (number, default: 0.6): Additive scale for LoRA.
  • scheduler (string, default: "K_EULER"): Scheduler algorithm for image generation.
  • numOutputs (integer, default: 1): Number of output images to generate (1 to 4).
  • guidanceScale (number, default: 7.5): Scale for classifier-free guidance.
  • highNoiseFrac (number, default: 0.8): Fraction of noise applied in expert_ensemble_refiner.
  • applyWatermark (boolean, default: true): Applies a watermark for verification.
  • negativePrompt (string, optional): Input negative prompt that guides the generator to avoid certain elements.
  • promptStrength (number, default: 0.8): Strength of the prompt in img2img/inpaint modes.
  • numInferenceSteps (integer, default: 50): Number of denoising steps during image generation.

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "In the style of akiraft, a boy wearing a red jacket from the back",
  "refine": "no_refiner",
  "loraScale": 0.6,
  "scheduler": "K_EULER",
  "numOutputs": 1,
  "guidanceScale": 7.5,
  "highNoiseFrac": 0.8,
  "applyWatermark": true,
  "promptStrength": 0.8,
  "numInferenceSteps": 50
}

Output

The action typically returns an array of image URLs. Here’s an example of what you might receive:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/b00ff914-3ecc-4367-bfc1-52c5fdbcedab/856dbbfc-af54-448d-9f6f-3bec036daba6.png"
]

Conceptual Usage Example (Python)

Here’s how you might use the Generate Image in AKIRA Style action 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 = "59c5fce4-e046-4822-a7b5-155ad1054e07"  # Action ID for Generate Image in AKIRA Style

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "In the style of akiraft, a boy wearing a red jacket from the back",
    "refine": "no_refiner",
    "loraScale": 0.6,
    "scheduler": "K_EULER",
    "numOutputs": 1,
    "guidanceScale": 7.5,
    "highNoiseFrac": 0.8,
    "applyWatermark": True,
    "promptStrength": 0.8,
    "numInferenceSteps": 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 code snippet, replace "YOUR_COGNITIVE_ACTIONS_API_KEY" with your actual API key. The payload is structured according to the input schema, and the action ID is specified for the Generate Image in AKIRA Style action. The endpoint URL and request structure are illustrative and should be adjusted according to the actual API specifications.

Conclusion

The doriandarko/sdxl-akira Cognitive Actions provide developers with powerful tools for generating visually stunning images in the style of AKIRA. By leveraging the flexibility of customizable prompts and various parameters, you can create unique artwork that engages users and enhances your applications. Consider exploring other use cases where image generation can add value, such as in gaming, design, or creative storytelling. Happy coding!