P-Image LoRA API

pruna-ai/p-image-lora/text-to-imageFrom 1 credit per image· Create Image

P-Image LoRA runs Pruna AI's speed-focused image models with one LoRA file of your choice per request: text-to-image in seven aspect ratios or any custom size up to 1440 pixels a side, and instruction editing with up to five source images.

Call it with the model name pruna-ai/p-image-lora/text-to-image on POST /jobs/createTask, from 1 credit per image ($0.01). New accounts get 30 free credits to try it in the Playground first.

  • Create Image
  • Edit Image
  • Up to 5 reference images
  • 8 aspect ratios
  • Loads your own LoRA

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 haveMode
a written descriptionP-Image LoRA Text to image
one or more pictures to changeP-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 and the file is not reviewed.

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

ParameterRequiredDescription
aspect_ratioNoThe 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
heightNoOutput height in pixels for the custom aspect ratio, 256 to 1440 in steps of 16; 1024 when left out. ≥ 256 · ≤ 1440
lorasNoLoad your own LoRA files to lock in a style or character. Default: []
output_formatNoFile type of the result. jpeg · png · webp · Default: jpeg
promptYesDescribe the subject, clothing, place, light and lens in sentences. Put a LoRA trigger word first.
seedNoReuse the same number to get a repeatable result. ≥ 0 · ≤ 2147483647
widthNoOutput width in pixels for the custom aspect ratio, 256 to 1440 in steps of 16; 1024 when left out. ≥ 256 · ≤ 1440

Pricing

Prices are in credits, the same credits you use on the website (1 credit = $0.01). The hold is taken when the task is accepted and settled to the actual charge when it finishes; failed tasks are refunded.

OptionCredits per image≈ USD
Standard0.9$0.009

Each task is rounded up to whole credits, so one run at the lowest tier costs 1 credit per image ($0.01).

For an exact number before you run, send the same body to POST /jobs/quote.

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

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow- and use the same credits as the website.
  2. 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.
  3. 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.

P-Image LoRA API questions

How much does the P-Image LoRA API cost?

P-Image LoRA starts at 1 credit ($0.01) per image with Create Image, its cheapest task. Credits are the same as on the website (1 credit = $0.01), new accounts get 30 free credits, and failed tasks are refunded.

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.

Which LoRAs work here?

For text-to-image, LoRAs made with Pruna's P-Image trainer, and in our tests community LoRAs trained for Z-Image Turbo saved in the usual diffusers layout. For editing, LoRAs trained for Qwen-Image-Edit. A LoRA for FLUX, an SDXL model or the other endpoint fails the request instead of loading.

Can I load more than one LoRA?

No. The models take one weights file per request. Merge LoRAs into one file beforehand if you need two looks at once.

My LoRA is in a private Hugging Face repository. What can I do?

Upload the .safetensors file somewhere that serves it without a login and use that direct link. We do not take access tokens for third-party accounts.

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?

Yes. The Playground runs P-Image LoRA on your PopNow credits, needs no API key, and shows the matching code for every run.

More about P-Image LoRA