Create Stunning Artworks with Gustave Doré Style Using Cognitive Actions

22 Apr 2025
Create Stunning Artworks with Gustave Doré Style Using Cognitive Actions

Integrating advanced image generation capabilities into your applications has never been easier, thanks to the Cognitive Actions provided in the mattismegevand/sdxl-gustavedore specification. This set of actions allows developers to harness the power of a fine-tuned SDXL model to generate unique illustrations that echo the iconic style of Gustave Doré. With pre-built actions designed for high-quality artistic creation, you can focus on your app's functionality and leave the art to the AI.

Prerequisites

Before diving into the Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform.
  • Basic knowledge of making HTTP requests in your programming language of choice.
  • A suitable environment for running Python code, if you choose to follow the provided examples.

Authentication typically involves passing your API key in the request headers, ensuring secure access to the Cognitive Actions.

Cognitive Actions Overview

Generate Illustrations in Gustave Doré Style

The Generate Illustrations in Gustave Doré Style action allows you to create stunning images that reflect the intricate aesthetics of Gustave Doré's art. Utilizing advanced inpainting and refinement techniques, this action can produce high-quality artworks based on your inputs.

Input

The action requires a JSON payload that can include the following fields:

  • prompt: string - Describes the desired outcome of the generated image (e.g., "In the style of GUSDOR, A cityscape viewed from a high-rise building with a pool on the rooftop").
  • width: integer - Specifies the width of the output image (default is 1024).
  • height: integer - Specifies the height of the output image (default is 1024).
  • refineStyle: string - Determines the refinement style (default is "no_refiner").
  • additiveScale: number - LoRA additive scale (value must be between 0 and 1, default is 0.6).
  • guidanceScale: number - Scale for classifier-free guidance (default is 7.5).
  • applyWatermark: boolean - Whether to add a watermark to generated images (default is true).
  • outputImageCount: integer - Number of images to generate (default is 1, range: 1-4).
  • inferenceStepsCount: integer - Number of denoising steps (default is 50, range: 1-500).
Example Input
{
  "width": 1024,
  "height": 1024,
  "prompt": "In the style of GUSDOR, A cityscape viewed from a high-rise building with a pool on the rooftop",
  "refineStyle": "no_refiner",
  "additiveScale": 0.6,
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "promptStrength": 0.8,
  "outputImageCount": 1,
  "schedulingMethod": "K_EULER",
  "highNoiseFraction": 0.8,
  "inferenceStepsCount": 50
}

Output

Upon successful execution, the action returns a JSON array containing the URLs of the generated images. For example:

[
  "https://assets.cognitiveactions.com/invocations/a366ae8b-cd43-4f21-8ee8-b292d3b0c78d/c0d49fae-412c-4227-ba2c-ab7d37ddaf84.png"
]

Conceptual Usage Example (Python)

Here's a conceptual Python code snippet illustrating how to invoke this action:

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 = "665f4464-2d75-42c0-9120-0c5ab5f92f56"  # Action ID for Generate Illustrations in Gustave Doré Style

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "In the style of GUSDOR, A cityscape viewed from a high-rise building with a pool on the rooftop",
    "refineStyle": "no_refiner",
    "additiveScale": 0.6,
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "outputImageCount": 1,
    "inferenceStepsCount": 50
}

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 the COGNITIVE_ACTIONS_EXECUTE_URL with the actual endpoint and COGNITIVE_ACTIONS_API_KEY with your API key. The input payload is structured according to the requirements of the action.

Conclusion

The mattismegevand/sdxl-gustavedore Cognitive Actions provide a powerful way to integrate artistic image generation directly into your applications. By utilizing the Generate Illustrations in Gustave Doré Style action, developers can easily create unique artworks that resonate with Doré's iconic style. Start experimenting with these actions today to enhance your applications with stunning visual content!