Create Stunning Custom Images with Keilah Lora

25 Apr 2025
Create Stunning Custom Images with Keilah Lora

Keilah Lora brings creativity to life through advanced image generation capabilities. This service allows developers to generate custom images using inpainting and image-to-image modes, empowering them to create visuals tailored to their specific needs. With adjustable parameters like aspect ratio, dimensions, and quality settings, Keilah Lora simplifies the process of generating high-quality images, whether for marketing materials, content creation, or artistic projects.

Imagine automatically producing visuals that align perfectly with your vision, all while saving time and resources. Developers can use this service for various purposes, from generating unique art pieces to creating illustrations for applications, making it a versatile tool in any developer's toolkit.

To get started, you’ll need a Cognitive Actions API key and a basic understanding of API calls.

Generate Image with Custom Inpainting

The "Generate Image with Custom Inpainting" action is designed to create custom images tailored to your specifications. This action solves the problem of needing unique visuals by allowing you to generate images based on detailed prompts and specific parameters. Whether you're looking to modify existing images or create something entirely new, this action provides the flexibility to do so.

Input Requirements

To use this action, the following inputs are required:

  • Prompt: A descriptive text that guides the image generation (e.g., "A serene mountain landscape at sunset").
  • Optional Parameters: These include aspects like mask (for inpainting), width, height, aspectRatio, and various quality settings.

Expected Output

The action returns a URL pointing to the generated image, formatted in the specified output format (e.g., webp, jpg, png).

Use Cases for this Specific Action

  • Art Creation: Artists can use this action to generate unique artwork based on specific themes or styles.
  • Marketing Materials: Marketers can create tailored visuals that resonate with their target audience, enhancing engagement.
  • Content Generation: Bloggers and content creators can generate images that complement their written content, making it more appealing and shareable.
import requests
import json

# Replace with your actual Cognitive Actions API key and endpoint
# Ensure your environment securely handles the API key
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
# This endpoint URL is hypothetical and should be documented for users
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"

action_id = "02612f3c-806b-41fd-859b-64563a0f8b70" # Action ID for: Generate Image with Custom Inpainting

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "prompt": "KEILAH is a traditional hula dancer at a luau. She is telling a story of her people through the dance, in traditional garb. The luau is on the beach, and the ocean is behind her. In front of her, green grass and beautiful tropical plants and trees abound.",
  "fastMode": false,
  "aspectRatio": "1:1",
  "imageFormat": "webp",
  "modelChoice": "dev",
  "outputCount": 1,
  "guidanceScale": 3,
  "mainLoraScale": 1,
  "outputQuality": 80,
  "denoisingSteps": 28,
  "extraLoraScale": 1,
  "promptStrength": 0.8,
  "approximateMegapixels": "1"
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json",
    # Add any other required headers for the Cognitive Actions API
}

# Prepare the request body for the hypothetical execution endpoint
request_body = {
    "action_id": action_id,
    "inputs": payload
}

print(f"--- Calling Cognitive Action: {action.name or action_id} ---")
print(f"Endpoint: {COGNITIVE_ACTIONS_EXECUTE_URL}")
print(f"Action ID: {action_id}")
print("Payload being sent:")
print(json.dumps(request_body, indent=2))
print("------------------------------------------------")

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json=request_body
    )
    response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully. Result:")
    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 (non-JSON): {e.response.text}")
    print("------------------------------------------------")

Conclusion

Keilah Lora's image generation capabilities offer developers a powerful and flexible solution for creating custom visuals. With the ability to adjust parameters and utilize both inpainting and image-to-image modes, this service opens up a world of creative possibilities. Whether for artistic endeavors, marketing strategies, or content enhancement, Keilah Lora is equipped to meet your image generation needs. Start integrating these actions into your projects to unlock a new level of creativity and efficiency.