Elevate Your Image Generation with the Biguloff Amrita Store Cognitive Actions

24 Apr 2025
Elevate Your Image Generation with the Biguloff Amrita Store Cognitive Actions

In today's digital landscape, generating high-quality images programmatically can significantly enhance user experiences and streamline workflows. The Biguloff Amrita Store Cognitive Actions offer a powerful image generation capability through a single action: Generate Image with Inpainting. This action utilizes advanced image-to-image generation and inpainting techniques, allowing developers to create customizable images tailored to their specific needs.

Prerequisites

To get started with the Biguloff Amrita Store Cognitive Actions, you will need:

  • An API key for access to the Cognitive Actions platform.
  • A basic understanding of JSON structures, as inputs and outputs are formatted in JSON.

Authentication typically involves passing your API key in the request headers, allowing secure access to the action's capabilities.

Cognitive Actions Overview

Generate Image with Inpainting

The Generate Image with Inpainting action allows users to create stunning images with customizable parameters. Whether you need to inpaint existing images or generate entirely new ones based on text prompts, this action is designed to meet various performance needs through different model options.

Input

The input for this action is structured as follows:

  • prompt (required): A detailed text description to guide the image generation.
  • mask (optional): An image mask for inpainting mode.
  • seed (optional): Random seed for reproducible generation.
  • image (optional): An input image for inpainting or image-to-image generation.
  • width (optional): Width of the generated image (only for custom aspect ratios).
  • height (optional): Height of the generated image (only for custom aspect ratios).
  • imageFormat (optional): The format of the output images (default is "webp").
  • outputCount (optional): Number of images to generate (default is 1, maximum is 4).
  • denoisingSteps (optional): Steps for denoising the generated image (default is 28).
  • enableFastMode (optional): Whether to run faster predictions.
  • inferenceModel (optional): The model to run inference with (default is "dev").
  • promptStrength (optional): Strength of the prompt for img2img.
  • imageAspectRatio (optional): Defines the aspect ratio for the generated image (default is "1:1").
  • imageOutputQuality (optional): Quality setting for saving output images (default is 80).
  • safetyCheckerDisabled (optional): Option to disable the safety checker.

Example Input:

{
  "prompt": "AMRT A giant, ultra-realistic lion with powerful, naturally muscular build, standing majestically in front of a sports nutrition store called \"Giant Lion.\" The lion has thick, well-defined muscles across its shoulders, legs, and chest, as if naturally enhanced. His mane is full and wild, complementing the strength in his massive physique. The store in the background has a bold sign reading \"Giant Lion\" and displays various sport nutrition products. Hyper-detailed texture on the lion's fur and muscles, emphasizing his natural power and dominance.",
  "imageFormat": "png",
  "outputCount": 3,
  "denoisingSteps": 28,
  "inferenceModel": "dev",
  "promptStrength": 0.8,
  "imageAspectRatio": "9:16",
  "primaryLoraScale": 1,
  "imageOutputQuality": 90,
  "secondaryLoraScale": 1,
  "diffusionGuidanceScale": 3
}

Output

The action returns an array of URLs pointing to the generated images, allowing developers to easily integrate these images into their applications.

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/a2133b93-411c-4613-8408-67c4de142afc/859bc97a-977b-4f44-b3f0-d233583f274f.png",
  "https://assets.cognitiveactions.com/invocations/a2133b93-411c-4613-8408-67c4de142afc/9fae905c-91d6-4127-9067-92a69144690a.png",
  "https://assets.cognitiveactions.com/invocations/a2133b93-411c-4613-8408-67c4de142afc/d170a2d0-7782-4abe-a0ad-4c8344406ec0.png"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate Image with Inpainting action using Python:

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 = "79482b45-3a3f-4aef-bf40-0a5dbd189d1b"  # Action ID for Generate Image with Inpainting

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "AMRT A giant, ultra-realistic lion with powerful, naturally muscular build, standing majestically in front of a sports nutrition store called \"Giant Lion.\" The lion has thick, well-defined muscles across its shoulders, legs, and chest, as if naturally enhanced. His mane is full and wild, complementing the strength in his massive physique. The store in the background has a bold sign reading \"Giant Lion\" and displays various sport nutrition products. Hyper-detailed texture on the lion's fur and muscles, emphasizing his natural power and dominance.",
    "imageFormat": "png",
    "outputCount": 3,
    "denoisingSteps": 28,
    "inferenceModel": "dev",
    "promptStrength": 0.8,
    "imageAspectRatio": "9:16",
    "primaryLoraScale": 1,
    "imageOutputQuality": 90,
    "secondaryLoraScale": 1,
    "diffusionGuidanceScale": 3
}

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}")

This code illustrates how to set up the input payload and make a request to the cognitive actions endpoint. Remember, the endpoint URL and exact request structure are hypothetical and should be adapted to your specific setup.

Conclusion

The Biguloff Amrita Store Cognitive Actions provide powerful tools for image generation, enabling developers to create custom images efficiently. With the ability to specify various parameters, you can tailor the output to fit your needs perfectly. Whether you're looking to enhance applications with unique visuals or automate image creation for content, these actions are a valuable addition to your development toolkit. Explore the possibilities today, and let your creativity flourish!