flux-dev-lora

Text-to-image and image-to-image generation with custom LoRA weights from HuggingFace

Overview

flux-dev-lora extends the Flux.1-dev model with support for custom LoRA (Low-Rank Adaptation) weights from HuggingFace. This allows you to apply specialized styles, techniques, or character designs to your generations. It supports both text-to-image and image-to-image workflows.

Rate Limit: 150 requests per minute

Category: Image Editing

Price: 0.01$ / image

Quickstart

Text-to-Image with LoRA (Asynchronous)

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: flux-dev-lora' \
  -d '{
    "input": {
      "prompt": "Long toons, a close-up of a cartoon character with a red backdrop",
      "lora": "prithivMLmods/Flux-Long-Toon-LoRA",
      "lora_scale": 1,
      "aspect_ratio": "1:1",
      "num_inference_steps": 28
    }
  }'

Text-to-Image with LoRA (Synchronous)

  curl -X POST 'https://api.pruna.ai/v1/predictions' \
    -H 'Content-Type: application/json' \
    -H 'apikey: YOUR_API_KEY' \
    -H 'Model: flux-dev-lora' \
    -H 'Try-Sync: true' \
    -d '{
      "input": {
        "prompt": "Long toons, a close-up of a cartoon character with a red backdrop",
        "lora": "prithivMLmods/Flux-Long-Toon-LoRA",
        "lora_scale": 1,
        "aspect_ratio": "1:1",
        "num_inference_steps": 28
      }
    }'

Image-to-Image with LoRA

Start with uploading an image

curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/your/file.jpg"

Note: Use -F (form) with @ prefix to upload a file from your local filesystem. The file path should be absolute or relative to your current directory.

Response:

{
  "id": "fqadqq42xq",
  "name": "test.jpg",
  "content_type": "image/jpeg",
  "size": 185093,
  "etag": "\"14e9a51deaac6bee2dd8b5c52d7d0b5f\"",
  "checksums": {
    "sha256": "aa10d5d09bcee5cb5d854bd81899308b0cf0c0c50e29d4f00c2c06e51f0e2fe6"
  },
  "metadata": {
    "content_length": 185093,
    "width": 1344,
    "height": 768
  },
  "created_at": "2025-01-08T18:51:26.729Z",
  "expires_at": "2025-01-09T18:51:26.729Z",
  "urls": {
    "get": "https://api.pruna.ai/v1/files/fqadqq42xq"
  }
}

Use the image in urls/get in the "image" input field

  curl -X POST 'https://api.pruna.ai/v1/predictions' \
    -H 'Content-Type: application/json' \
    -H 'apikey: YOUR_API_KEY' \
    -H 'Model: flux-dev-lora' \
    -d '{
      "input": {
        "prompt": "Transform into watercolor painting style",
        "image": "https://api.pruna.ai/v1/files/fqadqq42xq",
        "lora": "your-username/watercolor-lora",
        "prompt_strength": 0.8,
        "lora_scale": 1.2
      }
    }'

Parameters

Required Parameters

ParameterTypeDescription
promptstringText description of the desired output

LoRA Parameters

ParameterTypeDefaultDescription
lorastring-HuggingFace LoRA URL (e.g., "owner/model-name")
lora_scalenumber1LoRA application strength (-1 to 3)
extra_lorastring-Second HuggingFace LoRA URL for combining styles
extra_lora_scalenumber1Second LoRA application strength (-1 to 3)

Image-to-Image Parameters

ParameterTypeDefaultDescription
imagestring (URI)-Input image URL for img2img mode
prompt_strengthnumber0.8How much to transform the input image (0-1). Lower = closer to original

Generation Parameters

ParameterTypeDefaultDescription
num_outputsinteger1Number of images to generate (1-4)
num_inference_stepsinteger28Number of denoising steps
guidancenumber3Guidance scale (0-10)
seedintegerrandomRandom seed for reproducibility
aspect_ratiostring"1:1"Options: "1:1", "16:9", "21:9", "3:2", "2:3", "4:5", "5:4", "3:4", "4:3", "9:16", "9:21"
megapixelsstring"1"Output resolution: "1" (1MP) or "0.25" (0.25MP)
speed_modestring"Juiced 🧃"Options: "Base Model (compiled)", "Lightly Juiced 🍊", "Juiced 🧃", "Extra Juiced 🔥"
output_formatstring"jpg""png", "jpg", or "webp"
output_qualityinteger80Quality for jpg/webp (1-100)