About P-Image LoRA
The P-Image LoRA API offers fast, low-cost LoRA image generation: text to image typically returns in about eight seconds and edits in about eleven. It accepts a single LoRA per request and custom width and height on text to image.
Call it with the model name pruna-ai/p-image-lora/text-to-image on POST /jobs/createTask, from $0.006.
Introduction
P-Image LoRA Text to image draws one image from a written prompt on P-Image, the speed-focused text-to-image model from Pruna AI, with one LoRA file of your choice loaded. Pick one of seven aspect ratios or set a custom size up to 1440 pixels a side.
Choose a mode by starting material
| What you have | Mode |
|---|---|
| a written description | P-Image LoRA Text to image |
| one or more pictures to change | P-Image LoRA Image editing |
Key features
A few seconds per image
Pruna built P-Image for speed. In our tests the model took about three to five seconds per image without a LoRA, and a few seconds more the first time a LoRA file was fetched.
One LoRA, a whole new look
A film-colour LoRA, a flash-snapshot LoRA and a colour pencil LoRA each changed the entire picture in our tests. The LoRA loads from a public link; nothing is uploaded to us in advance.
Custom sizes
Besides seven ratios of about one megapixel, any width and height from 256 to 1440 pixels in steps of 16 work, from square thumbnails to wide 1440 x 608 panoramas.
Request parameters
| Parameter | Required | Description |
|---|---|---|
aspect_ratio | No | The shape of the frame: wide, square or tall. 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · custom · Default: 1:1 |
height | No | Output height in pixels for a custom size. Available limits depend on the model. ≥ 256 · ≤ 1440 |
loras | No | Add LoRA weights compatible with this model to guide its style or character. Default: [] |
output_format | No | File type of the result. jpeg · png · webp · Default: jpeg |
prompt | Yes | Describe what you want to make. |
seed | No | Use the same seed and settings for more controlled comparisons. ≥ 0 · ≤ 2147483647 |
width | No | Output width in pixels for a custom size. Available limits depend on the model. ≥ 256 · ≤ 1440 |
Pricing
Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
| Option | USD per image |
|---|---|
| Standard | $0.006 |
Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.
Use cases
A house style at draft speed
Load one style LoRA, keep its trigger word at the front and run a list of prompts. Every image shares the look and each one takes seconds.
Prompt guide & pro tips
Write sentences
Describe the subject, clothing, place, light and lens. Details such as a brass elevator gate or a starburst chandelier came through as written.
Trigger word first
Style LoRAs expect their trigger at the start of the prompt. Compare the same seed with and without the file to see what the LoRA itself adds.
Pick LoRAs for this model
LoRAs made with the P-Image trainer and, in our tests, community LoRAs trained for Z-Image Turbo loaded. LoRAs for FLUX or SDXL models made the request fail.
API quick start
Call the P-Image LoRA API in three steps
- Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
- Send the request. POST /jobs/createTask with model pruna-ai/p-image-lora/text-to-image and an input object that follows the parameter table. The response returns a task ID straight away.
- Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"model": "pruna-ai/p-image-lora/text-to-image",
"input": {
"prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
"aspect_ratio": "1:1",
"output_format": "jpeg"
}
}'
# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $POPNOW_API_KEY"Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.
What to build with the P-Image LoRA API
- Live LoRA preview in a model hub or style marketplace.
- Fast draft generation in a brand style.
- Custom-dimension banners up to 1440 pixels wide.
P-Image LoRA parameter notes
- loras accepts one entry per request.
- width and height (multiples of 16, 256 to 1440) apply on text to image.
- image_urls on edit takes up to five images; edit loads Qwen Image Edit LoRAs.
- seed and output_format (jpeg, png, webp) on both endpoints.
How P-Image LoRA API pricing adds up
Very low flat prices per image, with edits costing a little more than text to image.
- Create Image: $0.006 per run, $0.60 for 100 runs
Async jobs, webhooks and rate limits
Every P-Image LoRA request is asynchronous: createTask returns a taskId straight away, and the result arrives when the job finishes. Poll GET /jobs/recordInfo every few seconds, or pass a public https callBackUrl and verify the X-Webhook-Signature header (HMAC-SHA256 over taskId, timestamp and the body hash) before trusting the payload. Each account gets 1,000 write requests per 10 seconds; a 429 carries Retry-After. Send an Idempotency-Key with createTask so a retried request for pruna-ai/p-image-lora/text-to-image never runs or bills twice.
Common P-Image LoRA API errors
| errorCode | What it usually means and how to fix it |
|---|---|
invalid_request | More than one LoRA, or width and height not multiples of 16. |
invalid_asset | A private or login-protected LoRA link. |
content_rejected | A refused prompt or image. |
P-Image LoRA API questions
How much does the P-Image LoRA API cost?
P-Image LoRA starts at $0.006 per image with Create Image, its lowest-priced task. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
What is the model name for P-Image LoRA in the API?
Put pruna-ai/p-image-lora/text-to-image for Create Image; pruna-ai/p-image-lora/edit for Edit Image in the model field of POST /jobs/createTask.
How fast is the P-Image LoRA API?
About 8 seconds for text to image and 11 for edits.
Can P-Image LoRA use several LoRAs?
No, one per request.
What custom sizes are allowed?
256 to 1440 pixels per side, in multiples of 16.
What are the limits of the P-Image LoRA API?
Aspect ratios: 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +2; Prompt length (characters): 5,000. Requests outside these limits are rejected before anything is charged.
Can I try P-Image LoRA without writing code?
Run P-Image LoRA in the Playground without an API key, using the same PopNow balance as the website, shown in USD. Each run appears in your developer history with its matching code.
More about P-Image LoRA
- Endpoints
- P-Image LoRA · Edit Image
