usamaehsan/flux2-klein-4b-edit
Run usamaehsan/flux2-klein-4b-edit 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 |
array
|
Input image(s). 1 for editing, up to 4 references
|
|
| prompt |
string
|
Edit instruction or generation prompt
|
|
| aspect_ratio |
None
|
custom
|
custom = use width/height. A fixed ratio snaps to a pre-warmed size at `resolution` (fastest). match_input_image = nearest fixed ratio to the first image.
|
| resolution |
None
|
1024
|
Long side for fixed aspect ratios (ignored when aspect_ratio=custom)
|
| width |
integer
|
0
Max: 2048 |
Output width (0 = use input size)
|
| height |
integer
|
0
Max: 2048 |
Output height (0 = use input size)
|
| num_inference_steps |
integer
|
4
Min: 1 Max: 8 |
Steps (model distilled for 4)
|
| guidance_scale |
number
|
1
Max: 10 |
None
|
| seed |
integer
|
Random seed
|
|
| output_format |
None
|
jpg
|
None
|
| output_quality |
integer
|
90
Min: 1 Max: 100 |
None
|
| eager |
boolean
|
False
|
Debug: skip the compiled blocks for this call
|
| sage |
boolean
|
True
|
Debug: false = exact SDPA attention for this call
|
{
"type": "object",
"title": "Input",
"required": [
"prompt"
],
"properties": {
"sage": {
"type": "boolean",
"title": "Sage",
"default": true,
"x-order": 12,
"description": "Debug: false = exact SDPA attention for this call"
},
"seed": {
"type": "integer",
"title": "Seed",
"x-order": 8,
"description": "Random seed"
},
"eager": {
"type": "boolean",
"title": "Eager",
"default": false,
"x-order": 11,
"description": "Debug: skip the compiled blocks for this call"
},
"image": {
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"title": "Image",
"x-order": 0,
"description": "Input image(s). 1 for editing, up to 4 references"
},
"width": {
"type": "integer",
"title": "Width",
"default": 0,
"maximum": 2048,
"minimum": 0,
"x-order": 4,
"description": "Output width (0 = use input size)"
},
"height": {
"type": "integer",
"title": "Height",
"default": 0,
"maximum": 2048,
"minimum": 0,
"x-order": 5,
"description": "Output height (0 = use input size)"
},
"prompt": {
"type": "string",
"title": "Prompt",
"x-order": 1,
"description": "Edit instruction or generation prompt"
},
"resolution": {
"enum": [
512,
768,
1024
],
"type": "integer",
"title": "resolution",
"description": "Long side for fixed aspect ratios (ignored when aspect_ratio=custom)",
"default": 1024,
"x-order": 3
},
"aspect_ratio": {
"enum": [
"custom",
"match_input_image",
"1:1",
"4:5",
"5:4",
"3:4",
"4:3",
"2:3",
"3:2",
"9:16",
"16:9",
"1:2",
"2:1",
"5:7",
"7:5",
"3:5",
"5:3",
"4:7",
"7:4",
"9:21",
"21:9",
"1:3",
"3:1"
],
"type": "string",
"title": "aspect_ratio",
"description": "custom = use width/height. A fixed ratio snaps to a pre-warmed size at `resolution` (fastest). match_input_image = nearest fixed ratio to the first image.",
"default": "custom",
"x-order": 2
},
"output_format": {
"enum": [
"png",
"jpg",
"webp"
],
"type": "string",
"title": "output_format",
"description": "An enumeration.",
"default": "jpg",
"x-order": 9
},
"guidance_scale": {
"type": "number",
"title": "Guidance Scale",
"default": 1,
"maximum": 10,
"minimum": 0,
"x-order": 7
},
"output_quality": {
"type": "integer",
"title": "Output Quality",
"default": 90,
"maximum": 100,
"minimum": 1,
"x-order": 10
},
"num_inference_steps": {
"type": "integer",
"title": "Num Inference Steps",
"default": 4,
"maximum": 8,
"minimum": 1,
"x-order": 6,
"description": "Steps (model distilled for 4)"
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
{
"type": "string",
"title": "Output",
"format": "uri"
}