Grok Imagine takes JPG or PNG up to 20 MiB: convert iPhone HEIC
xAI lists jpg, jpeg and png inputs up to 20 MiB for Grok Imagine. iPhone HEIC photos need converting first; here is a short script before an edit on Sume.

xAI's models page says supported image file types are jpg/jpeg or png, with a maximum image size of 20 MiB. iPhones often save HEIC, which is not on that list, so convert before you send. The same habit helps on the Sume image API, whose reference URLs must be public HTTPS and which does not document HEIC as an input.
What the vendor says
From xAI's models page.
| Item | What the page says |
|---|---|
| File types | jpg/jpeg or png. |
| Maximum size | 20MiB. |
| Price | grok-imagine-image $0.02, grok-imagine-image-2.0 $0.04, grok-imagine-image-quality $0.05 per image. |
Convert and check
The script converts HEIC to JPEG and checks the size limit. It uses pillow-heif, installed with pip install pillow pillow-heif.
import os, sys
from PIL import Image
from pillow_heif import register_heif_opener
register_heif_opener()
src = sys.argv[1]
dst = os.path.splitext(src)[0] + ".jpg"
Image.open(src).convert("RGB").save(dst, quality=90)
size = os.path.getsize(dst)
print(dst, size, "ok" if size <= 20 * 1024 * 1024 else "too large")Then host it
After conversion, upload the file somewhere public over HTTPS and use that URL as an input_references entry. Localhost, private-network and non-HTTPS URLs are rejected before submission.
If the file is too large
Resize the long edge and lower the JPEG quality until it is under the limit. Check the edited result to make sure the smaller source still holds the detail you need.
Sources
Related posts
More in Developers
- Grok Imagine extension: duration is added seconds; Sume's chain
xAI's /v1/videos/extensions duration counts only the new seconds, so 10s plus 5 returns 15s. Sume has no extend call here: chain clips from the last frame.
- MiniMax H3 Max lip sync audio_url: Sume media host only
Sume's MiniMax H3 Max Lip Sync takes a public HTTPS audio_url on the Sume media host, 5 to 14.8 seconds, max 10 MB. Other hosts are rejected.
- MiniMax H3 Max lip sync: 1080p max, no 2K, speed_tier ignored
Sume's MiniMax H3 Max Lip Sync offers 480p, 768p (default) and 1080p; 2K is not offered, and speed_tier is accepted but ignored.
- MiniMax H3 Max lip sync image aspect ratio: 0.4 to 2.5
The still for Sume's MiniMax H3 Max Lip Sync must have an aspect ratio between 0.4 and 2.5. That covers 9:16 through 21:9 if ratio means width over height.
Written by Sume