p-image-lora
Text-to-image generation with custom LoRA weights from HuggingFace
Text-to-image generation with custom LoRA weights from HuggingFace
p-image-lora extends Pruna's p-image model with support for custom LoRA (Low-Rank Adaptation) weights from HuggingFace. Load your own trained LoRAs or community LoRAs to apply unique artistic styles, characters, or concepts to your generations.
Rate Limit: 250 requests per minute
Category: Text-to-Image Generation
Price: 0.005$ / image
Note: LoRAs used with this endpoint must be trained using p-image-trainer. LoRAs trained with other trainers (like p-image-edit-trainer) will not work.
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-image-lora' \
-d '{
"input": {
"prompt": "A portrait in my custom artistic style",
"lora_weights": "huggingface.co/your-username/your-lora-repo",
"lora_scale": 1.0,
"aspect_ratio": "1:1"
}
}'
Response:
{
"id": "abc123xyz",
"model": "p-image-lora",
"input": { ... },
"get_url": "https://api.pruna.ai/v1/predictions/status/abc123xyz"
}
Check status and get results:
curl -X GET 'https://api.pruna.ai/v1/predictions/status/abc123xyz' \
-H 'apikey: YOUR_API_KEY'
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-image-lora' \
-H 'Try-Sync: true' \
-d '{
"input": {
"prompt": "A portrait in my custom artistic style",
"lora_weights": "huggingface.co/your-username/your-lora-repo",
"lora_scale": 1.0,
"aspect_ratio": "1:1"
}
}'
For private LoRA repositories, include your HuggingFace API token:
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-image-lora' \
-d '{
"input": {
"prompt": "A landscape in my custom style",
"lora_weights": "huggingface.co/your-username/private-lora",
"hf_api_token": "hf_xxxxxxxxxxxxxxxxxxxx",
"lora_scale": 1.2
}
}'
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Text prompt for image generation |
| Parameter | Type | Default | Description |
|---|---|---|---|
| lora_weights | string | - | HuggingFace URL to LoRA weights. Format: huggingface.co/<owner>/<model-name>[/<lora-weights-file.safetensors>] |
| lora_scale | number | 1 | How strongly to apply the LoRA. Range: -1 to 3. Use 0.5-0.8 for subtle effects, 1.0 for standard, 1.2-1.5 for stronger effects |
| hf_api_token | string | - | HuggingFace API token for accessing private LoRAs. Get one at https://huggingface.co/settings/tokens |
| Parameter | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | string | "16:9" | Aspect ratio for the image. Options: "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "custom" |
| width | integer | - | Custom width in pixels (256-1440). Only used when aspect_ratio="custom". Must be multiple of 16 |
| height | integer | - | Custom height in pixels (256-1440). Only used when aspect_ratio="custom". Must be multiple of 16 |
| seed | integer | random | Random seed for reproducible generation |
| prompt_upsampling | boolean | false | Upsample the prompt with an LLM for enhanced results |
| disable_safety_checker | boolean | false | Disable safety checker for generated images |