Create Stunning Images with the Craisee Style Cognitive Actions

22 Apr 2025
Create Stunning Images with the Craisee Style Cognitive Actions

Integrating advanced image generation capabilities into your applications has never been easier with the Craisee Style Cognitive Actions. This powerful API allows developers to create images in the unique style of craisee.com, supporting various modes such as image-to-image and inpainting. Additionally, it offers customization options for image dimensions, guidance scales, and model settings, enabling you to produce high-quality visuals efficiently. In this article, we’ll explore how to utilize the "Generate Craisee Style Image" action to transform your ideas into captivating artwork.

Prerequisites

Before you start using the Craisee Style Cognitive Actions, make sure you have the following:

  • An API key for the Cognitive Actions platform.
  • An understanding of how to authenticate your requests. Generally, this involves including your API key in the request headers.

Cognitive Actions Overview

Generate Craisee Style Image

The Generate Craisee Style Image action allows you to create stunning images based on a text prompt. This operation supports various generation modes and provides extensive customization options to suit your creative needs.

Input

The input for this action is defined by the following schema:

{
  "prompt": "A cool abstract illustration golden retriever in the style of CRAISEE",
  "aspectRatio": "1:1",
  "outputCount": 1,
  "outputFormat": "webp",
  "guidanceScale": 3.5,
  "outputQuality": 90,
  "denoisingSteps": 28,
  "extraLoraScale": 1,
  "inferenceModel": "dev",
  "promptStrength": 0.8,
  "mainLoraIntensity": 1
}

Required Fields:

  • prompt: The text prompt guiding the image generation (e.g., "A cool abstract illustration golden retriever in the style of CRAISEE").

Optional Fields:

  • aspectRatio: Specifies the image's aspect ratio (default is "1:1").
  • outputCount: Number of images to generate (default is 1, maximum is 4).
  • outputFormat: Format of the output images (default is "webp").
  • guidanceScale: Influences the image generation process (default is 3).
  • outputQuality: Quality of the generated images (default is 80).
  • denoisingSteps: Number of steps for denoising (default is 28).
  • extraLoraScale: Intensity of the extra LoRA application (default is 1).
  • inferenceModel: The model to use for inference (default is "dev").
  • promptStrength: Strength of the prompt during img2img processing (default is 0.8).
  • mainLoraIntensity: Intensity of the main LoRA application (default is 1).

Output

The action returns a URL pointing to the generated image(s):

[
  "https://assets.cognitiveactions.com/invocations/db0fc320-37b7-42f6-ad28-2f0297672035/779fb7d9-b22b-41e0-8778-b8a645b8abc4.webp"
]

This output indicates the location of the generated image, allowing you to directly access and utilize it in your applications.

Conceptual Usage Example (Python)

Here’s how you might implement the Generate Craisee Style 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 = "9ab8a63f-a8b9-49b1-8cb4-c2e85d2197f2"  # Action ID for Generate Craisee Style Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "A cool abstract illustration golden retriever in the style of CRAISEE",
    "aspectRatio": "1:1",
    "outputCount": 1,
    "outputFormat": "webp",
    "guidanceScale": 3.5,
    "outputQuality": 90,
    "denoisingSteps": 28,
    "extraLoraScale": 1,
    "inferenceModel": "dev",
    "promptStrength": 0.8,
    "mainLoraIntensity": 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 code snippet, replace "YOUR_COGNITIVE_ACTIONS_API_KEY" with your actual API key. The payload is structured according to the requirements of the action, and the request is sent to the hypothetical endpoint. The response is printed in a readable format, displaying the URL of the generated image.

Conclusion

The Craisee Style Cognitive Actions provide developers with a powerful tool for generating unique and high-quality images. By leveraging the capabilities of the Generate Craisee Style Image action, you can easily integrate artistic image generation into your applications, enhancing user engagement and creativity. Start experimenting with different prompts and settings to see what stunning visuals you can create!