
TL;DR
By connecting a small Python script to OpenAI’s API, you can generate designs in batches instead of doing prompts and downloads manually.
GPT-4o writes the creative image prompt first, then that prompt gets sent to DALL-E 3 to generate and save the image automatically.
At roughly 12–17 cents per image (depending on testing and quality), the economics beat manual design creation by a mile.
Saving each image with a descriptive filename (including the prompt) makes it easy to recreate winners and iterate quickly.
I was about to sit down and crank out AI designs for a print on demand store, one by one by one, like some kind of digital assembly line worker. 💡 Then it hit me, why am I doing this manually when I could just write a script and let it run? So I did. And honestly, it’s too good not to share. 🤙
I fired up a little Python, connected ChatGPT to DALL-E 3, and walked away while it pumped out 85 unique designs into a folder on my desktop. Total cost? About $14.
The whole thing is only 187 lines of code, and I’m going to walk you through exactly how it works so you can do the same thing, even if you’ve never touched a line of code in your life.
Learn how to automate your image creation with AI!
The Problem With Making AI Art One by One
If you’re running a print on demand store, you already know the bottleneck isn’t finding a niche or setting up your Shopify. It’s the designs. You need volume. You need variety.
And if you’re using AI tools like ChatGPT or Midjourney to create them, you’re probably sitting there typing prompts, waiting, downloading, renaming, typing another prompt, waiting again…

It doesn’t scale. It just doesn’t.
I was staring down that exact problem. I’m thinking of starting a POD store focused on skateboarding merchandise, t-shirts, mugs, hats, that kind of thing, and I needed dozens, maybe hundreds of designs.
The thought of generating them manually made me want to close my laptop and go outside.
So instead of doing the boring thing, I built a shortcut.
The Script: What It Actually Does
The core idea here is simpler than you’d think. The script does two things in a loop:
Step 1: It sends a message to GPT-4o (OpenAI’s text model) and basically says, “You’re a creative assistant specializing in generating unique prompts for image design, primarily focused on skateboarding merchandise like t-shirts, mugs, and hats.”
Then it asks GPT to write a detailed, creative image prompt, stuff like “a vintage-inspired t-shirt design with a 70s roller-rink style, limited to three colors: orange, blue, and black, with no background.”
Step 2: That prompt gets automatically sent to DALL-E 3, which generates the image and saves it to a folder.
That’s it. That’s the whole loop. I tell it that it’s a graphic designer and then I tell it to create a prompt and then that prompt is sent over to the image generator DALL-E 3.
The script runs through this cycle as many times as you tell it to. 10 images, 50 images, 200 images. You set it and walk away.
The two-step prompting method (a language model writes the image prompt before sending it to the image model) tends to produce more creative and detailed results than writing DALL-E prompts yourself. It’s like having a creative director between you and the artist.
The Smart File Naming Trick
This is one of those small details that saves you massive headaches later. The script doesn’t just dump images into a folder with generic names like image_001.png.
Instead, it outputs the images into your downloads folder, inside of a folder called Images, and then it appends the name you gave it, the number, and then the prompt as the title, so you can always know what prompt created what in case you want to recreate it.
So a file might be named something like: skateboard_68_vintage-inspired-tshirt-design-70s-roller-rink-style.png
Why does this matter? Because when you’re scrolling through 85 designs trying to pick your winners for your store, you need to know what prompt made what.
And if you find a design style that sells well, you can feed that same prompt back in and generate variations. Without this naming convention, you’re just guessing.
What You Need to Set This Up
Alright, let’s talk about actually doing this. You need a few things, and none of them are complicated.
Requirements
- Python 3.x installed on your computer (free download from python.org)
- An OpenAI API key (sign up at platform.openai.com and add credits)
- A few Python libraries:
openai,requests, and optionallydotenvfor keeping your API key secure - A text editor or IDE — I used PyCharm, but VS Code works fine too
- About 10–15 minutes to get everything set up
Now here’s the thing. Because of AI, you really don’t need to know how to code anything anymore. And I mostly agree with that, but I want to be honest with you.
You do need the basics: install Python, run a script from the command line, and paste in your API key. That’s not really “coding” though, that’s more like following instructions. If you can set up a Shopify store, you can handle this.
The claim that you don’t need to know any code is mostly true, but you still need a working Python environment on your machine. If you’ve never installed Python before, budget an extra 20–30 minutes to follow a setup tutorial. It’s a one-time thing.
You can literally ask ChatGPT to write the entire script for you. Tell it what you want: “write me a Python script that uses GPT-4o to generate creative image prompts for skateboarding merchandise, sends those prompts to the DALL-E 3 API, and saves the resulting images to a folder with descriptive filenames.”
It’ll give you something pretty close to working code. You might need to tweak a few things, but the heavy lifting is done.
The Real Cost Breakdown
This is the part everyone wants to know about, so let me just lay it out.
| Expense | Cost | Notes |
|---|---|---|
| DALL-E 3 image generation | $8.58 | ~85 images at standard quality |
| GPT-4o text prompts | ~$2.00 | API calls for generating design prompts |
| Other API overhead | $0.02 | Minimal additional usage |
| Total | ~$10.60 | For 85 unique designs |
I generated about 85 images and that cost me probably 12 bucks, $14. That breaks down to roughly 12–17 cents per image. Compare that to hiring a designer at $25–50 per design, or even spending 5–10 minutes per image doing it manually. The math is absurd.
Your costs will vary depending on image quality settings. DALL-E 3 offers standard and HD quality, and you can generate at different resolutions (1024×1024, 1024×1792, and 1792×1024). At the time of writing, standard 1024×1024 costs $0.040 per image, standard larger sizes cost $0.080, HD 1024×1024 costs $0.080, and HD larger sizes cost $0.120 per image.
OpenAI updates pricing periodically, so always check their pricing page before you load up your account.
And the API credits are pre-paid, so there’s no surprise bill at the end of the month. You add $20 or $50 to your account and you can literally watch the balance tick down in the OpenAI dashboard as the script runs.
I had the cost dashboard open the whole time I was generating, which is a good habit to get into.
What To Do With 85 AI Designs
So now you’ve got a folder full of images. What next?
You’re not going to use all of them. That’s the point. You’re generating volume so you can cherry-pick the best ones. I went through all 85 and pulled out maybe 15–20 that I actually liked enough to put on merchandise.
Some of them had text issues because AI still struggles with lettering sometimes, but those can often be fixed in Photoshop.
I’m going to go ahead and choose from these and pick out the best ones and then kind of edit them a little bit. If there are any typos I can try to fix that in Photoshop.
The beauty of this approach is that you’re not precious about any single design. If a design is 80% there but has a weird misspelling, you can either fix it or just skip it because you’ve got 84 others to choose from.
That abundance mindset changes how you approach the whole print on demand game.
The goal isn’t to generate 85 perfect designs. The goal is to generate 85 designs so you can find the 15 great ones you’d never have thought of on your own.
Why This Beats Other Approaches
You might be wondering why you wouldn’t just use Midjourney or the ChatGPT interface directly. Those tools are great for one-off designs. But they’re interactive. You type, you wait, you review, you type again. There’s no “set it and forget it.”
With the API approach, the entire process is hands-off. You run the script, go make coffee, come back to a full folder. And because you’re using GPT-4o as your creative director, each prompt is unique. You’re not just running the same prompt 85 times with a different seed.
The other big win is repeatability. Because every filename contains the exact prompt that generated it, you’ve essentially built a database of what works.
Find a design that sells on your store? Pull the prompt from the filename, modify it slightly, run 20 variations. That’s how you turn print on demand from a hobby into a system.

