Generate 50 Product Images From One Formula in Google Sheets
AIIMAGE turns each row of product data into an AI image and puts a link to it in the cell, saved to your Google Drive. 50 catalog images go from about 4 hours of prompt, download, rename and upload to one dragged formula, so listings and ad tests go live without waiting on a designer.
Phil Nguyen · 13 min read · Updated

=AIIMAGE() turns a text description, or a row of product data, into an AI-generated image and puts a link to it in your cell, with the image saved to your Google Drive. Drag it down 50 rows and you have a first set of catalog images from one formula, so the listings can go live before your designer is free.
You need 50 product images for a new catalog. Your designer is booked for two more weeks. Stock photos all look the same. And making them one by one in a separate image app means 50 rounds of copy, paste, download, rename, and upload. At about 5 minutes a round, that is over 4 hours.
What if you could type a formula into a cell and get an image back? The same way =SUM() gives you a number?
That is what =AIIMAGE() does. It takes a text description, sends it to an image generation model, saves the image to your Drive and puts the link in your cell. One formula per image. Drag it down a column and your whole catalog gets visuals without a single download or upload.
Your first AI-generated image
Formula
=AIIMAGE("A minimalist product photo of a ceramic coffee mug, white background, soft studio lighting, centered composition")Generates an image from the text description, saves it to your Google Drive and returns a link to it in the cell. Powered by GPT Image or a Gemini image model, depending on your selected provider.
That is the whole thing. No API keys to set up. No image editor. No downloads. The link sits in your spreadsheet right next to the data it came from.
Caveat
Generated images are shared as "anyone with the link can view", so the link works in Docs, Slides and other tools. Do not put anything in a prompt you would not want visible to someone who gets the link.
Note
=AIIMAGE() works with OpenAI (GPT Image 2, GPT Image 1.5, GPT Image 1 Mini, ChatGPT Image) and Google Gemini (Gemini 3 Pro Image, Gemini 3.1 Flash Image, Gemini 3.1 Flash-Lite Image). Your selected provider in Extensions > SheetMagic > Open AI Settings controls which model creates the image. You can switch providers anytime. The formula stays the same.
Writing prompts that make usable images
The gap between a generic image and a good one comes down to your prompt. AI image models do best with specific, structured descriptions. Here is a pattern that works well:
Subject + Style + Background + Lighting + Composition
| Element | Weak | Strong |
|---|---|---|
| Subject | "a shoe" | "a white leather running shoe with teal accents" |
| Style | (nothing) | "flat design illustration" or "product photography" |
| Background | (nothing) | "solid white background" or "gradient from navy to black" |
| Lighting | (nothing) | "soft studio lighting" or "natural window light from the left" |
| Composition | (nothing) | "centered, slightly angled, with subtle shadow" |
Put them all together in one prompt:
Formula
=AIIMAGE("Product photography of a white leather running shoe with teal accents, solid white background, soft studio lighting, centered with subtle shadow")A structured prompt that gives the model enough specificity to generate a clean, consistent product image.
Tip
Keep prompts under 75 words. Image models do better with shorter, more specific descriptions than long paragraphs. Focus on what you see, not what you feel.
Batch image generation: 50 product images from a spreadsheet
This is where =AIIMAGE() really shines compared to standalone AI image tools. In Midjourney or ChatGPT, 50 images means 50 separate prompts typed into a chat window. In a spreadsheet, you build the prompt once and let the data fill in the rest.
The setup
| Column A | Column B | Column C |
|---|---|---|
| Product Name | Product Details | Image (formula) |
| Titanium Travel Mug | 16oz, matte black, double-walled | =AIIMAGE(...) |
| Bamboo Cutting Board | 14x10 inches, natural grain, handles | =AIIMAGE(...) |
| Wireless Earbuds Pro | White case, metallic silver buds, compact | =AIIMAGE(...) |
The formula
Formula
=AIIMAGE("Product photography of "&A2&", "&B2&". Solid white background, soft studio lighting, centered composition, e-commerce style.")Concatenates the product name and details into a dynamic prompt. Each row generates a unique image tailored to that product.
That is it. Type this formula in C2, drag it down to C51, and 50 product images generate at the same time. Each one pulls from that row's product name and details, so every image is different.
Note
Keep Formula is on by default. The formula then stays in column C as text and each image link lands in column D, the cell to its right, so keep column D empty. With Keep Formula off, the link replaces the formula in column C. Either way the link is fixed once it lands: editing column B later does not make a new image by itself.
Prepare your product data
Put product names in column A and key visual details (color, material, size, standout features) in column B. The more specific column B is, the better your images will turn out.
Write the formula in C2
Use the formula above, pointing to A2 and B2. Press Enter and wait for the first image. Look at it carefully. If the style is not right, tweak the prompt template before you scale up.
Drag the formula down
Once the first image looks good, grab the fill handle on C2 and drag it down to cover all your products. Each row generates on its own using its own product data.
Refine selectively
Some images will need tweaking. Edit the product details in column B to be more specific (add colors, materials, angles), then re-enter the =AIIMAGE() formula on that row to make a new image.
Caveat
Each =AIIMAGE() call uses AI tokens from your plan. Generating 50 images at once works great on paid plans (Solo gets 3.25M tokens/month). The free tier's 20,000 one-time tokens are less than one image costs on most models, so image work needs a paid plan.
Five use cases beyond product photos
1. Social media visuals at scale
Plan a whole month of social content in your spreadsheet. Then generate matching visuals in the next column:
Formula
=AIIMAGE("Social media graphic for: "&A2&". Modern flat design, vibrant colors, 1:1 aspect ratio, minimal text space at the bottom")A2 contains the post topic. Each row generates a unique social media graphic that matches the content plan.
2. Ad creative variations
Test different visual ideas for the same product by changing up the prompt:
Formula
=AIIMAGE(A2&", "&B2&" style, "&C2&" background, professional advertising photography")A2 has the product, B2 has the style variation (lifestyle, studio, flat lay), C2 has the background color. Mix and match for rapid creative testing.
3. Blog post hero images
Make custom header images for articles instead of reaching for stock photos:
Formula
=AIIMAGE("Blog header illustration for an article about "&A2&". Abstract, modern, blue and purple gradient, wide format, no text")A2 contains the article topic. Generates a unique, on-brand header image.
4. Presentation slide visuals
Build all your slide deck visuals from an outline:
Formula
=AIIMAGE("Clean presentation slide background for the topic: "&A2&". Subtle, professional, light gradient, space for text overlay")Generates slide backgrounds that match each section of your presentation outline.
5. Placeholder mockups for prototyping
Need UI mockups or wireframe-style visuals before the design team gets started?
Formula
=AIIMAGE("Simple wireframe mockup of a mobile app screen showing "&A2&". Black and white, clean lines, minimal UI elements")Quick visual prototypes directly from feature descriptions.
Chaining AIIMAGE with other formulas
Things get really fun when you combine =AIIMAGE() with other SheetMagic formulas. You can let the AI write the image prompt for you, in two columns. AI formulas run in the background and show "Processing..." first, so nesting =AITEXT() inside =AIIMAGE() would send that placeholder as the prompt. Put the prompt writer in its own cell:
Formula
=AITEXT("Write an image generation prompt for a product photo of: "&A2&". Include specific details about style, background, and lighting. Keep it under 50 words. Return only the prompt.", B2)AITEXT writes an image prompt from your product data. Put it in C2. With Keep Formula on (the default), the prompt lands in D2.
Formula
=AIIMAGE(D2)Once the prompt has landed, put this in E2 and point it at the cell holding the prompt (D2 with Keep Formula on, C2 with it off). You provide the product name, the AI handles the rest.
Or scrape a competitor's product page and generate a similar-style image for your own product. Put =VISIT(A2) in its own cell (B2) first, then:
Formula
=AITEXT("Describe the visual style of the product imagery on this page in 30 words. Include background, lighting, and composition details.", B2)Reads the scraped competitor page in B2 and extracts their visual style. VISIT runs in the background, so keep it in its own cell rather than nesting it inside AITEXT. Use this description as a template for your own AIIMAGE prompts.
Tips for consistent results
Use a template prompt. Write one prompt structure and pull in cell data for the parts that change. This keeps your images looking consistent across dozens of rows.
Say what you do not want. Add "no text," "no watermark," or "no people" if those things keep showing up. Negative instructions work well with image models.
Include style references. Phrases like "product photography style," "flat design illustration," "isometric 3D render," and "watercolor painting" are all reliable anchors. They help the model stay consistent.
Pick the right provider for the job. OpenAI gives you GPT Image 2, GPT Image 1.5, GPT Image 1 Mini, and ChatGPT Image (latest). Google gives you Gemini 3 Pro Image, Gemini 3.1 Flash Image, and Gemini 3.1 Flash-Lite Image. Switch providers in Extensions > SheetMagic > Open AI Settings to try them out.
Re-enter to regenerate. If an image is not right, tweak column B (your product details) or adjust the prompt template, then re-enter the formula on that row. A link that has landed does not change by itself, so the image you approved stays put.
What can you do with 50 generated images?
The images earn their keep when they replace a wait or a cost you would otherwise take on:
Launch listings now instead of in two weeks. Use the generated images as placeholders on new product pages and swap in final photos when the designer is free. Products that are listed can sell; products waiting for a photo cannot.
Test ad concepts before paying for a shoot. Generate the lifestyle, studio and flat-lay variants from the ad creative formula above for the same product, run them as small ad tests, and book a real shoot only for the concept that wins.
Fill a month of social posts in one sitting. Put 30 post topics in column A and the social graphic formula in column B. The visuals for the month come from one drag, not 30 sessions in a design app.
Brief your designer with pictures, not paragraphs. Send the links of the three images closest to what you want. The designer starts from a reference, which means fewer revision rounds on the final work.
Before a big batch, generate 10 images, check what they deducted in the dashboard, and multiply. Image cost depends on the model, so the test tells you what 50 or 500 will use before you drag the formula down.
Working with Generated Images
AIIMAGE returns a link to the image in your Google Drive. Here are ways to use it:
Click to view: The link opens the full-resolution image in your browser.
Download: Right-click the link in Sheets and open in a new tab, then save the image.
Embed in documents: Copy the URL into Google Docs, Slides, or any tool that accepts image URLs.
Batch download: For large batches, use the URLs as a download list with any bulk download tool.
Limitations to Know About
AI-generated images aren't perfect. Expect occasional artifacts: extra fingers on hands, distorted text, unusual proportions. For catalog or marketing use, review the batch and regenerate the ones that don't pass quality checks.
Text in images is unreliable. If your prompt includes words you want to appear in the image ("a sign that says SALE"), the result is often misspelled or garbled. Add text overlays separately in a design tool.
Style consistency has limits. While using the same prompt template helps, AI models don't produce pixel-identical styles across generations. For brand-critical work, use generated images as starting points and refine in a design tool.
Generation time. Image generation takes longer per cell than text generation. For batches, see our guide to processing large batches.
Getting started
You can install SheetMagic free, no credit card needed, and try the text formulas above on 20,000 AI tokens. One image on most models costs more than that, so =AIIMAGE() work needs a paid plan.
Note
Ready to try it? Install SheetMagic free, open a spreadsheet, and paste this into any cell:
=AIIMAGE("A friendly robot sitting at a desk using a spreadsheet, digital illustration, soft colors")
A link to your first AI-generated image shows up in the cell once the model finishes.
When you are ready for batch generation, paid plans start at $20/month with 3.25 million AI tokens. See the pricing page for the full breakdown.
For the complete formula reference covering all SheetMagic functions, read the complete guide to AI formulas in Google Sheets. To get started with installation and your first formulas, see getting started with AI in Google Sheets.
Have questions? visit the FAQ for answers about AI formulas, image generation, providers, and billing.
Text and scraping formulas run on the free allowance. Install from the Google Workspace Marketplace, no card, no expiry.
Install free for Google SheetsAbout the author
Phil NguyenPhil builds SheetMagic, the Google Sheets add-on that brings AI and web scraping into the spreadsheet, used by 6,300+ people. He writes these guides from the formulas he runs on his own sheets.
