Skip to content

Stable Diffusion with LoRAs · Inpaint

Integrate

Model id lora/inpaint
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/lora/inpaint?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "stabilityai/stable-diffusion-xl-base-1.0",
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

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

This request: ≈$0.184 184 API credits Run it on this page

Get API key
Open model Image Editing Reference inputs #diffusion#lora#customization#fine-tuning

Inpainting with a chosen Stable Diffusion base model and LoRAs, guided by a black-and-white mask

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.

•required

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

•required

Base model for generating the image, identified by either a URL or a HuggingFace ID.

num_images default 1

Set how many images a single request produces, allowing more generation time for a larger batch.

Advanced negative_prompt · image · mask · ic_light_model_background_image_url · ic_light_image_url · prediction_type · image_format · unet_name · variant · image_encoder_path · image_encoder_subfolder · image_encoder_weight_name · ic_light_model_url · scheduler · noise_strength · num_inference_steps · guidance_scale · clip_skip · tile_width · tile_height · tile_stride_width · tile_stride_height · eta · seed · prompt_weighting · controlnet_guess_mode · rescale_betas_snr_zero · enable_safety_checker · debug_latents · debug_per_pass_latents · loras · embeddings · controlnets · ip_adapter · timesteps · sigmas
default

Negative prompt specifying unwanted image details. It can exclude colors, objects, scenery, or finer features and qualities, such as a moustache, blur, or low resolution.

image_url
Drop a file, or

Source image URL for image-to-image generation or inpainting.

mask_url
Drop a file, or

Inpainting mask URL pointing to a black-and-white image.

Drop a file, or

Model-compatible background for IC Light image generation, supplied as an image URL.

Drop a file, or

Input image URL for generation with the IC Light model.

prediction_type default epsilon

Choose the prediction type for generating images; without a different selection, `epsilon` is used.

image_format default png

File format for the resulting image.

Custom U-Net selection for generating images; supply either its HuggingFace ID or its URL.

HuggingFace model variant selection; 'fp16' is one example.

Image encoder specified by an HTTPS URL or Hugging Face ID, with compatibility determined by the IP-Adapter weights: SD1.5 uses image_encoder_subfolder='models/image_encoder', while h94/IP-Adapter SDXL uses h94/IP-Adapter and image_encoder_subfolder='sdxl_models/image_encoder'. An encoder is required whenever ip_adapter contains a value.

Subdirectory within image_encoder_path that holds the image encoder weights.

default pytorch_model.bin

Select the image encoder's weights by name for use in generating images.

IC Light model URL used when generating images.

Scheduler or sampler used to denoise the image.

default 0.5

Control added image noise on a scale where 1.0 means complete noise and settings close to 0 mean minimal noise. This applies only with a supplied image_url.

default 30

Control how many generation steps Stable Diffusion performs; additional steps may yield a more detailed final image.

default 7.5

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

default 0

Skips a portion of image generation to render faster, producing slightly different results.

default 4096

Set how large each tile is during image generation.

default 4096

Set how large each tile is during image generation.

default 2048

Set the spacing between successive tile positions during image generation.

default 2048

Set the spacing between successive tile positions during image generation.

default 0

Eta setting used when generating images.

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 []

LoRAs whose combined effect produces the generated image, with no limit on how many you supply.

default []

Embeddings applied during image generation to map prompt tokens to embedding weights. Currently, only one embedding is supported.

default []

Control nets scheduled for application to the image at specified timesteps during generation, with no limit on how many you supply.

default []

IP adapters used to generate images. Providing any entries requires image_encoder_path.

