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 Midjourney or DALL-E means 50 rounds of copy, paste, download, rename, and upload.
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, and puts the result right in your cell. One formula per image. Drag it down a column and your whole catalog gets visuals in minutes.
Your first AI-generated image
=AIIMAGE("A minimalist product photo of a ceramic coffee mug, white background, soft studio lighting, centered composition")Generates an image from the text description and displays it directly in the cell. Powered by DALL-E 3 or Imagen 4 depending on your selected provider.
That is the whole thing. No API keys to set up on the free tier. No image editor. No downloads. The image lives in your spreadsheet right next to the data it came from.
=AIIMAGE() works with OpenAI (DALL-E 3), Google Gemini (Imagen 4, Gemini 3 Pro Image, Gemini 3.1 Flash Image), and other providers. Your selected provider in Extensions > SheetMagic > Settings controls which model creates the image. Gemini image models also support editing and multi-turn refinement. 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:
=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.
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
=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.
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) and the image regenerates on its own.
Each =AIIMAGE() call uses AI tokens from your plan. Generating 50 images at once works great on paid plans (Solo gets 3M tokens/month). The free tier's 3,000 one-time tokens will cover a few test images. Start small on the free tier, then move to a paid plan when you are ready to go big.
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:
=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:
=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:
=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:
=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?
=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:
=AIIMAGE(AITEXT("Write a DALL-E image 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 generates an optimized image prompt from your product data, then AIIMAGE generates the image. Fully automated -- 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:
=AITEXT("Describe the visual style of the product imagery on this page in 30 words. Include background, lighting, and composition details.", VISIT(A2))Scrapes a competitor page and extracts their visual style. 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. DALL-E 3 (OpenAI) is great at photorealistic product imagery and follows complex layout instructions well. Imagen 4 (Google) is fast and handles stylized illustrations nicely. Gemini 3 Pro Image gives you high-quality generation with editing and refinement. Gemini 3.1 Flash Image is faster and costs less. Switch providers in Extensions > SheetMagic > Settings to try them out.
Edit to regenerate. If an image is not right, tweak column B (your product details) or adjust the prompt template. The formula recalculates on its own and makes a new image.
Getting started
You can try all of this on the free tier. No credit card needed. You get 3,000 AI tokens to start with, which is enough to generate a few test images and see how =AIIMAGE() fits your workflow.
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")
Your first AI-generated image will show up in seconds.
When you are ready for batch generation, paid plans start at $19/month with 3 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.

