Create Stunning Tarot Cup Images with the Zeke Tarot Suit Cups Cognitive Actions

21 Apr 2025
Create Stunning Tarot Cup Images with the Zeke Tarot Suit Cups Cognitive Actions

The Zeke Tarot Suit Cups API provides developers with powerful Cognitive Actions to generate visually appealing tarot cup images based on the iconic Rider-Waite tarot deck. By leveraging a fine-tuned Flux model, this API allows for customization in image properties, enabling developers to create unique and tailored visuals for their applications. In this article, we will explore the capabilities of the Generate Tarot Cup Image action, guiding you through its integration and usage.

Prerequisites

Before you start using the Cognitive Actions, you will need to have the following in place:

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

Authentication typically involves passing the API key in the request headers to authorize your calls to the Cognitive Actions API.

Cognitive Actions Overview

Generate Tarot Cup Image

The Generate Tarot Cup Image action is designed to create images of the 'cup' suit from the Rider-Waite tarot deck. This action allows for extensive customization, including image dimensions, format, and quality, while optimizing for either detail or speed.

Input

The input for this action is structured as follows:

  • prompt (required): A text prompt that guides image generation. For example: "three tarot-suit-cups arranged on a table, each containing a different animal."
  • model (optional): Specifies the model for inference. Options include "dev" for quality and "schnell" for speed. Default is "dev".
  • goFast (optional): Run predictions at higher speed when enabled; default is false.
  • aspectRatio (optional): The aspect ratio for the generated image, default is "1:1".
  • outputFormat (optional): The format for the output image, with options like "webp", "jpg", and "png"; default is "webp".
  • numberOfOutputs (optional): Specifies how many images should be generated, default is 1.

Below is a practical example of the JSON payload needed to invoke the action:

{
  "model": "dev",
  "goFast": false,
  "prompt": "three tarot-suit-cups arranged on a table, each containing a different animal.",
  "loraScale": 1,
  "aspectRatio": "1:1",
  "outputFormat": "jpg",
  "guidanceScale": 3,
  "outputQuality": 80,
  "promptStrength": 0.8,
  "imageMegapixels": "1",
  "numberOfOutputs": 1,
  "additionalLoraScale": 1,
  "numberOfInferenceSteps": 28
}

Output

Upon successful execution, the action returns a URL pointing to the generated image. Here’s an example of the output:

[
  "https://assets.cognitiveactions.com/invocations/31a68384-7a05-4744-a0a6-5c353f6e8c83/7114b20b-6d13-4fc8-8e18-eb2519c2856c.jpg"
]

This URL can be used directly to display the generated image in your application.

Conceptual Usage Example (Python)

Here’s how you might call this action using a conceptual Python code snippet:

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 = "d843e2d7-b8f4-4c4a-849d-2100a301675a" # Action ID for Generate Tarot Cup Image

# Construct the input payload based on the action's requirements
payload = {
    "model": "dev",
    "goFast": False,
    "prompt": "three tarot-suit-cups arranged on a table, each containing a different animal.",
    "loraScale": 1,
    "aspectRatio": "1:1",
    "outputFormat": "jpg",
    "guidanceScale": 3,
    "outputQuality": 80,
    "promptStrength": 0.8,
    "imageMegapixels": "1",
    "numberOfOutputs": 1,
    "additionalLoraScale": 1,
    "numberOfInferenceSteps": 28
}

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}
    )
    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 variable is built according to the action's requirements, ensuring you provide the necessary parameters.

Conclusion

The Zeke Tarot Suit Cups Cognitive Actions empower developers to create stunning tarot cup images with ease and flexibility. By utilizing the Generate Tarot Cup Image action, you can enhance your applications with unique, visually appealing content tailored to your specifications.

Explore more possibilities by integrating these actions into your projects, and consider experimenting with different prompts and settings to achieve diverse artistic outcomes!