Generate Stunning Images with Aisha AI's Alchemist-Mix v1 Cognitive Actions

24 Apr 2025
Generate Stunning Images with Aisha AI's Alchemist-Mix v1 Cognitive Actions

In the world of artificial intelligence, image generation has taken a significant leap forward with the development of advanced models. The Aisha AI Alchemist-Mix v1 Cognitive Actions provide developers with powerful tools to create stylized images through a simple API. With customizable parameters, these actions enable you to generate stunning visuals tailored to your specific needs, making it an exciting resource for artists, designers, and developers alike.

Prerequisites

Before diving into the integration of the Cognitive Actions, you need to ensure you have the following:

  • An API key for accessing the Aisha AI Cognitive Actions platform.
  • Familiarity with making HTTP requests and handling JSON data.
  • Basic knowledge of Python for testing and implementation.

To authenticate your API requests, you will generally include the API key in the request headers. This allows the platform to verify your identity and grant access to the Cognitive Actions.

Cognitive Actions Overview

Generate Styled Image

Description: Generate styled images using the Alchemist-Mix-v1 model, with customizable parameters such as seed, width, height, and prompt. Supports advanced features like CFG scale control and scheduler algorithm selection to enhance quality and adherence to prompts.

Category: Image Generation

Input

The input for the Generate Styled Image action requires the following fields:

FieldTypeDescriptionExample
seedIntegerThe seed value used for generation. Set to -1 for a random seed.-1
modelStringSpecifies the model to be used for generation. Default is 'Alchemist-Mix-v1'."Alchemist-Mix-v1"
stepsIntegerDefines the number of steps for generation, ranging from 1 to 100. Default is 40.40
widthIntegerSpecifies the width of the output image in pixels. Accepts values from 1 to 4096. Default is 1024.1024
heightIntegerSpecifies the height of the output image in pixels. Accepts values from 1 to 4096. Default is 1024.1024
promptStringThe prompt used for generation, supporting Compel weighting syntax."street, 1girl, dark-purple short hair..."
cfgScaleNumberControls the model's adherence to the provided prompt. Default is 5.5
clipSkipIntegerNumber of CLIP layers to skip. Setting this to 1 results in no skipping.1
pagScaleNumberEnhances generation quality similar to CFG. Default is 0.0
batchSizeIntegerSpecifies how many images to generate per batch, ranging from 1 to 4.1
schedulerStringIdentifies the scheduling algorithm to be applied. Default is 'Euler a'."Euler a"
negativePromptStringSpecifies undesirable elements using Compel weighting syntax."nsfw, naked"
guidanceRescaleNumberAdjusts CFG-derived noise levels to prevent overexposure.1
prependPrePromptBooleanPre-adds specified preprompt details for refinement.true
variationalAutoEncoderStringChooses which Variational Autoencoder (VAE) to use. Default is 'default'."default"

Example Input:

{
  "seed": -1,
  "model": "Alchemist-Mix-v1",
  "steps": 40,
  "width": 1024,
  "height": 1024,
  "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
  "cfgScale": 5,
  "clipSkip": 1,
  "pagScale": 0,
  "batchSize": 1,
  "scheduler": "Euler a",
  "negativePrompt": "nsfw, naked",
  "guidanceRescale": 1,
  "prependPrePrompt": true,
  "variationalAutoEncoder": "default"
}

Output

The output typically consists of an array of URLs pointing to the generated image(s).

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/25789209-b141-499f-a6a5-46c71b677f34/f901d4ad-c3bd-4d38-b2c5-04f1046f9886.png"
]

Conceptual Usage Example (Python)

Here’s how you could invoke the Generate Styled Image action using a conceptual Python script:

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 = "f46324cd-7eab-4d35-8c0a-64bee25d9259"  # Action ID for Generate Styled Image

# Construct the input payload based on the action's requirements
payload = {
    "seed": -1,
    "model": "Alchemist-Mix-v1",
    "steps": 40,
    "width": 1024,
    "height": 1024,
    "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
    "cfgScale": 5,
    "clipSkip": 1,
    "pagScale": 0,
    "batchSize": 1,
    "scheduler": "Euler a",
    "negativePrompt": "nsfw, naked",
    "guidanceRescale": 1,
    "prependPrePrompt": True,
    "variationalAutoEncoder": "default"
}

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 Python code snippet, make sure to replace the placeholder YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action_id corresponds to the Generate Styled Image action, and the payload is structured according to the input schema provided.

Conclusion

With the Aisha AI Alchemist-Mix v1 Cognitive Actions, developers can easily leverage AI to generate high-quality, styled images tailored to specific requirements. The customizable parameters allow for a wide range of applications, from artistic creations to practical visual content. Whether you are enhancing an app, building a game, or exploring creative designs, these actions provide a valuable resource for your development toolkit. Embrace the power of AI and start creating today!