Generate Stunning NSFW Illustrations with Aisha AI's Cognitive Actions

In the realm of digital creativity, the ability to generate high-quality images based on textual prompts has revolutionized how artists, developers, and content creators work. The WAI-NSFW-illustrious-v11 Cognitive Actions provide a powerful API that allows developers to generate NSFW illustrative images using customizable parameters. This blog post will guide you through the capabilities of the Generate NSFW Illustrative Images action, detailing how to harness its features effectively in your applications.
Prerequisites
Before getting started, ensure you have access to the Cognitive Actions platform. You will need an API key that you can include in your request headers for authentication. This key allows you to securely access the Cognitive Actions API and utilize its functionalities.
Cognitive Actions Overview
Generate NSFW Illustrative Images
The Generate NSFW Illustrative Images action utilizes the WAI-NSFW-illustrious-SDXL-v11 model to create visually appealing and customizable NSFW images. With various configurable parameters, developers can fine-tune the image quality and characteristics.
Input
The action accepts the following input parameters:
- seed (integer, optional): The seed for generating images. Use -1 for a random seed.
Example:"seed": -1 - model (string, required): The model used for image generation. Default is "WAI-NSFW-illustrious-SDXL-v11".
Example:"model": "WAI-NSFW-illustrious-SDXL-v11" - steps (integer, optional): The number of steps in the image generation process, ranging from 1 to 100. Default is 30.
Example:"steps": 30 - width (integer, optional): Width of the generated image in pixels (1-4096). Default is 1024.
Example:"width": 1024 - height (integer, optional): Height of the generated image in pixels (1-4096). Default is 1024.
Example:"height": 1024 - prompt (string, required): A descriptive prompt using Compel weighting syntax to guide image generation.
Example:"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V" - batchSize (integer, optional): Number of images to generate per batch (1-4).
Example:"batchSize": 1 - pageScale (number, optional): Enhances image quality. Set to 0 to disable. Default is 3.
Example:"pageScale": 3 - scheduler (string, optional): The scheduler algorithm used during image generation. Default is "Euler a".
Example:"scheduler": "Euler a" - configScale (number, optional): Determines how closely the model adheres to the prompt. Default is 7.
Example:"configScale": 7 - clipLayerSkip (integer, optional): Number of CLIP layers to skip. Default is 2.
Example:"clipLayerSkip": 2 - negativePrompt (string, optional): Defines undesired elements in the generated image.
Example:"negativePrompt": "nsfw, naked" - guidanceRescale (number, optional): Adjusts CFG-generated noise to prevent overexposure. Default is 0.5.
Example:"guidanceRescale": 0.5 - prependPrePrompt (boolean, optional): Whether to prepend a standard preprompt to the prompt and negative prompt. Default is true.
Example:"prependPrePrompt": true - visualAutoencoder (string, optional): The VAE used for encoding and decoding images. Default is "default".
Example:"visualAutoencoder": "default"
Example Input
Here’s how a complete input request might look:
{
"seed": -1,
"model": "WAI-NSFW-illustrious-SDXL-v11",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"batchSize": 1,
"pageScale": 3,
"scheduler": "Euler a",
"configScale": 7,
"clipLayerSkip": 2,
"negativePrompt": "nsfw, naked",
"guidanceRescale": 0.5,
"prependPrePrompt": true,
"visualAutoencoder": "default"
}
Output
Upon successful execution, the action returns a URL to the generated image. For example:
[
"https://assets.cognitiveactions.com/invocations/19607469-38d5-423d-aa0b-0abcd5c89707/a023924d-7e8f-4c86-8d74-abad03a7c71e.png"
]
Conceptual Usage Example (Python)
Here’s a conceptual Python code snippet illustrating how to call this 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 = "2f419130-9e75-48fc-93e2-4d50212fe099" # Action ID for Generate NSFW Illustrative Images
# Construct the input payload based on the action's requirements
payload = {
"seed": -1,
"model": "WAI-NSFW-illustrious-SDXL-v11",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"batchSize": 1,
"pageScale": 3,
"scheduler": "Euler a",
"configScale": 7,
"clipLayerSkip": 2,
"negativePrompt": "nsfw, naked",
"guidanceRescale": 0.5,
"prependPrePrompt": true,
"visualAutoencoder": "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 snippet, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key and adjust the endpoint URL as necessary. The code constructs the input payload according to the action's schema, sends a request, and handles potential errors gracefully.
Conclusion
The Generate NSFW Illustrative Images action from the WAI-NSFW-illustrious-v11 Cognitive Actions opens up a world of creative possibilities for developers. By customizing various parameters, you can generate unique and tailored images that meet your project's needs.
Consider exploring this action further to enhance your applications, whether for creative projects, content generation, or artistic experimentation. Happy coding!