Generate Stunning Images with the Erotophilia-v1 Cognitive Actions

25 Apr 2025
Generate Stunning Images with the Erotophilia-v1 Cognitive Actions

In the world of digital content creation, the ability to generate high-quality images based on textual prompts has become increasingly powerful and accessible. The Erotophilia-v1 Cognitive Actions provide developers with the tools to generate images by utilizing detailed prompts and customizable parameters. This not only streamlines the creative process but also allows for significant flexibility in image production.

Prerequisites

Before diving into the integration of the Erotophilia-v1 Cognitive Actions, ensure you have the following:

  • API Key: You will need an API key to authenticate your requests to the Cognitive Actions platform.
  • Basic understanding of JSON: Familiarity with JSON format will help you structure your requests effectively.

Conceptually, authentication usually involves passing the API key in the headers of your HTTP requests, allowing secure access to the Cognitive Actions.

Cognitive Actions Overview

Generate Image with Erotophilia-v1

The Generate Image with Erotophilia-v1 action is designed to create images based on intricate prompts. With the ability to customize various parameters, developers can achieve tailored outputs that meet specific creative needs.

Input

The input schema requires several fields, each serving a purpose in the image generation process:

  • seed (integer, default: -1): Controls randomness. Set to -1 for an automatic random seed.
  • width (integer, default: 1024): The image width in pixels (1 to 4096).
  • height (integer, default: 1024): The image height in pixels (1 to 4096).
  • prompt (string): Descriptive text guiding the image generation.
  • cfgScale (number, default: 7): Focus level on the prompt (1 to 50).
  • pagScale (number, default: 3): Enhances output quality (0 to 50).
  • batchSize (integer, default: 1): Number of images to generate (1 to 4).
  • modelName (string): The model name used, default is "Erotophilia-v1".
  • clipLayerSkip (integer, default: 2): Number of CLIP layers to skip in processing.
  • prependPrompt (boolean, default: true): Option to include a predefined preprompt.
  • negativePrompt (string): Elements to avoid in the output.
  • generationSteps (integer, default: 30): Number of refinement steps (1 to 100).
  • guidanceRescale (number, default: 0.5): Adjusts noise scale in images (0 to 5).
  • scheduleAlgorithm (string): Algorithm for scheduling (default: "Euler a").
  • varianceAutoencoder (string): Selects the Variance Autoencoder model (default: "default").

Example Input:

{
  "seed": -1,
  "width": 1024,
  "height": 1024,
  "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
  "cfgScale": 7,
  "pagScale": 3,
  "batchSize": 1,
  "modelName": "Erotophilia-v1",
  "clipLayerSkip": 2,
  "prependPrompt": true,
  "negativePrompt": "nsfw, naked",
  "generationSteps": 30,
  "guidanceRescale": 0.5,
  "scheduleAlgorithm": "Euler a",
  "varianceAutoencoder": "default"
}

Output

The output typically consists of an array of URLs, each pointing to a generated image based on the input prompt and parameters.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/3a47c15e-2b4d-4560-8f5d-7f0ae3a89bbe/43033be5-b22d-4f35-a03c-f8e9b90b74a7.png"
]

Conceptual Usage Example (Python)

Here’s a conceptual example of how to use the Generate Image with Erotophilia-v1 action in 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 = "1e6cb503-336a-4e19-86b6-12c05c23c7c9"  # Action ID for Generate Image with Erotophilia-v1

# 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": 7,
    "pagScale": 3,
    "batchSize": 1,
    "modelName": "Erotophilia-v1",
    "clipLayerSkip": 2,
    "prependPrompt": true,
    "negativePrompt": "nsfw, naked",
    "generationSteps": 30,
    "guidanceRescale": 0.5,
    "scheduleAlgorithm": "Euler a",
    "varianceAutoencoder": "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 the placeholder API key and endpoint with your actual values. The input payload mirrors the example input schema, ensuring the correct structure for the request.

Conclusion

The Erotophilia-v1 Cognitive Actions provide a robust framework for image generation, enabling developers to craft unique visual content tailored to their specifications. With customizable parameters and a focus on quality and detail, these actions can be seamlessly integrated into various applications. Consider exploring additional use cases, such as generating illustrations for storytelling, creating artwork for games, or enhancing marketing materials with bespoke images. Start harnessing the power of these Cognitive Actions today!