Generate Stunning Images with the datacte/proteus-v0.1 Cognitive Actions

23 Apr 2025
Generate Stunning Images with the datacte/proteus-v0.1 Cognitive Actions

In today's digital landscape, the demand for high-quality image generation has surged, making tools like the datacte/proteus-v0.1 indispensable for developers. This specification provides a powerful action called Generate Refined Images with Proteus, which leverages advanced models to create visually stunning images with intricate details. By utilizing these pre-built Cognitive Actions, developers can seamlessly integrate sophisticated image generation capabilities into their applications.

Prerequisites

Before diving into the integration of the Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform, which will be used for authenticating your requests.
  • Familiarity with making API calls and handling JSON data.
  • Basic understanding of image processing concepts will be beneficial.

Authentication typically involves passing the API key in the request headers, enabling secure access to the cognitive actions.

Cognitive Actions Overview

Generate Refined Images with Proteus

This action utilizes the ProteusV0.1 model, built on the OpenDalleV1.1, to generate high-quality images with improved facial and stylistic details. It specifically enhances prompt adherence and stylistic capabilities, making it perfect for creating surreal, anime, or cartoonish visuals.

Input

The input schema for this action is structured as follows:

  • mask (string, optional): Input mask URI for inpaint mode. Black areas remain unchanged; white areas are subject to inpainting.
  • seed (integer, optional): Specifies a random seed for image generation. Leave blank for a random seed.
  • image (string, optional): Input image URI for processing in img2img or inpaint mode.
  • width (integer, optional, default: 1024): Width of the output image in pixels.
  • height (integer, optional, default: 1024): Height of the output image in pixels.
  • prompt (string, required): Descriptive text guiding the image generation process.
  • scheduler (string, optional, default: "KarrasDPM"): Scheduling algorithm for image generation.
  • guidanceScale (number, optional, default: 7.5): Scale for classifier-free guidance.
  • applyWatermark (boolean, optional, default: true): Determines if a watermark is applied to the generated image.
  • negativePrompt (string, optional): Descriptive text to exclude certain elements.
  • promptStrength (number, optional, default: 0.8): Influences how much the prompt affects image generation.
  • numberOfOutputs (integer, optional, default: 1): Number of images to generate (max: 4).
  • disableSafetyChecker (boolean, optional, default: false): Option to disable the safety checker for outputs.
  • numberOfInferenceSteps (integer, optional, default: 20): Number of denoising steps in image generation.

Example Input

Here’s an example of the JSON payload that might be sent to the action:

{
  "width": 1024,
  "height": 1024,
  "prompt": "high quality pixel art, a pixel art silhouette of an anime space-themed girl in a space-punk steampunk style, lying in her bed by the window of a spaceship, smoking, with a rustic feel. The image should embody epic portraiture and double exposure, featuring an isolated landscape visible through the window. The colors should primarily be dynamic and action-packed, with a strong use of negative space. The entire artwork should be in pixel art style, emphasizing the characters shape and set against a white background. Silhouette",
  "scheduler": "KarrasDPM",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "negativePrompt": "worst quality, low quality",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "numberOfInferenceSteps": 20
}

Output

Upon successful execution, the action returns a link to the generated image. Here’s an example of what the output may look like:

[
  "https://assets.cognitiveactions.com/invocations/988f3ed9-66c2-4fef-95aa-43a4fc202588/cc4b5e55-0b06-4984-b4bd-b0f2e2191853.png"
]

Conceptual Usage Example (Python)

Here’s how you might call the Generate Refined Images with Proteus action with a conceptual Python example:

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 = "fe3f46ec-f712-437e-9035-d689c904e508" # Action ID for Generate Refined Images with Proteus

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "high quality pixel art, a pixel art silhouette of an anime space-themed girl in a space-punk steampunk style, lying in her bed by the window of a spaceship, smoking, with a rustic feel. The image should embody epic portraiture and double exposure, featuring an isolated landscape visible through the window. The colors should primarily be dynamic and action-packed, with a strong use of negative space. The entire artwork should be in pixel art style, emphasizing the characters shape and set against a white background. Silhouette",
    "scheduler": "KarrasDPM",
    "guidanceScale": 7.5,
    "applyWatermark": True,
    "negativePrompt": "worst quality, low quality",
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "numberOfInferenceSteps": 20
}

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 COGNITIVE_ACTIONS_API_KEY and COGNITIVE_ACTIONS_EXECUTE_URL with your actual API key and the endpoint URL. The input payload is structured using the provided schema, ensuring that all required fields are included.

Conclusion

The datacte/proteus-v0.1 Cognitive Actions provide a robust solution for generating refined images that cater to various artistic styles and requirements. By integrating the Generate Refined Images with Proteus action into your applications, you can enhance user experiences and create visually captivating content. Explore the potential of these actions and consider how they could fit into your future projects!