Frequently Asked Questions
Not directly with this script, since Midjourney doesn’t offer an official public API in the same way OpenAI does. You’d need workarounds like Discord bots or third-party automation tools, which add complexity. DALL-E 3’s API is purpose-built for automation, which is why it’s the more straightforward choice here.
Nope. The ChatGPT Plus subscription ($20/month) and the OpenAI API are separate billing systems. You can use the API without a Plus subscription by loading prepaid credits and paying per usage.
DALL-E 3 supports 1024×1024, 1024×1792, and 1792×1024. For t-shirt designs, the vertical 1024×1792 option works well. For mugs or hats, square 1024×1024 is usually your best bet.
These may need upscaling for print (many POD platforms recommend 300 DPI), so you may want to run images through an AI upscaler before uploading.
The designs you create through the DALL-E API are yours to use commercially, per OpenAI’s current usage policies. Each POD platform has its own content policies, and some are stricter about AI-generated content.
Merch by Amazon, for example, has been known to reject or remove listings that appear to be mass-produced or low-quality, so check each platform’s terms before uploading.
DALL-E 3 doesn’t natively output transparent PNGs. The usual trick is to prompt for designs “with no background” or “on a solid white background,” then use a background removal tool like remove.bg or Photoshop to strip out the white.
You can even add a background-removal step into your Python script if you want full automation.
Final Thoughts
I was going to do them through using AI one by one by one, but I thought, well, why don’t I just write a script and it’ll completely create the images for me and save them.
That one thought turned a tedious afternoon into a $14 experiment that produced 85 unique designs. And the script itself? 187 lines. That’s it.
If you’re doing print on demand and you’re still generating designs manually, this is the move. Get Python installed, grab an OpenAI API key, have ChatGPT write you a bulk generation script, and start building your design library at scale.
The hardest part is the initial setup, and after that you’re just pressing run and picking your favorites. The tools are all there, they’re cheap, and honestly the whole process is pretty cool.

















