Create Stunning Images with the deodatos/ai-2-orlinsky Cognitive Action

23 Apr 2025
Create Stunning Images with the deodatos/ai-2-orlinsky Cognitive Action

The deodatos/ai-2-orlinsky API offers powerful Cognitive Actions for generating images inspired by the distinctive red Orlinsky sculpture style. These pre-built actions streamline the image creation process, giving developers advanced control over various image properties such as size, aspect ratio, and output format. Whether you're building an art application, a game, or any creative project, these actions can enhance your application's visual capabilities.

Prerequisites

Before you start using the Cognitive Actions, ensure you have the following:

  • Access to the Cognitive Actions API, including an API key for authentication.
  • Familiarity with JSON data structures, as the input and output formats for the actions are JSON-based.
  • Basic understanding of making HTTP requests, especially POST requests, as this will be essential for executing the actions.

Authentication typically involves passing your API key in the request headers. Make sure to keep your API key secure.

Cognitive Actions Overview

Generate Orlinsky Style Image

The Generate Orlinsky Style Image action allows you to create images that embody the unique aesthetic of the Orlinsky sculptures. It offers various parameters to customize the output, including aspect ratio, resolution, and output format.

Input

The input for this action is structured as follows:

{
  "prompt": "show ORLK red on a snowboard going downhill on the snow",
  "goFast": false,
  "loraScale": 1,
  "guidanceScale": 3,
  "inferenceModel": "dev",
  "inferenceSteps": 28,
  "numberOfOutputs": 1,
  "imageAspectRatio": "1:1",
  "imageOutputFormat": "png",
  "imageOutputQuality": 80,
  "additionalLoraScale": 1,
  "imagePromptStrength": 0.8,
  "approximateMegapixels": "1"
}

Required Fields:

  • prompt: A descriptive text prompt that guides the image generation.

Optional Fields:

  • mask: URI for an image mask if inpainting is needed.
  • seed: Random seed for reproducibility.
  • image: Input image for transformations.
  • width and height: Dimensions for custom aspect ratios.
  • goFast: Enables faster image generation.
  • guidanceScale: Influences the realism of generated images.
  • Other parameters control the image properties further.

Output

The action returns a URL to the generated image. For example:

[
  "https://assets.cognitiveactions.com/invocations/6d4af1cb-e501-49f4-96e9-389145276dec/ef6c0c6e-9512-4a6d-9a34-7bf9f5c187bf.png"
]

This URL points to the generated image file.

Conceptual Usage Example (Python)

Here’s how you can invoke the Generate Orlinsky Style Image 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 = "8a2ef345-8dc3-4f90-b995-f8b255ebd78b"  # Action ID for Generate Orlinsky Style Image

# Construct the input payload based on the action's requirements
payload = {
    "goFast": false,
    "prompt": "show ORLK red on a snowboard going downhill on the snow",
    "loraScale": 1,
    "guidanceScale": 3,
    "inferenceModel": "dev",
    "inferenceSteps": 28,
    "numberOfOutputs": 1,
    "imageAspectRatio": "1:1",
    "imageOutputFormat": "png",
    "imageOutputQuality": 80,
    "additionalLoraScale": 1,
    "imagePromptStrength": 0.8,
    "approximateMegapixels": "1"
}

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, replace the COGNITIVE_ACTIONS_API_KEY and the COGNITIVE_ACTIONS_EXECUTE_URL with your actual API endpoint details. The payload is constructed based on the required input schema for the action.

Conclusion

By integrating the Generate Orlinsky Style Image action from the deodatos/ai-2-orlinsky API, developers can easily create visually striking images tailored to specific requirements. This action, along with its customizable parameters, opens up a world of creative possibilities for applications in art, design, and entertainment. To get started, explore different prompts and parameters to see how they affect the generated images, and consider how you can incorporate this functionality into your projects. Happy coding!