- Third-party
Pruna's P-Image is an ultra-fast text-to-image model with automatic prompt enhancement and 2-stage refinement, combining exceptional speed with high-quality output and flexible aspect ratios.
| Model Info | |
|---|---|
| More information | link ↗ |
| Pricing |
|
const response = await env.AI.run(
'pruna/p-image',
{
prompt: 'A majestic lion standing on a rocky cliff at sunset, photorealistic, 4k',
aspect_ratio: '16:9',
},
)
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",
"input": {
"prompt": "A majestic lion standing on a rocky cliff at sunset, photorealistic, 4k",
"aspect_ratio": "16:9"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/pruna/p-image/lion-at-sunset.jpg"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Reading Nook — Square-format generation with prompt upsampling.
const response = await env.AI.run(
'pruna/p-image',
{
prompt: 'A cozy reading nook by a rainy window, warm lighting, detailed illustration',
aspect_ratio: '1:1',
prompt_upsampling: true,
},
)
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",
"input": {
"prompt": "A cozy reading nook by a rainy window, warm lighting, detailed illustration",
"aspect_ratio": "1:1",
"prompt_upsampling": true
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/pruna/p-image/reading-nook.jpg"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}prompt
stringrequiredText description of the image to generate. The model automatically enhances prompts for better results.aspect_ratio
stringrequireddefault: 16:9enum: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, customAspect ratio for the image. Use "custom" with width/height for exact dimensions.width
integerminimum: 256maximum: 1440multipleOf: 16Custom width in pixels (256-1440, multiple of 16). Only used when aspect_ratio="custom".height
integerminimum: 256maximum: 1440multipleOf: 16Custom height in pixels (256-1440, multiple of 16). Only used when aspect_ratio="custom".lora_weights
stringLoad LoRA weights. Supports HuggingFace URLs in the format huggingface.co/<owner>/<model-name>[/<file.safetensors>].lora_scale
numberrequireddefault: 0.5minimum: -1maximum: 3How strongly the LoRA should be applied (-1 to 3).hf_api_token
stringHuggingFace API token for accessing private LoRAs. This credential is forwarded verbatim to Pruna. It is only written to gateway request-body logs when the gateway-level collectLogPayload debug flag is explicitly enabled — it never appears in structured analytics logs.prompt_upsampling
booleanrequireddefault: falseUpsample the prompt with an LLM for enhanced results.seed
integerminimum: -9007199254740991maximum: 9007199254740991Random seed for reproducible generation.disable_safety_checker
booleanrequireddefault: falseDisable safety checker for generated images.image
stringformat: uriPresigned URL for the generated image.