---
title: "p-image-edit-lora"
description: "Image editing with custom LoRA weights"
url: "https://docs.api.pruna.ai/guides/models/p-image-edit-lora"
image: "https://docs.api.pruna.ai/_og/d/c_Ocean.takumi,title_p-image-edit-lora,description_Image+editing+with+custom+LoRA+weights,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiM3YzNhZWQifX19,p_Ii9ndWlkZXMvbW9kZWxzL3AtaW1hZ2UtZWRpdC1sb3JhIg,s_MO_9O5BS6O4vITLh.png"
---

# p-image-edit-lora

Image editing with custom LoRA weights from HuggingFace

## [Overview](#overview)

p-image-edit-lora extends Pruna's p-image-edit model with support for custom LoRA (Low-Rank Adaptation) weights from HuggingFace. Load your own trained editing LoRAs to apply custom transformations, style transfers, and specialized edits to your images.

**Rate Limit:** 250 requests per minute

**Category:** Image Editing

**Price:** 0.01$ / image

**Note:** LoRAs used with this endpoint must be trained using `p-image-edit-trainer`. LoRAs trained with other trainers (like `p-image-trainer`) will not work.

## [Quickstart](#quickstart)

### [Start with uploading an image](#start-with-uploading-an-image)

```bash
curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/your/file.jpg"
```

Note: Use -F (form) with @ prefix to upload a file from your local filesystem. The file path should be absolute or relative to your current directory.

Response:

```text
{
  "id": "fqadqq42xq",
  "name": "test.jpg",
  "content_type": "image/jpeg",
  "size": 185093,
  "etag": "\"14e9a51deaac6bee2dd8b5c52d7d0b5f\"",
  "checksums": {
    "sha256": "aa10d5d09bcee5cb5d854bd81899308b0cf0c0c50e29d4f00c2c06e51f0e2fe6"
  },
  "metadata": {
    "content_length": 185093,
    "width": 1344,
    "height": 768
  },
  "created_at": "2025-01-08T18:51:26.729Z",
  "expires_at": "2025-01-09T18:51:26.729Z",
  "urls": {
    "get": "https://api.pruna.ai/v1/files/fqadqq42xq"
  }
}
```

### [Image Edit with LoRA (Asynchronous)](#image-edit-with-lora-asynchronous)

```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-image-edit-lora' \
  -d '{
    "input": {
      "prompt": "Apply my custom transformation to image 1",
      "images": ["https://api.pruna.ai/v1/files/fqadqq42xq"],
      "lora_weights": "huggingface.co/your-username/your-edit-lora",
      "lora_scale": 1.0
    }
  }'
```

Response:

```text
{
  "id": "abc123xyz",
  "model": "p-image-edit-lora",
  "input": { ... },
  "get_url": "https://api.pruna.ai/v1/predictions/status/abc123xyz"
}
```

### [Image Edit with LoRA (Synchronous)](#image-edit-with-lora-synchronous)

```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-image-edit-lora' \
  -H 'Try-Sync: true' \
  -d '{
    "input": {
      "prompt": "Apply my custom transformation to image 1",
      "images": ["https://api.pruna.ai/v1/files/fqadqq42xq"],
      "lora_weights": "huggingface.co/your-username/your-edit-lora",
      "lora_scale": 1.0
    }
  }'
```

### [Using a Private HuggingFace LoRA](#using-a-private-huggingface-lora)

For private LoRA repositories, include your HuggingFace API token:

```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-image-edit-lora' \
  -d '{
    "input": {
      "prompt": "Apply the trained style to image 1",
      "images": ["https://api.pruna.ai/v1/files/fqadqq42xq"],
      "lora_weights": "huggingface.co/your-username/private-edit-lora",
      "hf_api_token": "hf_xxxxxxxxxxxxxxxxxxxx",
      "lora_scale": 1.2
    }
  }'
```

### [Parameters](#parameters)

#### [Required Parameters](#required-parameters)

| Parameter | Type   | Description                                                                    |
| :-------- | :----- | :----------------------------------------------------------------------------- |
| prompt    | string | Text prompt describing the edit. Refer to images as "image 1", "image 2", etc. |

#### [Image Parameters](#image-parameters)

| Parameter | Type             | Default | Description                                                                      |
| :-------- | :--------------- | :------ | :------------------------------------------------------------------------------- |
| images    | array of strings |         | Array of image URLs. For editing tasks, provide the main image as the first image |

#### [LoRA Parameters](#lora-parameters)

| Parameter    | Type   | Default | Description                                                                      |
| :----------- | :----- | :------ | :------------------------------------------------------------------------------- |
| lora_weights | string | -       | HuggingFace URL to LoRA weights. Format: huggingface.co/<owner>/<model-name>[/<lora-weights-file.safetensors>] |
| lora_scale   | number | 1       | How strongly to apply the LoRA. Range: -1 to 3                                   |
| hf_api_token | string | -       | HuggingFace API token for accessing private LoRAs                                |

#### [Generation Parameters](#generation-parameters)

| Parameter              | Type    | Default             | Description                                                                      |
| :--------------------- | :------ | :------------------ | :------------------------------------------------------------------------------- |
| turbo                  | boolean | true                | Enable faster optimizations. Set to false for complex tasks requiring more precision |
| aspect_ratio           | string  | "match_input_image" | Output aspect ratio. Options: "match_input_image", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3" |
| seed                   | integer | random              | Random seed for reproducible generation                                          |
| disable_safety_checker | boolean | false               | Disable safety checker for generated images                                      |