Create Stunning Tarot Card Images with the Conservatory of Flowers Cognitive Actions

21 Apr 2025
Create Stunning Tarot Card Images with the Conservatory of Flowers Cognitive Actions

The Conservatory of Flowers Cognitive Actions provide a powerful toolset for developers to generate beautifully styled tarot card images inspired by the iconic Conservatory of Flowers in Golden Gate Park, San Francisco. By leveraging advanced image generation capabilities, these actions allow for a customizable approach to creating unique tarot card artwork directly from textual prompts. In this guide, we will explore how to utilize these Cognitive Actions effectively in your applications.

Prerequisites

To get started with the Conservatory of Flowers Cognitive Actions, you will need:

  • An API key for the Cognitive Actions platform, which you can obtain by signing up for an account.
  • Basic knowledge of making HTTP requests, particularly with JSON payloads.

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

Cognitive Actions Overview

Generate Tarot Card Style Image

The Generate Tarot Card Style Image action offers developers the ability to create images styled as tarot cards, utilizing flux fine-tuning with specific imagery from the Conservatory of Flowers.

  • Category: Image Generation

Input

The input for this action is defined by a schema requiring a prompt and allowing several optional parameters. Here’s a look at the fields:

  • prompt (required): A descriptive text for image generation.
  • mask: Optional image mask for inpainting mode.
  • seed: Optional random seed for reproducibility.
  • image: Optional input image for image transformations.
  • width: Custom width for the generated image (if aspect_ratio is set to 'custom').
  • height: Custom height for the generated image (if aspect_ratio is set to 'custom').
  • fastMode: Optional boolean to enable faster predictions.
  • imageFormat: Specifies the output image format (webp, jpg, png).
  • outputCount: Number of images to generate (1 to 4).
  • imageQuality: Quality setting for output images (0 to 100).
  • modelWeights: Specify LoRA weights to load.
  • loraIntensity: Intensity of the main LoRA application.
  • additionalLora: Additional LoRA weights to load.
  • inferenceModel: Select model for inference.
  • inferenceSteps: Number of denoising steps (1 to 50).
  • imageResolution: Resolution of the generated image (1 or 0.25).
  • promptIntensity: Adjust influence of the prompt.
  • imageAspectRatio: Aspect ratio for the generated image (1:1, 16:9, etc.).
  • guidanceIntensity: Scale for guidance during the diffusion process.
  • safetyCheckerDisabled: Enable or disable the safety checker.
  • additionalLoraIntensity: Controls intensity for additional LoRA weights.

Example Input

Here’s an example JSON payload for the Generate Tarot Card Style Image action:

{
  "prompt": "The tarot-cards/conservatory-of-flowers building in San Francisco, set among green grass, flowers, and palm trees. The bottom of the card is labeled \"THE EMPRESS\". The card is rendered in the style of tarot-cards/rider-waite",
  "fastMode": false,
  "imageFormat": "webp",
  "outputCount": 1,
  "imageQuality": 100,
  "loraIntensity": 1,
  "additionalLora": "tarot-cards/rider-waite",
  "inferenceModel": "dev",
  "inferenceSteps": 50,
  "imageResolution": "1",
  "promptIntensity": 0.8,
  "imageAspectRatio": "2:3",
  "guidanceIntensity": 3,
  "additionalLoraIntensity": 1
}

Output

Upon successful execution, the action returns a link to the generated image. For example:

[
  "https://assets.cognitiveactions.com/invocations/e4c0412a-da85-48f2-bf50-3ba8365b4c7a/62170c18-73f8-4fbc-bec9-6f3da676a254.webp"
]

Conceptual Usage Example (Python)

Here’s how you might use this action in a Python script:

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 = "ca6b598e-0665-4613-a7a0-faa40898b7e7" # Action ID for Generate Tarot Card Style Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "The tarot-cards/conservatory-of-flowers building in San Francisco, set among green grass, flowers, and palm trees. The bottom of the card is labeled \"THE EMPRESS\". The card is rendered in the style of tarot-cards/rider-waite",
    "fastMode": False,
    "imageFormat": "webp",
    "outputCount": 1,
    "imageQuality": 100,
    "loraIntensity": 1,
    "additionalLora": "tarot-cards/rider-waite",
    "inferenceModel": "dev",
    "inferenceSteps": 50,
    "imageResolution": "1",
    "promptIntensity": 0.8,
    "imageAspectRatio": "2:3",
    "guidanceIntensity": 3,
    "additionalLoraIntensity": 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}
    )
    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 snippet, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action_id corresponds to the Generate Tarot Card Style Image action, and the payload is structured according to the action's input requirements. This example illustrates how to send a request to the Cognitive Actions API and handle the response effectively.

Conclusion

The Conservatory of Flowers Cognitive Actions empower developers to create unique tarot card images with ease and flexibility. By utilizing the Generate Tarot Card Style Image action, you can bring your creative visions to life with various customization options. Whether you’re working on a tarot-themed application or simply want to experiment with image generation, these Cognitive Actions provide a robust solution. Start integrating them into your projects today!