Create Stunning Graphics with galleri5/icons Cognitive Actions

21 Apr 2025
Create Stunning Graphics with galleri5/icons Cognitive Actions

In the realm of digital design, the ability to quickly generate high-quality visuals is paramount. The galleri5/icons Cognitive Actions offer developers an innovative way to create slick icons and constructivist graphics using advanced image generation techniques. By leveraging the power of SDXL finetune, these actions enable the production of trendy graphics with remarkable precision, enhancing applications with visually appealing content.

Prerequisites

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

  • API Key: You will need a valid API key to access the Cognitive Actions platform. This key is typically included in the request headers to authenticate your API calls.
  • Environment Setup: Familiarity with making HTTP requests in your programming environment (e.g., Python) will be beneficial for implementing these actions.

Cognitive Actions Overview

Generate Slick Icons and Constructivist Graphics

This action allows you to generate stylish icons and flat constructivist graphics optimized for visual appeal. Trained on Bing Generations, it offers refined accuracy in image creation.

  • Category: Image Generation

Input

The input schema for this action is quite comprehensive. Here’s a breakdown of the required and optional fields:

  • prompt (string): A text input guiding the image generation (e.g., "Minimalist colorful cricket cover drive ICON in the style of CONMINMISM").
  • width (integer): The width of the output image in pixels (default: 1024).
  • height (integer): The height of the output image in pixels (default: 1024).
  • refine (string): Style of refinement to apply (default: "no_refiner").
  • loraScale (number): LoRA additive scale factor (default: 0.6).
  • scheduler (string): Type of scheduler for image generation (default: "K_EULER").
  • applyWatermark (boolean): Indicates if a watermark should be applied (default: true).
  • negativePrompt (string): Specifies elements to avoid (default: "").
  • promptStrength (number): Strength of the prompt (default: 0.8).
  • numberOfOutputs (integer): Number of images to generate (default: 1).
  • highNoiseFraction (number): Fraction of noise when using certain refiners (default: 0.8).
  • guidanceScalingFactor (number): Scaling factor for classifier-free guidance (default: 7.5).
  • numberOfInferenceSteps (integer): Steps for the denoising process (default: 50).
  • numberOfRefinementSteps (integer): Steps for refining the base image.
  • mask (string): URI for an input mask (optional).
  • seed (integer): Random seed for generation (optional).
  • modelWeights (string): LoRA weights for image generation (optional).
  • disableImageSafetyChecker (boolean): Turn off the safety checker (default: false, optional).
Example Input
{
  "width": 1024,
  "height": 1024,
  "prompt": "Minimalist colorful cricket cover drive ICON in the style of CONMINMISM",
  "refine": "expert_ensemble_refiner",
  "loraScale": 1,
  "scheduler": "K_EULER_ANCESTRAL",
  "applyWatermark": true,
  "negativePrompt": "SOFT, BLURRY, colorful",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "highNoiseFraction": 0.8,
  "guidanceScalingFactor": 4.96,
  "numberOfInferenceSteps": 50,
  "numberOfRefinementSteps": 20
}

Output

The action typically returns a URL to the generated image. For example:

[
  "https://assets.cognitiveactions.com/invocations/b4a3b916-8362-4e59-a9f5-4870cc3e6e8e/749163c8-22cd-4814-b036-9665bf33c453.png"
]

Conceptual Usage Example (Python)

Here’s a conceptual Python snippet demonstrating how to call the Cognitive Actions execution endpoint for generating slick icons:

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 = "2dce4461-8c86-42ea-b483-d58821c58fe9"  # Action ID for Generate Slick Icons and Constructivist Graphics

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "Minimalist colorful cricket cover drive ICON in the style of CONMINMISM",
    "refine": "expert_ensemble_refiner",
    "loraScale": 1,
    "scheduler": "K_EULER_ANCESTRAL",
    "applyWatermark": True,
    "negativePrompt": "SOFT, BLURRY, colorful",
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "highNoiseFraction": 0.8,
    "guidanceScalingFactor": 4.96,
    "numberOfInferenceSteps": 50,
    "numberOfRefinementSteps": 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, replace the placeholder API key and endpoint with actual credentials. This example demonstrates how to structure the input JSON payload to invoke the action effectively.

Conclusion

The galleri5/icons Cognitive Actions empower developers to create stunning graphics effortlessly. By integrating these actions into your applications, you can enhance user experiences with high-quality visuals tailored to specific themes and styles. Whether you're generating icons for an app or crafting engaging graphics for marketing, these actions provide the tools needed to elevate your design capabilities. Explore the possibilities and start creating today!