Create Stunning Anime Images with Mistoon Anime XL Cognitive Actions

22 Apr 2025
Create Stunning Anime Images with Mistoon Anime XL Cognitive Actions

The Mistoon Anime XL Cognitive Actions provide developers with a powerful tool to generate stunning anime-style images effortlessly. By leveraging advanced models, these actions enable image creation based on text prompts, existing images, or even through inpainting. This versatility opens up a plethora of creative possibilities for applications in gaming, art generation, and animation.

Prerequisites

Before you start integrating the Mistoon Anime XL Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform.
  • Basic understanding of making HTTP requests and handling JSON data.
  • Ensure you can send authorization headers (e.g., passing the API key) with your requests.

Cognitive Actions Overview

Generate Anime Images with Mistoon Anime XL

This action allows you to create anime images using the Mistoon Anime XL Model. You can generate images from text (Text2Img), modify existing images (Img2Img), or inpaint areas of an image to enhance or alter them.

  • Category: Image Generation

Input

The action accepts several parameters to customize the image generation process, outlined in the schema below:

{
  "width": 1024,
  "height": 1024,
  "prompt": "score_9, score_8_up, score_7_up, karuizawa, 1girl, blonde hair, ponytail, hair scrunchie, blunt bangs, red eyes, blunt bangs, purple eyes, looking_at_viewer",
  "strength": 0.8,
  "loraScale": 0.6,
  "scheduler": "K_EULER_ANCESTRAL",
  "guidanceScale": 3.5,
  "negativePrompt": "score_6, score_5, score_4, multiple, lowres, text, error, missing arms, missing legs, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, jpeg artifacts, signature, watermark, out of frame, extra fingers, mutated hands, (poorly drawn hands), (poorly drawn face), (mutation), (deformed breasts), (ugly), blurry, (bad anatomy), (bad proportions), (extra limbs), cloned face, flat color, monochrome, limited palette, headwear",
  "numberOfOutputs": 1,
  "numberOfInferenceSteps": 40
}

The fields explained:

  • width: (integer) Output image width in pixels (default: 1024).
  • height: (integer) Output image height in pixels (default: 1024).
  • prompt: (string) Descriptive text to guide the generation.
  • strength: (number) Influences the effect of the prompt (0-1).
  • loraScale: (number) Scale factor for LoRA models (0-1).
  • scheduler: (string) Denoising method (default: "K_EULER_ANCESTRAL").
  • guidanceScale: (number) Scale for classifier-free guidance (1-50).
  • negativePrompt: (string) Specifies attributes to avoid.
  • numberOfOutputs: (integer) Number of images to generate (1-4).
  • numberOfInferenceSteps: (integer) Steps for denoising (1-500).

Output

The action returns a list of URLs pointing to the generated anime images. An example output might look like this:

[
  "https://assets.cognitiveactions.com/invocations/cc9b8e5b-20b8-4495-a3d7-6e435530022f/af8ae28f-b18a-4bce-8c79-06837eab2564.png"
]

Conceptual Usage Example (Python)

Here's a conceptual example of how to call the Mistoon Anime XL action using 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 = "a81d9369-1f2c-4829-8818-e02c853b0fdc"  # Action ID for Generate Anime Images with Mistoon Anime XL

# Construct the input payload
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "score_9, score_8_up, score_7_up, karuizawa, 1girl, blonde hair, ponytail, hair scrunchie, blunt bangs, red eyes, blunt bangs, purple eyes, looking_at_viewer",
    "strength": 0.8,
    "loraScale": 0.6,
    "scheduler": "K_EULER_ANCESTRAL",
    "guidanceScale": 3.5,
    "negativePrompt": "score_6, score_5, score_4, multiple, lowres, text, error, missing arms, missing legs, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, jpeg artifacts, signature, watermark, out of frame, extra fingers, mutated hands, (poorly drawn hands), (poorly drawn face), (mutation), (deformed breasts), (ugly), blurry, (bad anatomy), (bad proportions), (extra limbs), cloned face, flat color, monochrome, limited palette, headwear",
    "numberOfOutputs": 1,
    "numberOfInferenceSteps": 40
}

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 YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key.
  • The action_id corresponds to the "Generate Anime Images with Mistoon Anime XL" action.
  • The payload is structured to match the required input schema for the action.

Conclusion

The Mistoon Anime XL Cognitive Actions provide a versatile and powerful means to create high-quality anime images tailored to your requirements. Whether you're developing games, art applications, or engaging content, integrating these actions can significantly enhance your projects. Consider exploring various input configurations to achieve unique artistic styles and outputs. Happy coding!