Generate Stunning Images with giksant/giceli Cognitive Actions

22 Apr 2025
Generate Stunning Images with giksant/giceli Cognitive Actions

In the world of AI-driven creativity, the giksant/giceli API offers powerful Cognitive Actions that allow developers to generate customized images with ease. These actions cater to various use cases, from creating unique artwork to enhancing existing images through transformations. By leveraging pre-built actions, developers can save time and resources, focusing on integrating these capabilities into their applications without needing to build the underlying technology from scratch.

Prerequisites

Before you can start using the Cognitive Actions offered by the giksant/giceli API, ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Basic familiarity with making HTTP requests in your programming language of choice.

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

Cognitive Actions Overview

Generate Customized Image

This action is designed to generate customized images using various input parameters, including image mask URLs, model selection, and prompt strength for image-to-image transformations. You can choose between speed enhancements with the "schnell" model or detailed output with the "dev" model, producing high-quality images up to a maximum resolution of 1440x1440 pixels.

Input

The input schema for this action requires the following fields:

  • prompt (required): A text prompt guiding the generated image's style and content.
  • image (optional): Input image for transformations.
  • mask (optional): Image mask for inpainting mode.
  • model (optional): Model selection (default is "dev").
  • width (optional): Width of the generated image (256 to 1440).
  • height (optional): Height of the generated image (256 to 1440).
  • aspectRatio (optional): Aspect ratio for the generated image (default is "1:1").
  • imageFormat (optional): Specifies the output format (default is "webp").
  • guidanceScale (optional): Guidance scale for the diffusion process.
  • numInferenceSteps (optional): Number of denoising steps (default is 28).
  • numberOfOutputs (optional): Number of outputs to generate (1 to 4).
  • goFast (optional): Enable for accelerated predictions.
  • additional parameters: For fine-tuning and customization.

Example Input:

{
  "image": "https://replicate.delivery/pbxt/MPFnmDwrjDemmwdgIqUiq8DQypbJ6XuhRjewaK4IVBNzOMzW/f300023d-a28f-4e65-b72b-85b8a881474b.jpg",
  "model": "dev",
  "goFast": false,
  "prompt": "giceli \n\n\"A professional woman with shoulder-length dark brown hair and a confident, friendly expression sits at a modern, minimalist desk. She is wearing a stylish outfit consisting of a camel-colored ribbed long-sleeve top and a deep blue sleeveless blazer. Her makeup is well-applied, with dark eyeliner, soft brown eyeshadow, and a natural pink lip color. She wears elegant gold jewelry, including hoop earrings, multiple rings, and a delicate bracelet. She is holding a small blue book with the title 'Catherine Antiansiedad,' featuring an illustration of a clock and a running person, suggesting a theme related to anxiety management.  \n\nThe setting is a clean, well-organized workspace with a white marble desk. On the desk, there is a realistic anatomical brain model with red veins resting on a thick hardcover book, a pair of stylish eyeglasses, and a white ceramic cup. A small decorative tray holds gold accessories, adding a touch of elegance. The background features a modern interior with white walls, floating shelves with books, and a large black-framed window allowing natural light to enter. The overall aesthetic is warm, professional, and intellectual, suggesting themes of psychology, neuroscience, or personal development.\"",
  "megapixels": "1",
  "aspectRatio": "1:1",
  "imageFormat": "jpg",
  "guidanceScale": 3,
  "mainLoraScale": 1,
  "outputQuality": 80,
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "numInferenceSteps": 28,
  "additionalLoraScale": 1
}

Output

The action typically returns a list of URLs pointing to the generated images. For example:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/131f47d0-e476-462a-b0b9-a5998be6664e/2707c057-c9a5-416e-b021-27b8fc608e28.jpg"
]

Conceptual Usage Example (Python)

Here's a conceptual Python code snippet demonstrating how to call the Generate Customized Image action using a hypothetical Cognitive Actions endpoint:

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 = "afc3b303-59e3-4671-b04a-a5525d2783e4"  # Action ID for Generate Customized Image

# Construct the input payload based on the action's requirements
payload = {
    "image": "https://replicate.delivery/pbxt/MPFnmDwrjDemmwdgIqUiq8DQypbJ6XuhRjewaK4IVBNzOMzW/f300023d-a28f-4e65-b72b-85b8a881474b.jpg",
    "model": "dev",
    "goFast": false,
    "prompt": "giceli \n\n\"A professional woman with shoulder-length dark brown hair and a confident, friendly expression sits at a modern, minimalist desk...",
    "megapixels": "1",
    "aspectRatio": "1:1",
    "imageFormat": "jpg",
    "guidanceScale": 3,
    "mainLoraScale": 1,
    "outputQuality": 80,
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "numInferenceSteps": 28,
    "additionalLoraScale": 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 code snippet, replace the API key and endpoint with your actual values. The action_id corresponds to the Generate Customized Image action, and the payload contains the required input fields structured according to the API's schema.

Conclusion

The giksant/giceli API's Cognitive Actions provide a robust framework for generating customized images tailored to your specifications. By understanding the capabilities of the Generate Customized Image action, you can easily integrate image generation into your applications, creating unique visuals that enhance user experiences. As you explore these capabilities, consider experimenting with different prompts and configurations to discover the full potential of AI-driven image generation.