Create Stunning Visuals: Integrate Image Generation with Aisha AI's Illustrious Ultra Real Beta Actions

In the ever-evolving world of AI, the ability to generate ultra-realistic images is a game-changer for developers across various domains. The Aisha AI's Illustrious Ultra Real Beta offers a powerful API that allows you to create high-fidelity images based on detailed textual prompts. This pre-built cognitive action not only simplifies the image generation process but also provides extensive customization options, enabling you to tailor the output to your specific needs.
Prerequisites
Before you dive into the world of ultra-realistic image generation, ensure you have the following:
- An API key for accessing the Aisha AI Cognitive Actions platform.
- Basic knowledge of JSON format as well as Python for executing the API calls.
For authentication, you will need to pass your API key in the headers of your requests. This typically looks like including an Authorization header with a Bearer token in your API calls.
Cognitive Actions Overview
Generate Ultra-Realistic Images
The Generate Ultra-Realistic Images action uses the Illustrious-Ultra-Real-Beta model to create images based on your textual descriptions. It supports various customization parameters that enhance the image quality and fidelity.
Input
The action requires a structured input payload, which includes the following fields:
- vae: Specifies the Variational Autoencoder to use (default is
default). - seed: Integer for random number generation (default is -1 for a random seed).
- model: Selects the model for image generation (default is
Illustrious-Ultra-Real-Beta). - steps: Number of generation steps (default is 20, ranging from 1 to 100).
- width: Width of the generated image in pixels (default is 1024, max 4096).
- height: Height of the generated image in pixels (default is 1024, max 4096).
- prompt: Text prompt for image generation (default is a detailed description).
- cfgScale: Controls the model's adherence to the prompt (default is 7).
- clipSkip: Number of CLIP layers to skip (default is 1).
- pagScale: Enhances image quality (default is 0).
- batchSize: Number of images to generate per batch (default is 1).
- scheduler: Specifies the scheduling algorithm (default is
Euler a). - negativePrompt: Text for elements to exclude (default is
nsfw, naked). - guidanceRescale: Rescale amount for CFG-generated noise (default is 1).
- prependPrePrompt: Prepend predefined prompt components (default is true).
Here’s an example of the input JSON payload for this action:
{
"vae": "default",
"seed": -1,
"model": "Illustrious-Ultra-Real-Beta",
"steps": 20,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"cfgScale": 7,
"clipSkip": 1,
"pagScale": 0,
"batchSize": 1,
"scheduler": "Euler a",
"negativePrompt": "nsfw, naked",
"guidanceRescale": 1,
"prependPrePrompt": true
}
Output
Upon successful execution, this action returns a URL that links to the generated image. Here’s an example of the output you might receive:
[
"https://assets.cognitiveactions.com/invocations/5b56fd47-2b84-4e82-b05d-c033fae646d7/61c1879d-b3f7-4171-9887-5a4c891ae8e7.png"
]
Conceptual Usage Example (Python)
Below is a conceptual Python code snippet to demonstrate how you might call this action via the Cognitive Actions API:
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 = "49a4a686-7ba1-4ad3-af11-8031989ce2af" # Action ID for Generate Ultra-Realistic Images
# Construct the input payload based on the action's requirements
payload = {
"vae": "default",
"seed": -1,
"model": "Illustrious-Ultra-Real-Beta",
"steps": 20,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"cfgScale": 7,
"clipSkip": 1,
"pagScale": 0,
"batchSize": 1,
"scheduler": "Euler a",
"negativePrompt": "nsfw, naked",
"guidanceRescale": 1,
"prependPrePrompt": True
}
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 the code above, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action_id is set for the Generate Ultra-Realistic Images action. The input payload is structured to match the example provided earlier, ensuring you pass all required fields.
Conclusion
By leveraging the Generate Ultra-Realistic Images Cognitive Action from Aisha AI's Illustrious Ultra Real Beta, developers can easily integrate powerful image generation capabilities into their applications. With customizable parameters, the potential for creativity is immense. Explore various prompts, settings, and configurations to create stunning visuals that meet your project requirements. Start integrating today and unlock a new realm of possibilities in your applications!