Create Stunning Logos with profdl/logos Cognitive Actions

In today's digital landscape, having a unique and eye-catching logo is essential for any brand or business. The profdl/logos API provides developers with an incredible toolset of Cognitive Actions designed to generate high-quality logos based on custom text prompts. These pre-built actions allow for flexibility and control over various parameters, making it easy for developers to integrate logo generation capabilities into their applications.
Prerequisites
Before you can start using the Cognitive Actions in the profdl/logos API, you'll need a few things:
- API Key: You'll need to obtain an API key from the Cognitive Actions platform to authenticate your requests. This key should be included in the request headers.
- Setup: Familiarize yourself with the API documentation, which outlines the endpoints and general usage patterns.
Authentication typically involves passing your API key in the headers of your requests, allowing you to securely access the Cognitive Actions.
Cognitive Actions Overview
Generate Logo in Custom Style
Purpose:
The "Generate Logo in Custom Style" action allows you to create logo designs based on specific text prompts. It produces black logos on white backgrounds while offering control over various parameters like size, prompt strength, and refinement methods.
Category:
- Image Generation
Input
The input schema for this action requires the following fields:
- prompt (string): The text prompt guiding image generation. Example:
"iconic logo in the style of logo" - width (integer): Output image width in pixels. Default:
1024 - height (integer): Output image height in pixels. Default:
1024 - refine (string): Style of refinement to apply. Default:
"no_refiner" - negPrompt (string): Elements or styles to exclude. Example:
"cropped, lines, linear, off center, circles, curves, color, texture, light, shading, complex, maximal, too much detail," - scheduler (string): Diffusion scheduler method. Default:
"K_EULER" - modelScale (number): Intensity of LoRA scaling. Default:
0.6 - outputCount (integer): Number of images to generate. Default:
1 - addWatermark (boolean): Whether to add a watermark. Default:
true - guidanceLevel (number): Guidance scale for the prompt. Default:
7.5 - noiseFraction (number): Fraction of noise for refinement. Default:
0.8 - inferenceSteps (integer): Steps used to denoise. Default:
50 - promptIntensity (number): Influence of prompt in img2img or inpaint mode. Default:
0.8
Example Input:
{
"width": 1024,
"height": 1024,
"prompt": "iconic logo in the style of logo",
"refine": "no_refiner",
"negPrompt": "cropped, lines, linear, off center, circles, curves, color, texture, light, shading, complex, maximal, too much detail, ",
"scheduler": "K_EULER_ANCESTRAL",
"modelScale": 1,
"outputCount": 1,
"addWatermark": true,
"guidanceLevel": 7.5,
"noiseFraction": 0.8,
"inferenceSteps": 27,
"promptIntensity": 0.9
}
Output
The action typically returns a list of URLs pointing to the generated logo images.
Example Output:
[
"https://assets.cognitiveactions.com/invocations/ecee1230-131b-4213-be0a-cb52efb04264/8fb06836-2ab0-4f07-b612-762efe63374f.png"
]
Conceptual Usage Example (Python)
Here’s how you might call this Cognitive 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 = "ef747e0f-6d42-4273-923d-d463c21a0959" # Action ID for Generate Logo in Custom Style
# Construct the input payload based on the action's requirements
payload = {
"width": 1024,
"height": 1024,
"prompt": "iconic logo in the style of logo",
"refine": "no_refiner",
"negPrompt": "cropped, lines, linear, off center, circles, curves, color, texture, light, shading, complex, maximal, too much detail, ",
"scheduler": "K_EULER_ANCESTRAL",
"modelScale": 1,
"outputCount": 1,
"addWatermark": true,
"guidanceLevel": 7.5,
"noiseFraction": 0.8,
"inferenceSteps": 27,
"promptIntensity": 0.9
}
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 the placeholder with your actual API key and adjust the payload as needed. The action ID corresponds to the "Generate Logo in Custom Style" action, and the endpoint URL is illustrative.
Conclusion
The profdl/logos API provides powerful tools for logo generation, allowing developers to create custom designs tailored to their specifications. By utilizing the "Generate Logo in Custom Style" action, you can incorporate stunning visual branding into your applications quickly and efficiently. Start experimenting with different prompts and parameters to unlock the full potential of this API!