Skip to content

Fooocus Inpainting

Integrate

Model id fooocus/inpaint
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/fooocus/inpaint?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inpaint_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

This request: ≈$0.055 55 API credits · ≈ ₽5.86 Run it on this page

Get API key
Open model Image Editing #stylized#editing

Inpaints or outpaints an image with an optional mask, with modes for detail fixes or content changes

Open model · Image

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

default

Describe the image you want generated, using as much detail as possible to get the best results.

•required
Drop a file, or

Reference image used during inpainting.

default 1024x1024

Output image dimensions, selected from presets or specified as custom width and height. Both custom dimensions must be divisible by 8.

num_images default 1

Image count to generate per request.

Advanced negative_prompt · inpaint_additional_prompt · mask_image_url · performance · output_format · inpaint_engine · refiner_model · inpaint_mode · guidance_scale · sharpness · refiner_switch · inpaint_strength · inpaint_respective_field · inpaint_erode_or_dilate · seed · override_inpaint_options · inpaint_disable_initial_latent · invert_mask · mixing_image_prompt_and_inpaint · enable_safety_checker · styles · outpaint_selections · loras · image_prompt_1 · image_prompt_2 · image_prompt_3 · image_prompt_4
default

Negative prompt specifying image details to exclude, including colors, objects, scenery, or finer features. Examples include a moustache, blur, or low resolution.

default

Description of the desired inpainting content.

Drop a file, or

Mask image applied during image generation.

performance default Extreme Speed

Performance choice: Speed or Quality.

output_format default jpeg

File format for the resulting image.

inpaint_engine default v2.6

Model version for Fooocus inpainting.

default None

Refiner selection: SDXL or SD 1.5.

