Creating Striking Imagery with the Zavy Chroma XL v7 Cognitive Actions

22 Apr 2025
Creating Striking Imagery with the Zavy Chroma XL v7 Cognitive Actions

The Zavy Chroma XL v7 API is a powerful tool for developers looking to generate visually stunning images with high contrast and vibrant colors. Leveraging the SDXL framework, this API provides a set of cognitive actions designed to help you craft artwork that stands out. In this article, we will explore the capabilities of the Generate High Contrast Image action, guiding you through its integration into your applications.

Prerequisites

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

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

For authentication, you typically include your API key in the request headers, allowing you to securely access the service.

Cognitive Actions Overview

Generate High Contrast Image

The Generate High Contrast Image action is designed to create visually striking images. This action is particularly useful for developers looking to generate images with enhanced contrast and vibrant colors.

Category: Image Generation

Input

The input for this action requires a JSON object structured as follows:

{
  "width": 1024,
  "height": 1024,
  "prompt": "glamour portrait photo, macro, a captivating vibrant dark green-neon capturing the essence of a cyborg Bedouin sorcerer in fight stance, defying expectations by conjuring a whimsical robot 'freak' from an oversized sedge hat. ethereal, smoky backdrop. throwing a translucent orange/tanslucent purple/black iaidow, weapon, katana, holding sword, 100mm f/2.8 macro lens, atmospheric haze, Film grain, cinematic film still, shallow depth of field, highly detailed, high budget, cinemascope, moody, epic, OverallDetail, gorgeous, 2000s vintage RAW photo, photorealistic, candid camera, color graded cinematic, eye catchlights, atmospheric lighting, skin pores, imperfections, natural, shallow dof",
  "sampler": "Default",
  "scheduler": "Default",
  "loraStrength": 1,
  "outputFormat": "webp",
  "outputQuality": 80,
  "negativePrompt": "",
  "numberOfImages": 1
}
  • Width: (integer, default: 1024) The width of the generated image.
  • Height: (integer, default: 1024) The height of the generated image.
  • Prompt: (string) A detailed description of the desired image.
  • Sampler: (string) Specifies the sampler to use for image generation.
  • Scheduler: (string) Chooses the scheduler for generation.
  • Lora Strength: (number, default: 1) Adjusts the strength of Lora in the generation process.
  • Output Format: (string, default: webp) Specifies the format for the output image.
  • Output Quality: (integer, default: 80) Defines the output image quality.
  • Negative Prompt: (string) Elements to exclude from the generated image.
  • Number of Images: (integer, default: 1) Number of images to generate (up to 10).

Output

Upon successful execution, the action typically returns a list of URLs pointing to the generated images. For example:

[
  "https://assets.cognitiveactions.com/invocations/894f4da3-a452-4be3-9875-c238add2792d/711f0342-9c1d-4718-9d35-5b758ae500ec.webp"
]

This output contains links to the generated images, allowing you to easily integrate them into your application or display them as needed.

Conceptual Usage Example (Python)

Here’s a conceptual example of how you might call the Generate High Contrast 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 = "4a2c7f48-7d41-4226-b4fa-63a5f10c8d94" # Action ID for Generate High Contrast Image

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "glamour portrait photo, macro, a captivating vibrant dark green-neon capturing the essence of a cyborg Bedouin sorcerer in fight stance, defying expectations by conjuring a whimsical robot 'freak' from an oversized sedge hat. ethereal, smoky backdrop. throwing a translucent orange/tanslucent purple/black iaidow, weapon, katana, holding sword, 100mm f/2.8 macro lens, atmospheric haze, Film grain, cinematic film still, shallow depth of field, highly detailed, high budget, cinemascope, moody, epic, OverallDetail, gorgeous, 2000s vintage RAW photo, photorealistic, candid camera, color graded cinematic, eye catchlights, atmospheric lighting, skin pores, imperfections, natural, shallow dof",
    "sampler": "Default",
    "scheduler": "Default",
    "loraStrength": 1,
    "outputFormat": "webp",
    "outputQuality": 80,
    "negativePrompt": "",
    "numberOfImages": 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 example, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The payload object is constructed according to the action's input requirements. The script sends a POST request to the hypothetical endpoint and processes the response.

Conclusion

The Generate High Contrast Image action from the Zavy Chroma XL v7 API empowers developers to create stunning visuals with ease. By utilizing the provided input schema and following the examples, you can seamlessly integrate this functionality into your applications. Explore the possibilities of image generation and enhance your projects with eye-catching graphics!