P-Image-Edit

P-Image-Edit is Pruna’s performance image editing model, delivering state-of-the-art AI image editing in less than one second.

Designed for professional results, it offers a rare combination of speed, affordability, visual quality, exact prompt adherence, exceptional text rendering, and multi-image editing capabilities, making it the go-to choice when you need fast, precise, and reliable image editing with high control.

Tip

Test it now in the P-Image-Edit Playground.

[Modification] [Change Target] [Preservation]
Add a teddy bear, next to the character reading a book, matching textures while preserving the overall style and keeping all other elements unchanged
Before: Purple prune character in living room
Before
After: With purple teddy bear added
After
  1. Modification Instruction - What change to make? - Add: “add a bird”, “insert clouds”, “place flowers” - Remove: “remove the person”, “eliminate power lines” - Modify: “change color to blue”, “convert to oil painting” - Transform: “transform to Viking”, “change outfit to modern”

  2. Change Target - What to modify? - Be specific: “the woman with red hair”, “the car in the foreground”, “the text on the sign” - Avoid pronouns: Use “the purple prune character” not “it”

  3. Preservation Requirements - What must stay the same? - Identity: “preserve facial features”, “keep same person” - Composition: “maintain exact position”, “keep same pose” - Lighting: “keep same lighting”, “preserve shadows” - Style: “maintain visual consistency”, “keep art style”

Tip

For full prompting guidelines, see the Image Editing guide.

Key Features

P-Image-Edit delivers exceptional performance for image editing with the following key capabilities:

Performance

State-of-the-art AI image editing in 1s for $0.010. P-Image-Edit provides exceptional value with ultra-fast editing times while maintaining high-quality output.

Adherence

Faithful image generation from controllable prompt instructions. The model provides exact prompt adherence for precise results, faithfully following your editing prompts to deliver accurate and consistent image editing.

Text Rendering

Precise, styled text rendering without misspelling. P-Image-Edit excels at rendering and editing text within images with precision and control, delivering highly controlled text generation.

Multi-Image Editing

High control with multiple reference images. The model can seamlessly combine and edit multiple images with precise control over the final output, enabling advanced multi-image editing workflows.

"Change background / object / camera angle"
Performance Example

Tip

For full prompting guidelines, see the Image Editing guide.

Domain Use Cases

Product Photography Example 1
"Change the red Ferrari to a matte black finish with gold racing stripes. And add a racing number '23' and sponsorship decals to the car's doors and hood."
Product Photography Example 2
"Place the red Ferrari speeding on a sun-drenched coastal highway instead of the city."
Product Photography Example 3
"Add a blue motorbike and driver next to the red car. And add a helicopter flying low above the street, with its spotlight on the car."

Tip

For full prompting guidelines, see the Image Generation guide.

Integration

P-Image-Edit integrates seamlessly with Pruna’s API infrastructure. Here’s how to get started:

Tip

For more information on how to use the API, see the API Reference.

API Endpoint

Base URL: https://api.pruna.ai/v1/predictions

Authentication

Include your API key in the request header:

-H 'apikey: YOUR_API_KEY'

File Upload

Before editing images, you’ll need to upload your reference images. P-Image-Edit supports 1-5 images for multi-image editing.

Upload an image:

curl -X POST https://api.pruna.ai/v1/files \
-H 'apikey: YOUR_API_KEY' \
-F 'content=@my-photo.jpg'

Response:

{
    "id": "file-abc123",
    "urls": {
        "get": "https://api.pruna.ai/v1/files/file-abc123"
    }
}

Use the file URL from the response in your editing requests.

Asynchronous (Default)

Submit requests asynchronously for longer-running edits:

curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-image-edit' \
-d '{
    "input": {
        "images": ["https://api.pruna.ai/v1/files/file-abc123"],
        "prompt": "Change the background to a sunset beach scene",
        "aspect_ratio": "16:9"
    }
}'

Response includes a status URL to check progress:

{
    "id": "1zww7deyssrme0csqwr90phzzr",
    "model": "p-image-edit",
    "input": { },
    "get_url": "https://api.pruna.ai/v1/predictions/status/1zww7deyssrme0csqwr90phzzr"
}

Check status by polling the status endpoint:

curl -H 'apikey: YOUR_API_KEY' \
https://api.pruna.ai/v1/predictions/status/1zww7deyssrme0csqwr90phzzr

When completed, download the result:

curl -H 'apikey: YOUR_API_KEY' \
https://api.pruna.ai/v1/predictions/delivery/xezq/abc123.../output.jpg \
-o result.jpg

Synchronous (Try-Sync)

For faster results, use synchronous mode with the Try-Sync: true header:

curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-image-edit' \
-H 'Try-Sync: true' \
-d '{
    "input": {
        "images": ["https://api.pruna.ai/v1/files/file-abc123"],
        "prompt": "Change the background to a sunset beach scene",
        "aspect_ratio": "16:9"
    }
}'

If the editing completes within 60 seconds, you’ll receive the result directly:

{
    "status": "succeeded",
    "generation_url": "https://api.pruna.ai/v1/predictions/delivery/xezq/abc123.../output.jpg"
}

Download your image:

curl -H 'apikey: YOUR_API_KEY' \
https://api.pruna.ai/v1/predictions/delivery/xezq/abc123.../output.jpg \
-o my-image.jpg

Configuration

P-Image-Edit offers flexible configuration options to customize image editing:

Tip

For more information on how to use the API, see the API Reference.

Required Parameters

Parameter

Type

Description

images

array

Array of 1-5 image URLs or base64 encoded images to edit. The source images that will be modified.

prompt

string

Text description of the editing instructions. The model provides exact prompt adherence for precise results, faithfully following your editing prompts to deliver accurate and consistent image editing.

Optional Parameters

Parameter

Type

Default

Description

reference_image

string

“1”

Which image in the images array to use as the primary reference (e.g., “1”, “2”, “3”). Used for multi-image editing to specify the main image.

aspect_ratio

string

“16:9”

Aspect ratio for the edited image. Options: “1:1”, “16:9”, “9:16”, “4:3”, “3:4”, “3:2”, “2:3”, “custom”

width

integer

None

Custom width in pixels (256-1440). Only used when aspect_ratio=”custom”. Must be multiple of 16.

height

integer

None

Custom height in pixels (256-1440). Only used when aspect_ratio=”custom”. Must be multiple of 16.

seed

integer

random

Random seed for reproducible editing

disable_safety_checker

boolean

false

Disable safety checker for edited images

Example Configuration

Single image editing:

{
    "input": {
        "images": ["https://api.pruna.ai/v1/files/file-abc123"],
        "prompt": "Replace the sky with a dramatic stormy sky with lightning",
        "aspect_ratio": "16:9",
        "seed": 42
    }
}

Multi-image editing:

{
    "input": {
        "images": [
            "https://api.pruna.ai/v1/files/file-abc123",
            "https://api.pruna.ai/v1/files/file-def456"
        ],
        "prompt": "Combine the subject from the main image with the background from reference image 2",
        "reference_image": "1",
        "aspect_ratio": "custom",
        "width": 1024,
        "height": 768
    }
}