usamaehsan/mage-flow-edit-turbo
Mage-Flow-Edit Turbo (4B, MIT) - instruction-based image editing in 4 steps.
Run usamaehsan/mage-flow-edit-turbo with an API
Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.
Input schema
The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.
| Field | Type | Default value | Description |
|---|---|---|---|
| image |
string
|
Image to edit. This is the primary reference: the output shape is derived from THIS image, and any extra reference is resized to match it.
|
|
| image_2 |
string
|
Optional second reference image. The instruction can refer to the inputs as "image 1" / "image 2".
|
|
| image_3 |
string
|
Optional third reference image. Mage-Flow-Edit was trained with up to 3 references; a 4th is not accepted here.
|
|
| prompt |
string
|
An instruction describing the edit.
|
|
| width |
integer
|
1024
Max: 2048 |
Output width. Must be a multiple of 16. Set 0 to keep the input's own size (capped by max_size).
|
| height |
integer
|
1024
Max: 2048 |
Output height. Must be a multiple of 16. Set 0 to keep the input's own size (capped by max_size).
|
| max_size |
integer
|
1024
Min: 256 Max: 2048 |
Long-edge cap used only when width/height are 0.
|
| steps |
integer
|
4
Min: 1 Max: 50 |
Denoise steps. This is the 4-step Turbo checkpoint; above ~4 costs more without improving much.
|
| cfg |
number
|
1
Min: 1 Max: 10 |
Guidance. Turbo is distilled for 1.0 (no CFG); raising it doubles the work per step.
|
| seed |
integer
|
-1
|
Random seed. -1 for random.
|
| debug_timing |
boolean
|
False
|
Log a per-stage time breakdown. Adds GPU syncs, so it slightly inflates the total - use for profiling only.
|
| vl_cond_long_edge |
integer
|
384
Min: 128 Max: 768 |
Long edge the source image is resized to for the text encoder's conditioning pass. 384 matches training.
|
| content_gate |
boolean
|
True
|
Run the model's built-in content gate. It is a full Qwen3-VL generation on every edit (~1s of billed GPU), so turn it off only when the caller already moderates the prompt and the source image upstream.
|
| gate_long_edge |
integer
|
0
Max: 1024 |
Long edge the source image is resized to for the mandatory content gate. 0 = full resolution.
|
| gate_max_tokens |
integer
|
192
Min: 16 Max: 192 |
Token budget for the content gate's verdict. The gate is a greedy VL generation, so this caps its decode loop.
|
| output_format |
None
|
webp
|
Output image format.
|
| output_quality |
integer
|
90
Min: 1 Max: 100 |
Compression quality for WebP and JPEG.
|
{
"type": "object",
"title": "Input",
"required": [
"image",
"prompt"
],
"properties": {
"cfg": {
"type": "number",
"title": "Cfg",
"default": 1,
"maximum": 10,
"minimum": 1,
"x-order": 8,
"description": "Guidance. Turbo is distilled for 1.0 (no CFG); raising it doubles the work per step."
},
"seed": {
"type": "integer",
"title": "Seed",
"default": -1,
"x-order": 9,
"description": "Random seed. -1 for random."
},
"image": {
"type": "string",
"title": "Image",
"format": "uri",
"x-order": 0,
"description": "Image to edit. This is the primary reference: the output shape is derived from THIS image, and any extra reference is resized to match it."
},
"steps": {
"type": "integer",
"title": "Steps",
"default": 4,
"maximum": 50,
"minimum": 1,
"x-order": 7,
"description": "Denoise steps. This is the 4-step Turbo checkpoint; above ~4 costs more without improving much."
},
"width": {
"type": "integer",
"title": "Width",
"default": 1024,
"maximum": 2048,
"minimum": 0,
"x-order": 4,
"description": "Output width. Must be a multiple of 16. Set 0 to keep the input's own size (capped by max_size)."
},
"height": {
"type": "integer",
"title": "Height",
"default": 1024,
"maximum": 2048,
"minimum": 0,
"x-order": 5,
"description": "Output height. Must be a multiple of 16. Set 0 to keep the input's own size (capped by max_size)."
},
"prompt": {
"type": "string",
"title": "Prompt",
"x-order": 3,
"description": "An instruction describing the edit."
},
"image_2": {
"type": "string",
"title": "Image 2",
"format": "uri",
"x-order": 1,
"description": "Optional second reference image. The instruction can refer to the inputs as \"image 1\" / \"image 2\"."
},
"image_3": {
"type": "string",
"title": "Image 3",
"format": "uri",
"x-order": 2,
"description": "Optional third reference image. Mage-Flow-Edit was trained with up to 3 references; a 4th is not accepted here."
},
"max_size": {
"type": "integer",
"title": "Max Size",
"default": 1024,
"maximum": 2048,
"minimum": 256,
"x-order": 6,
"description": "Long-edge cap used only when width/height are 0."
},
"content_gate": {
"type": "boolean",
"title": "Content Gate",
"default": true,
"x-order": 12,
"description": "Run the model's built-in content gate. It is a full Qwen3-VL generation on every edit (~1s of billed GPU), so turn it off only when the caller already moderates the prompt and the source image upstream."
},
"debug_timing": {
"type": "boolean",
"title": "Debug Timing",
"default": false,
"x-order": 10,
"description": "Log a per-stage time breakdown. Adds GPU syncs, so it slightly inflates the total - use for profiling only."
},
"output_format": {
"enum": [
"webp",
"jpg",
"png"
],
"type": "string",
"title": "output_format",
"description": "Output image format.",
"default": "webp",
"x-order": 15
},
"gate_long_edge": {
"type": "integer",
"title": "Gate Long Edge",
"default": 0,
"maximum": 1024,
"minimum": 0,
"x-order": 13,
"description": "Long edge the source image is resized to for the mandatory content gate. 0 = full resolution."
},
"output_quality": {
"type": "integer",
"title": "Output Quality",
"default": 90,
"maximum": 100,
"minimum": 1,
"x-order": 16,
"description": "Compression quality for WebP and JPEG."
},
"gate_max_tokens": {
"type": "integer",
"title": "Gate Max Tokens",
"default": 192,
"maximum": 192,
"minimum": 16,
"x-order": 14,
"description": "Token budget for the content gate's verdict. The gate is a greedy VL generation, so this caps its decode loop."
},
"vl_cond_long_edge": {
"type": "integer",
"title": "Vl Cond Long Edge",
"default": 384,
"maximum": 768,
"minimum": 128,
"x-order": 11,
"description": "Long edge the source image is resized to for the text encoder's conditioning pass. 384 matches training."
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
{
"type": "string",
"title": "Output",
"format": "uri"
}