Generate Stunning Custom Images with the Austin Xu Test SDXL Cognitive Actions

25 Apr 2025
Generate Stunning Custom Images with the Austin Xu Test SDXL Cognitive Actions

In the world of image generation, the ability to create customized visuals can significantly enhance applications and user experiences. The Austin Xu Test SDXL Fine-tune Actions provide developers with powerful tools for generating images through advanced techniques like img2img and inpainting. With features that allow precise control over image quality and customization, these Cognitive Actions can elevate your projects by automating image generation based on descriptive prompts.

Prerequisites

To get started with the Austin Xu Test SDXL Cognitive Actions, you will need an API key from the Cognitive Actions platform. This key will authenticate your requests to the service. Generally, authentication is handled by passing the API key in the request headers.

Authorization: Bearer YOUR_COGNITIVE_ACTIONS_API_KEY

Cognitive Actions Overview

Generate Tuned Image

The Generate Tuned Image action allows developers to create customized images by specifying parameters such as prompts, dimensions, and various refinement options. This action is particularly useful for applications requiring dynamic image generation based on user input or predefined criteria.

  • Category: Image Generation
  • Description: Generate a customized image via img2img or inpaint mode with various refinement options like LoRA scales and scheduler algorithms. Enhance the image quality by controlling parameters such as prompt strength, guidance scale, and noise fraction, while ensuring safe deployment through optional watermarking and safety checks.

Input

The input schema for this action requires several fields, some of which are optional. Below is a breakdown of the input parameters:

ParameterTypeRequiredDescription
maskstringNoURI of the input mask for inpaint mode.
seedintegerNoRandom seed for reproducibility (leave blank for random).
imagestringYesURI of the input image for transformation.
widthintegerNoWidth of the output image in pixels (default 1024).
heightintegerNoHeight of the output image in pixels (default 1024).
promptstringYesTextual prompt guiding the image generation.
schedulerstringNoMethod to schedule denoising steps (default "K_EULER").
outputCountintegerNoNumber of images to generate (between 1 and 4, inclusive; default 1).
guidanceScalenumberNoAdjusts the magnitude of classifier-free guidance (default 7.5).
applyWatermarkbooleanNoIndicates whether to apply a watermark (default true).
negativePromptstringNoText to direct the generator away from certain features.
promptStrengthnumberNoStrength of the prompt (range: 0 to 1; default 0.8).
refinementStylestringNoMethod of refining the image (default "no_refiner").
highNoiseFractionnumberNoFraction of noise applied (range: 0 to 1; default 0.8).
numInferenceStepsintegerNoTotal number of denoising steps (range: 1 to 500; default 50).
loraAdjustmentScalenumberNoScale of LoRA adjustments (range: 0 to 1; default 0.6).
safetyCheckerDisabledbooleanNoOption to disable the safety checker (default false).

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "a poster of a fancy headphone with Thanksgiving promotions",
  "scheduler": "K_EULER",
  "outputCount": 1,
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "negativePrompt": "",
  "promptStrength": 0.8,
  "refinementStyle": "no_refiner",
  "highNoiseFraction": 0.8,
  "numInferenceSteps": 50,
  "loraAdjustmentScale": 0.6
}

Output

When the Generate Tuned Image action is successfully executed, it returns an array of URLs pointing to the generated images.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/629138b1-d942-4df4-b28c-5da501417f62/75ad6a04-cdbc-4a22-8a25-6fc324326a1c.png"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate Tuned Image action using Python. This example illustrates how to structure your input payload and send a request to the Cognitive Actions endpoint.

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 = "bb694864-d0dd-4112-8bee-2468bbc12eab"  # Action ID for Generate Tuned Image

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "a poster of a fancy headphone with Thanksgiving promotions",
    "scheduler": "K_EULER",
    "outputCount": 1,
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "negativePrompt": "",
    "promptStrength": 0.8,
    "refinementStyle": "no_refiner",
    "highNoiseFraction": 0.8,
    "numInferenceSteps": 50,
    "loraAdjustmentScale": 0.6
}

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, you will replace the placeholder for the API key and endpoint with your actual values. The input payload is structured based on the requirements for generating a tuned image.

Conclusion

The Austin Xu Test SDXL Cognitive Actions provide developers with a robust framework for generating high-quality, customized images effortlessly. By leveraging parameters like prompt strength, guidance scale, and refinement styles, you can create visuals tailored to specific needs. Consider integrating these Cognitive Actions into your applications to enhance user engagement and automate image generation efficiently. The possibilities are as limitless as your creativity!