Transform Your Images with jbilcke/sdxl-botw Cognitive Actions

21 Apr 2025
Transform Your Images with jbilcke/sdxl-botw Cognitive Actions

In the world of game-inspired art, the ability to transform images into styles reminiscent of beloved titles can unlock creative possibilities. The jbilcke/sdxl-botw specification provides a powerful Cognitive Action that leverages the SDXL LoRA model to generate stunning visuals inspired by the iconic game, "Breath of the Wild." This action allows developers to harness pre-built capabilities for image transformation, enabling custom designs and artistic expressions without needing extensive image processing expertise.

Prerequisites

To begin using the Cognitive Actions in the jbilcke/sdxl-botw spec, you'll need an API key for the platform. This key is typically passed in the request headers to authenticate your requests. Ensure you have the appropriate setup to make HTTP requests, which can be done using libraries like requests in Python.

Cognitive Actions Overview

Generate Breath of the Wild Styled Image

The Generate Breath of the Wild Styled Image action allows you to transform images inspired by the game using various parameters for customization. This action is categorized under image-processing.

Input

The input for this action is structured as a JSON object with various parameters. Here’s a breakdown of the required fields:

  • prompt: (string) Descriptive text for the image generation.
  • image: (string) URI of the input image.
  • width: (integer, default: 1024) Width of the output image in pixels.
  • height: (integer, default: 1024) Height of the output image in pixels.
  • numberOfOutputs: (integer, default: 1) Number of images to generate per request (1 to 4).
  • refine: (string, default: "no_refiner") Style refinement method.
  • loraScale: (number, default: 0.6) LoRA additive scale (0 to 1).
  • scheduler: (string, default: "K_EULER") Scheduling method for image generation.
  • guidanceScale: (number, default: 7.5) Intensity level for guidance (1 to 50).
  • applyWatermark: (boolean, default: true) Whether to apply a watermark.
  • negativePrompt: (string) Text input specifying what to avoid.
  • promptStrength: (number, default: 0.8) Strength of the prompt (0 to 1).
  • highNoiseFraction: (number, default: 0.8) Fraction of noise for "expert_ensemble_refiner."
  • numberOfInferenceSteps: (integer, default: 50) Total number of denoising steps (1 to 500).

Here’s an example of the JSON payload you would send:

{
  "width": 1024,
  "height": 1024,
  "prompt": "Link riding a llama, in the style of TOK",
  "refine": "no_refiner",
  "loraScale": 0.83,
  "scheduler": "K_EULER",
  "guidanceScale": 18.41,
  "applyWatermark": true,
  "negativePrompt": "overexposed",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "highNoiseFraction": 0.8,
  "numberOfInferenceSteps": 50
}

Output

The output of this action is a JSON array containing the URIs of the generated images. For example:

[
  "https://assets.cognitiveactions.com/invocations/b23ad0a3-43e9-4063-8a35-3106a3046b9a/dcedd970-4a7f-4390-9d29-80d34e4c22a8.png"
]

Conceptual Usage Example (Python)

Here’s how you might call this 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 = "6d001f3b-fa2e-48e5-b725-cb52437d351b"  # Action ID for Generate Breath of the Wild Styled Image

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "Link riding a llama, in the style of TOK",
    "refine": "no_refiner",
    "loraScale": 0.83,
    "scheduler": "K_EULER",
    "guidanceScale": 18.41,
    "applyWatermark": True,
    "negativePrompt": "overexposed",
    "promptStrength": 0.8,
    "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 code snippet, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action_id corresponds to the action you want to execute. The payload is constructed using the required parameters, and a POST request is sent to the hypothetical endpoint.

Conclusion

The jbilcke/sdxl-botw Cognitive Action offers developers a unique opportunity to transform images into captivating styles inspired by "Breath of the Wild." With customizable parameters and straightforward API integration, you can bring your creative visions to life. To take the next step, consider exploring additional use cases such as creating themed artwork for games, enhancing marketing materials, or experimenting with AI-generated art styles. The possibilities are limitless!