default {"array":[],"method":...

Denoising timestep schedule override, mutually exclusive with sigmas. Without an override—the default—the scheduler calculates timesteps from num_inference_steps; supplying a custom schedule makes num_inference_steps irrelevant. An override requires scheduler support for the timesteps argument to set_timesteps.

default {"array":[],"method":...

Denoising sigma schedule override, mutually exclusive with timesteps. Without an override—the default—the scheduler calculates sigmas from num_inference_steps; supplying a custom schedule makes num_inference_steps irrelevant. An override requires scheduler support for the sigmas argument to set_sigmas.

POST /run/lora/inpaint?wait=20 quote → $0.184
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/lora/inpaint?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "stabilityai/stable-diffusion-xl-base-1.0",
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/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 Stable Diffusion with LoRAs · Inpaint

Edits parts of an image using `image_url` and a black-and-white `mask_url` with a Stable Diffusion model set in `model_name`. `noise_strength` ranges 0 to 1. Supports merged LoRAs, embeddings, ControlNets, IP adapters and several schedulers, with steps from 1 to 150. Output is png or jpeg.

Parameters

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

NameType DefaultAllowed Description
model_namerequired
Typestring
Base model for generating the image, identified by either a URL or a HuggingFace ID.
unet_nameoptional
Typestring | null
Custom U-Net selection for generating images; supply either its HuggingFace ID or its URL.
variantoptional
Typestring | null
HuggingFace model variant selection; 'fp16' is one example.
promptrequired
Typestring
Describe the image you want generated, using as much detail as possible to get the best results.
negative_promptoptional
Typestring
Default
Negative prompt specifying unwanted image details. It can exclude colors, objects, scenery, or finer features and qualities, such as a moustache, blur, or low resolution.
prompt_weightingoptional
Typeboolean
Defaultfalse
Prompt-weighting toggle: true removes the 77 token limit through embedding averaging and enables weighting syntax.
image_urloptional image
Typeurl · image
Source image URL for image-to-image generation or inpainting.
mask_urloptional mask
Typeurl · image
Inpainting mask URL pointing to a black-and-white image.
noise_strengthoptional
Typenumber
Default0.5
≤ 1> 0
Control added image noise on a scale where 1.0 means complete noise and settings close to 0 mean minimal noise. This applies only with a supplied image_url.
lorasoptional
Typeobject[]
Default[]
LoRAs whose combined effect produces the generated image, with no limit on how many you supply.
loras[].pathrequired
Typestring
Location of the LoRA weights, specified as a URL or path.
loras[].scaleoptional
Typenumber
Default1
0 – 4
Multiplier applied to the LoRA weight before it is merged into the base model.
embeddingsoptional
Typeobject[]
Default[]
Embeddings applied during image generation to map prompt tokens to embedding weights. Currently, only one embedding is supported.
embeddings[].pathrequired
Typestring
Embedding weights specified by URL or file path.
embeddings[].tokensoptional
Typestring[]
Prompt tokens mapped to embedding weights. Omitting them creates one token per embedding-file vector, named <s0>, <s1>, ...; use the mapped tokens in your prompts.
controlnetsoptional
Typeobject[]
Default[]
Control nets scheduled for application to the image at specified timesteps during generation, with no limit on how many you supply.
controlnets[].pathrequired
Typestring
ControlNet weight location, specified as a URL or path.
controlnets[].config_urloptional
Typestring | null
Optional URL pointing to the ControlNet's config.json file.
controlnets[].variantoptional
Typestring | null
Optional variant for use with a Hugging Face repository key.
controlnets[].image_urlrequired
Typeurl · image
Image URL supplied as the ControlNet input.
controlnets[].mask_urloptional
Typeurl · image
ControlNet mask, which must match the control image in size when supplied; width and height must each be divisible by 32.
controlnets[].conditioning_scaleoptional
Typenumber
Default1
0 – 2
Scaling applied to ControlNet weights before they are merged into the base model.
controlnets[].start_percentageoptional
Typenumber
Default0
0 – 1
Percentage of total timesteps at which ControlNet starts influencing image generation.
controlnets[].end_percentageoptional
Typenumber
Default1
0 – 1
Percentage of total timesteps at which ControlNet stops influencing image generation.
controlnets[].ip_adapter_indexoptional
Typeinteger | null
IP adapter selection by index for an InstantID ControlNet; other ControlNets do not need this setting.
controlnet_guess_modeoptional
Typeboolean
Defaultfalse
Restricts ControlNet application to conditional predictions when true.
ip_adapteroptional
Typeobject[]
Default[]
IP adapters used to generate images. Providing any entries requires image_encoder_path.
ip_adapter[].ip_adapter_image_urlrequired
Typeurl · image
Image URL supplied as the IP adapter input.
ip_adapter[].ip_adapter_mask_urloptional
Typeurl · image
IP adapter mask, subject to a size constraint when supplied: its dimensions must equal those of the adapter image.
ip_adapter[].pathrequired
Typestring
IP adapter weights location, specified as a URL or path.
ip_adapter[].model_subfolderoptional
Typestring | null
IP adapter weight location, specified as a subfolder within the model directory.
ip_adapter[].weight_nameoptional
Typestring | null
Filename of the weights.
ip_adapter[].insight_face_model_pathoptional
Typestring | null
InsightFace model weights location, specified as a URL or path.
ip_adapter[].scaleoptional
Typenumber
Default1
≥ 0
Scaling factor for IP adapter weights, applied before they are merged into the base model.
ip_adapter[].scale_jsonoptional
Typeobject | null
Scaling factor for IP adapter weights, applied before they are merged into the base model.
ip_adapter[].unconditional_noising_factoroptional
Typenumber
Default0
0 – 1
Factor controlling unconditional noising for the IP adapter.
ip_adapter[].image_projection_shortcutoptional
Typeboolean
Defaulttrue
Image projection shortcut setting, with True as the default. Use False for FaceID plus V1 models and True for FaceID plus V2 models.
image_encoder_pathoptional
Typestring | null
Image encoder specified by an HTTPS URL or Hugging Face ID, with compatibility determined by the IP-Adapter weights: SD1.5 uses image_encoder_subfolder='models/image_encoder', while h94/IP-Adapter SDXL uses h94/IP-Adapter and image_encoder_subfolder='sdxl_models/image_encoder'. An encoder is required whenever ip_adapter contains a value.
image_encoder_subfolderoptional
Typestring | null
Subdirectory within image_encoder_path that holds the image encoder weights.
image_encoder_weight_nameoptional
Typestring | null
Defaultpytorch_model.bin
Select the image encoder's weights by name for use in generating images.
ic_light_model_urloptional
Typestring | null
IC Light model URL used when generating images.
ic_light_model_background_image_urloptional
Typeurl · image
Model-compatible background for IC Light image generation, supplied as an image URL.
ic_light_image_urloptional
Typeurl · image
Input image URL for generation with the IC Light model.
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.
num_inference_stepsoptional
Typeinteger
Default30
1 – 150
Control how many generation steps Stable Diffusion performs; additional steps may yield a more detailed final image.
guidance_scaleoptional
Typenumber
Default7.5
0 – 20
Prompt-adherence strength for image selection, expressed as CFG (Classifier Free Guidance).
clip_skipoptional
Typeinteger
Default0
0 – 2
Skips a portion of image generation to render faster, producing slightly different results.
scheduleroptional
Typeenum
DPM++ 2MDPM++ 2M KarrasDPM++ 2M SDEDPM++ 2M SDE KarrasEulerEuler AEuler (trailing timesteps)LCMLCM (trailing timesteps)DDIMTCD
Scheduler or sampler used to denoise the image.
timestepsoptional
Typeobject
Default{"array":[],"method":"default"}
Denoising timestep schedule override, mutually exclusive with sigmas. Without an override—the default—the scheduler calculates timesteps from num_inference_steps; supplying a custom schedule makes num_inference_steps irrelevant. An override requires scheduler support for the timesteps argument to set_timesteps.
timesteps.methodoptional
Typeenum
Defaultdefault
defaultarray
Choose how timesteps are determined: 'default', the default setting, lets the scheduler use `num_inference_steps`. To supply a timestep schedule yourself, select 'array' and place the schedule in the `array` field.
timesteps.arrayoptional
Typeinteger[]
Default[]
Timestep schedule applied when the selected method is 'custom'.
sigmasoptional
Typeobject
Default{"array":[],"method":"default"}
Denoising sigma schedule override, mutually exclusive with timesteps. Without an override—the default—the scheduler calculates sigmas from num_inference_steps; supplying a custom schedule makes num_inference_steps irrelevant. An override requires scheduler support for the sigmas argument to set_sigmas.
sigmas.methodoptional
Typeenum
Defaultdefault
defaultarray
Choose how sigmas are determined: 'default', the default setting, uses the scheduler's own sigma values. To supply a sigma schedule yourself, select 'custom' and place the schedule in the `array` field.
sigmas.arrayoptional
Typenumber[]
Default[]
Sigma schedule applied when the selected method is 'custom'.
prediction_typeoptional
Typeenum
Defaultepsilon
v_predictionepsilon
Choose the prediction type for generating images; without a different selection, `epsilon` is used.
rescale_betas_snr_zerooptional
Typeboolean
Defaultfalse
Controls whether the sampler enables rescale_betas_snr_zero.
image_formatoptional
Typeenum
Defaultpng
jpegpng
File format for the resulting image.
num_imagesoptional num_outputs
Typeinteger
Default1
1 – 8
Set how many images a single request produces, allowing more generation time for a larger batch.
enable_safety_checkeroptional
Typeboolean
Defaultfalse
Safety checker activation; true enables checking.
tile_widthoptional
Typeinteger
Default4096
128 – 4,096
Set how large each tile is during image generation.
tile_heightoptional
Typeinteger
Default4096
128 – 4,096
Set how large each tile is during image generation.
tile_stride_widthoptional
Typeinteger
Default2048
64 – 2,048
Set the spacing between successive tile positions during image generation.
tile_stride_heightoptional
Typeinteger
Default2048
64 – 2,048
Set the spacing between successive tile positions during image generation.
etaoptional
Typenumber
Default0
0 – 1
Eta setting used when generating images.
debug_latentsoptional
Typeboolean
Defaultfalse
Saves latents for debugging when true.
debug_per_pass_latentsoptional
Typeboolean
Defaultfalse
Enable per-pass debugging by setting this to true, which saves the latents from every pass.
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": "lora/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": 184,
    "usd": "0.184",
    "charged": 184,
    "refunded": 0
  },
  "input": {
    "model_name": "stabilityai/stable-diffusion-xl-base-1.0",
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "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
      }
    ],
    "seed": 42,
    "has_nsfw_concepts": [
      false
    ],
    "debug_latents": {
      "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
    },
    "debug_per_pass_latents": {
      "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
    }
  },
  "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.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/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 images.
seed
integerImage-generation seed, including the randomly chosen value if the input omitted a seed; otherwise, it repeats the supplied value.
has_nsfw_concepts
array of booleanIndicates whether NSFW concepts appear in the generated images.
debug_latents
object {url, content_type, file_name, file_size} | nullLatent data stored for debugging.
debug_per_pass_latents
object {url, content_type, file_name, file_size} | nullPer-pass latent data stored for debugging.

More models: Image Editing

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