Create Stunning Egyptian Tomb Paintings with Cognitive Actions

24 Apr 2025
Create Stunning Egyptian Tomb Paintings with Cognitive Actions

Integrating art and technology, the tjrndll/egyptian-tomb-painting API offers developers a unique way to generate captivating images inspired by the iconic style of Egyptian tomb paintings. This API includes a powerful Cognitive Action that allows you to create images based on textual prompts while providing various customization options. Leveraging pre-built actions can streamline your development process, making it easier to incorporate advanced image generation features into your applications.

Prerequisites

To use the Cognitive Actions, you will need:

  • An API key for the Cognitive Actions platform.
  • Basic knowledge of making HTTP requests and handling JSON data.

Authentication typically involves passing your API key in the request headers. This ensures that your application can securely access the Cognitive Actions API.

Cognitive Actions Overview

Generate Egyptian Tomb Painting Style Image

This action generates an image based on a given prompt, styled in the manner of Egyptian tomb paintings. It supports features such as inpainting, refinement, and LoRA model adjustments, allowing for customizable outputs.

Category: Image Generation

Input

The input for this action requires a structured JSON object. Below are the key fields you can use:

  • prompt: The textual input that guides image generation (example: "in the style of TOK a t-rex set in an egyptian tomb painting").
  • width: The width of the output image in pixels (default: 1024).
  • height: The height of the output image in pixels (default: 1024).
  • loraScale: LoRA additive scale for trained models (default: 0.6).
  • refineStyle: Specifies the refinement method (default: "no_refiner").
  • guidanceScale: A scale value for classifier-free guidance (default: 7.5).
  • applyWatermark: Determines whether to apply a watermark (default: true).
  • negativePrompt: An optional input to specify aspects to avoid.
  • promptStrength: The influence of the prompt in inpaint mode (default: 0.8).
  • numberOfOutputs: The number of images to output (default: 1).
  • schedulingMethod: The method to schedule the denoising process (default: "K_EULER").
  • highNoiseFraction: The fraction of noise applied in refinement (default: 0.8).
  • inferenceStepCount: The total number of steps for denoising (default: 50).

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "in the style of TOK a t-rex set in an egyptian tomb painting",
  "loraScale": 0.6,
  "refineStyle": "no_refiner",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "negativePrompt": "",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "schedulingMethod": "K_EULER_ANCESTRAL",
  "highNoiseFraction": 0.8,
  "inferenceStepCount": 50
}

Output

Upon successful execution, the action returns a URL linking to the generated image. The output typically consists of an array containing one or more image links.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/1dc72182-70e1-4c84-81db-20bb8db6775d/bc1261b5-ae0c-407f-b742-3722aa7d6d6f.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 = "eea89f7b-e70a-4794-9e17-d6218a94e345"  # Action ID for Generate Egyptian Tomb Painting Style Image

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "in the style of TOK a t-rex set in an egyptian tomb painting",
    "loraScale": 0.6,
    "refineStyle": "no_refiner",
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "negativePrompt": "",
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "schedulingMethod": "K_EULER_ANCESTRAL",
    "highNoiseFraction": 0.8,
    "inferenceStepCount": 50
}

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 YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The payload structure is designed to match the input requirements for generating an Egyptian tomb painting style image.

Conclusion

The tjrndll/egyptian-tomb-painting API provides developers with a powerful tool to create unique images inspired by ancient art. By utilizing the Generate Egyptian Tomb Painting Style Image action, you can easily integrate advanced image generation capabilities into your applications. Start experimenting with different prompts and customization options to unlock the creative potential of this API!