107 lines
3.5 KiB
Python
107 lines
3.5 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
AeThex Logo Generator using DALL-E API
|
|
Requires OpenAI API key: export OPENAI_API_KEY="sk-..."
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
try:
|
|
import openai
|
|
except ImportError:
|
|
print("❌ OpenAI library not installed. Install with:")
|
|
print(" pip install openai")
|
|
sys.exit(1)
|
|
|
|
# Logo generation prompts
|
|
PROMPTS = [
|
|
# Minimalist modern
|
|
"minimalist logo for AeThex game engine, purple and cyan gradient, "
|
|
"letter A with network nodes, modern geometric shapes, tech startup style, "
|
|
"white background, flat design, vector art style",
|
|
|
|
# Cloud-native focus
|
|
"logo design for cloud-native game engine, letter A integrated with cloud "
|
|
"and network symbols, purple #8B5CF6 and cyan #06B6D4 colors, "
|
|
"minimalist modern tech aesthetic, white background",
|
|
|
|
# Gaming focus
|
|
"modern logo for game engine called AeThex, abstract geometric A shape, "
|
|
"purple to cyan gradient, gaming and code symbols, clean minimalist design, "
|
|
"professional tech company style, white background",
|
|
|
|
# Connection/multiplayer focus
|
|
"logo with letter A made of connected nodes and lines, representing multiplayer "
|
|
"and cloud connectivity, purple and cyan color scheme, modern minimalist, "
|
|
"tech startup aesthetic, white background, vector style",
|
|
|
|
# Abstract geometric
|
|
"abstract geometric logo for tech platform, triangular A shape with circular "
|
|
"nodes, purple gradient with cyan accents, minimalist modern design, "
|
|
"suitable for game engine brand, white background"
|
|
]
|
|
|
|
def generate_logos(api_key=None, num_variations=3):
|
|
"""Generate logo variations using DALL-E"""
|
|
|
|
if api_key is None:
|
|
api_key = os.getenv('OPENAI_API_KEY')
|
|
|
|
if not api_key:
|
|
print("❌ No OpenAI API key found!")
|
|
print("\nSet your API key:")
|
|
print(" export OPENAI_API_KEY='sk-your-key-here'")
|
|
print("\nOr get one at: https://platform.openai.com/api-keys")
|
|
return
|
|
|
|
openai.api_key = api_key
|
|
output_dir = Path('assets/ai-generated-logos')
|
|
output_dir.mkdir(exist_ok=True)
|
|
|
|
print(f"🎨 Generating {num_variations} logo variations with DALL-E...\n")
|
|
|
|
for i, prompt in enumerate(PROMPTS[:num_variations], 1):
|
|
try:
|
|
print(f"[{i}/{num_variations}] Generating variation {i}...")
|
|
print(f" Prompt: {prompt[:80]}...")
|
|
|
|
response = openai.Image.create(
|
|
prompt=prompt,
|
|
n=1,
|
|
size="1024x1024",
|
|
response_format="url"
|
|
)
|
|
|
|
image_url = response['data'][0]['url']
|
|
print(f" ✓ Generated: {image_url}\n")
|
|
|
|
# Download image
|
|
import urllib.request
|
|
filename = f"logo-variation-{i}.png"
|
|
filepath = output_dir / filename
|
|
urllib.request.urlretrieve(image_url, filepath)
|
|
print(f" ✓ Saved to: {filepath}\n")
|
|
|
|
except Exception as e:
|
|
print(f" ❌ Error: {e}\n")
|
|
|
|
print(f"✅ Done! Check {output_dir}/ for generated logos")
|
|
print("\nNext steps:")
|
|
print("1. Open the images and pick your favorite")
|
|
print("2. Use remove.bg to remove background")
|
|
print("3. Trace in Figma/Inkscape to make vector")
|
|
|
|
def main():
|
|
api_key = os.getenv('OPENAI_API_KEY')
|
|
|
|
if len(sys.argv) > 1:
|
|
num_variations = int(sys.argv[1])
|
|
else:
|
|
num_variations = 3
|
|
|
|
generate_logos(api_key, num_variations)
|
|
|
|
if __name__ == '__main__':
|
|
main()
|