Create Stunning Minimalist Shapes with Cognitive Actions

26 Apr 2025
Create Stunning Minimalist Shapes with Cognitive Actions

In the world of design and creativity, generating unique visuals can often take time and effort. With the "Symbols" service, developers now have access to powerful Cognitive Actions that simplify the creation of curvy minimalist shapes and patterns. By leveraging a fine-tuned SDXL model, this service produces aesthetically pleasing images inspired by South Indian alphabets. The benefits are clear: speed up your design process, enhance your creative projects, and easily integrate stunning visuals into your applications.

Common use cases for these actions include generating backgrounds for websites, creating graphics for marketing materials, or even enhancing user interfaces with unique design elements. Whether you're a developer building a creative app or a designer seeking inspiration, the "Symbols" service can help you achieve your artistic vision effortlessly.

Before diving into the details, ensure you have a Cognitive Actions API key and a basic understanding of making API calls.

Generate Curvy Minimalist Shapes

The "Generate Curvy Minimalist Shapes" action allows developers to create visually striking images that embody simplicity and elegance. By utilizing a specialized model trained with AI-generated images, this action generates curvy shapes and patterns based on your text prompts. This is particularly useful for creating unique design elements that stand out in any project.

Input Requirements

To use this action, you'll need to provide several parameters:

  • Prompt: A text prompt that guides the image generation, such as "In the style of minimalist curvy IDEOGRAM, A single Malayali alphabet."
  • Width and Height: Specify the dimensions of the output image, with a default of 1024 pixels for both.
  • Lora Scale: An optional scale factor for LoRA, which can enhance the generated images.
  • Guidance Scale: This controls the strength of the guidance with a range from 1 to 50.
  • Negative Prompt: An optional input to discourage certain elements in the generated image.
  • Number of Outputs: You can choose to generate between 1 to 4 images.

Expected Output

The output will be a URI link to the generated image, which can be directly used in your applications. For example, a successful response might look like this:

  • https://assets.cognitiveactions.com/invocations/797d69ad-a21d-4eb2-9640-89ac860aa21d/db0a85e5-27b8-4e31-86ca-f49a5435a2e6.png

Use Cases for this specific action

This action is perfect for developers looking to:

  • Enhance websites with unique visual elements.
  • Create custom icons or illustrations for applications.
  • Experiment with generative design to inspire new creative directions.
import requests
import json

# Replace with your actual Cognitive Actions API key and endpoint
# Ensure your environment securely handles the API key
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
# This endpoint URL is hypothetical and should be documented for users
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"

action_id = "55852932-4e7b-46f8-ae7f-4b38f4fed993" # Action ID for: Generate Curvy Minimalist Shapes

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "width": 1024,
  "height": 1024,
  "prompt": "In the style of minimalist curvy IDEOGRAM, A single Malayali alphabet",
  "loraScale": 0.6,
  "addWatermark": true,
  "refineMethod": "no_refiner",
  "guidanceScale": 7.5,
  "negativePrompt": "",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "schedulingMethod": "K_EULER_ANCESTRAL",
  "highNoiseFraction": 0.8,
  "inferenceStepCount": 50
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json",
    # Add any other required headers for the Cognitive Actions API
}

# Prepare the request body for the hypothetical execution endpoint
request_body = {
    "action_id": action_id,
    "inputs": payload
}

print(f"--- Calling Cognitive Action: {action.name or action_id} ---")
print(f"Endpoint: {COGNITIVE_ACTIONS_EXECUTE_URL}")
print(f"Action ID: {action_id}")
print("Payload being sent:")
print(json.dumps(request_body, indent=2))
print("------------------------------------------------")

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json=request_body
    )
    response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully. Result:")
    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 (non-JSON): {e.response.text}")
    print("------------------------------------------------")

Conclusion

The "Symbols" service offers a powerful tool for developers looking to create minimalist shapes and patterns effortlessly. With its easy-to-use interface and customizable parameters, you can generate unique visuals that enhance your projects and spark creativity. By integrating these Cognitive Actions into your workflow, you can save time and focus on what truly matters—bringing your creative ideas to life.

To get started, sign up for your API key and explore the possibilities of generating stunning visuals with the "Symbols" service!