falImage to imageComing soon

fal-ai/flux-general/inpainting

fal-ai/flux-general/inpainting is an image to image tool from fal that runs in the background and returns images. Coming soon: listed with its price, not yet open to runs.

This tool is listed but not yet available to run.

Priced by usage

Pricing

$0.0975 per megapixel. Each image_size preset counts as 1 MP, and a custom width × height rounds up to whole megapixels. Billed on num_images, default 1. The final charge comes from usage.

Limits

Runs
In the background
Returns
image
Longest queue wait
3600s
Run deadline
1800s
Largest inline input
1024 KB
Largest input file
500 MB
Largest output
4768 MB
Outputs per run
16

Input

FieldKindDefaultDescription
prompt requiredtext—The prompt to generate an image from.
image_sizeJSON—The size of the generated image.
num_inference_stepsnumber (whole)
1 to 50
28The number of inference steps to perform.
seednumber (whole)— The same seed and the same prompt given to the same version of the model will output the same image every time.
lorasJSON[] 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.
control_lorasJSON[] The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs and they will be merged together to generate the final image.
controlnetsJSON[] The controlnets to use for the image generation. Only one controlnet is supported at the moment.
controlnet_unionsJSON[] The controlnet unions to use for the image generation. Only one controlnet is supported at the moment.
ip_adaptersJSON[] IP-Adapter to use for image generation.
easycontrolsJSON[] EasyControl Inputs to use for image generation.
fill_imageJSON—Use an image input to influence the generation. Can be used to fill images in masked areas.
guidance_scalenumber
0 to 20
3.5 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.
real_cfg_scalenumber
0 to 5
3.5 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.
use_real_cfgtrue or falsefalse Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. If using XLabs IP-Adapter v1, this will be turned on!.
use_cfg_zerotrue or falsefalse Uses CFG-zero init sampling as in https://arxiv.org/abs/2503.18886.
num_imagesnumber (whole)
1 to 10
1The number of images to generate. This is always set to 1 for streaming output.
reference_image_urltext—URL of Image for Reference-Only
reference_strengthnumber
-3 to 3
0.65Strength of reference_only generation. Only used if a reference image is provided.
reference_startnumber
0 to 1
0 The percentage of the total timesteps when the reference guidance is to bestarted.
reference_endnumber
0 to 1
1 The percentage of the total timesteps when the reference guidance is to be ended.
base_shiftnumber
0.01 to 5
0.5Base shift for the scheduled timesteps
max_shiftnumber
0.01 to 5
1.15Max shift for the scheduled timesteps
output_formatone of
jpeg, png
pngThe format of the generated image.
use_beta_scheduletrue or falsefalseSpecifies whether beta sigmas ought to be used.
sigma_scheduletext—Sigmas schedule for the denoising process.
schedulerone of
euler, dpmpp_2m
eulerScheduler for the denoising process.
negative_prompttext Negative prompt to steer the image generation away from unwanted features. By default, we will be using NAG for processing the negative prompt.
nag_scalenumber
… to 10
3 The scale for NAG. Higher values will result in a image that is more distant to the negative prompt.
nag_taunumber2.5 The tau for NAG. Controls the normalization of the hidden state. Higher values will result in a less aggressive normalization, but may also lead to unexpected changes with respect to the original image. Not recommended to change this value.
nag_alphanumber
… to 1
0.25 The alpha value for NAG. This value is used as a final weighting factor for steering the normalized guidance (positive and negative prompts) in the direction of the positive prompt. Higher values will result in less steering on the normalized guidance where lower values will result in considering the positive prompt guidance more.
nag_endnumber
… to 1
0.25 The proportion of steps to apply NAG. After the specified proportion of steps has been iterated, the remaining steps will use original attention processors in FLUX.
image_url requiredURL or file—URL of image to use for inpainting. or img2img
strengthnumber
0.01 to 1
0.85The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original.
mask_url requiredURL or file— The mask to area to Inpaint in.

Same request in code

curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "fal",
    "model": "fal-ai/flux-general/inpainting",
    "input": {
      "prompt": "A photo of a lion sitting on a stone bench",
      "image_url": "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png",
      "mask_url": "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
    }
  }'