Skip to content

Image editing API

Instruction-based image editing built on Qwen-Image-Edit 2511. You describe the change in plain language — no mask, no inpainting UI — and pass one to three reference images.

Price
$0.03 / image
Model id
image-edit
Reference images
1–3
Licence
Apache-2.0

What instruction editing replaces

Traditional editing endpoints need a mask: you segment the region, send it alongside the image, and the model repaints inside it. Qwen-Image-Edit takes an instruction instead — "replace the background with a marble surface", "make the jacket red", "put the subject from image 2 into image 1".

That removes the entire masking step from your product, which is usually the hardest part of the UI to build well.

  • Object edits — add, remove, replace or recolour something in the frame
  • Background replacement without segmenting the subject
  • Style transfer across the whole image
  • Composition — combine subjects or elements from up to three references

Edit an image

Reference images can be public https URLs or inline data URIs. URLs are strongly preferred: the whole request body has to stay under about 4 MB.

curl
curl https://api.fastgencloud.com/v1/images/edits \
  -H "Authorization: Bearer $FASTGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "model": "image-edit",
      "image": "https://example.com/product.jpg",
      "prompt": "place the product on a polished marble surface with soft studio lighting"
    }'

Writing instructions that work

Edit models follow imperative, concrete instructions best. Name the thing you want changed and state the target state.

  • Prefer "replace the background with a sunlit kitchen" over "make it nicer"
  • One change per request beats three changes stacked into one sentence
  • If an edit is too subtle, raise steps to 20–30 and guidance to about 4 — the default is the fast distilled setting
  • Reference images by position when you pass several: "the person from the first image, wearing the jacket from the second"

Parameters

model
image-edit
image / images
one reference, or an array of 1–3
prompt
the edit instruction, 1–2000 characters, verbatim
size
optional; defaults to the supported size closest to the first reference
steps
optional, 1–50; default is the fast distilled setting
guidance
optional; default 1.0 distilled, ~4 at higher step counts
seed
optional integer for reproducible output
webhook_url
optional signed callback on completion

How the API works

Every generation is a job. The POST returns 202 with a job id immediately, so your request thread is never blocked on a GPU. You then either poll GET /v1/jobs/{id} or register a webhook_url and receive a signed callback when the job finishes.

Send an Idempotency-Key header and a retried request replays the original job instead of charging you twice. Your wallet is debited when the job is submitted and refunded automatically if it fails.

poll the job
curl https://api.fastgencloud.com/v1/jobs/$JOB_ID \
  -H "Authorization: Bearer $FASTGEN_API_KEY"

Pricing and billing

Pricing is prepaid and usage-based: you top the wallet up with a card and each job debits it. There is no subscription, no per-seat cost, and no monthly minimum.

Images above 1 megapixel are billed pro rata by pixel count — a 1.5 MP image costs 1.5x the listed rate. Failed jobs are refunded in full, automatically.

Frequently asked questions

Do I need to supply a mask?
No. The model works from the instruction alone. If you specifically want masked inpainting, the SDXL-based models support an inpaint path instead.
Why does my edit come back nearly identical to the input?
Usually the instruction is too vague or the step count is too low for a large change. Name the target explicitly and try steps around 20–30 with guidance near 4.
What image formats and sizes are accepted?
Standard web formats by https URL, or inline data URIs. Keep the whole request body under roughly 4 MB — which in practice means URLs once you are sending more than one reference.

Related

Start generating

Create an account, add a prepaid balance, and call the API with a key from the console. No subscription, no minimum, no per-seat pricing.

Get an API key