API reference · BFL

bfl/flux-general/inpainting

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

IMAGEAsyncOpen model
Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/run
Model IDbfl/flux-general/inpainting
01

Input Schema

32 parameters · 2 required · 30 optional

ParameterTypeRequiredDescription
imagestringRequiredURL of image to use for inpainting. or img2img
promptstringRequiredThe prompt to generate an image from.
maskstringOptional The mask to area to Inpaint in.
seedintegerOptional The same seed and the same prompt given to the same version of the model will output the same image every time.
lorasobject[]Optional 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. · Default: []
nag_endnumberOptional 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. · Max: 1 · Default: 0.25
nag_taunumberOptional 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. · Default: 2.5
strengthnumberOptionalThe 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. · Min: 0.01 · Max: 1 · Default: 0.85
max_shiftnumberOptionalMax shift for the scheduled timesteps · Min: 0.01 · Max: 5 · Default: 1.15
nag_alphanumberOptional 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. · Max: 1 · Default: 0.25
nag_scalenumberOptional The scale for NAG. Higher values will result in a image that is more distant to the negative prompt. · Max: 10 · Default: 3
schedulerstringOptionalScheduler for the denoising process. · Options: euler, dpmpp_2m · Default: "euler"
eulerdpmpp_2m
base_shiftnumberOptionalBase shift for the scheduled timesteps · Min: 0.01 · Max: 5 · Default: 0.5
fill_imagestringOptionalUse an image input to influence the generation. Can be used to fill images in masked areas.
controlnetsobject[]Optional The controlnets to use for the image generation. Only one controlnet is supported at the moment. · Default: []
ip_adaptersobject[]Optional IP-Adapter to use for image generation. · Default: []
aspect_ratiostringOptionalThe aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16
21:916:93:24:35:41:14:53:42:39:16
easycontrolsobject[]Optional EasyControl Inputs to use for image generation. · Default: []
use_cfg_zerobooleanOptional Uses CFG-zero init sampling as in https://arxiv.org/abs/2503.18886. · Default: false
use_real_cfgbooleanOptional 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!. · Default: false
control_lorasobject[]Optional 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. · Default: []
output_formatstringOptionalThe format of the generated image. · Options: jpeg, png · Default: "png"
jpegpng
reference_endnumberOptional The percentage of the total timesteps when the reference guidance is to be ended. · Min: 0 · Max: 1 · Default: 1
guidance_scalenumberOptional 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. · Min: 0 · Max: 20 · Default: 3.5
real_cfg_scalenumberOptional 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. · Min: 0 · Max: 5 · Default: 3.5
sigma_schedulestringOptionalSigmas schedule for the denoising process.
reference_startnumberOptional The percentage of the total timesteps when the reference guidance is to bestarted. · Min: 0 · Max: 1 · Default: 0
controlnet_unionsobject[]Optional The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. · Default: []
use_beta_schedulebooleanOptionalSpecifies whether beta sigmas ought to be used. · Default: false
reference_strengthnumberOptionalStrength of reference_only generation. Only used if a reference image is provided. · Min: -3 · Max: 3 · Default: 0.65
num_inference_stepsintegerOptionalThe number of inference steps to perform. · Min: 1 · Max: 50 · Default: 28
reference_image_urlstringOptionalURL of Image for Reference-Only
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

Code Examples

Ready-to-run snippets

# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "bfl/flux-general/inpainting",
  "mask": "https://static.sandbase.ai/examples/bfl/flux-general/inpainting/input_mask_1.png",
  "image": "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png",
  "loras": [],
  "prompt": "A photo of a lion sitting on a stone bench",
  "nag_end": 0.25,
  "nag_tau": 2.5,
  "strength": 0.85,
  "max_shift": 1.15,
  "nag_alpha": 0.25,
  "nag_scale": 3,
  "scheduler": "euler",
  "base_shift": 0.5,
  "controlnets": [],
  "ip_adapters": [],
  "easycontrols": [],
  "use_cfg_zero": false,
  "use_real_cfg": false,
  "control_loras": [],
  "output_format": "png",
  "reference_end": 1,
  "guidance_scale": 3.5,
  "real_cfg_scale": 3.5,
  "reference_start": 0,
  "controlnet_unions": [],
  "use_beta_schedule": false,
  "reference_strength": 0.65,
  "num_inference_steps": 28
}'

# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
  -H "Authorization: Bearer YOUR_API_KEY"