Search

Search HiAPI models, tools, and resources.

Back to blog
Tutorial4 min read

How to Use FIBO 1.5 API: Generate and Edit in 5 Minutes

fibo-gen-1.5 generation plus fibo-edit-1.5 one-line editing: curl/Python examples, parameters, and verbatim errors.

HiAPI EditorialFIBOAPI IntegrationImage Editing

TL;DR

  • FIBO 1.5 is a generate-plus-edit pair: fibo-gen-1.5/text-to-image for photoreal generation (with accurate in-image text) and fibo-edit-1.5/image-to-image for one-line editing (up to 4 reference images, plus masked local edits). Try it on the Gen model page; new accounts get 200 free credits.
  • Both cost the same: $0.0575 per image — a generate-then-edit pipeline is $0.115 (see the pricing page).
  • Everything runs on HiAPI /v1/tasks: submit for a taskId, then poll. The editing field is called instruction, not prompt.

What it does

  • Photoreal output with accurate text: product labels and storefront signs come out letter-perfect (the label below reads NOIR 07).
  • One-line edits: describe the change in instruction; anything you don't mention stays as-is.
  • Up to 4 images per composite: try-ons, background swaps, product-into-scene — image_urls are referenced in order.
  • Masked local edits: white marks what changes, black stays.

Here's a real Gen output:

Luxury product photo of an amber glass perfume bottle on wet black marble, gold cap, soft rim light, droplets on the glass, the label reads 'NOIR 07' in elegant serif letters

Perfume product shot

fibo-gen-1.5/text-to-image, 4:5, 768×960, $0.0575.

Try this prompt →

Two endpoints: which to use

fibo-gen-1.5/text-to-imagefibo-edit-1.5/image-to-image
What it doesGenerates photoreal images from textEdits existing images with one instruction
Required inputpromptimage_urls (1–4) + instruction
Price$0.0575/image$0.0575/image
Special parametersaspect_ratio (9), seed (default 5555)mask_url, seed (default 5555)
Best forNew frames, lettered assetsTry-ons, background swaps, composites, local fixes

Typical pipeline: generate the base in Gen, then produce the set in Edit (new backgrounds, recolors, added elements). Scene templates live in the prompt guide.

Two ways to start

Browser, 3 steps: open the model page → paste the prompt, pick a ratio → generate. One image is $0.0575.

API, 3 steps: POST /v1/tasks to submit → take the taskId → GET /v1/tasks/<taskId> until success.

curl: your first image

curl -X POST https://api.hiapi.ai/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: your-unique-key-001" \
  -d '{
  "model": "fibo-gen-1.5/text-to-image",
  "input": {
    "prompt": "Luxury product photo of an amber glass perfume bottle on wet black marble, gold cap, soft rim light, droplets on the glass, the label reads 'NOIR 07' in elegant serif letters",
    "aspect_ratio": "4:5",
    "seed": 2026
  }
}'

For editing, switch model to fibo-edit-1.5/image-to-image and put the change in instruction, referencing images in order (a two-image try-on):

curl -X POST https://api.hiapi.ai/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "fibo-edit-1.5/image-to-image",
  "input": {
    "image_urls": [
      "https://static.hiapi.ai/gallery/2026/10/78f963cb21d0242c.jpg",
      "https://static.hiapi.ai/gallery/2026/10/36246b7cabde4a1a.jpg"
    ],
    "instruction": "Dress the woman in image 1 with the mustard corduroy jacket from image 2, worn open over her white t-shirt. Keep her pose, face and the studio background.",
    "aspect_ratio": "3:4"
  }
}'

Masked local edit: mask_url pairs with exactly one image, and white marks what changes (the opposite of Ideogram 4.5 Edit):

