Create Stunning Images with the fuskio64/eugenito Cognitive Actions

22 Apr 2025
Create Stunning Images with the fuskio64/eugenito Cognitive Actions

In today's digital landscape, the ability to generate high-quality images programmatically can transform applications in creative ways. The fuskio64/eugenito spec offers developers a powerful Cognitive Action for generating personalized images using the keyword "Eugenito". This action allows for extensive customization based on user prompts, model selection, and various image parameters, making it an excellent tool for developers looking to enhance their applications with dynamic image generation capabilities.

Prerequisites

To start using the Cognitive Actions from the fuskio64/eugenito spec, you need an API key for the Cognitive Actions platform. Authentication typically involves passing this API key in the headers of your requests. Ensure you have the necessary permissions to access the action and are familiar with JSON structures, as the input and output will primarily be in JSON format.

Cognitive Actions Overview

Generate Image with Eugenito

The Generate Image with Eugenito action creates a personalized image by leveraging a text prompt and various customization options. You can choose between the 'dev' or 'schnell' models, specify dimensions, adjust for output quality, and even enable 'fast mode' for quicker results.

Input

The input for this action requires a JSON object with the following fields:

  • prompt (required): A text prompt guiding the image generation (e.g., "Eugenito as a cowboy looking to the camera").
  • model (optional): Select either "dev" (default) or "schnell".
  • width (optional): Width of the image in pixels (256 to 1440).
  • height (optional): Height of the image in pixels (256 to 1440).
  • goFast (optional): Boolean to enable fast predictions (default is false).
  • aspectRatio (optional): Specifies the aspect ratio for the image (default is "1:1").
  • numOutputs (optional): Number of images to generate (default is 1).
  • outputFormat (optional): Format of the output image (default is "webp").
  • guidanceScale (optional): Controls the diffusion process guidance scale (default is 3).
  • outputQuality (optional): Quality level for the output image (default is 80).
  • ...and others, allowing for in-depth customization.

Here’s an example of the input JSON payload:

{
  "model": "dev",
  "prompt": "Eugenito as a cowboy looking to the camera",
  "loraScale": 1,
  "numOutputs": 1,
  "aspectRatio": "1:1",
  "outputFormat": "webp",
  "guidanceScale": 3.5,
  "outputQuality": 90,
  "extraLoraScale": 1,
  "promptStrength": 0.8,
  "numInferenceSteps": 28
}

Output

Upon successful execution, the action returns a JSON array containing the URLs of the generated images. Here’s an example of what the output might look like:

[
  "https://assets.cognitiveactions.com/invocations/a13664dd-428b-40c9-927e-0f817fb7eaab/04e5ef38-ae38-4b82-8bc2-cecfe782b82e.webp"
]

Conceptual Usage Example (Python)

Here’s how you might invoke the Generate Image with Eugenito action in 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 = "976958e9-341d-4e3b-9912-535c1cd8b00b"  # Action ID for Generate Image with Eugenito

# Construct the input payload based on the action's requirements
payload = {
    "model": "dev",
    "prompt": "Eugenito as a cowboy looking to the camera",
    "loraScale": 1,
    "numOutputs": 1,
    "aspectRatio": "1:1",
    "outputFormat": "webp",
    "guidanceScale": 3.5,
    "outputQuality": 90,
    "extraLoraScale": 1,
    "promptStrength": 0.8,
    "numInferenceSteps": 28
}

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, you'll need to replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action_id should be set to the ID of the action you want to call. The payload is structured according to the required input schema, and the request is sent to a hypothetical execution endpoint.

Conclusion

The fuskio64/eugenito Cognitive Action empowers developers to generate unique and customized images seamlessly. By leveraging its robust features, you can enhance your applications with stunning visuals tailored to user input. Explore various configurations and experiment with different prompts to unlock the full potential of this image generation tool. As you integrate these capabilities into your projects, consider the myriad applications, from creative content generation to automated design tasks, that can benefit from this powerful action. Happy coding!