Images
AI image generation, editing, variations, upscaling, style transfer, and background removal. Use SeaLink /v1/images/* and choose model capabilities and parameters from the model detail page.
POST /v1/images/generations
AI image generation. The example uses qwen-image-max; use /models and the model detail page for available models, sizes, and response formats.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | qwen-image-max, qwen-image-plus |
| prompt | string | Yes* | Image description; *no if using template_id |
| template_id | string | No | Prompt template ID |
| prompts | array | No | A/B test prompt array, up to 10 |
| n | integer | No | 1 - 10 (default 1) |
| size | string | No | 256x256, 512x512, 1024x1024, 1792x1024, 1024x1792 |
| response_format | string | No | url, b64_json (default url) |
| quality | string | No | standard, hd |
| style | string | No | vivid, natural |
| reference_image | string | No | Reference image base64 or URL |
| tags | array | No | Array of tag strings |
curl https://test.sealink.io/v1/images/generations \-H "Authorization: Bearer <your-sealink-key>" \-H "Content-Type: application/json" \-d '{"model": "qwen-image-max","prompt": "A serene Japanese garden with cherry blossoms, soft morning light","n": 1,"size": "1024x1024","response_format": "url"}'
from openai import OpenAIclient = OpenAI(base_url="https://test.sealink.io/v1",api_key="<your-sealink-key>",)response = client.images.generate(model="qwen-image-max",prompt="A serene Japanese garden with cherry blossoms, soft morning light",n=1,size="1024x1024",)print(response.data[0].url)
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://test.sealink.io/v1",apiKey: "<your-sealink-key>",});const response = await client.images.generate({model: "qwen-image-max",prompt: "A serene Japanese garden with cherry blossoms, soft morning light",n: 1,size: "1024x1024",});console.log(response.data[0].url);
POST /v1/images/edits
Image editing. Edit images using prompts. Supports JSON and multipart/form-data. Multipart files max 10MB.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | qwen-image-edit-max |
| prompt | string | Yes | Edit instruction |
| image / image_url | string | Yes | Source image base64 or URL; multipart mode uses image file field |
| mask / mask_url | string | No | Mask base64 or URL |
| n | integer | No | 1 - 10 |
| size | string | No | 256x256, 512x512, 1024x1024 |
| response_format | string | No | url, b64_json |
# JSON mode — reference image as URLcurl https://test.sealink.io/v1/images/edits \-H "Authorization: Bearer <your-sealink-key>" \-H "Content-Type: application/json" \-d '{"model": "qwen-image-edit-max","image_url": "https://example.com/photo.png","prompt": "Add a rainbow in the sky","n": 1,"size": "1024x1024"}'
from openai import OpenAIclient = OpenAI(base_url="https://test.sealink.io/v1",api_key="<your-sealink-key>",)response = client.images.edit(model="qwen-image-edit-max",image=open("photo.png", "rb"),prompt="Add a rainbow in the sky",n=1,size="1024x1024",)print(response.data[0].url)
import OpenAI from "openai";import fs from "fs";const client = new OpenAI({baseURL: "https://test.sealink.io/v1",apiKey: "<your-sealink-key>",});const response = await client.images.edit({model: "qwen-image-edit-max",image: fs.createReadStream("photo.png"),prompt: "Add a rainbow in the sky",n: 1,size: "1024x1024",});console.log(response.data[0].url);
POST /v1/images/variations
Image variations. Generate variations of an input image with similar style but different content. Multipart/form-data only.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| image | file | Yes | PNG image file, max 10MB, square |
| model | string | No | qwen-image-edit-max |
| n | integer | No | 1 - 10 |
| size | string | No | 256x256, 512x512, 1024x1024 |
# Multipart mode — upload local imagecurl https://test.sealink.io/v1/images/variations \-H "Authorization: Bearer <your-sealink-key>" \-F "image=@photo.png" \-F "model=qwen-image-edit-max" \-F "n=2" \-F "size=1024x1024"
from openai import OpenAIclient = OpenAI(base_url="https://test.sealink.io/v1",api_key="<your-sealink-key>",)response = client.images.create_variation(model="qwen-image-edit-max",image=open("photo.png", "rb"),n=2,size="1024x1024",)print(response.data[0].url)
import OpenAI from "openai";import fs from "fs";const client = new OpenAI({baseURL: "https://test.sealink.io/v1",apiKey: "<your-sealink-key>",});const response = await client.images.createVariation({model: "qwen-image-edit-max",image: fs.createReadStream("photo.png"),n: 2,size: "1024x1024",});console.log(response.data[0].url);
POST /v1/images/upscale
Image upscaling. Enlarge low-resolution images by 2x or 4x with enhanced clarity and detail.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | real-esrgan-x4 |
| image | string | Yes | Source image base64 or URL |
| scale | integer | No | 2 or 4 |
| response_format | string | No | url, b64_json |
curl https://test.sealink.io/v1/images/upscale \-H "Authorization: Bearer <your-sealink-key>" \-H "Content-Type: application/json" \-d '{"model": "real-esrgan-x4","image": "https://example.com/low-res.jpg","scale": 4,"response_format": "url"}'
import requestsres = requests.post("https://test.sealink.io/v1/images/upscale",headers={"Authorization": "Bearer <your-sealink-key>"},json={"model": "real-esrgan-x4","image": "https://example.com/low-res.jpg","scale": 4,"response_format": "url",},)print(res.json()["data"][0]["url"])
const res = await fetch("https://test.sealink.io/v1/images/upscale", {method: "POST",headers: {Authorization: "Bearer <your-sealink-key>","Content-Type": "application/json",},body: JSON.stringify({model: "real-esrgan-x4",image: "https://example.com/low-res.jpg",scale: 4,response_format: "url",}),});const data = await res.json();console.log(data.data[0].url);
POST /v1/images/style-transfer
Style transfer. Apply the artistic style of one image to the content of another.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | ip-adapter |
| image | string | Yes | Content image base64 or URL |
| style_reference | string | Yes | Style reference image base64 or URL |
| strength | number | No | 0 - 1 |
| response_format | string | No | url, b64_json |
curl https://test.sealink.io/v1/images/style-transfer \-H "Authorization: Bearer <your-sealink-key>" \-H "Content-Type: application/json" \-d '{"model": "ip-adapter","image": "https://example.com/content.jpg","style_reference": "https://example.com/style.jpg","strength": 0.7,"response_format": "url"}'
import requestsres = requests.post("https://test.sealink.io/v1/images/style-transfer",headers={"Authorization": "Bearer <your-sealink-key>"},json={"model": "ip-adapter","image": "https://example.com/content.jpg","style_reference": "https://example.com/style.jpg","strength": 0.7,"response_format": "url",},)print(res.json()["data"][0]["url"])
const res = await fetch("https://test.sealink.io/v1/images/style-transfer", {method: "POST",headers: {Authorization: "Bearer <your-sealink-key>","Content-Type": "application/json",},body: JSON.stringify({model: "ip-adapter",image: "https://example.com/content.jpg",style_reference: "https://example.com/style.jpg",strength: 0.7,response_format: "url",}),});const data = await res.json();console.log(data.data[0].url);
POST /v1/images/background-remove
Background removal. Automatically detect and remove image backgrounds, returning a transparent PNG.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | rmbg-v2 |
| image | string | Yes | Source image base64 or URL |
| response_format | string | No | url, b64_json |
curl https://test.sealink.io/v1/images/background-remove \-H "Authorization: Bearer <your-sealink-key>" \-H "Content-Type: application/json" \-d '{"model": "rmbg-v2","image": "https://example.com/product.jpg","response_format": "url"}'
import requestsres = requests.post("https://test.sealink.io/v1/images/background-remove",headers={"Authorization": "Bearer <your-sealink-key>"},json={"model": "rmbg-v2","image": "https://example.com/product.jpg","response_format": "url",},)print(res.json()["data"][0]["url"])
const res = await fetch("https://test.sealink.io/v1/images/background-remove", {method: "POST",headers: {Authorization: "Bearer <your-sealink-key>","Content-Type": "application/json",},body: JSON.stringify({model: "rmbg-v2",image: "https://example.com/product.jpg",response_format: "url",}),});const data = await res.json();console.log(data.data[0].url);