Create Stunning Imagery of Maldivian Traditional Dress with Hiyala AI Actions

23 Apr 2025
Create Stunning Imagery of Maldivian Traditional Dress with Hiyala AI Actions

The novelstudio24/hiyala-ai API offers an innovative way to generate high-quality images inspired by Maldivian traditional dress. By utilizing AI-generated imagery, developers can create unique visual content that captures the elegance and charm of Maldivian culture. With customizable parameters for image dimensions, quality, and style, these Cognitive Actions empower developers to enrich their applications with captivating visuals.

Prerequisites

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

  • An API key for authenticating your requests to the Cognitive Actions platform.
  • An understanding of JSON structure as you will be sending and receiving JSON payloads in your API calls.

Authentication typically involves passing your API key in the headers of your request, allowing you to securely access the Cognitive Actions functionalities.

Cognitive Actions Overview

Generate Maldivian Traditional Dress Imagery

The Generate Maldivian Traditional Dress Imagery action allows you to create AI-generated images that showcase the beauty of Maldivian women in their traditional attire. This action is categorized under image-generation, providing a flexible framework for generating custom imagery based on provided prompts.

Input

The input schema for this action includes several fields, with the following being essential:

  • prompt (required): A descriptive text guiding the generation of the image.
  • image (optional): A URI of an input image for image-to-image generation.
  • width and height (optional): Specify custom dimensions if using a custom aspect ratio.
  • fastMode (optional): A boolean indicating whether to optimize prediction speed.
  • imageFormat (optional): The desired format of the output image (default is webp).

Example Input:

{
  "image": "https://replicate.delivery/pbxt/MIVXzTpj1nIJWNNvAUsgVIsTN0ZXyFWZTVm0j5iVt1YzZM1e/IMG_7538.jpeg",
  "prompt": "Create a portrait of a young woman dhivehi hiyala standing in a rustic setting, framed by an open window made of natural materials like wood and thatched palm leaves. She is wearing a vibrant red traditional dress with intricate golden and multicolored embroidery around the neckline, accessorized with a long, gold necklace. Her expression is serene and confident, with her hands gently clasped in front of her. The background features lush green foliage, creating a natural and peaceful atmosphere. The lighting is soft and warm, emphasizing the details of her attire and the textures of the surrounding environment.",
  "fastMode": false,
  "imageFormat": "webp",
  "imageQuality": 80,
  "inferenceModel": "dev",
  "numberOfOutputs": 1,
  "approxMegapixels": "1",
  "imageAspectRatio": "1:1",
  "mainLoraIntensity": 1,
  "inferenceStepCount": 28,
  "imagePromptStrength": 0.8,
  "diffusionGuidanceScale": 3,
  "additionalLoraIntensity": 1
}

Output

The action typically returns a JSON array containing the URI of the generated image, which can be directly displayed in your applications.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/5c6e98a4-d613-4eca-a3d6-5dd9ec38fe94/bb58bc00-9471-4b07-89ee-dc34815629f4.webp"
]

Conceptual Usage Example (Python)

Here’s a conceptual Python code snippet demonstrating how to call this 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 = "50bee467-1d47-40d1-9186-a22c1fea49ae" # Action ID for Generate Maldivian Traditional Dress Imagery

# Construct the input payload based on the action's requirements
payload = {
    "image": "https://replicate.delivery/pbxt/MIVXzTpj1nIJWNNvAUsgVIsTN0ZXyFWZTVm0j5iVt1YzZM1e/IMG_7538.jpeg",
    "prompt": "Create a portrait of a young woman dhivehi hiyala standing in a rustic setting...",
    "fastMode": False,
    "imageFormat": "webp",
    "imageQuality": 80,
    "inferenceModel": "dev",
    "numberOfOutputs": 1,
    "approxMegapixels": "1",
    "imageAspectRatio": "1:1",
    "mainLoraIntensity": 1,
    "inferenceStepCount": 28,
    "imagePromptStrength": 0.8,
    "diffusionGuidanceScale": 3,
    "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}
    )
    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, the payload is constructed according to the input schema required for generating the image. The action ID is specified, and the response is processed to retrieve and display the generated image URI.

Conclusion

The Hiyala AI Cognitive Actions provide a powerful avenue for developers to generate stunning and culturally rich imagery, specifically focusing on Maldivian traditional dress. By leveraging these actions, developers can enhance their applications with unique visual content that resonates with users.

Explore the potential of integrating these Cognitive Actions into your projects and consider how they can elevate user engagement through captivating imagery.