Generate Stunning Images with goodguy1963/sdxl-finetunes-img2img Cognitive Actions

23 Apr 2025
Generate Stunning Images with goodguy1963/sdxl-finetunes-img2img Cognitive Actions

Creating captivating and photorealistic images has never been easier thanks to the goodguy1963/sdxl-finetunes-img2img API. This powerful tool allows developers to generate images from detailed prompts and specified seeds, providing a range of customizable parameters to fine-tune the output. Whether you're developing applications for art, marketing, or visual content creation, the pre-built Cognitive Actions streamline the process and enhance creativity.

Prerequisites

Before you start integrating the Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform, which you will use for authentication.
  • Basic familiarity with making API calls and handling JSON data.

Conceptually, authentication typically involves passing the API key in the request headers.

Cognitive Actions Overview

Generate Image from Seed and Prompt

This action creates high-quality, photorealistic images using a provided seed and detailed prompts. It includes customizable parameters like width, height, denoise strength, and more. The action also allows for control over image quality through negative prompts and various scheduling methods.

Input

The input for this action is structured as follows:

{
  "steps": 50,
  "width": 2048,
  "height": 2048,
  "prompt": "squirrel sitting on a table with a candle and a bottle of perfume, highly detailed scene, highly detailed composition, high quality, detailed, photorealistic, perfect eyes, bokeh, photo, perfect light, detailed style, depth of field",
  "inputImage": "https://example.com/image.png",
  "samplerName": "ddim",
  "outputFormat": "webp",
  "safetyFilter": true,
  "guidanceScale": 2.47,
  "outputQuality": 95,
  "ipadapterEndAt": 1,
  "negativePrompt": "ugly, deformed, soft, ext, watermark, abstract, big hands, fake, fake hands, distorted, drawing, painting, crayon, sketch, impressionist, worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed",
  "denoiseStrength": 0.8,
  "ipadapterWeight": 0.9,
  "ipadapterStartAt": 0,
  "samplerScheduler": "sgm_uniform",
  "lora1StrengthClip": 1,
  "lora2StrengthClip": 0,
  "lora3StrengthClip": 0,
  "controlnetStrength": 1,
  "lora1StrengthModel": 0.5,
  "lora2StrengthModel": 0,
  "lora3StrengthModel": 0,
  "modelCheckpointName": "realvisxlV50_v50Bakedvae.safetensors",
  "controlNetEndPercentage": 0.5,
  "controlNetStartPercentage": 0
}
  • Required Fields: steps, width, height, prompt, inputImage, samplerName, outputFormat, safetyFilter, guidanceScale, outputQuality, denoiseStrength, ipadapterWeight, samplerScheduler, modelCheckpointName.
  • Optional Fields: seed, negativePrompt, ipadapterEndAt, ipadapterStartAt, lora1StrengthClip, lora2StrengthClip, lora3StrengthClip, controlnetStrength, lora1StrengthModel, lora2StrengthModel, lora3StrengthModel, controlNetEndPercentage, controlNetStartPercentage.

Output

The output structure is not explicitly defined in the provided information, but generally, you can expect a URL to the generated image or details about the image processing result. If an error occurs, the API will return an appropriate error message.

Conceptual Usage Example (Python)

Here's how you might call this action in 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 = "24ea0f85-8472-447c-95b1-ced080e05f6a" # Action ID for Generate Image from Seed and Prompt

# Construct the input payload based on the action's requirements
payload = {
    "steps": 50,
    "width": 2048,
    "height": 2048,
    "prompt": "squirrel sitting on a table with a candle and a bottle of perfume, highly detailed scene, highly detailed composition, high quality, detailed, photorealistic, perfect eyes, bokeh, photo, perfect light, detailed style, depth of field",
    "inputImage": "https://example.com/image.png",
    "samplerName": "ddim",
    "outputFormat": "webp",
    "safetyFilter": true,
    "guidanceScale": 2.47,
    "outputQuality": 95,
    "denoiseStrength": 0.8,
    "ipadapterWeight": 0.9,
    "samplerScheduler": "sgm_uniform",
    "modelCheckpointName": "realvisxlV50_v50Bakedvae.safetensors"
}

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 payload contains the required input for the action, structured according to the specified schema. The endpoint URL and request structure are hypothetical and may differ in actual implementation.

Conclusion

The goodguy1963/sdxl-finetunes-img2img Cognitive Action provides a robust solution for generating high-quality images tailored to your specifications. By leveraging customizable parameters and a simple API call structure, developers can easily integrate this functionality into their applications. Now that you understand how to use this action, consider exploring additional use cases, such as combining multiple images, experimenting with different prompts, or integrating it into creative projects. Happy coding!