Skip to content

inference.moss-image.sft.flow.img2img.v1

View markdown Try it in the explorer

The inference.moss-image.sft.flow.img2img.v1 job edits an image by following a written instruction, with a fast version of MOSS-Image, OpenMOSS’s open-weight image model. Upload one image and describe the change: recolour an object, change a material, add an element or change the lighting or time of day, while the rest of the image stays as it was.

{
"type": "inference.moss-image.sft.flow.img2img.v1",
"config": {
"image": "car.jpg",
"prompt": "Change the color of the car to bright yellow, keep everything else unchanged."
}
}

Upload one image. Supported formats include JPEG, PNG, WebP, GIF, BMP, TIFF, HEIC/HEIF and AVIF. For animated or multi-page images, the first frame or page is used. For large photographs, JPEG or WebP can reduce upload size. Each side must be 64 to 4096 pixels, with an aspect ratio of at most 4:1. image names the uploaded file; if it is omitted, the only uploaded file is used. The returned job config includes the selected filename. An explicit filename takes precedence when other files are uploaded.

The edited image keeps the input’s aspect ratio at about 1 megapixel (for example 1024x1024 for a square input, 1248x832 for 3:2), with each side a multiple of 16 pixels.

Write the instruction in English and say both what to change and what to keep, e.g. “Make the sofa brown leather, keep the room unchanged.” Specific, local edits (colours, materials, an added object) work best; replacing one object with another or rewriting text in the image is less reliable.

The model reads at most 4096 tokens of the instruction (about 16,000 characters of English, fewer for Chinese); anything beyond that is cut off.

steps (1-50, default 4) trades speed for fidelity. Small local edits are clean from 1-2 steps; larger changes such as a new time of day complete better with 4 or more. Edits change little past about 16 steps.

The same seed reproduces the same edit.

Typical latency on a warm worker is about 0.8 s for a 1 megapixel edit with the default 4 steps.

{
"type": "object",
"required": [
"type",
"config"
],
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"enum": [
"inference.moss-image.sft.flow.img2img.v1"
]
},
"config": {
"type": "object",
"required": [
"prompt"
],
"additionalProperties": false,
"properties": {
"image": {
"type": "string",
"format": "filename",
"examples": [
"input.png"
],
"description": "Filename of the uploaded image to edit. Each side must be 64 to 4096 pixels, with an aspect ratio of at most 4:1. If omitted, the only uploaded file is used.",
"minLength": 1
},
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 16384,
"examples": [
"Change the color of the car to bright yellow, keep everything else unchanged."
],
"description": "The edit instruction, used verbatim: say what to change and what to keep. Text beyond the model's 4096-token limit (about 16,000 characters of English, fewer for Chinese) is cut off."
},
"steps": {
"type": "integer",
"minimum": 1,
"maximum": 50,
"default": 4,
"description": "Number of sampling steps, 1 to 50. 1-2 steps are already sharp; more steps add fine detail (little changes past about 16) and take proportionally longer."
},
"seed": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647,
"description": "Random seed for reproducible results."
}
}
}
}
}