Create Stunning Images with IBRUNON: A Developer's Guide to Cognitive Actions

25 Apr 2025
Create Stunning Images with IBRUNON: A Developer's Guide to Cognitive Actions

Integrating visual creativity into your applications has never been easier with the IBRUNON Cognitive Actions. This powerful API allows developers to generate detailed images based on input prompts, making it ideal for projects ranging from art generation to content creation. With customizable settings for image size, quality, and style, IBRUNON provides a flexible solution for enhancing user experiences and engaging audiences.

In this guide, we'll explore the Generate Image with IBRUNON action, including its capabilities, input requirements, output formats, and implementation examples to help you seamlessly integrate it into your applications.

Prerequisites

To start using the IBRUNON Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform.
  • Basic knowledge of making HTTP requests and handling JSON data.
  • Understanding of how to structure requests for API endpoints.

Authentication typically involves passing your API key in the request headers.

Cognitive Actions Overview

Generate Image with IBRUNON

The Generate Image with IBRUNON action allows you to create unique images based on descriptive prompts. You can adjust parameters such as aspect ratio, quality, and inference steps to control the output, offering flexibility in the image generation process.

Input

The input for this action is structured as a JSON object, requiring the following key fields:

  • prompt (required): The descriptive prompt that guides the image generation.
  • model (optional): Specifies which model to use for inference. Available options are "dev" or "schnell".
  • width and height (optional): Specify dimensions for a custom aspect ratio.
  • imageFormat (optional): The format of the output image, with options including "webp", "jpg", and "png".
  • Additional optional parameters include seed, goFast, imageQuality, and numberOfOutputs.

Here's a practical example of the JSON payload needed to invoke this action:

{
  "model": "dev",
  "prompt": "DSLR cinematic wide angle film shot of surprised and stressed IBRUNON seated in the driver’s seat inside the vehicle, with his hands steering a green Jeep Wrangler-style vehicle driving along a dirt road...",
  "loraScale": 1,
  "imageFormat": "png",
  "imageQuality": 100,
  "guidanceScale": 2,
  "extraLoraScale": 1,
  "inferenceSteps": 28,
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "imageAspectRatio": "16:9"
}

Output

The output of the Generate Image with IBRUNON action typically returns a URL to the generated image. Here’s a sample output:

[
  "https://assets.cognitiveactions.com/invocations/c4995f7f-d602-46fb-996d-549e4ce7d4ed/702a2774-1311-4706-b39d-3b37540da463.png"
]

Conceptual Usage Example (Python)

Below is a conceptual Python code snippet demonstrating how to call the IBRUNON action:

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 = "4ed7ef2d-6e41-42ce-bc5a-225ab1341fb3"  # Action ID for Generate Image with IBRUNON

# Construct the input payload based on the action's requirements
payload = {
    "model": "dev",
    "prompt": "DSLR cinematic wide angle film shot of surprised and stressed IBRUNON seated in the driver’s seat inside the vehicle, with his hands steering a green Jeep Wrangler-style vehicle driving along a dirt road...",
    "loraScale": 1,
    "imageFormat": "png",
    "imageQuality": 100,
    "guidanceScale": 2,
    "extraLoraScale": 1,
    "inferenceSteps": 28,
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "imageAspectRatio": "16:9"
}

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 is structured to include necessary parameters for generating the image, and the response is printed in a readable format.

Conclusion

The Generate Image with IBRUNON action offers a robust solution for creating stunning images tailored to your specifications. By leveraging customizable inputs and detailed prompts, developers can easily enhance their applications with visually engaging content. Start experimenting with different prompts and configurations to see the creative possibilities unfold!