If you’re constantly copying the same logo into ten different social‑media sizes, you know how tedious design work can get. The best ai for design isn’t a single magic button—it’s a repeatable pipeline that ties together image generation, layout tweaks, and asset export. By the end of this article you’ll have a working prototype you can run today, or you can grab a ready‑made blueprint from our vault.
What the pipeline actually does
The pipeline takes a short text description, runs it through an image model, applies a brand‑color overlay, resizes the output to preset dimensions, and saves each variant to a folder. Think of it as a tiny factory: you feed it a prompt, it spits out ready‑to‑post assets. No manual cropping, no opening Photoshop for every size.
We’ll use three main pieces: a text‑to‑image model, a simple image‑processing script (Python + Pillow), and a scheduler that triggers the script when a new prompt lands in a Google Sheet. The whole thing runs on a cheap VPS or even a local machine if you prefer.
Why does my AI design workflow break after 50 images?
This is a common snag. The first batch looks great, then the model starts returning distorted faces or off‑brand colors. The root cause is usually token drift: the model’s internal state gets nudged by earlier generations when you call it in a tight loop without clearing context.
Fix: insert a short “reset” call between generations. For most APIs you can simply start a new session or pass an empty seed. In the code example below you’ll see where we add that line.
What most guides get wrong about AI design automation
Many tutorials treat the AI model as a black box you can call forever. They ignore cost, rate limits, and the need for post‑processing. The result? You get a demo that works for five images and then collapses under real usage.
They also skip the branding step. Slapping a logo onto a generated image isn’t enough; you need to adjust hue, saturation, and contrast so the output feels cohesive with your brand guide.
How to debug when the pipeline stops outputting usable assets
First, check the logs. If you see HTTP 429, you’ve hit the model’s rate limit. Pause for a minute or upgrade your plan. If the images are blank, verify your API key hasn’t expired.
Second, look at the raw output from the model before any processing. Save the raw file to a temporary folder and open it. If the model itself is returning nonsense, the problem is upstream—maybe the prompt is too long or contains unsupported characters.
Third, verify your image‑processing library version. Pillow 9.x changed the default resampling filter; older code may produce blurry results. Pin the version in your requirements file.
Concrete example: prompt, tool, and cost
Let’s walk through a real snippet you can copy.
- Sign up for Midjourney (basic plan $10/mo). Get your API key from the developer portal.
- Install the Python dependencies:
pip install requests pillow google‑api‑python‑client
- Create a Google Sheet with a column named “prompt”. Each row is a new design request.
- Use this Python script (save as
design_worker.py):
import requests, json, os, time
from PIL import Image, ImageOps
import gspread
from oauth2client.service_account import ServiceAccountCredentials
# ---- config ----
MJ_API = "https://api.midjourney.com/v1/imagine"
MJ_KEY = os.getenv("MJ_KEY")
SHEET_ID = "your‑sheet‑id"
OUTPUT_DIR = "./output"
os.makedirs(OUTPUT_DIR, exist_ok=True)
# ---- Google Sheets auth ----
scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('creds.json', scope)
client = gspread.authorize(creds)
sheet = client.open_by_key(SHEET_ID).sheet1
while True:
records = sheet.get_all_records()
for i, r in enumerate(records, start=2):
if r.get('processed'):
continue
prompt = r['prompt']
# call Midjourney
headers = {"Authorization": f"Bearer {MJ_KEY}"}
payload = {"prompt": prompt, "width": 1024, "height": 1024}
resp = requests.post(MJ_API, headers=headers, json=payload)
if resp.status_code != 200:
print(f"API error {resp.status_code}: {resp.text}")
continue
image_url = resp.json()['output'][0]
img_data = requests.get(image_url).content
img = Image.open(io.BytesIO(img_data))
# ---- reset model state (simple sleep) ----
time.sleep(1.5)
# brand overlay: apply a tint
tint = Image.new('RGB', img.size, (30, 144, 255)) # dodger blue
img = Image.blend(img, tint, 0.15)
# resize for Instagram (1080x1080)
out = img.resize((1080, 1080), Image.LANCZOS)
out.save(f"{OUTPUT_DIR}/design_{i}.png")
# mark row as processed
sheet.update_cell(i, sheet.find('processed').col, True)
time.sleep(30)
That script pulls a prompt, calls Midjourney, applies a brand tint, resizes, and saves the file. The time.sleep(1.5) line is the reset that prevents drift.
Cost breakdown: Midjourney basic $10/mo gives you ~200 fast hours, enough for roughly 400–600 images depending on complexity. The VPS to run the script can be a $5/mo droplet. So you’re looking at under $20/mo for a fully automated design pipeline.
