Create Stunning Glitch Art with galleri5/nammeh Cognitive Actions

22 Apr 2025
Create Stunning Glitch Art with galleri5/nammeh Cognitive Actions

In the realm of creative applications, the galleri5/nammeh API provides developers with powerful Cognitive Actions that simplify the process of generating unique images. One of the most captivating actions offered is the ability to create images with a funky glitch aesthetic. This action utilizes the SDXL LoRA model, allowing for an innovative approach to image generation with customizable parameters. In this article, we will explore how to effectively integrate this action into your applications, enhancing your creative projects with ease.

Prerequisites

Before diving into the integration, ensure you have the following:

  • An API key for the galleri5/nammeh Cognitive Actions platform.
  • Basic understanding of JSON and HTTP requests.
  • Familiarity with Python for conceptual implementation.

Authentication typically involves passing your API key in the headers of your requests.

Cognitive Actions Overview

Generate Funky Glitch Aesthetic Images

This action allows you to create images with a unique glitch aesthetic. By leveraging the capabilities of the SDXL LoRA model, you can generate images that reflect custom styles without relying on artist references. This is particularly beneficial for designers and developers looking to add innovative visuals to their projects.

Input

The action accepts a variety of parameters, which can be structured as follows:

{
  "mask": "https://example.com/mask.png",
  "seed": 12345,
  "image": "https://example.com/input.jpg",
  "width": 1024,
  "height": 1024,
  "prompt": "Photo in style of NAMMEH, sandeep mannepalli",
  "refine": "no_refiner",
  "scheduler": "K_EULER",
  "addWatermark": false,
  "numberOfOutputs": 1,
  "promptIntensity": 0.8,
  "guidanceMagnitude": 7.5,
  "highNoiseFraction": 0.8,
  "numberOfInferenceSteps": 50,
  "localRecurrentAdditiveScale": 1
}
  • mask: Optional URI for an input mask used in inpaint mode.
  • seed: Optional integer for generating consistent results.
  • image: Optional URI for an input image.
  • width: Width of the output image, default is 1024.
  • height: Height of the output image, default is 1024.
  • prompt: Descriptive text for image generation.
  • refine: Method of refinement, with options like no_refiner.
  • scheduler: Specifies the denoising algorithm.
  • addWatermark: Boolean to apply watermark to the image.
  • numberOfOutputs: Number of images to generate (1-4).
  • promptIntensity: Strength of the prompt influence.
  • guidanceMagnitude: Scale factor for guidance.
  • highNoiseFraction: Proportion of noise for refiners.
  • numberOfInferenceSteps: Iterative steps for denoising.
  • localRecurrentAdditiveScale: Scale factor for Locally Recurrent Additive operations.

Output

Upon successful execution, the action will return an array of image URLs, similar to the following example output:

[
  "https://assets.cognitiveactions.com/invocations/0199ab86-cc39-48e2-91bd-e1a667ba4bff/f666298b-becb-471e-8e73-8a6621b9fff6.png"
]

This output contains the generated images that embody the funky glitch aesthetic as specified in the input.

Conceptual Usage Example (Python)

Here's how you might integrate this action into your Python application:

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 = "b80d9d41-a314-4e12-acca-e5821a620951"  # Action ID for Generate Funky Glitch Aesthetic Images

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "Photo in style of NAMMEH, sandeep mannepalli",
    "refine": "no_refiner",
    "scheduler": "K_EULER",
    "addWatermark": False,
    "numberOfOutputs": 1,
    "promptIntensity": 0.8,
    "guidanceMagnitude": 7.5,
    "highNoiseFraction": 0.8,
    "numberOfInferenceSteps": 50,
    "localRecurrentAdditiveScale": 1
}

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 example, replace "YOUR_COGNITIVE_ACTIONS_API_KEY" with your actual API key. The payload is structured according to the action's input schema, and the response will provide you with the generated images.

Conclusion

By leveraging the galleri5/nammeh Cognitive Actions, specifically the ability to generate funky glitch aesthetic images, developers can enhance their applications with unique visual styles. This action opens up a world of creative possibilities, enabling you to generate customized images with ease. Consider experimenting with different parameters to see how they influence the output, and explore further use cases for integrating this action into your projects. Happy coding!