Image generation and editing
Generate, edit, and create variations of images through unified APIs.
Overview
AGTCloud provides image generation and editing capabilities. After selecting a model, submit text or image input through the OpenAI Images-compatible API and read the generated result.
Supported tasks
| Task | Description | Main input |
|---|---|---|
| Image generation | Create an image from a text description | Model, prompt |
| Image editing | Modify an existing image or a selected region | Image, prompt, optional mask |
| Image variations | Create alternate versions from a source image | Source image |
Featured models
| Model | Provider | Highlights |
|---|---|---|
| Qwen Image | Alibaba Cloud | Supports creative image workflows with multilingual prompts |
| Seedream | ByteDance | Built for creative visuals, posters, and photorealistic images |
| Wan Image | Alibaba Cloud | Covers text-to-image, image-to-image, and visual creation workflows |
API access
Base URL
https://api.agtcloud.cn/v1Generate an image
curl 'https://api.agtcloud.cn/v1/images/generations' \
-H 'Authorization: Bearer your-api-key' \
-H 'Content-Type: application/json' \
--data '{
"model": "qwen-image",
"prompt": "A modern library overlooking the sea in soft morning light"
}'Edit an image
curl 'https://api.agtcloud.cn/v1/images/edits' \
-H 'Authorization: Bearer your-api-key' \
-F 'model=MODEL_ID' \
-F 'image=@input.png' \
-F 'mask=@mask.png' \
-F 'prompt=Replace the background with a beach at sunrise'Create image variations
curl 'https://api.agtcloud.cn/v1/images/variations' \
-H 'Authorization: Bearer your-api-key' \
-F 'model=MODEL_ID' \
-F 'image=@input.png' \
-F 'n=2'Handle image results
| Response form | Handling |
|---|---|
| URL | Download the image and save it to your own storage when needed |
| Base64 | Decode the value into binary image data and save it |
The response fields depend on the request parameters and model capabilities. For batch output, process each item in data[].