Image Editing
Edit an existing image by providing a reference image alongside a text prompt describing the desired changes.
CLI
progrok image --ref photo.png "make the sky purple" API
curl -X POST http://localhost:18645/v1/images/edits -H 'Authorization: Bearer anything' -H 'Content-Type: application/json' -d '{
"model": "grok-imagine-image",
"prompt": "make the sky purple",
"image": {"url": "https://example.com/photo.png"},
"aspect_ratio": "1:1",
"resolution": "1k"
}' Use the singular image object for one reference. It accepts a URL or file ID. aspect_ratio and resolution control the output; xAI's native shape does not use size.