Generate Stunning Custom Images with Hyestt/Tee-Lora Cognitive Actions

21 Apr 2025
Generate Stunning Custom Images with Hyestt/Tee-Lora Cognitive Actions

In the world of artificial intelligence and machine learning, the ability to generate custom images has become increasingly accessible with the introduction of advanced tools. The Hyestt/Tee-Lora offers a powerful set of Cognitive Actions that allow developers to create customized images through sophisticated image inpainting. This integration supports various options for fine-tuning the image generation process, including aspect ratios, image dimensions, and model selection, making it an invaluable resource for developers looking to enhance their applications with visual content generation.

Prerequisites

Before diving into the integration of the Hyestt/Tee-Lora Cognitive Actions, you'll need to ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Basic knowledge of JSON and HTTP requests.

Authentication typically involves passing your API key in the request headers, ensuring that your application can securely communicate with the service.

Cognitive Actions Overview

Generate Customized Image

The Generate Customized Image action allows developers to create images based on specific prompts with numerous configurable options. This action supports advanced image inpainting and the application of optional LoRA weights, giving you extensive control over the image generation process.

Input

The input for this action requires at least the prompt field, while additional fields can be specified for further customization. Below is the schema and an example input JSON payload:

Schema:

{
  "prompt": "string (required)",
  "mask": "string (optional)",
  "seed": "integer (optional)",
  "image": "string (optional)",
  "width": "integer (optional, max: 1440, min: 256)",
  "height": "integer (optional, max: 1440, min: 256)",
  "imageFormat": "string (optional, default: 'webp')",
  "outputCount": "integer (optional, default: 1, max: 4, min: 1)",
  "modelWeights": "string (optional)",
  "outputPixels": "string (optional, default: '1')",
  "guidanceScale": "number (optional, default: 3)",
  "loraIntensity": "number (optional, default: 1)",
  "outputQuality": "integer (optional, default: 80, max: 100, min: 0)",
  "inferenceModel": "string (optional, default: 'dev')",
  "inferenceSteps": "integer (optional, default: 28)",
  "promptStrength": "number (optional, default: 0.8)",
  "imageAspectRatio": "string (optional, default: '1:1')",
  "optimizeForSpeed": "boolean (optional, default: false)",
  "safetyCheckerDisabled": "boolean (optional, default: false)"
}

Example Input:

{
  "prompt": "a photo of teee a man, standing on the street, night, smile to the camera",
  "imageFormat": "webp",
  "outputCount": 1,
  "guidanceScale": 3.5,
  "loraIntensity": 1,
  "outputQuality": 90,
  "inferenceModel": "dev",
  "inferenceSteps": 28,
  "promptStrength": 0.8,
  "imageAspectRatio": "1:1",
  "additionalLoraIntensity": 1
}

Output

The output of this action is a URL to the generated image based on the provided prompt and parameters. Below is an example of the expected output:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/07bfacda-11dd-4854-a00f-dbc1b970a17f/796f59e5-7460-4c32-b2ec-bddfa4861d59.webp"
]

Conceptual Usage Example (Python)

Here’s how you can use the Generate Customized Image action in your application. Below is a conceptual Python code snippet that demonstrates how to structure the input and make a request to the Cognitive Actions API:

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 = "f8acbcc5-f509-4ee3-a71f-7612565eb086" # Action ID for Generate Customized Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "a photo of teee a man, standing on the street, night, smile to the camera",
    "imageFormat": "webp",
    "outputCount": 1,
    "guidanceScale": 3.5,
    "loraIntensity": 1,
    "outputQuality": 90,
    "inferenceModel": "dev",
    "inferenceSteps": 28,
    "promptStrength": 0.8,
    "imageAspectRatio": "1:1",
    "additionalLoraIntensity": 1
}

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 example, you replace the API key and endpoint with your actual credentials. The action ID and input payload are structured as demonstrated in the earlier sections, allowing for effective communication with the Cognitive Actions service.

Conclusion

Integrating the Hyestt/Tee-Lora Cognitive Actions into your applications opens up exciting possibilities for generating custom images tailored to your specifications. By leveraging the various parameters available, you can create high-quality visuals that enhance user experiences and drive engagement. Explore these actions further, experiment with different parameters, and unlock the full potential of image generation in your projects.