Generate Stunning Images with Aisha AI's Nailove Real v0.2 Cognitive Actions

In today's digital landscape, creating high-quality visual content quickly and efficiently is paramount for developers. The Aisha AI's Nailove Real v0.2 Cognitive Actions offer a powerful solution for generating and enhancing realistic images. Leveraging advanced AI models, these actions allow you to create stunning visuals tailored to your specific needs, using customizable prompts and refinement options.
Prerequisites
To get started with the Nailove Real v0.2 Cognitive Actions, you will need:
- An API key for the Cognitive Actions platform.
- A basic understanding of JSON for structuring your requests.
Authentication typically involves including your API key in the request headers, ensuring a secure connection to the service.
Cognitive Actions Overview
Generate and Enhance Realistic Images
The Generate and Enhance Realistic Images action allows you to create high-quality images using the NAI-Love-Real-v0.2 model. This action supports advanced features for enhancing details such as faces and hands, while also offering customizable prompt options and various upscale methods to optimize output.
- Category: Image Generation
Input
The input for this action requires a structured JSON object, which includes the following fields:
- seed (integer, optional): Seed for image generation; set to -1 to use a random seed.
- model (string, required): The specific model used for generation, defaulting to "NAI-Love-Real-v0.2".
- steps (integer, optional): Number of processing steps for generating the image (1 to 100).
- width (integer, optional): Width of the generated image in pixels (1 to 4096).
- height (integer, optional): Height of the generated image in pixels (1 to 4096).
- prompt (string, required): Text prompt describing the desired image.
- refiner (boolean, optional): Enable or disable the image refiner function.
- upscale (string, optional): Factor to upscale the image (options: "Original", "x2", "x4", "x8").
- cfgScale (number, optional): CFG scale for model focus on prompt (1 to 50).
- clipSkip (integer, optional): Number of CLIP model layers to skip (minimum 1).
- pagScale (number, optional): Similar to CFG scale, offering improvements (0 to 50).
- scheduler (string, optional): Select the scheduler method for image generation.
- aDetailerFace (boolean, optional): Enable ADetailer for face enhancement.
- aDetailerHand (boolean, optional): Enable ADetailer for hand enhancement.
- negativePrompt (string, optional): Elements to avoid in the image.
- aDetailerPerson (boolean, optional): Enable ADetailer for person enhancement.
- guidanceRescale (number, optional): Scale amount of CFG-generated noise (0 to 5).
- prependPrePrompt (boolean, optional): Whether to prepend a pre-defined prompt for improved quality.
- variationalAutoEncoder (string, optional): Select the Variational Autoencoder model.
Here’s an example of the input payload:
{
"seed": -1,
"model": "NAI-Love-Real-v0.2",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"cfgScale": 6,
"clipSkip": 2,
"pagScale": 0,
"scheduler": "Euler a",
"aDetailerFace": true,
"aDetailerHand": false,
"negativePrompt": "nsfw, naked",
"aDetailerPerson": false,
"guidanceRescale": 1,
"prependPrePrompt": true,
"variationalAutoEncoder": "default"
}
Output
Upon successful execution, the action returns a URL to the generated image. For example:
[
"https://assets.cognitiveactions.com/invocations/92e9506b-c7f7-4270-af0a-be3aa278c4da/3ef173ab-903f-49d6-86b1-3d034d904dd7.png"
]
Conceptual Usage Example (Python)
Here’s how you might call this 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 = "d757edd0-0255-433c-a5b3-a1fa92522f36" # Action ID for Generate and Enhance Realistic Images
# Construct the input payload based on the action's requirements
payload = {
"seed": -1,
"model": "NAI-Love-Real-v0.2",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"cfgScale": 6,
"clipSkip": 2,
"pagScale": 0,
"scheduler": "Euler a",
"aDetailerFace": True,
"aDetailerHand": False,
"negativePrompt": "nsfw, naked",
"aDetailerPerson": False,
"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 code snippet, you replace the YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key and ensure that the endpoint is correctly set. The action ID and the input payload are structured according to the specifications provided.
Conclusion
The Nailove Real v0.2 Cognitive Actions provide developers with an exceptional tool for generating and enhancing images. With customizable options for prompts, upscale factors, and fine-tuning details, you can create stunning visuals that meet your project requirements. Consider exploring different combinations of inputs to see how they can help elevate your applications and bring your creative visions to life.