Create Stunning Architectural Images with the cbh123/iwan-baan-sdxl Cognitive Actions

24 Apr 2025
Create Stunning Architectural Images with the cbh123/iwan-baan-sdxl Cognitive Actions

In the world of architecture and design, visual representation is key. The cbh123/iwan-baan-sdxl API provides developers with powerful Cognitive Actions that enable the generation of images inspired by the renowned architectural photographer Iwan Baan. Leveraging a fine-tuned SDXL model, this API allows for advanced image processing techniques, such as img2img or inpainting, giving users precise control over image refinement and enhancement. By incorporating these pre-built actions into your applications, you can create stunning architectural images with ease.

Prerequisites

Before you start using the Cognitive Actions, ensure that you have the following:

  • An API key for the Cognitive Actions platform.
  • Basic understanding of JSON format for input and output structures.
  • Familiarity with making HTTP requests, particularly using libraries like requests in Python.

Authentication typically involves passing your API key in the headers of your requests, ensuring that you have access to the Cognitive Actions services.

Cognitive Actions Overview

Generate Iwan Baan Style Architecture Image

The Generate Iwan Baan Style Architecture Image action allows you to create images that embody the signature style of Iwan Baan. This operation supports both img2img and inpaint modes, enabling detailed image refinement based on your specifications.

Input

The input for this action requires a JSON object structured according to the following schema:

{
  "mask": "string (optional URI)",
  "seed": "integer (optional)",
  "image": "string (required URI)",
  "width": 1024,
  "height": 1024,
  "prompt": "string (required)",
  "refine": "string (default: 'no_refiner')",
  "loraScale": 0.6,
  "scheduler": "string (default: 'K_EULER')",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "negativePrompt": "string (optional)",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "refinementSteps": "integer (optional)",
  "highNoiseFraction": 0.8,
  "numberOfInferenceSteps": 50
}

Here is an example of the input payload you can use:

{
  "width": 1024,
  "height": 1024,
  "prompt": "A photo of a government building in the style of TOK",
  "refine": "no_refiner",
  "loraScale": 0.6,
  "scheduler": "K_EULER",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "promptStrength": 0.8,
  "numberOfOutputs": 4,
  "highNoiseFraction": 0.8,
  "numberOfInferenceSteps": 50
}

Output

When you execute this action successfully, it returns an array of URLs pointing to the generated images. For instance, the output may look like this:

[
  "https://assets.cognitiveactions.com/invocations/0eda5359-cee2-4c51-a31e-6e63eda3abdd/e2a0c945-f932-42b0-ba5c-d6e854ded2b8.png",
  "https://assets.cognitiveactions.com/invocations/0eda5359-cee2-4c51-a31e-6e63eda3abdd/7ede0e0e-211e-40c4-9654-58c40911b09b.png",
  "https://assets.cognitiveactions.com/invocations/0eda5359-cee2-4c51-a31e-6e63eda3abdd/7157c4ca-9732-4b86-a1b2-24168ed0ca63.png",
  "https://assets.cognitiveactions.com/invocations/0eda5359-cee2-4c51-a31e-6e63eda3abdd/e7d660c9-a431-457b-a1fe-d3aeeb17e7e4.png"
]

Conceptual Usage Example (Python)

Here’s a conceptual example of how to call the Generate Iwan Baan Style Architecture Image action using Python. Remember this is a hypothetical endpoint structure.

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 = "8f9677a7-3c63-423b-bd6a-4c4bb05061c9"  # Action ID for Generate Iwan Baan Style Architecture Image

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "A photo of a government building in the style of TOK",
    "refine": "no_refiner",
    "loraScale": 0.6,
    "scheduler": "K_EULER",
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "promptStrength": 0.8,
    "numberOfOutputs": 4,
    "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 payload variable is structured to match the requirements for generating an architectural image, while the endpoint URL and request structure are hypothetical.

Conclusion

The cbh123/iwan-baan-sdxl Cognitive Action's image generation capabilities allow developers to harness the power of advanced AI models to create stunning images that emulate Iwan Baan's unique architectural style. By integrating these actions into your applications, you can explore a multitude of creative possibilities. Consider experimenting with various input parameters to maximize the potential of your generated images. Happy coding!