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

24 Apr 2025
Generate Stunning Visuals with Aisha AI's Nailove Real v0.2 Cognitive Actions

In the ever-evolving field of artificial intelligence, image generation has become a powerful tool for developers looking to create visually compelling content. The Aisha AI's Nailove Real v0.2 Cognitive Actions offer a robust image generation capability, allowing developers to create realistic images based on customizable prompts. This blog post will guide you through the Generate Realistic Images action, explaining how to leverage its features to enhance your applications.

Prerequisites

Before diving into the cognitive actions, ensure you have the following:

  • An API key for the Cognitive Actions platform.
  • Basic understanding of JSON and RESTful API calls.

To authenticate, you will typically pass your API key in the headers of your requests, ensuring secure access to the cognitive actions.

Cognitive Actions Overview

Generate Realistic Images

The Generate Realistic Images action utilizes the NAI-Love-Real-v0.2 model to produce high-quality images based on a specific prompt. You can customize various parameters such as image size, batch processing, and fine-tuning details for enhanced outputs, particularly for facial and hand features through the ADetailer.

Input

The input for this action is structured as follows:

{
  "seed": -1,
  "width": 1024,
  "height": 1024,
  "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
  "cfgScale": 6,
  "pagScale": 0,
  "batchSize": 1,
  "modelType": "NAI-Love-Real-v0.2",
  "scheduler": "Euler a",
  "adetailerFace": true,
  "adetailerHand": false,
  "clipLayerSkip": 2,
  "negativePrompt": "nsfw, naked",
  "adetailerPerson": false,
  "generationSteps": 30,
  "guidanceRescale": 1,
  "prependPreprompt": true,
  "variationalAutoencoder": "default"
}

Key Parameters:

  • seed: Integer value for random seed generation (use -1 for a random seed).
  • width & height: Dimensions of the generated image (1 to 4096 pixels).
  • prompt: Description of the image to be generated.
  • cfgScale: Controls model adherence to the prompt (1 to 50).
  • batchSize: Number of images to generate (1 to 4).
  • scheduler: Specifies the algorithm used in the generation process.
  • adetailerFace, adetailerHand, adetailerPerson: Boolean flags to enable advanced detailing features.

Output

Upon successfully executing this action, you will receive a response containing the URL(s) of the generated images. Here’s an example output:

[
  "https://assets.cognitiveactions.com/invocations/ed731dd0-c2fc-4188-bac3-f91eeded5877/c3935117-2a7f-4f50-a530-345e5c47267c.png"
]

Conceptual Usage Example (Python)

Here’s a conceptual Python code snippet demonstrating how to invoke the Generate Realistic Images 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 = "363879a6-cd18-454d-b74a-abd6b06f718a" # Action ID for Generate Realistic Images

# Construct the input payload based on the action's requirements
payload = {
    "seed": -1,
    "width": 1024,
    "height": 1024,
    "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
    "cfgScale": 6,
    "pagScale": 0,
    "batchSize": 1,
    "modelType": "NAI-Love-Real-v0.2",
    "scheduler": "Euler a",
    "adetailerFace": True,
    "adetailerHand": False,
    "clipLayerSkip": 2,
    "negativePrompt": "nsfw, naked",
    "adetailerPerson": False,
    "generationSteps": 30,
    "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 example, ensure to replace the COGNITIVE_ACTIONS_API_KEY with your actual API key. The payload variable is structured to match the required input schema, allowing you to generate stunning images based on your prompts.

Conclusion

The Aisha AI's Nailove Real v0.2 Cognitive Actions provide developers with a powerful tool for generating realistic images tailored to specific requirements. By leveraging these pre-built actions, you can save time and enhance the visual appeal of your applications. Explore the capabilities of this action, experiment with different parameters, and consider integrating it into your next project to elevate user experience and engagement.