Skip to content
Pruna AI logo

P-Image

Text-to-ImagePruna AI

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 informationlink
PricingView pricing in the Cloudflare dashboard

Usage

TypeScript
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)
Lion at Sunset

Examples

Reading Nook — Square-format generation with prompt upsampling.
TypeScript
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)
Reading Nook

Parameters

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.
disable_safety_checker
booleanrequireddefault: falseDisable safety checker for generated images.
height
integermaximum: 1440minimum: 256multipleOf: 16Custom height in pixels (256-1440, multiple of 16). Only used when aspect_ratio="custom".
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.
lora_scale
numberrequireddefault: 0.5maximum: 3minimum: -1How strongly the LoRA should be applied (-1 to 3).
lora_weights
stringLoad LoRA weights. Supports HuggingFace URLs in the format huggingface.co/<owner>/<model-name>[/<file.safetensors>].
prompt
stringrequiredText description of the image to generate. The model automatically enhances prompts for better results.
prompt_upsampling
booleanrequireddefault: falseUpsample the prompt with an LLM for enhanced results.
seed
integermaximum: 9007199254740991minimum: -9007199254740991Random seed for reproducible generation.
width
integermaximum: 1440minimum: 256multipleOf: 16Custom width in pixels (256-1440, multiple of 16). Only used when aspect_ratio="custom".

API Schemas (Raw)

Input
Output