curl -X POST https://api.hiapi.ai/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "fibo-edit-1.5/image-to-image",
  "input": {
    "image_urls": ["https://static.hiapi.ai/gallery/2026/10/d9037da1559e78a6.jpg"],
    "mask_url": "https://static.hiapi.ai/gallery/2026/10/cae371f9e4689db5.png",
    "instruction": "Replace the floor under the sneaker with light wooden planks."
  }
}'

Python: submit, poll, download

import time, uuid, requests

BASE = "https://api.hiapi.ai/v1/tasks"
HEADERS = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
}

payload = {
    "model": "fibo-gen-1.5/text-to-image",
    "input": {
        "prompt": "Luxury product photo of an amber glass perfume bottle on wet black marble, gold cap, soft rim light, droplets on the glass, the label reads 'NOIR 07' in elegant serif letters",
        "aspect_ratio": "4:5",
        "seed": 2026,
    },
}

resp = requests.post(
    BASE,
    headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
    json=payload,
    timeout=30,
)
resp.raise_for_status()
task_id = resp.json()["taskId"]

while True:
    task = requests.get(f"{BASE}/{task_id}", headers=HEADERS, timeout=30).json()
    print(task["status"])
    if task["status"] in ("success", "fail"):
        break
    time.sleep(3)

if task["status"] == "success":
    image_url = task["output"][0]["url"]   # temporary URL — download promptly
    img = requests.get(image_url, timeout=60)
    with open("output_image", "wb") as f:
        f.write(img.content)
    print("saved")

Parameters

fibo-gen-1.5/text-to-image

FieldRequiredValuesNotes
promptyes1–10,000 charsFrame description; quote any in-image text (the label reads '…')
aspect_rationo1:1 / 2:3 / 3:2 / 3:4 / 4:3 / 4:5 / 5:4 / 9:16 / 16:9, default 1:1Nine ratios, one price
seednointeger, default 5555Fixed even when omitted — same prompt, same result; change it to reroll

fibo-edit-1.5/image-to-image

FieldRequiredValuesNotes
image_urlsyes1–4 imagesOrder matters; instruction refers to image 1, image 2…
instructionyes≥1 charWhat to change; unmentioned content stays
aspect_rationosame nineApplies only with 2+ images; single-image edits keep the original ratio
mask_urlnoimage URLSingle-image edits only; white = change, black = keep; must match the image size
seednointeger, default 5555Same inputs reproduce

Any field outside the tables returns a 400.

Errors you'll actually hit (verbatim)

What you didResponse
Omitted prompt on Gen400 invalid input: prompt: missing required field "prompt"
Sent seed as a string400 invalid input: seed: got string, want integer
Misspelled aspect_ratio400 invalid input: aspect_ratio: value must be one of '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9'
Omitted instruction on Edit400 invalid input: instruction: missing required field "instruction"
Sent 5 images to Edit400 invalid input: image_urls: maxItems: got 5, want 4
Paired a mask with 2 images400 (mask_url requires exactly 1 image)
Out of credits402 insufficient account balance; top up and retry

Re-submitting the same Idempotency-Key returns 409 or 422; use a fresh key.

Before you ship

  • Callbacks: pass "callback": {"url": "https://..."} at the request top level.
  • Persist outputs: output[0].url is temporary — download it right away.
  • Name images in instructions: reference image 1 / image 2 in the order of image_urls.
  • Mask polarity: FIBO is white-edits, black-keeps — invert your masks when porting scripts from other editors.

FAQ

  • Yes, the editing field is called instruction, not prompt; the wrong name returns a missing-field error.
  • Yes, four input images max — the fifth returns a 400.
  • Yes, seed defaults to 5555 and is fixed — identical inputs reproduce; pass a new seed for a different take.
  • Yes, both endpoints share one price and calling convention — change only model and input.

Next: take the perfume prompt and generate a base image, then reshape it with one instruction; scene templates are in the prompt guide.

Generate it with HiAPI

Choose a model, enter your prompt, and see the result.

HiAPI Blog

Related articles

HiAPI

Generate it with HiAPI

Start generating