Light Mode
Image to Image
POST
/ api/v1/taskThis is provided as part of the Flux API from PiAPI. available models:
- Qubico/flux1-dev
- Qubico/flux1-schnell
- Qubico/flux1-dev-advanced
Below is an example of image-to-image request and response.
Request
Header Params
X-API-Key
string
required
Your API KEY used for request authorization
Body Params application/json
model
enum<string>
required
the model name
Allowed values:
Qubico/flux1-devQubico/flux1-schnellQubico/flux1-dev-advanced
task_type
enum<string>
required
Allowed value:
img2img
input
object
required
the input param of the flux task
prompt
string
required
image
string
required
config
object
optional
webhook_config
object
optional
Example
{
"model": "Qubico/flux1-schnell",
"task_type": "img2img",
"input": {
"prompt": "a bear",
"image": "https://i.ibb.co/J7ZNgSG/01.jpg"
},
"config": {
"webhook_config": {
"endpoint": "https://webhook.site/xxxx",
"secret": ""
}
}
}
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
code
integer
required
message
string
required
data
object
required
task_id
string
required
model
string
required
task_type
string
required
status
string
required
pending/processing/failed/completed
input
object
required
output
object
required
meta
object
required
logs
array[string]
required
error
object
required
Example
{
"code": 200,
"data": {
"task_id": "1631d053-2352-4add-95cc-360fc52d5f89",
"model": "Qubico/flux1-schnell",
"task_type": "img2img",
"status": "pending",
"config": {
"webhook_config": {
"endpoint": "https://webhook.site/xxxx",
"secret": ""
}
},
"input": {
"prompt": "a bear",
"negative_prompt": "",
"image": "https://i.ibb.co/J7ZNgSG/01.jpg",
"width": 0,
"height": 0,
"steps": 0
},
"output": null,
"meta": {
"created_at": "2024-09-25T07:40:08.333962391Z",
"started_at": "0001-01-01T00:00:00Z",
"ended_at": "0001-01-01T00:00:00Z",
"usage": {
"type": "quota",
"frozen": 0,
"consume": 20000
},
"is_using_private_pool": false
},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
},
"message": "success"
}
Modified at 9 days ago