Flux Kontext Lora

edit

fal-ai/flux-kontext-lora

Prompt-driven image editing on FLUX.1 Kontext, with LoRAs.

FLUX.1 Kontext [dev] edits an image from a plain instruction, and this endpoint adds a loras list on top for style, brand or product adaptations. There is no Kontext trainer in this catalog, so it consumes Kontext edit LoRAs trained elsewhere.

Parameters

Schema facts from the fal API; the notes are ours.

Required

image_urlstringrequired

Input image for image-to-image, editing or video conditioning.

Raw schema description

The URL of the image to edit. Max width: 14142px, Max height: 14142px, Timeout: 20s

promptstringrequired

The text description of what to generate.

Tip: If your LoRA used a trigger word, include it. Describe the scene around the subject normally.

Raw schema description

The prompt to edit the image.

Optional

num_inference_stepsintegerdefault: 301050

Number of denoising steps per image. More steps, more refinement, more latency.

Tip: Defaults are tuned per model. Cutting steps in half is the quickest way to trade quality for speed.

Raw schema description

The number of inference steps to perform.

seedinteger

Random seed. Same seed plus same inputs gives a nearly identical image.

Tip: Fix the seed when comparing LoRA scales or parameters, so the only thing changing is the thing you are testing.

Raw schema description

The same seed and the same prompt given to the same version of the model will output the same image every time.

guidance_scalenumberdefault: 2.5020

How strictly generation follows the prompt (classifier-free guidance).

In the atelier: How tightly you hold the painter to the brief. Too tight and the work gets stiff and oversaturated; too loose and he wanders.

Tip: Stay near the endpoint default. Adjust in steps of 0.5.

Raw schema description

The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.

sync_modebooleandefault: false

Returns media as a data URI instead of a hosted URL, and skips storing it.

Tip: Useful for privacy; awkward for big files. Most workflows leave it off.

Raw schema description

If `True`, the media will be returned as a data URI and the output data won't be available in the request history.

num_imagesintegerdefault: 114

How many images to generate in one call.

Raw schema description

The number of images to generate.

enable_safety_checkerbooleandefault: true

Runs a safety filter on outputs.

Raw schema description

If set to true, the safety checker will be enabled.

output_formatenumdefault: pngjpeg | png

File format of the result: jpeg, png or webp.

Raw schema description

The format of the generated image.

loraslistdefault: []

List of LoRA weights to load, each with a path (URL or HF repo) and a scale.

In the atelier: Which bracelets the painter wears for this painting, and how hard he leans on each.

Tip: Order does not matter; scales do. Start every LoRA at 1.0 and adjust one at a time.

Watch out: Stacking three strong LoRAs usually degrades all of them. Lower each scale when combining.

Raw schema description

The LoRAs to use for the image generation. You can use any number of LoRAs and they will be merged together to generate the final image.

accelerationenumdefault: nonenone | regular | high

Speed and cost preset for the generation backend.

Tip: 'regular' balances quality and latency. Use higher acceleration for drafts and iteration.

Raw schema description

The speed of the generation. The higher the speed, the faster the generation.

resolution_modeenumdefault: match_inputauto | match_input | 1:1 | 16:9 | 21:9 | 3:2 | 2:3 | 4:5 | 5:4 | 3:4 | 4:3 | 9:16 | 9:21

How output resolution is chosen: 'auto' snaps to a preset the model was trained on, 'match_input' mirrors your input size.

Tip: 'auto' is the safer default. Use 'match_input' when downstream tooling needs exact dimensions.

Raw schema description

Determines how the output resolution is set for image editing. - `auto`: The model selects an optimal resolution from a predefined set that best matches the input image's aspect ratio. This is the recommended setting for most use cases as it's what the model was trained on. - `match_input`: The model will attempt to use the same resolution as the input image. The resolution will be adjusted to be compatible with the model's requirements (e.g. dimensions must be multiples of 16 and within supported limits). Apart from these, a few aspect ratios are also supported.

Call it

import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/flux-kontext-lora", {
  input: {
    "image_url": "https://your-cdn.com/input.jpg",
    "prompt": "turn the sketch into a finished painting",
    "loras": [
      {
        "path": "https://your-cdn.com/lora.safetensors",
        "scale": 1
      }
    ]
  },
  logs: true,
});
console.log(result.data);