Unlock Creative Possibilities with asiryan/unlimited-xl Cognitive Actions

22 Apr 2025
Unlock Creative Possibilities with asiryan/unlimited-xl Cognitive Actions

The asiryan/unlimited-xl API offers developers a powerful toolset for generating and transforming images through the Generate Image with Unlimited XL action. This action leverages advanced algorithms to create stunning visuals based on textual input, allowing applications to enhance user experiences with custom graphics. Whether you're looking to generate images from scratch, modify existing images, or fill in specific areas, these Cognitive Actions streamline the process and eliminate the need for complex image manipulation logic.

Prerequisites

To get started with the asiryan/unlimited-xl Cognitive Actions, you'll need:

  • An API key for authentication with the Cognitive Actions platform.
  • Basic understanding of making HTTP requests and handling JSON data.

For authentication, the API key is typically passed in the request headers, allowing secure access to the services.

Cognitive Actions Overview

Generate Image with Unlimited XL

The Generate Image with Unlimited XL action allows developers to create images from text prompts, transform existing images, or perform inpainting. This action is categorized under image generation, making it ideal for applications that require dynamic visual content.

Input

The following fields are part of the input schema for this action:

  • prompt: (string) Input prompt guiding the image generation process.
  • negativePrompt: (string) A prompt to avoid undesired features in the output image.
  • width: (integer) Width of the output image in pixels (default: 1024).
  • height: (integer) Height of the output image in pixels (default: 1024).
  • strength: (number) Influence of the prompt in img2img or inpaint mode (default: 0.8).
  • loraScale: (number) Scaling factor for LoRA models (default: 0.6).
  • scheduler: (string) Method used for model scheduling (default: "K_EULER_ANCESTRAL").
  • guidanceScale: (number) Scale used for classifier-free guidance (default: 3.5).
  • numberOfOutputs: (integer) Number of images to generate (default: 1, range: 1-4).
  • numInferenceSteps: (integer) Total number of denoising steps (default: 40).
  • image: (string) URI of the input image for img2img or inpaint mode.
  • mask: (string) URI of the input mask for inpaint mode.
  • seed: (integer) Random seed for reproducibility.

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "score_9, score_8_up, score_7_up, score_6_up, flair bridge boost girl in matte black full over rubbersuit with zip, tignt eance, nilon, long ponytail, big eace, in vnite room",
  "strength": 0.8,
  "loraScale": 0.6,
  "scheduler": "K_EULER_ANCESTRAL",
  "guidanceScale": 3.5,
  "negativePrompt": "score_6, score_5, score_4, bad quality, bad anatomy, worst quality, low quality, low resolutions, extra fingers, blur, blurry, ugly, wrongs proportions, watermark, image artifacts, lowres, jpeg artifacts, deformed, noisy image, poorly drawn face, ugly face, crossed eyes",
  "numberOfOutputs": 1,
  "numInferenceSteps": 40
}

Output

The output of this action is typically a list of generated image URLs. For example:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/86f02bbd-66cb-4b8a-bf1c-edc977aada87/949748a8-0894-45da-b541-5eee1ff6f0e2.png"
]

In case of errors, the response may include error messages detailing what went wrong during the execution.

Conceptual Usage Example (Python)

Here's a conceptual Python code snippet demonstrating how to call the Generate Image with Unlimited XL action. This example focuses on structuring the input JSON payload correctly.

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 = "f6637ebb-4415-4d63-92f3-c87a7520d6d4"  # Action ID for Generate Image with Unlimited XL

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "score_9, score_8_up, score_7_up, score_6_up, flair bridge boost girl in matte black full over rubbersuit with zip, tignt eance, nilon, long ponytail, big eace, in vnite room",
    "strength": 0.8,
    "loraScale": 0.6,
    "scheduler": "K_EULER_ANCESTRAL",
    "guidanceScale": 3.5,
    "negativePrompt": "score_6, score_5, score_4, bad quality, bad anatomy, worst quality, low quality, low resolutions, extra fingers, blur, blurry, ugly, wrongs proportions, watermark, image artifacts, lowres, jpeg artifacts, deformed, noisy image, poorly drawn face, ugly face, crossed eyes",
    "numberOfOutputs": 1,
    "numInferenceSteps": 40
}

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 snippet, make sure to replace the YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID and the input payload structure should align with the specifications provided, ensuring the request is formatted correctly.

Conclusion

The asiryan/unlimited-xl Cognitive Actions provide a robust solution for developers looking to incorporate innovative image generation capabilities into their applications. With the flexibility to customize prompts, adjust parameters, and handle various image processing tasks, these actions can significantly enhance the creative potential of your projects. Explore the possibilities, and start integrating these actions to elevate your application's visual appeal!