---
title: "p-image-edit-text-aware"
description: "Image edit that routes to p-image-edit or nano banana depending on text in the input"
url: "https://docs.api.pruna.ai/guides/models/p-image-edit-text-aware"
image: "https://docs.api.pruna.ai/_og/d/c_Ocean.takumi,title_p-image-edit-text-aware,description_Image+edit+that+routes+to+p-image-edit+or+nano+banana+depending+on+text+in+the+input,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiM3YzNhZWQifX19,p_Ii9ndWlkZXMvbW9kZWxzL3AtaW1hZ2UtZWRpdC10ZXh0LWF3YXJlIg,s_90Cgws7kYH1jL1fL.png"
---

# p-image-edit-text-aware

Same inputs as p-image-edit. Routes to p-image-edit when the input has no text, or nano banana when it does.

## [Overview](#overview)

p-image-edit-text-aware detects text in the input images, then edits with p-image-edit (no text) or nano banana (text). Same request shape as `p-image-edit`. Unlisted: call it with `Model: p-image-edit-text-aware`.

**Rate Limit:** 500 requests per minute

**Category:** Image Editing

**Pricing:** billed from the completed run.

| Routing                       | Price            |
| :---------------------------- | :--------------- |
| No text (has_text=false)      | $0.01 per output |
| Text detected (has_text=true) | $0.03 per output |

## [Quickstart](#quickstart)

### [Upload an image](#upload-an-image)

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

### [Edit (asynchronous)](#edit-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-text-aware' \
  -d '{
    "input": {
      "prompt": "Change the background to a studio backdrop",
      "images": ["https://api.pruna.ai/v1/files/fqadqq42xq"],
      "aspect_ratio": "match_input_image"
    }
  }'
```

### [Synchronous request](#synchronous-request)

```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-text-aware' \
  -H 'Try-Sync: true' \
  -d '{
    "input": {
      "prompt": "Change the background to a studio backdrop",
      "images": ["https://api.pruna.ai/v1/files/fqadqq42xq"]
    }
  }'
```

## [Parameters](#parameters)

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

| Parameter | Type             | Description                                      |
| :-------- | :--------------- | :----------------------------------------------- |
| prompt    | string           | Text instruction describing the desired edit     |
| images    | array of strings | Image URLs to edit. Provide the main image first |

### [Optional Parameters](#optional-parameters)

| Parameter              | Type    | Default             | Description                                                            |
| :--------------------- | :------ | :------------------ | :--------------------------------------------------------------------- |
| aspect_ratio           | string  | "match_input_image" | "match_input_image", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3" |
| turbo                  | boolean | true                | Faster run with extra optimizations; turn off for complicated edits    |
| seed                   | integer | random              | Random seed for reproducible generation                                |
| disable_safety_checker | boolean | false               | Disable safety checker                                                 |