Create Stunning Tarot Images with the deeterbleater/flux-tarot Cognitive Actions

24 Apr 2025
Create Stunning Tarot Images with the deeterbleater/flux-tarot Cognitive Actions

The deeterbleater/flux-tarot provides a powerful Cognitive Action designed for developers looking to generate unique tarot-style images reminiscent of a classic tarot deck from 1920. With the ability to customize various parameters, these pre-built actions streamline the image-generation process and allow for creative exploration in your applications.

Prerequisites

To use the Cognitive Actions from the deeterbleater/flux-tarot spec, you will need:

  • An API key for the Cognitive Actions platform.
  • Basic understanding of JSON structure for sending requests.

Authentication typically involves passing your API key in the headers of your HTTP requests.

Cognitive Actions Overview

Generate Tarot Image

The Generate Tarot Image action allows you to create detailed tarot images based on a provided prompt. You can utilize either the 'dev' or 'schnell' model to generate these images, giving you flexibility in how you achieve your desired outcome.

Input

The input for the Generate Tarot Image action is structured as follows:

{
  "prompt": "RIDER tarot, card, ominous",
  "loraScale": 1,
  "aspectRatio": "1:1",
  "outputFormat": "webp",
  "guidanceScale": 3.5,
  "outputQuality": 90,
  "inferenceModel": "dev",
  "promptStrength": 0.8,
  "numberOfOutputs": 4,
  "numInferenceSteps": 28,
  "additionalLoraStrength": 1
}

Required Field:

  • prompt: A text string guiding image generation.

Optional Fields:

  • mask: URI of an image mask for inpainting mode.
  • seed: An integer for reproducible image generation.
  • image: URI of an input image for image-to-image mode.
  • width and height: Specify dimensions when aspect ratio is 'custom'.
  • goFast: Toggle for faster predictions.
  • loraScale: Strength of the main LoRA application.
  • aspectRatio: Determines the aspect ratio of the generated image.
  • outputFormat: The file format of the generated images.
  • guidanceScale: Scale for the diffusion process.
  • outputQuality: Quality of the saved output image.
  • inferenceModel: Choose between 'dev' and 'schnell'.
  • promptStrength: Strength of the prompt when using img2img mode.
  • numberOfOutputs: Total number of images to generate.
  • numInferenceSteps: Steps for denoising.
  • disableSafetyChecker: Option to disable safety checks.
  • additionalLoraWeights: Load additional LoRA weights via URLs.
  • additionalLoraStrength: Strength of additional LoRA application.

Output

The output from this action returns a list of URLs pointing to the generated tarot images. Here’s an example of the output:

[
  "https://assets.cognitiveactions.com/invocations/23f334ac-cfb0-47ae-beb4-59c05b7d4d4f/c549311c-bde7-4787-a487-679b839769e4.webp",
  "https://assets.cognitiveactions.com/invocations/23f334ac-cfb0-47ae-beb4-59c05b7d4d4f/fa5aae61-f5ec-4f38-8160-d2612af1c380.webp",
  "https://assets.cognitiveactions.com/invocations/23f334ac-cfb0-47ae-beb4-59c05b7d4d4f/c4e278c4-bf84-4e4d-b5f6-2e30a1b0ea98.webp",
  "https://assets.cognitiveactions.com/invocations/23f334ac-cfb0-47ae-beb4-59c05b7d4d4f/70127b99-e443-4299-a1ff-a9fd05ff94b7.webp"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate Tarot 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 = "067acd43-1779-4e1e-b67c-30aae176beda" # Action ID for Generate Tarot Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "RIDER tarot, card, ominous",
    "loraScale": 1,
    "aspectRatio": "1:1",
    "outputFormat": "webp",
    "guidanceScale": 3.5,
    "outputQuality": 90,
    "inferenceModel": "dev",
    "promptStrength": 0.8,
    "numberOfOutputs": 4,
    "numInferenceSteps": 28,
    "additionalLoraStrength": 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 Python example, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key and adjust the endpoint as needed. The payload is structured to meet the requirements of the Generate Tarot Image action.

Conclusion

The deeterbleater/flux-tarot Cognitive Actions provide a unique opportunity for developers to create captivating tarot-style images with ease. By leveraging the flexibility of the provided parameters, you can customize your image generation to suit your creative needs. Explore possibilities by integrating these actions into your applications and enhance user experiences with stunning visuals!