Create Stunning Art with the SDXL Vermeer Cognitive Actions

In the realm of image generation, the SDXL Vermeer Cognitive Actions provide powerful capabilities for developers looking to harness the creativity of AI. By leveraging a model fine-tuned on the iconic paintings of Johannes Vermeer, these actions enable users to generate unique images that reflect specific styles and themes. The pre-built actions simplify the process, allowing you to focus on crafting prompts and customizing outputs without the need for extensive machine learning expertise.
Prerequisites
Before diving into the SDXL Vermeer Cognitive Actions, ensure you have the following:
- API Key: You will need an API key to authenticate your requests to the Cognitive Actions platform.
- Setup: Familiarity with making HTTP requests and handling JSON data formats is beneficial.
Conceptually, authentication is typically handled by including the API key in the headers of your requests.
Cognitive Actions Overview
Generate Vermeer Style Image
The Generate Vermeer Style Image action allows you to produce images using the SDXL LoRA model that has been fine-tuned on Vermeer's masterpieces. This action supports customization through prompts and various parameters to enhance the style and quality of the generated images.
- Category: Image Generation
Input
The input for this action is defined by the following schema:
- seed (optional): A random seed to influence image generation. Leave blank to randomize.
- myPrompt (required): The primary input prompt, including the 'TOK' style trigger word. Default: "A TOK painting of a cat."
- loraScale (optional): A scale adjustment for LoRA models, ranging from 0 to 1. Default: 0.6.
- outputWidth (optional): The width of the output image in pixels (128 to 4096). Default: 1024.
- outputHeight (optional): The height of the output image in pixels (128 to 4096). Default: 1024.
- negativePrompt (optional): Elements to exclude from the image. Default: empty string.
- numberOfOutputs (optional): The number of images to generate (1 to 4). Default: 1.
- refinementSteps (optional): Specifies refinement steps; defaults to the number of inference steps if not set.
- highNoiseFraction (optional): Fraction of noise in the refiner models (0 to 1). Default: 0.8.
- additionalPromptTerms (optional): Extra terms to append to the primary prompt. Default: empty string.
- guidanceInfluenceScale (optional): Impact of the input text on output (0 to 50). Default: 7.5.
- numberOfInferenceSteps (optional): Total denoising steps in inference (1 to 500). Default: 50.
Example Input
{
"myPrompt": "a painting of a man wearing a VR headset, in the style of TOK",
"loraScale": 0.6,
"outputWidth": 1024,
"outputHeight": 1024,
"negativePrompt": "monochrome",
"numberOfOutputs": 1,
"highNoiseFraction": 0.8,
"additionalPromptTerms": "",
"guidanceInfluenceScale": 7.5,
"numberOfInferenceSteps": 50
}
Output
The action returns URLs to the generated images. An example output might look like this:
[
"https://assets.cognitiveactions.com/invocations/5ae04efa-7098-4d3a-891d-33eaf3b172c4/0ee624d7-4166-491e-bb8c-0485abcf41a7.png"
]
In case of errors, the response will typically include error codes and messages.
Conceptual Usage Example (Python)
Here’s a conceptual example of how you might invoke the Generate Vermeer 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 = "582a4d02-56ad-4411-b9fd-68454f4cb050" # Action ID for Generate Vermeer Style Image
# Construct the input payload based on the action's requirements
payload = {
"myPrompt": "a painting of a man wearing a VR headset, in the style of TOK",
"loraScale": 0.6,
"outputWidth": 1024,
"outputHeight": 1024,
"negativePrompt": "monochrome",
"numberOfOutputs": 1,
"highNoiseFraction": 0.8,
"additionalPromptTerms": "",
"guidanceInfluenceScale": 7.5,
"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 YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID for generating the Vermeer style image is included in the request, along with the input JSON payload that specifies your desired output.
Conclusion
The SDXL Vermeer Cognitive Action for generating images opens up a world of creative possibilities for developers. With customizable prompts and variable parameters, you can produce stunning artwork that draws inspiration from classical styles. Whether you're looking to enhance your applications with unique visuals or explore creative AI applications, these actions provide a robust foundation to get started. Consider integrating this action into your projects and unleash your creativity!