p-image

Ultra-fast text-to-image generation by Pruna

Overview

P-Image is Pruna's ultra-fast text-to-image model with automatic prompt enhancement and 2-stage refinement. It combines exceptional speed with high-quality output, supporting custom aspect ratios and flexible dimensions. Perfect for high-volume production or when you need both speed and quality.

Rate Limit: 250 requests per minute

Category: Text-to-Image Generation

Price: 0.005$ / image

Quickstart

Asynchronous Request (Default)

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-image' \
  -d '{
    "input": {
      "prompt": "A majestic lion standing on a rocky cliff at sunset",
      "aspect_ratio": "16:9"
    }
  }'

Response:

  {
    "id": "1zww7deyssrme0csqwr90phzzr",
    "model": "p-image",
    "input": { ... },
    "get_url": "https://api.pruna.ai/v1/predictions/status/1zww7deyssrme0csqwr90phzzr"
  }

Check status and get results:

  curl -X GET 'https://api.pruna.ai/v1/predictions/status/1zww7deyssrme0csqwr90phzzr' \
    -H 'apikey: YOUR_API_KEY'

Synchronous Request (Try-Sync)

curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-image' \
-H 'Try-Sync: true' \
-d '{
"input": {
"prompt": "A majestic lion standing on a rocky cliff at sunset",
"aspect_ratio": "16:9"
}
}'

Response (if completed within 60 seconds):

{
"status": "succeeded",
"generation_url": "/v1/predictions/delivery/xezq/52UGYRrRfqViaKmvYsEnENTh0qLDAWHptQ8jOnEHu7XC6AtKA/output.jpg"
}

Parameters

Required Parameters

ParameterTypeDescription
promptstringText description of the image to generate. The model automatically enhances prompts for better results.

Optional Parameters

ParameterTypeDefaultDescription
aspect_ratiostring"16:9"Aspect ratio for the image. Options: "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "custom"
widthinteger-Custom width in pixels (256-1440). Only used when aspect_ratio="custom". Must be multiple of 16.
heightinteger-Custom height in pixels (256-1440). Only used when aspect_ratio="custom". Must be multiple of 16.
seedintegerrandomRandom seed for reproducible generation
disable_safety_checkerbooleanfalseDisable safety checker for generated images