default Inpaint or Outpaint (...

Mode applied during inpainting.

default 4

Prompt-adherence strength for image selection, expressed as CFG (Classifier Free Guidance).

default 2

Sharpness setting for the output image. Increasing it makes both the image and its textures sharper.

default 0.8

Refiner switch value: use 0.4 with realistic SD1.5 models, 0.667 with anime SD1.5 models, and 0.8 with XL-refiners. Switching between two SDXL models permits any value.

default 1

Denoising strength for inpainting, equivalent to A1111's inpaint setting. It does not apply to outpainting, which always uses 1.0.

default 0.618

Select the area for inpainting using A1111's equivalents: "Only Masked" corresponds to 0, and "Whole Image" corresponds to 1. Outpainting ignores this setting and always uses 1.0.

default 0

Adjust the mask's white area before any inversion, with a default value of 0. Use positive values to expand that area or negative values to contract it.

Seed for reproducing images in Stable Diffusion. An image can be reproduced exactly on every run by keeping the model version, prompt, and seed unchanged.

default ["Fooocus Enhance","F...

Style applied during generation.

default []

Directions in which outpainting extends the image.

default [{"path":"https://hug...

LoRA selection merged for final image generation, limited to 5 LoRAs.

POST /run/fooocus/inpaint?wait=20 quote → $0.055
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/fooocus/inpaint?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inpaint_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Fooocus Inpainting

Edits an existing image by regenerating a masked region or extending its borders. Provide `inpaint_image_url` and optionally `mask_image_url`, then pick an `inpaint_mode`: plain inpaint/outpaint, detail improvement, or content modification. It also accepts LoRAs, up to four image prompts, a refiner choice and 1 to 4 outputs per request in png, jpeg or webp. Strength and respective-field settings allow finer control over how much changes.

Parameters

Send either the canonical name or the native name, not both. Canonical names

NameType DefaultAllowed Description
promptoptional
Typestring
Default
Describe the image you want generated, using as much detail as possible to get the best results.
negative_promptoptional
Typestring
Default
Negative prompt specifying image details to exclude, including colors, objects, scenery, or finer features. Examples include a moustache, blur, or low resolution.
stylesoptional
Typeenum[]
Default["Fooocus Enhance","Fooocus Sharp","Fooocus V2"]
Style applied during generation.
performanceoptional
Typeenum
DefaultExtreme Speed
SpeedQualityExtreme SpeedLightning
Performance choice: Speed or Quality.
guidance_scaleoptional
Typenumber
Default4
1 – 30
Prompt-adherence strength for image selection, expressed as CFG (Classifier Free Guidance).
sharpnessoptional
Typenumber
Default2
0 – 30
Sharpness setting for the output image. Increasing it makes both the image and its textures sharper.
aspect_ratiooptional
Typestring
Default1024x1024
Output image dimensions, selected from presets or specified as custom width and height. Both custom dimensions must be divisible by 8.
num_imagesoptional num_outputs
Typeinteger
Default1
1 – 4
Image count to generate per request.
lorasoptional
Typeobject[]
Default[{"path":"https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors","scale":0.1}]
LoRA selection merged for final image generation, limited to 5 LoRAs.
loras[].pathrequired
Typestring
Location of the LoRA weights, specified as a URL or path.
loras[].scaleoptional
Typenumber
Default0.1
0 – 1
Multiplier applied to the LoRA weight before it is merged into the base model.
refiner_modeloptional
Typeenum
DefaultNone
NonerealisticVisionV60B1_v51VAE.safetensors
Refiner selection: SDXL or SD 1.5.
refiner_switchoptional
Typenumber
Default0.8
0 – 1
Refiner switch value: use 0.4 with realistic SD1.5 models, 0.667 with anime SD1.5 models, and 0.8 with XL-refiners. Switching between two SDXL models permits any value.
output_formatoptional
Typeenum
Defaultjpeg
pngjpegwebp
File format for the resulting image.
seedoptional
Typeinteger | null
Seed for reproducing images in Stable Diffusion. An image can be reproduced exactly on every run by keeping the model version, prompt, and seed unchanged.
inpaint_image_urlrequired
Typeurl · image
Reference image used during inpainting.
mask_image_urloptional
Typeurl · image
Mask image applied during image generation.
inpaint_modeoptional
Typeenum
DefaultInpaint or Outpaint (default)
Inpaint or Outpaint (default)Improve Detail (face, hand, eyes, etc.)Modify Content (add objects, change background, etc.)
Mode applied during inpainting.
inpaint_additional_promptoptional
Typestring
Default
Description of the desired inpainting content.
outpaint_selectionsoptional
Typeenum[]
Default[]
Directions in which outpainting extends the image.
override_inpaint_optionsoptional
Typeboolean
Defaultfalse
Override toggle for advanced inpainting settings: `inpaint_disable_initial_latent`, `inpaint_engine`, `inpaint_strength`, `inpaint_respective_field`, and `inpaint_erode_or_dilate`. Setting it to true overrides these options; otherwise, their defaults apply.
inpaint_disable_initial_latentoptional
Typeboolean
Defaultfalse
Initial preprocessing toggle: true disables that preprocessing.
inpaint_engineoptional
Typeenum
Defaultv2.6
Nonev1v2.5v2.6
Model version for Fooocus inpainting.
inpaint_strengthoptional
Typenumber
Default1
≤ 1> 0
Denoising strength for inpainting, equivalent to A1111's inpaint setting. It does not apply to outpainting, which always uses 1.0.
inpaint_respective_fieldoptional
Typenumber
Default0.618
0 – 1
Select the area for inpainting using A1111's equivalents: "Only Masked" corresponds to 0, and "Whole Image" corresponds to 1. Outpainting ignores this setting and always uses 1.0.
inpaint_erode_or_dilateoptional
Typenumber
Default0
-64 – 64
Adjust the mask's white area before any inversion, with a default value of 0. Use positive values to expand that area or negative values to contract it.
invert_maskoptional
Typeboolean
Defaultfalse
Mask inversion toggle; true reverses the mask.
image_prompt_1optional
Typeobject
image_prompt_1.typeoptional
Typeenum
DefaultImagePrompt
ImagePromptPyraCannyCPDSFaceSwap
image_prompt_1.image_urloptional
Typeurl · image
image_prompt_1.stop_atoptional
Typenumber
Default0.5
0 – 1
image_prompt_1.weightoptional
Typenumber
Default1
0 – 2
image_prompt_2optional
Typeobject
image_prompt_2.typeoptional
Typeenum
DefaultImagePrompt
ImagePromptPyraCannyCPDSFaceSwap
image_prompt_2.image_urloptional
Typeurl · image
image_prompt_2.stop_atoptional
Typenumber
Default0.5
0 – 1
image_prompt_2.weightoptional
Typenumber
Default1
0 – 2
image_prompt_3optional
Typeobject
image_prompt_3.typeoptional
Typeenum
DefaultImagePrompt
ImagePromptPyraCannyCPDSFaceSwap
image_prompt_3.image_urloptional
Typeurl · image
image_prompt_3.stop_atoptional
Typenumber
Default0.5
0 – 1
image_prompt_3.weightoptional
Typenumber
Default1
0 – 2
image_prompt_4optional
Typeobject
image_prompt_4.typeoptional
Typeenum
DefaultImagePrompt
ImagePromptPyraCannyCPDSFaceSwap
image_prompt_4.image_urloptional
Typeurl · image
image_prompt_4.stop_atoptional
Typenumber
Default0.5
0 – 1
image_prompt_4.weightoptional
Typenumber
Default1
0 – 2
mixing_image_prompt_and_inpaintoptional
Typeboolean
Defaultfalse
Combines Image Prompt with Inpaint.
enable_safety_checkeroptional
Typeboolean
Defaulttrue
Safety checker toggle; setting it to false disables checking.
required Canonical name, also accepted

File parameters take a public https:// URL, a data: URI up to 10 MB, or the file_url of an upload. Files

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "fooocus/inpaint",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 55,
    "usd": "0.055",
    "charged": 55,
    "refunded": 0
  },
  "input": {
    "inpaint_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ],
    "timings": {},
    "has_nsfw_concepts": [
      false
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
images
array of object {url, content_type, file_name, file_size, width, height}File information for the generated image.
timings
objectElapsed time for generation.
has_nsfw_concepts
array of booleanIndicates whether NSFW concepts appear in the generated images.

More models: Image Editing

For AI agents: this page as Markdown is at https://doitong.com/en-US/developers/models/fooocus/inpaint.md. All models and guides: https://doitong.com/developers/llms.txt