Generate Stunning Images with Aisha AI's WAI-NSFW-Illustrious V8 Actions

22 Apr 2025
Generate Stunning Images with Aisha AI's WAI-NSFW-Illustrious V8 Actions

In the world of artificial intelligence, generating high-quality images has become a powerful tool for developers and creators alike. The "aisha-ai-official/wai-nsfw-illustrious-v8" spec offers a robust set of Cognitive Actions designed to facilitate image generation using the WAI-NSFW-Illustrious-SDXL-V8 model. With adjustable parameters, developers can create stunning visuals tailored to their specific requirements, making this a valuable resource for applications in various domains.

Prerequisites

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

  • An API key for the Cognitive Actions platform, which is necessary for authentication.
  • Familiarity with sending HTTP requests, as you will be interacting with the Cognitive Actions API.

Authentication typically involves passing your API key in the headers of your requests, ensuring secure access to the actions.

Cognitive Actions Overview

Generate Image with WAI-NSFW-Illustrious V8

The "Generate Image with WAI-NSFW-Illustrious V8" action allows developers to generate high-quality images by specifying various adjustable parameters. This action is particularly useful for applications that require customized visuals based on user-defined prompts.

Input

The action requires a structured JSON payload with the following fields:

  • seed (integer, default: -1): A seed for random generation. Set to -1 for randomness.
  • model (string, default: "WAI-NSFW-illustrious-SDXL-v8"): The model used for generation.
  • steps (integer, default: 30): The number of steps in the generation process (1 to 100).
  • width (integer, default: 1024): Width of the image in pixels (1 to 4096).
  • height (integer, default: 1024): Height of the image in pixels (1 to 4096).
  • prompt (string, default: "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V"): The input text prompt to guide image generation.
  • cfgScale (number, default: 5): Configuration scale to control attention to the prompt (1 to 50).
  • pagScale (number, default: 3): Enhances image quality (0 to 50).
  • batchSize (integer, default: 1): Number of images to generate per batch (1 to 4).
  • scheduler (string, default: "Euler a"): Algorithm for planning steps.
  • clipLayerSkip (integer, default: 2): Number of CLIP layers to skip.
  • negativePrompt (string, default: "nsfw, naked"): Elements to avoid in the image.
  • guidanceRescale (number, default: 0.5): Adjusts CFG noise rescaling (0 to 5).
  • prependPreprompt (boolean, default: true): Prepends a standard prompt for higher quality.
  • variationalAutoencoder (string, default: "default"): The VAE model used for generation.

Example Input:

{
  "seed": -1,
  "model": "WAI-NSFW-illustrious-SDXL-v8",
  "steps": 30,
  "width": 1024,
  "height": 1024,
  "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
  "cfgScale": 5,
  "pagScale": 3,
  "batchSize": 1,
  "scheduler": "Euler a",
  "clipLayerSkip": 2,
  "negativePrompt": "nsfw, naked",
  "guidanceRescale": 0.5,
  "prependPreprompt": true,
  "variationalAutoencoder": "default"
}

Output

Upon successful execution, the action returns a URL linking to the generated image. Here’s an example of what the output might look like:

[
  "https://assets.cognitiveactions.com/invocations/b3cb8503-ec55-4d94-a64c-1a90e220cd80/5719312b-eb05-4506-b587-b89d8a244f80.png"
]

Conceptual Usage Example (Python):

Here’s how you might invoke the "Generate Image with WAI-NSFW-Illustrious V8" 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 = "270933aa-d390-4cfd-87dd-33e1f779b778"  # Action ID for Generate Image with WAI-NSFW-Illustrious V8

# Construct the input payload based on the action's requirements
payload = {
    "seed": -1,
    "model": "WAI-NSFW-illustrious-SDXL-v8",
    "steps": 30,
    "width": 1024,
    "height": 1024,
    "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
    "cfgScale": 5,
    "pagScale": 3,
    "batchSize": 1,
    "scheduler": "Euler a",
    "clipLayerSkip": 2,
    "negativePrompt": "nsfw, naked",
    "guidanceRescale": 0.5,
    "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 code snippet, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action_id variable is set to the ID of the image generation action. The payload is structured according to the specified input schema, and a POST request is made to the hypothetical execution endpoint. Handle errors gracefully to ensure a smooth integration into your application.

Conclusion

The Cognitive Actions provided by the "aisha-ai-official/wai-nsfw-illustrious-v8" spec empower developers to create stunning images tailored to their needs with just a few lines of code. The flexibility in parameters allows for a customized approach, enhancing the creative possibilities within applications. Explore these actions further and start integrating them into your projects to unlock a new realm of visual generation!