Nova Canvas boto3 read timeout vs Sume's 30 second wait and 202
The AWS SDK read timeout is 60 s and Amazon suggests 300 s for Nova Canvas. Sume's /v1/images waits 30 s, then returns a 202 job. Handle both in Python.

A Nova Canvas call that times out in boto3 and a Sume call that returns 202 look like the same bug. They are not. One is a client timeout that you set; the other is a documented answer that tells you to poll.
What each side says
| Topic | Nova Canvas via AWS SDK | Sume /v1/images |
|---|---|---|
| Default wait | SDK read_timeout is 60 s | wait_timeout_seconds defaults to 30, the platform ceiling |
| Advice | Amazon recommends at least 300 s | Branch on status code |
| When the wait ends | Client times out | 202 with a job envelope, status_url and result_url |
| Failure | Exception | 502 error envelope with retryable and next_action |
Handle the three answers
On Sume, 200 means images are in the body, 202 means the job is still running, and 502 means it failed. Do not raise a timeout on 202. Poll status_url until the job is terminal, then read result_url. You can also pass mode: "async" to skip the wait, or mode: "webhook" with a webhook_url.
import os, time, requests
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
r = requests.post("https://api.sume.com/v1/images", headers=H, timeout=60, json={
"model": "ideogram/ideogram-v4.5", "quality": "high", "resolution": "2K",
"prompt": "Add soft window light from the left. Keep the product unchanged.",
"input_references": [{"type": "image_url", "image_url": {"url": "https://example.com/lamp.jpg"}}]})
if r.status_code == 200:
print(r.json()["data"][0]["url"])
elif r.status_code == 202:
job = r.json().get("job", r.json())
while True:
s = requests.get(job["status_url"], headers=H, timeout=30).json()
if s.get("status") in ("completed", "failed"):
break
time.sleep(3)
print(s.get("status"), job["result_url"])
else:
print(r.status_code, r.json()["error"]["next_action"])The envelope field names come from the Sume docs on jobs and results; check them against a real 202 before you ship.
Sources
Related posts
More in Developers
- Nova Canvas cfgScale 1.1 to 10 vs Sume: no guidance field
Nova Canvas has a cfgScale from 1.1 to 10, default 6.5. Sume rejects fields a model does not list. How to get the same effect with wording and model choice.
- Nova Canvas returned fewer images than asked: Sume n and data length
Nova Canvas can return fewer images than numberOfImages when moderation blocks some. How to count what you got and what you paid for on Sume.
- Nova Canvas rejects PNGs with transparent pixels: flatten before edits
Nova Canvas needs 8-bit PNG or JPEG with no transparent pixels in the alpha channel. Flatten cutouts onto white before any image edit, here and on Sume.
- Nuxt Nitro server route for an AI video webhook with readRawBody
A Nuxt server/api route calls readRawBody, checks Sume's sume-v1 HMAC and answers 401 on a mismatch before it queues the finished video download.
Written by Sume