Skip to content
Inferlane

Guides, 10 of 17

Guide: text to image

Pick a model, write a prompt and control size, count and seed.

What you will build

A prompt goes in, one or more images come back as URLs. This guide picks a text to image model from the catalog, sends a prompt with a size and count, waits for the result and reads the billed amount.

Text to image models

Every model below takes the same three calls. Prices come from the catalog and are billed per megapixel or per the unit shown.

black-forest-labs/flux-2-pro$0.03 / megapixel
FLUX.2 [pro]. Production text to image model from Black Forest Labs, focused on prompt adherence and photoreal detail.
google/nano-banana-pro$0.15 / image
Nano Banana Pro. Google's Gemini based image model, strong at layout, legible text and multi subject scenes.
openai/gpt-image-2$0.08 / image
GPT Image 2. OpenAI's image generation model, good at following long, detailed instructions.
bytedance/seedream-5$0.04 / image
Seedream 5.0. ByteDance's text to image model with high resolution output and consistent style across a batch.
ideogram/ideogram-4$0.06 / image
Ideogram 4. Ideogram's image model, known for accurate typography and graphic design layouts.
qwen/qwen-image-3$0.02 / megapixel
Qwen Image 3. Open weights image model from the Qwen team with strong multilingual text rendering. Open weights.
krea/krea-2-turbo$0.02 / image
Krea 2 Turbo. Fast variant of Krea 2, tuned for natural looking photography with few steps.
openai/gpt-image-2-5$0.09 / image
GPT Image 2.5. OpenAI's newer image model, tuned for instruction following, text in images and edits in the same call.
black-forest-labs/flux-2-dev$0.012 / megapixel
FLUX.2 [dev]. Open weights FLUX.2 model for research and fine tuning, released under a non commercial license. Open weights.
recraft/recraft-v3$0.04 / image
Recraft V3. Image model for design work, with raster and vector styles and precise control over colors.

Inputs of FLUX.2 [pro]

This walkthrough uses black-forest-labs/flux-2-pro. Its inputs, read from the same schema that GET /models/black-forest-labs/flux-2-pro returns:

promptstring, required
What to generate. Plain language works best.
image_sizeenum
Output size preset. One of square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9. Default "landscape_4_3".
num_imagesinteger
How many images to return. Billed per image. From 1 to 4. Default 1.
seedinteger
Fix the seed to reproduce a result. Leave empty for random. From 0 to 2147483647.
output_formatenum
File format of the result. One of jpeg, png. Default "jpeg".
enable_safety_checkerboolean
Run the safety checker on outputs. Default true.

Submit the request

curl -X POST "https://inferlane.net/api/v1/queue/black-forest-labs/flux-2-pro" \
  -H "Authorization: Key $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"A matte ceramic bottle on a stone ledge, soft window light","image_size":"square_hd","num_images":1}'

The answer is 202 with a request_id. Keep it: export REQUEST_ID="...".

Poll until it completes

Poll the status about once a second. A FLUX.2 [pro] request completes in about 3.5 seconds.

curl "https://inferlane.net/api/v1/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $API_KEY"

Read the result

curl "https://inferlane.net/api/v1/requests/$REQUEST_ID" \
  -H "Authorization: Key $API_KEY"
200 OK
{
  "request_id": "YmxhY2stZm9yZXN0LWxhYnMvZmx1eC0yLXByb3xtdXF6ZDB2c3wxLjA0OXxiYzQ1N2JjNXw3OGM4MGU",
  "model_id": "black-forest-labs/flux-2-pro",
  "status": "COMPLETED",
  "sample": true,
  "output": {
    "images": [
      {
        "url": "https://inferlane.net/media/outputs/portrait-1x1.webp",
        "width": 1024,
        "height": 1024,
        "content_type": "image/webp"
      }
    ],
    "seed": 421337
  },
  "billing": {
    "unit": "megapixel",
    "quantity": 1.049,
    "unit_price": 0.03,
    "amount": 0.03147,
    "currency": "USD",
    "sample": true
  },
  "timings": {
    "queue_ms": 900,
    "inference_ms": 2600
  },
  "submitted_at": "2026-10-02T13:09:55.000Z",
  "completed_at": "2026-10-02T13:09:58.500Z"
}

FLUX.2 [pro] is priced at $0.03 / megapixel. Output width times height in millions of pixels, times the number of images. This request bills a quantity of 1.049, so billing.amount is 0.03147 USD.

The whole flow in one script

# 1. Submit the request and keep its request_id
REQUEST_ID=$(curl -s -X POST "https://inferlane.net/api/v1/queue/black-forest-labs/flux-2-pro" \
  -H "Authorization: Key $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "A matte ceramic bottle on a stone ledge, soft window light",
  "image_size": "square_hd",
  "num_images": 1
}' \
  | sed -n 's/.*"request_id": *"\([^"]*\)".*/\1/p')

# 2. Poll the status about once a second until it is COMPLETED
until curl -s "https://inferlane.net/api/v1/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $API_KEY" | grep -q '"status": "COMPLETED"'; do
  sleep 1
done

# 3. Fetch the result
curl "https://inferlane.net/api/v1/requests/$REQUEST_ID" \
  -H "Authorization: Key $API_KEY"

Size, count and seed

  • image_size takes a preset: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9. Larger sizes bill more on megapixel priced models.
  • num_images asks for several images in one request. The images array returns one entry per image, and the billed quantity grows with it.
  • Send the same seed with the same inputs to get a repeatable result. Leave it out to get a new variation each time; the result reports the seed that was used.

Switch models

To try another model, change the id in the path and check its inputs: some models use aspect_ratio instead of image_size. Unknown fields are rejected with 422, so a mismatch shows up on the first call. To compare several models on one prompt, see Sandbox.