---
title: "p-image-trainer"
url: "https://docs.api.pruna.ai/apis/models-api-0/versions/7dfbc266-0f94-4c90-8518-d9e4d1a245ec/schemas/p-image-trainer"
---

> Full API specification: https://docs.api.pruna.ai/apis/models-api-0/versions/7dfbc266-0f94-4c90-8518-d9e4d1a245ec.md

# p-image-trainer

Train custom LoRA models for use with p-image-lora. The training job returns a zip file containing the trained LoRA weights, which must be uploaded to HuggingFace. Use the HuggingFace repository URL with p-image-lora model. Rate limit: 5 requests per minute.

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: P-API
  version: 0.3.0
servers:
  - url: https://api.pruna.ai
    description: Production server
components:
  schemas:
    p-image-trainer:
      type: object
      required:
        - input
      properties:
        input:
          type: object
          properties:
            steps:
              title: Steps
              default: 1000
              maximum: 5000
              minimum: 100
              multipleOf: 100
              description: Total number of training steps (must be a multiple of 100)
              type: integer
            image_data:
              title: Image Data
              format: uri
              description: Zip archive with images of a consistent style. Use at least 10
                images. The zip can also contain a text file for each image
                (e.g., photo.txt for photo.jpg) to specify edit instructions for
                the image pair. You can also pass a URL pointing to the zip file
                instead of uploading a file directly.
              type: string
            learning_rate:
              title: Learning Rate
              default: 0.0001
              maximum: 0.01
              minimum: 0.00001
              description: Learning rate applied to trainable parameters
              type: number
            training_type:
              enum:
                - content
                - style
                - balanced
              title: training_type
              description: Type of training to perform
              default: balanced
              type: string
            default_caption:
              title: Default Caption
              description: Default caption to use when caption files are missing. If not
                provided and captions are missing, training will fail.
              type: string
          required:
            - image_data
          additionalProperties: false
      description: "Train custom LoRA models for use with p-image-lora. The training
        job returns a zip file containing the trained LoRA weights, which must
        be uploaded to HuggingFace. Use the HuggingFace repository URL with
        p-image-lora model. Rate limit: 5 requests per minute."
```
