Create Stunning Low-Poly 3D Renders with Cognitive Actions

26 Apr 2025
Create Stunning Low-Poly 3D Renders with Cognitive Actions

In the world of digital art and design, achieving a unique visual style can set your work apart. The "Old School 3D Renders" service provides developers with the tools to generate images that embody a classic low-poly aesthetic, reminiscent of early 3D graphics. With the power of Cognitive Actions, you can create stunning visuals quickly and effortlessly, allowing for endless creative possibilities in your projects.

This service is particularly beneficial for game developers, digital artists, and designers looking to produce vintage-style graphics for their applications. Whether you're crafting assets for a retro-themed game or generating stylized artwork for marketing materials, these cognitive actions can enhance your workflow and output quality.

Prerequisites

Before diving in, ensure you have an API key for the Cognitive Actions service and a basic understanding of making API calls.

Create Old School 3D Render

The "Create Old School 3D Render" action is designed to generate images in a classic low-poly style, leveraging two inference models: 'dev' for detailed outputs and 'schnell' for quicker results. This action allows you to customize various parameters, ensuring that the generated image meets your specific needs.

Purpose

This action solves the problem of creating visually appealing 3D renders that evoke nostalgia, while offering customization options to suit different artistic requirements.

Input Requirements

The input schema for this action requires a "prompt" that guides the image generation process. Other optional parameters include:

  • mask: URI for an image mask in inpainting mode.
  • seed: Optional random seed for consistent results.
  • image: URI of an input image for transformations.
  • model: Choose between 'dev' or 'schnell'.
  • width and height: Specify dimensions when using a custom aspect ratio.
  • aspectRatio: Define the aspect ratio for the output.
  • Additional parameters for quality, output format, and more.

Expected Output

The output will be a rendered image in the specified format (e.g., webp, jpg, png), reflecting the low-poly aesthetic described in the prompt.

Use Cases for this Action

  • Game Development: Create retro-style assets that resonate with players who appreciate nostalgic graphics.
  • Art Projects: Generate unique visuals that stand out in portfolios or exhibitions.
  • Marketing Materials: Design promotional content that leverages a distinctive visual style to attract attention.

```python
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 = "0c2bc7af-f28b-463e-af54-82dd13b0ce94" # Action ID for: Create Old School 3D Render

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "model": "dev",
  "prompt": "An old school 3D render, low poly, of luoyang china in the style of 3DRNDR",
  "loraScale": 1,
  "numOutputs": 1,
  "aspectRatio": "1:1",
  "outputFormat": "webp",
  "guidanceScale": 3.5,
  "outputQuality": 90,
  "extraLoraScale": 1,
  "promptStrength": 0.8,
  "numInferenceSteps": 28
}

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 "Old School 3D Renders" service offers a straightforward yet powerful way to generate captivating low-poly images. With its customizable parameters, you can fine-tune your outputs to match your artistic vision. Whether you're in game development, digital art, or marketing, these cognitive actions can significantly enhance your creative process. 

Consider experimenting with the action today to see how it can elevate your projects and deliver stunning visuals that capture the essence of classic 3D design.