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

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.

API Schemas (Raw)

Input
Output