Generate logo concepts using SDXL Lightning. Use when creating brand marks, app icons, project logos, or identity assets from text prompts.
Create logo concepts using SDXL Lightning (4-step) running locally via Python diffusers.
diffusers, transformers, torch, accelerate, safetensors, Pillow, huggingface_hubtorch.cuda.is_available())Agent Forge: Select Image Model or agentForge.imageModelStoragePath setting)Ask the user for:
Build a structured prompt following this pattern:
Subject: [main element], [secondary elements]
Style: flat vector illustration, clean lines, minimal, [additional style cues]
Composition: centered, square format, icon-only (no text)
Color: [specific palette], [background color]
Quality: sharp edges, professional quality, scalable
Negative: photorealistic, 3D render, text, watermark, blurry, busy, complex, low quality
Create a Python script in the project's generated/logo/ directory:
import torch
from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
import os
# Model configuration
# If agentForge.imageModelStoragePath is set, use it as HF_HOME
# Default: ~/.agent-forge/models
MODEL_STORAGE = os.environ.get("HF_HOME", os.path.expanduser("~/.agent-forge/models"))
os.environ["HF_HOME"] = MODEL_STORAGE
BASE_MODEL = "stabilityai/stable-diffusion-xl-base-1.0"
LIGHTNING_REPO = "ByteDance/SDXL-Lightning"
LIGHTNING_CKPT = "sdxl_lightning_4step_unet.safetensors"
# Load pipeline
pipe = StableDiffusionXLPipeline.from_pretrained(
BASE_MODEL, torch_dtype=torch.float16, variant="fp16"
)
pipe.unet.load_state_dict(
load_file(hf_hub_download(LIGHTNING_REPO, LIGHTNING_CKPT), device="cpu")
)
pipe.scheduler = EulerDiscreteScheduler.from_config(
pipe.scheduler.config, timestep_spacing="trailing"
)
pipe = pipe.to("cuda")
# Prompt
PROMPT = "YOUR PROMPT HERE"
NEGATIVE = "photorealistic, 3D, text, watermark, blurry, low quality, complex"
# Generate 4 variations with different seeds
SEEDS = [42, 137, 256, 512]
for seed in SEEDS:
image = pipe(
prompt=PROMPT,
negative_prompt=NEGATIVE,
num_inference_steps=4,
guidance_scale=0.0,
width=1024,
height=1024,
generator=torch.Generator("cuda").manual_seed(seed),
).images[0]
filename = f"logo_seed{seed}.png"
image.save(filename)
print(f"Saved {filename} (seed={seed})")
Always generate at least 4 variations with different seeds.
Show all generated variations to the user:
If the user wants changes:
Once the user selects a logo:
packages/extension/media/)generated/logo/prompts.md| Use Case | Dimensions |
|---|---|
| App icon / logo | 1024x1024 |
| Favicon source | 512x512 |
| Social media profile | 800x800 |
| Wide banner logo | 1024x512 |
HF_HOME to the configured model storage path before loading.