Google Sheets =IMAGE() with a Sume URL: PNG, JPEG, never SVG
=IMAGE needs a URL with a protocol and rejects SVG and drive.google.com links. Put a Sume data[0].url from a png or jpeg request in a cell and pick a mode.

Put the Sume data[0].url in a cell and wrap it in =IMAGE(A2, 1). Google's IMAGE function help gives the signature IMAGE(url, [mode], [height], [width]), says the URL needs a protocol, says SVG is not supported, and says drive.google.com links are not allowed. Mode 1 fits the image in the cell, 2 stretches it, 3 keeps the original size and 4 takes a custom size.
Sume's image API lists svg among its output_format values in the docs, so do not choose it for a sheet. Ask for png or jpeg, which Sheets can draw.
Which mode should a product grid use?
| Mode | Behaviour | Use it for |
|---|---|---|
1 | Fits inside the cell, keeps the ratio | Thumbnail columns |
2 | Stretches to the cell | Almost never; it distorts |
3 | Original size | Checking real pixels |
4 | Custom height and width | A fixed contact-sheet size |
How do I fill the column from a script?
An Apps Script function can call Sume and write the URL into the sheet, and IMAGE() does the drawing. This one reads a prompt from column A and writes the URL to column B for one row.
function sumeImage(row) {
const sheet = SpreadsheetApp.getActiveSheet();
const prompt = sheet.getRange(row, 1).getValue();
const res = UrlFetchApp.fetch("https://api.sume.com/v1/images", {
method: "post",
contentType: "application/json",
headers: { Authorization: "Bearer " +
PropertiesService.getScriptProperties().getProperty("SUME_API_KEY") },
payload: JSON.stringify({ model: "openai/gpt-image-2.5", prompt: prompt,
quality: "low", output_format: "png" }),
muteHttpExceptions: true,
});
if (res.getResponseCode() !== 200) return;
sheet.getRange(row, 2).setValue(JSON.parse(res.getContentText()).data[0].url);
}Store the key in Script Properties, not in a cell. A 202 leaves the cell empty on purpose in this sketch; the jobs guide explains how to poll status_url for slow requests. If a row triggers a call on edit, add a guard so one edit cannot start two paid generations.
The cell holds only the link. If the sheet is shared widely, remember that anyone who can read it can open the URL, so keep unreleased product art out of a public sheet. For a gallery, set the row height first and use mode 1, then add a second column that holds the prompt, so the picture and the text that produced it stay on one row when you sort.
If you want a lower-cost review pass, ask the sheet for 512 or 1K tiers instead of 4K: the request takes resolution values 512, 1K, 2K and 4K where a model lists them, and the catalog for each model shows which. A thumbnail cell never needs more than a 1K image, and a smaller job is also less likely to run past the 30-second wait and come back as a 202.
Sources
Related posts
More in Integrations
- Google Slides createImage with a Sume URL: use PNG or JPEG
CreateImageRequest takes PNG, JPEG or GIF, up to 50 MB and 25 megapixels, from a public URL of 2 KB or less. Ask Sume for output_format png or jpeg, not WebP.
- GPT-6.1 Sol function calling to start a Sume Agent Completion safely
Expose one function that starts an Agent Completion. Let GPT-6.1 Sol fill instruction and input, and keep the spend cap and idempotency key out of its args.
- Read-only MCP session lists avatars; create gives insufficient_scope
A hosted MCP connection with read scope can list and search avatars, but paid avatar and video tools return insufficient_scope until you grant write.
- jobs_wait defaults to 50 seconds: how many calls for a long render
Remote MCP jobs_wait waits 50 seconds by default and 55 at most. A render that takes N minutes needs about N x 60 / 50 calls on the same ids. Never resubmit.
Written by Sume