- 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 information | link ↗ |
| Pricing |
|
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"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/pruna/p-image-edit/watercolor-style.jpg"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}prompt
stringrequiredText instruction describing the desired edit or composition.▶images[]
arrayrequiredminItems: 1maxItems: 5Array of 1-5 reference images. Each entry is an HTTP(S) URL or a base64 data URI (data:image/...;base64,...).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.