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 a run response. If its status is pending or running, poll GET /v1/run/{id} with the returned opaque ID until it reaches a terminal state.

stringidrequired

Opaque SandBase run identifier. Use it exactly as returned; no prefix is guaranteed.

stringstatusrequired

Current public run status.

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

Optional<string>model

Public SandBase model name used for this run.

Optional<array<object>>outputs

Present only for completed runs. Each object is capability-specific; inspect the selected model schema for its fields.

Optional<object>error

Present only for failed or timeout runs. Contains a public error type and sanitized message.

Optional<string>error.type

Stable public error category.

Optional<string>error.message

Sanitized error message safe to show to clients.

Optional<object>usage

Usage details when available.

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