Skip to content

ERNIE-Image Trainer

POST/v1/run

Ernie Image Trainer by Baidu - advanced AI model for training. Delivers high-quality results with fast inference, suitable for both creative and production workflows.

Request body

Submit an async generation request. The model field selects the model; other fields are model-specific input parameters.

stringmodelrequired

Model identifier. Set to baidu/ernie-image-trainer.

Default: baidu/ernie-image-trainer

Optional<string>images_data_url

URL to the input data zip archive. The zip should contain pairs of images and corresponding captions. The images should be named: ROOT.EXT. For example: 001.jpg The corresponding captions should be named: ROOT.txt. For example: 001.txt If no text file is provided for an image, the default_caption will be used.

Optional<string>default_caption

Default caption to use when caption files are missing. If None, missing captions will cause an error.

Optional<number>learning_rate

Learning rate.

Default: 0.0005

Optional<integer>steps

Number of steps to train for

Range: 10 to 40000

Default: 2000

Response Schema

The submit endpoint returns an accepted generation task. Poll the result endpoint with the returned id for terminal outputs or errors.

Optional<string>error

Error message if the task failed. Empty on success.

stringidrequired

Unique identifier for the generation task.

Optional<string>model

Model ID used for the prediction.

Optional<array>outputs

Array of generated content. Empty when status is not completed.

stringstatusrequired

Status of the task: pending, running, completed, failed, or timeout.

Allowed values: pending, running, completed, failed, timeout

Model capabilities

array<string>capability_tagsrequired

Capabilities declared by the model registry.

Default: training

stringexecution_moderequired

Execution mode declared by the model registry.

Default: async