{ "model_id": "pruna/p-image", "provider_id": "pruna", "name": "P-Image", "description": "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.", "task": "Text-to-Image", "tags": [ "Text-to-Image", "Image Generation" ], "context_length": null, "max_output_tokens": null, "schema_version": "1.0.0", "pricing": { "Per image": 0.005 }, "examples": [ { "name": "Lion at Sunset", "description": "Generate a photorealistic landscape from a text prompt.", "input": { "prompt": "A majestic lion standing on a rocky cliff at sunset, photorealistic, 4k", "aspect_ratio": "16:9" }, "output": { "image": "https://examples.aig.cloudflare.com/pruna/p-image/lion-at-sunset.jpg" }, "raw_response": { "state": "Completed", "result": { "image": "https://examples.aig.cloudflare.com/pruna/p-image/lion-at-sunset.jpg" }, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'pruna/p-image',\n {\n prompt: 'A majestic lion standing on a rocky cliff at sunset, photorealistic, 4k',\n aspect_ratio: '16:9',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"pruna/p-image\",\n \"input\": {\n \"prompt\": \"A majestic lion standing on a rocky cliff at sunset, photorealistic, 4k\",\n \"aspect_ratio\": \"16:9\"\n }\n}'" } ] }, { "name": "Reading Nook", "description": "Square-format generation with prompt upsampling.", "input": { "prompt": "A cozy reading nook by a rainy window, warm lighting, detailed illustration", "aspect_ratio": "1:1", "prompt_upsampling": true }, "output": { "image": "https://examples.aig.cloudflare.com/pruna/p-image/reading-nook.jpg" }, "raw_response": { "state": "Completed", "result": { "image": "https://examples.aig.cloudflare.com/pruna/p-image/reading-nook.jpg" }, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'pruna/p-image',\n {\n prompt: 'A cozy reading nook by a rainy window, warm lighting, detailed illustration',\n aspect_ratio: '1:1',\n prompt_upsampling: true,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"pruna/p-image\",\n \"input\": {\n \"prompt\": \"A cozy reading nook by a rainy window, warm lighting, detailed illustration\",\n \"aspect_ratio\": \"1:1\",\n \"prompt_upsampling\": true\n }\n}'" } ] } ], "default_example": null, "code_snippets": [], "supports_async": false, "zdr": false, "zdr_comment": null, "external_info": "https://docs.api.pruna.ai/guides/quickstart", "terms": null, "cover_image_url": null, "metadata": { "Aspect Ratios": "1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, custom", "Output Formats": "jpg" }, "request_formats": null, "providers": null, "provider_details": [ { "id": "pruna", "pricing": { "output_image_count": 0.005 } } ], "banner": null, "created_at": "2026-06-18 15:45:31", "schema": { "input": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "Text description of the image to generate. The model automatically enhances prompts for better results." }, "aspect_ratio": { "default": "16:9", "description": "Aspect ratio for the image. Use \"custom\" with width/height for exact dimensions.", "type": "string", "enum": [ "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "custom" ] }, "width": { "description": "Custom width in pixels (256-1440, multiple of 16). Only used when aspect_ratio=\"custom\".", "type": "integer", "minimum": 256, "maximum": 1440, "multipleOf": 16 }, "height": { "description": "Custom height in pixels (256-1440, multiple of 16). Only used when aspect_ratio=\"custom\".", "type": "integer", "minimum": 256, "maximum": 1440, "multipleOf": 16 }, "lora_weights": { "description": "Load LoRA weights. Supports HuggingFace URLs in the format huggingface.co//[/].", "type": "string" }, "lora_scale": { "default": 0.5, "description": "How strongly the LoRA should be applied (-1 to 3).", "type": "number", "minimum": -1, "maximum": 3 }, "hf_api_token": { "description": "HuggingFace 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 \u2014 it never appears in structured analytics logs.", "type": "string" }, "prompt_upsampling": { "default": false, "description": "Upsample the prompt with an LLM for enhanced results.", "type": "boolean" }, "seed": { "description": "Random seed for reproducible generation.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "disable_safety_checker": { "default": false, "description": "Disable safety checker for generated images.", "type": "boolean" } }, "required": [ "prompt", "aspect_ratio", "lora_scale", "prompt_upsampling", "disable_safety_checker" ], "additionalProperties": {} }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "image": { "type": "string", "format": "uri", "description": "Presigned URL for the generated image." } }, "required": [ "image" ], "additionalProperties": {} } } }