Skip to content
Pruna AI logo

P-Image-Edit

Image-to-Image • Pruna AI

View as MarkdownAgent setup
  • Third-party

Pruna's P-Image-Edit edits and composes 1-5 reference images with text instructions. It supports complex compositions, style transfers, and targeted edits with flexible output aspect ratios.

Model Info
More informationlink ↗
Pricing
  • Per image$0.01

Usage

const response = await env.AI.run(
  'pruna/p-image-edit',
  {
    prompt: 'Transform the subject into a watercolor painting style with vibrant colors',
    images: ['https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg'],
    aspect_ratio: '1:1',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "pruna/p-image-edit",
  "input": {
    "prompt": "Transform the subject into a watercolor painting style with vibrant colors",
    "images": [
      "https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg"
    ],
    "aspect_ratio": "1:1"
  }
}'
Watercolor Style
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/pruna/p-image-edit/watercolor-style.jpg"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

Parameters

prompt
stringrequiredText instruction describing the desired edit or composition.
turbo
booleanrequireddefault: trueRun faster with additional optimizations. For complicated tasks, it is recommended to turn this off.
aspect_ratio
stringrequireddefault: match_input_imageenum: match_input_image, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3Output aspect ratio.
seed
integerminimum: -9007199254740991maximum: 9007199254740991Random seed for reproducible generation.
disable_safety_checker
booleanrequireddefault: falseDisable safety checker for generated images.
image
stringformat: uriPresigned URL for the edited image.

API Schemas (Raw)

Input
Output

Was this helpful?