Create Stunning Game Icons with the Geeklab App Icon Generator

The Geeklab App Icon Generator offers a powerful API designed for developers looking to generate customized game icons. With its suite of Cognitive Actions, developers can create stylized icons for mobile games using specific text prompts and various customization options. The pre-built actions simplify the process of icon creation, allowing for quick integration into applications that require unique and eye-catching visuals.
Prerequisites
To get started with the Geeklab App Icon Generator, you will need:
- An API key for accessing the Cognitive Actions platform.
- Basic knowledge of making HTTP requests and handling JSON data.
Authentication typically involves passing your API key in the headers of your requests to securely access the API.
Cognitive Actions Overview
Generate Game Icons
Description: This action generates customized game icons with flexible options for inpainting, image resizing, and refinement. It is perfect for creating stylized mobile game icons based on user-defined text prompts and additional parameters.
Category: Image Generation
Input
The input schema for the "Generate Game Icons" action requires several parameters to customize the icon generation:
- mask (string, optional): Input mask for inpaint mode. Black areas will be preserved, and white areas will be inpainted.
- seed (integer, optional): Random seed for generating images. Leave empty for a random seed.
- image (string, optional): URI of the input image for processing.
- width (integer, default: 1024): Width of the output image in pixels.
- height (integer, default: 1024): Height of the output image in pixels.
- prompt (string, default: "An astronaut riding a rainbow unicorn"): Text prompt to guide image generation.
- outputCount (integer, default: 1, range: 1-4): Number of images to generate.
- refineStyle (string, default: "no_refiner"): Style of refinement to apply.
- loraIntensity (number, default: 0.6, range: 0-1): Intensity of the Low-Rank Adaptation scale.
- noiseFraction (number, default: 0.8, range: 0-1): Fraction of noise for expert refinement.
- schedulerType (string, default: "KarrasDPM"): Type of scheduler for the generation process.
- applyWatermark (boolean, default: false): Option to apply a watermark.
- negativePrompt (string, optional): Input to specify undesired elements in the image.
- promptStrength (number, default: 0.8, range: 0-1): Influence of the prompt in img2img / inpaint.
- refinementSteps (integer, optional): Steps for refinement.
- guidanceIntensity (number, default: 7.5, range: 1-50): Intensity of classifier-free guidance.
- inferenceStepCount (integer, default: 35, range: 1-500): Steps used during denoising.
- safetyCheckerDisabled (boolean, default: false): Option to disable the safety checker.
Example Input:
{
"width": 1024,
"height": 1024,
"prompt": "3d character, surfer, looking at the camera, smiling, blue waves in the background, sunny beach, summer image of app icon,mobile app icon, stylized, mobile game icon",
"outputCount": 1,
"refineStyle": "no_refiner",
"loraIntensity": 0.6,
"noiseFraction": 0.8,
"schedulerType": "K_EULER_ANCESTRAL",
"applyWatermark": true,
"negativePrompt": "multiple characters,(worst quality:1.5), (low quality:1.5), (normal quality:1.5), lowres, bad anatomy, bad hands, multiple eyebrow, (cropped), extra limb, missing limbs, deformed hands, long neck, long body, (bad hands), signature, username, artist name, conjoined fingers, deformed fingers, ugly eyes, imperfect eyes, skewed eyes, unnatural face, unnatural body, error, painting by bad-artist,nsfw,porn,nudity,sexy",
"promptStrength": 0.8,
"guidanceIntensity": 7.5,
"inferenceStepCount": 40
}
Output
The action typically returns a URL to the generated game icon image.
Example Output:
[
"https://assets.cognitiveactions.com/invocations/9c6b8c13-5a3c-422d-a957-3e4cab43e897/4ec381b5-a1ec-4967-8585-d0783470c2d8.png"
]
Conceptual Usage Example (Python)
Here’s a brief conceptual example of how you might call the "Generate Game Icons" action using Python:
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 = "4b509ee6-61ea-41fc-98af-c0364c8e8d79" # Action ID for Generate Game Icons
# Construct the input payload based on the action's requirements
payload = {
"width": 1024,
"height": 1024,
"prompt": "3d character, surfer, looking at the camera, smiling, blue waves in the background, sunny beach, summer image of app icon,mobile app icon, stylized, mobile game icon",
"outputCount": 1,
"refineStyle": "no_refiner",
"loraIntensity": 0.6,
"noiseFraction": 0.8,
"schedulerType": "K_EULER_ANCESTRAL",
"applyWatermark": True,
"negativePrompt": "multiple characters,(worst quality:1.5), ...",
"promptStrength": 0.8,
"guidanceIntensity": 7.5,
"inferenceStepCount": 40
}
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 YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID is directly tied to the "Generate Game Icons" action, and the input payload is structured according to the specifications above.
Conclusion
The Geeklab App Icon Generator provides developers with a straightforward way to create unique game icons tailored to their specifications. By leveraging the "Generate Game Icons" action, you can enhance your mobile applications with impressive visuals that stand out. Explore the possibilities of customization and start integrating this powerful tool into your projects today!