Create Stunning Images with AbsoluteReality V1.8.1 Cognitive Actions

25 Apr 2025
Create Stunning Images with AbsoluteReality V1.8.1 Cognitive Actions

In the world of digital content creation, the ability to generate high-quality images from textual descriptions is a game changer. The AbsoluteReality V1.8.1 Cognitive Actions provide developers with powerful tools to create stunning visuals through their API. These pre-built actions cater to various use cases, including transforming existing images and customizing output parameters, making them ideal for content creators, designers, and developers alike.

Prerequisites

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

  • An API key for the Cognitive Actions platform, which will be used for authentication.
  • Familiarity with making HTTP requests and handling JSON data structures in your development environment.

When making API calls, you will typically pass your API key in the headers to authenticate your requests.

Cognitive Actions Overview

Generate Image with AbsoluteReality

The Generate Image with AbsoluteReality action allows you to leverage the AbsoluteReality V1.8.1 model for image generation. Whether you want to create images from scratch based on text prompts or modify existing images, this action provides the flexibility and quality you need.

Input

The action requires a structured input JSON object with the following fields:

  • prompt (required): A detailed textual description guiding the generation process.
  • width (optional): Desired width of the output image in pixels (default: 512, max: 1920).
  • height (optional): Desired height of the output image in pixels (default: 728, max: 1920).
  • image (optional): URI of the input image for img2img and inpainting modes.
  • mask (optional): URI of the mask image used for inpainting.
  • seed (optional): Seed for random number generation (default is random).
  • strength (optional): Influence of the original image on the output (default: 1).
  • scheduler (optional): Scheduler algorithm used for generation (default: "Euler A Karras").
  • guidanceScale (optional): Scale for how strongly the model follows the text prompt (default: 7.5).
  • negativePrompt (optional): Textual description indicating elements to avoid.
  • numberOfOutputs (optional): Number of image outputs to generate (default: 1, max: 4).
  • numberOfInferenceSteps (optional): Steps for image inference (default: 20, max: 100).

Example Input:

{
  "seed": 47412,
  "width": 512,
  "height": 728,
  "prompt": "((masterpiece)), ((photorealistic)), ((high quality)), ((extremely detailed)), a young woman, black robe, dark red hair, very long hair, blue eyes, pale skin, red lips, (((rim lighting))), dark theme, fantasy, simple background, character design, concept art, Surrealism, art by greg rutkowski, (aperture f/8, shutter speed 1/125, ISO 100, white balance, single-shot autofocus, RAW photo), unreal engine, 8k uhd, raytracing",
  "strength": 1,
  "scheduler": "Euler A Karras",
  "guidanceScale": 7.5,
  "negativePrompt": "disfigured, kitsch, ugly, oversaturated, greain, low-res, deformed, blurry, bad anatomy, poorly drawn face, mutation, mutated, extra limb, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, blur, out of focus, long neck, long body, disgusting, poorly drawn, childish, mutilated, mangled, old, surreal, calligraphy, sign, writing, watermark, text, body out of frame, extra legs, extra arms, extra feet, out of frame, poorly drawn feet, cross-eye",
  "numberOfOutputs": 1,
  "numberOfInferenceSteps": 20
}

Output

On executing the action, you can expect a response containing the generated image's URI:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/384b2bdd-9f8f-4bd6-bff0-f2625099ab9f/e1e009b2-b8b0-4f6c-8e9d-e287f41d22d0.png"
]

Conceptual Usage Example (Python)

Here's how you might structure a call to the Generate Image with AbsoluteReality 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 = "efe09dc9-73f9-40c9-928f-2dbc4d198935"  # Action ID for Generate Image with AbsoluteReality

# Construct the input payload based on the action's requirements
payload = {
    "seed": 47412,
    "width": 512,
    "height": 728,
    "prompt": "((masterpiece)), ((photorealistic)), ((high quality)), ((extremely detailed)), a young woman, black robe, dark red hair, very long hair, blue eyes, pale skin, red lips, (((rim lighting))), dark theme, fantasy, simple background, character design, concept art, Surrealism, art by greg rutkowski, (aperture f/8, shutter speed 1/125, ISO 100, white balance, single-shot autofocus, RAW photo), unreal engine, 8k uhd, raytracing",
    "strength": 1,
    "scheduler": "Euler A Karras",
    "guidanceScale": 7.5,
    "negativePrompt": "disfigured, kitsch, ugly, oversaturated, greain, low-res, deformed, blurry, bad anatomy, poorly drawn face, mutation, mutated, extra limb, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, blur, out of focus, long neck, long body, disgusting, poorly drawn, childish, mutilated, mangled, old, surreal, calligraphy, sign, writing, watermark, text, body out of frame, extra legs, extra arms, extra feet, out of frame, poorly drawn feet, cross-eye",
    "numberOfOutputs": 1,
    "numberOfInferenceSteps": 20
}

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 will replace the COGNITIVE_ACTIONS_API_KEY and endpoint URL with your actual API credentials. The action_id references the Generate Image with AbsoluteReality action, and the payload is structured according to the required input schema.

Conclusion

The AbsoluteReality V1.8.1 Cognitive Actions provide developers with a robust toolkit for generating and transforming images through intelligent and customizable parameters. By integrating these actions into your applications, you can enhance user experiences and streamline your content creation process.

Explore different use cases, experiment with various prompts and parameters, and unleash your creativity with the power of AI-driven image generation!