Pixu API v1
API Endpoints
- POST /api/create_model
- POST /api/create_model_from_url
- POST /api/txt2img_strict_portrait
- POST /api/txt2img_composition
- POST /api/txt2img_results
- POST /api/face_info
- POST /api/face_info_url
POST /api/create_model
https://pixu.ai/pixu/api/create_model
Query Parameters
| Name | Type | Description |
|---|---|---|
| api_key | string | API KEY as generated in /accounts page |
| app_uid | string | Unique identifier of your APP if negotiated in contract. Otherwise set to API |
| name (OPTIONAL) | string | Name of your model |
| face_base64 | string | Base64 encoded image of person's face. Only the cropped face should be provided |
| height | int | Desired height in pixels of the face of generated images. Choose between 192 or 136 |
| baseline | int | ID of predefined trained parameters. Choose between 1 or 2 |
callback_url | int | URL that will be called when the model is trained. Pixu will make GET request to the callback url. Model_UID will be appended at the end.
Example: https://my-site.com/callback_create_model/?model_uid= |
Response Fields
| Name | Type | Description |
|---|---|---|
| modelUid | string | Unique identifier of the model being trained |
Example
The following example creates a model:
curl -X POST https://pixu.ai/pixu/api/create_model \
-H "Content-Type: application/json" \
-d '{"api_key":"my_api_key", \
"app_uid":"api", \
"name":"My Model", \
"face_base64" : "base64 encoded cropped face", \
"height" : 192, \
"baseline" : 1, \
"callback_url" : "https://my-site.com/callback_create_model/?model_uid=" \
}'
This would yield the following response:
{
"response": {
"modelUid": "upose_de2d19bbb30703a45df8d0366ec49099"
}
}
When the model is trained Pixu will make this request
curl -X GET https://my-site.com/callback_create_model/?model_uid=upose_de2d19bbb30703a45df8d0366ec49099
POST /api/create_model_from_url
https://pixu.ai/pixu/api/create_model_from_url
Query Parameters
| Name | Type | Description |
|---|---|---|
| api_key | string | API KEY as generated in /accounts page |
| app_uid | string | Unique identifier of your APP if negotiated in contract. Otherwise set to API |
| name (OPTIONAL) | string | Name of your model |
| url | string | URL of photograph of a person. Either face crop or regular photo should be provided. If more than one face is present, extracted face is undeterministic |
| height | int | Desired height in pixels of the face of generated images. Choose between 192 or 136 |
| baseline | int | ID of predefined trained parameters. Choose between 1 or 2 |
callback_url | int | URL that will be called when the model is trained. Pixu will make GET request to the callback url. Model_UID will be appended at the end.
Example: https://my-site.com/callback_create_model/?model_uid= |
Response Fields
| Name | Type | Description |
|---|---|---|
| modelUid | string | Unique identifier of the model being trained |
Example
The following example creates a model:
curl -X POST https://pixu.ai/pixu/api/create_model_from_url \
-H "Content-Type: application/json" \
-d '{"api_key":"my_api_key", \
"app_uid":"api", \
"name":"My Model", \
"url" : "http://images.mysite.com/image1.jpg", \
"height" : 192, \
"baseline" : 2, \
"callback_url" : "https://my-site.com/callback_create_model/?model_uid=" \
}'
This would yield the following response:
{
"response": {
"modelUid": "upose_de2d19bbb30703a45df8d0366ec49099"
}
}
When the model is trained Pixu will make this request
curl -X GET https://my-site.com/callback_create_model/?model_uid=upose_de2d19bbb30703a45df8d0366ec49099
POST /api/txt2img_strict_portrait
https://pixu.ai/pixu/api/txt2img_strict_portrait
Query Parameters
| Name | Type | Description |
|---|---|---|
| api_key | string | API KEY as generated in /accounts page |
| app_uid | string | Unique identifier of your APP if negotiated in contract. Otherwise set to API |
| model_uid | string | Unique identifier of the model. If ommited random face will be generated |
| model_weight | float | Use 1.0 for maximum likeness and lower values for some randomness of the face |
| positive | string | Positive prompt |
| negative | string | Negative prompt |
| resolution | string | Resolution of output images. There are 3 options: 512,512 or 512,768 or 768,512 |
callback_url | int | URL that will be called when images are generated. Pixu will make GET request to the callback url. Request_uid will be appended at the end
Example: https://my-site.com/callback_txt2img/?request_uid= |
Response Fields
| Name | Type | Description |
|---|---|---|
| string | Unique identifier of the model being trained |
Example
The following example creates a model:
curl -X POST https://pixu.ai/pixu/api/txt2img_strict_portrait \
-H "Content-Type: application/json" \
-d '{
"api_key": "my_api_key",
"app_uid" : "api",
"model_uid" : "upose_61d36be5f3ace3e064f7698c49c7fc5b",
"model_weight" : 1.0,
"positive" : "woman in the bar",
"negative" : "(big hands, un-detailed skin, semi-realistic)",
"resolution" : "512,768",
"callback_url" : "https://my-site.com/callback_txt2img/?request_uid="
}'
This would yield the following response:
{
"response": "9d788755c7f5c894c7aca0519b1e46d04b538bdf"
}
When the model is trained Pixu will make this request
curl -X GET https://my-site.com/callback_txt2img/?request_uid=9d788755c7f5c894c7aca0519b1e46d04b538bdf
POST /api/txt2img_composition
https://pixu.ai/pixu/api/txt2img_composition
Query Parameters
| Name | Type | Description |
|---|---|---|
| api_key | string | API KEY as generated in /accounts page |
| app_uid | string | Unique identifier of your APP if negotiated in contract. Otherwise set to API |
| comp_uid | string | Unique identifier of the composition. If ommited, random composition will be used |
| model_uid | string | Unique identifier of the model. If ommited random face will be generated |
| model_weight | float | Use 0.8-0.9 for best results |
| positive | string | Positive prompt |
| negative | string | Negative prompt |
| resolution | string | Resolution of output images. There are 3 options: 512,512 or 512,768 or 768,512 |
callback_url | int | URL that will be called when images are generated. Pixu will make GET request to the callback url. Request_uid will be appended at the end
Example: https://my-site.com/callback_txt2img/?request_uid= |
Response Fields
| Name | Type | Description |
|---|---|---|
| string | Unique identifier of the model being trained |
Example
The following example creates a model:
curl -X POST https://pixu.ai/pixu/api/txt2img_composition \
-H "Content-Type: application/json" \
-d '{
"api_key": "my_api_key",
"app_uid" : "api",
"comp_uid" : "53e7e0eb241903ed48829fbe3b43262a",
"model_uid" : "upose_61d36be5f3ace3e064f7698c49c7fc5b",
"model_weight" : 0.8,
"positive" : "woman in the bar",
"negative" : "(big hands, un-detailed skin, semi-realistic)",
"resolution" : "512,768",
"callback_url" : "https://my-site.com/callback_txt2img/?request_uid="
}'
This would yield the following response:
{
"response": "9d788755c7f5c894c7aca0519b1e46d04b538bdf"
}
When the model is trained Pixu will make this request
curl -X GET https://my-site.com/callback_txt2img/?request_uid=9d788755c7f5c894c7aca0519b1e46d04b538bdf