Unlock Creative Possibilities with asiryan/proteus-v0.2 Cognitive Actions

24 Apr 2025
Unlock Creative Possibilities with asiryan/proteus-v0.2 Cognitive Actions

In the rapidly evolving landscape of artificial intelligence, the ability to generate high-quality images from textual descriptions is a game-changer for developers and creatives alike. The asiryan/proteus-v0.2 Cognitive Actions provide a powerful toolset for text-to-image, image-to-image transformations, and inpainting. By leveraging the Proteus v0.2 model, developers can create visually stunning images quickly and efficiently, enhancing their applications with advanced image generation capabilities.

Prerequisites

Before you dive into using the Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Basic knowledge of making HTTP requests in your preferred programming language (the examples will utilize Python).

To authenticate, you will typically pass your API key in the headers of your requests.

Cognitive Actions Overview

Generate Image Using Proteus v0.2

The Generate Image Using Proteus v0.2 action enables you to create images based on text descriptions or manipulate existing images using inpainting and image-to-image transformations. This action supports various configurations, allowing for nuanced control over the generation process.

Input

The action requires a structured input schema with the following fields:

  • prompt (string): A descriptive text prompt guiding the image generation. (Required)
  • width (integer): The output image width in pixels (default is 1024). (Optional)
  • height (integer): The output image height in pixels (default is 1024). (Optional)
  • strength (number): Strength of the prompt for img2img or inpaint mode (default is 0.8). (Optional)
  • loraScale (number): Additive scale for LoRA (default is 0.6). (Optional)
  • scheduler (string): Scheduler algorithm for denoising (default is "K_EULER_ANCESTRAL"). (Optional)
  • guidanceScale (number): Scale for classifier-free guidance (default is 7). (Optional)
  • negativePrompt (string): Text describing undesirable characteristics in the generated image (default includes various low-quality terms). (Optional)
  • numberOfOutputs (integer): Number of images to generate (default is 1, max is 4). (Optional)
  • numberOfInferenceSteps (integer): Number of denoising inference steps (default is 40). (Optional)
  • image (string): URI of the input image for img2img or inpaint mode. (Optional)
  • mask (string): URI of the input mask for inpaint mode. (Optional)
  • loraWeights (string): URI of the LoRA weights to use. (Optional)
  • seed (integer): A random seed for generating variations. (Optional)

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "black fluffy gorgeous dangerous cat animal creature, large orange eyes, big fluffy ears, piercing gaze, full moon, dark ambiance, best quality, extremely detailed",
  "strength": 0.8,
  "loraScale": 0.6,
  "scheduler": "K_EULER_ANCESTRAL",
  "guidanceScale": 7,
  "negativePrompt": "bad quality, bad anatomy, worst quality, low quality, low resolutions, extra fingers, blur, blurry, ugly, wrongs proportions, watermark, image artifacts, lowres, ugly, jpeg artifacts, deformed, noisy image",
  "numberOfOutputs": 1,
  "numberOfInferenceSteps": 40
}

Output

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

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/7b6262d6-3e53-42c6-a3ec-10ee253bc20d/206dae19-7e28-43ed-ba66-708ec6cec392.png"
]

Conceptual Usage Example (Python)

Here's how you might structure a request in Python to execute the Generate Image Using Proteus v0.2 action:

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 = "ceb747b7-38ce-469a-aab2-1e4490431c77"  # Action ID for Generate Image Using Proteus v0.2

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "black fluffy gorgeous dangerous cat animal creature, large orange eyes, big fluffy ears, piercing gaze, full moon, dark ambiance, best quality, extremely detailed",
    "strength": 0.8,
    "loraScale": 0.6,
    "scheduler": "K_EULER_ANCESTRAL",
    "guidanceScale": 7,
    "negativePrompt": "bad quality, bad anatomy, worst quality, low quality, low resolutions, extra fingers, blur, blurry, ugly, wrongs proportions, watermark, image artifacts, lowres, ugly, jpeg artifacts, deformed, noisy image",
    "numberOfOutputs": 1,
    "numberOfInferenceSteps": 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 code snippet, replace the API key and endpoint with your own. The payload is structured according to the action's input schema, ensuring that all necessary fields are included. The action ID is specified to target the correct functionality.

Conclusion

The asiryan/proteus-v0.2 Cognitive Actions empower developers to seamlessly integrate advanced image generation capabilities into their applications. By using the Generate Image Using Proteus v0.2 action, you can create stunning visuals that enhance user engagement and creativity. Consider exploring various configurations to tailor the output to your specific needs. The possibilities are endless, so start experimenting with your image generation projects today!