Create Stunning Basquiat-Style Art with SDXL Cognitive Actions

22 Apr 2025
Create Stunning Basquiat-Style Art with SDXL Cognitive Actions

In the realm of generative art, the georgedavila/sdxl-basquiat Cognitive Actions allow developers to create unique images inspired by the iconic style of Jean-Michel Basquiat. This API integrates the power of the SDXL LoRA model, fine-tuned specifically on Basquiat’s artwork, enabling you to generate vibrant and expressive images through simple input prompts. By leveraging these pre-built actions, developers can elevate their applications with artistic capabilities that blend creativity and technology.

Prerequisites

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

  • An API key for the Cognitive Actions platform.
  • Basic familiarity with making HTTP requests and handling JSON payloads.

Authentication usually involves passing your API key in the headers of your requests to access the Cognitive Actions services securely.

Cognitive Actions Overview

Generate Basquiat Style Images

The Generate Basquiat Style Images action allows users to create images influenced by Basquiat’s distinct artistic style. You can specify prompts that guide the style and elements in the generated images, while also having the flexibility to adjust various parameters.

Input

The input schema for this action is as follows:

{
  "seed": 12345,
  "loraScale": 0.6,
  "inputPrompt": "A BASQUIAT painting of a spaceship, rainbow background",
  "outputWidth": 2048,
  "outputHeight": 1024,
  "guidanceScale": 7.5,
  "negativePrompt": "monochrome",
  "promptAddition": "",
  "numberOfOutputs": 1,
  "highNoiseFraction": 0.8,
  "numberOfInferenceSteps": 50
}
  • seed: (optional) Random seed for generation. Leave blank for a random seed.
  • loraScale: (required, default 0.6) The additive scale for the LoRA model, between 0 and 1.
  • inputPrompt: (required) The main prompt to influence the image generation. Including "BASQUIAT" triggers the specific style.
  • outputWidth: (required, default 1024) Width of the output image in pixels (128-4096).
  • outputHeight: (required, default 1024) Height of the output image in pixels (128-4096).
  • guidanceScale: (required, default 7.5) Influences how much the input text affects the image (0-50).
  • negativePrompt: (optional) Specifies elements to exclude from the generation.
  • promptAddition: (optional) Additional terms to append to the input prompt.
  • numberOfOutputs: (required, default 1) Number of images to generate (1-4).
  • highNoiseFraction: (optional, default 0.8) Sets the fraction of noise applied for refinement.
  • numberOfInferenceSteps: (required, default 50) Total denoising steps during generation (1-500).

Output

The output of the action is a URL to the generated image. For example:

[
  "https://assets.cognitiveactions.com/invocations/351bb86f-6a40-4489-ad70-5b9a175f2a8a/c7deefa8-153e-41d8-b81b-8ea06a86b537.png"
]

Conceptual Usage Example (Python)

Here is a conceptual Python snippet demonstrating how to call the 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 = "b8e99f58-42da-461c-9e07-8c27366c08e3" # Action ID for Generate Basquiat Style Images

# Construct the input payload based on the action's requirements
payload = {
    "loraScale": 0.6,
    "inputPrompt": "A BASQUIAT painting of a spaceship, rainbow background",
    "outputWidth": 2048,
    "outputHeight": 1024,
    "guidanceScale": 7.5,
    "negativePrompt": "monochrome",
    "numberOfOutputs": 1,
    "highNoiseFraction": 0.8,
    "numberOfInferenceSteps": 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 placeholder API key and endpoint with your actual values. The action ID and input payload are structured to match the requirements of the Generate Basquiat Style Images action.

Conclusion

The georgedavila/sdxl-basquiat Cognitive Actions provide a powerful tool for generating art inspired by Basquiat’s distinctive style. With customizable parameters for image generation, developers can create beautiful and unique artworks suitable for various applications. Consider integrating these actions into your projects to explore the intersection of technology and creativity!