# Stable Diffusion with LoRAs · Inpaint API

> தேர்ந்தெடுக்கப்பட்ட Stable Diffusion அடிப்படை மாதிரி மற்றும் LoRAs உடன், கருப்பு-வெள்ளை முகமூடி வழிகாட்டுதலுடன் படப்பகுதி நிரப்புதல்

`model_name`-ல் அமைக்கப்பட்ட Stable Diffusion மாதிரியைப் பயன்படுத்தி, `image_url` மற்றும் கருப்பு-வெள்ளை `mask_url` மூலம் படத்தின் பகுதிகளைத் திருத்துகிறது. `noise_strength` 0 முதல் 1 வரை இருக்கும். ஒன்றிணைக்கப்பட்ட LoRAs, உட்பொதிவுகள், ControlNets, IP adapters மற்றும் பல scheduler-களை ஆதரிக்கிறது; படிகள் 1 முதல் 150 வரை இருக்கும். வெளியீடு png அல்லது jpeg வடிவில் இருக்கும்.

- Model id: `lora/inpaint`
- Made by: Open model
- Category: Image Editing
- Output: image
- Estimated price per run: $0.184 / image (cheapest run $0.184 (184 API credits))
- Run: `POST https://api.doitong.com/v1/run/lora/inpaint`
- Quote: `POST https://api.doitong.com/v1/quote/lora/inpaint`
- Docs page: https://doitong.com/ta/developers/models/lora/inpaint

## Pricing

Price: **$0.184 / image**. Estimated from the typical cost of one run, per output (`num_images`). The quote is exactly what the run charges.

The full example input below costs $0.184 = 184 API credits (1 image × 184 API credits).

Prices are the upstream price in USD, paid from the API balance in API credits (1000 API credits = 1 USD). `POST https://api.doitong.com/v1/quote/lora/inpaint` with the same JSON body returns the exact price for that input; the quote is exactly what a run charges. Invalid input is never charged and failed or canceled requests are refunded automatically.

## Input parameters

Send either the canonical name or the native field name (not both). Canonical names are the same across models.

| Parameter | Canonical name | Type | Required | Default | Allowed values / range | Description |
|---|---|---|---|---|---|---|
| `model_name` |  | string | yes |  |  | படத்தை உருவாக்குவதற்கான அடிப்படை மாதிரி; URL அல்லது HuggingFace ID மூலம் அடையாளம் காணப்படுகிறது. |
| `unet_name` |  | string \| null | no |  |  | படங்களை உருவாக்குவதற்கான தனிப்பயன் U-Net தேர்வு; அதன் HuggingFace ID அல்லது URL-ஐ வழங்கவும். |
| `variant` |  | string \| null | no |  |  | HuggingFace மாதிரி மாறுபாட்டுத் தேர்வு; 'fp16' ஓர் எடுத்துக்காட்டு. |
| `prompt` |  | string | yes |  |  | நீங்கள் உருவாக்க விரும்பும் படத்தை விவரிக்கவும்; சிறந்த முடிவுகளுக்கு இயன்ற அளவு விவரங்களைப் பயன்படுத்தவும். |
| `negative_prompt` |  | string | no | `` |  | விரும்பத்தகாத பட விவரங்களைக் குறிப்பிடும் எதிர்மறை ப்ராம்ப்ட். இது நிறங்கள், பொருட்கள், காட்சியமைப்பு அல்லது மீசை, மங்கல், குறைந்த தெளிவுத்திறன் போன்ற நுணுக்கமான அம்சங்களையும் பண்புகளையும் நீக்கலாம். |
| `prompt_weighting` |  | boolean | no | `false` |  | ப்ராம்ப்ட்-எடை நிலைமாற்றி: true embedding averaging மூலம் 77 டோக்கன் வரம்பை நீக்கி, எடை syntax-ஐ இயக்கும். |
| `image_url` | `image` | string (image URL) \| null | no |  |  | image-to-image உருவாக்கம் அல்லது inpainting-க்கான மூலப் படம் URL. |
| `mask_url` | `mask` | string (image URL) \| null | no |  |  | கருப்பு-வெள்ளைப் படத்தைச் சுட்டும் inpainting mask URL. |
| `noise_strength` |  | number | no | `0.5` | ≤ 1, > 0 | சேர்க்கப்படும் படம் noise-ஐக் கட்டுப்படுத்தும் அளவுகோல்: 1.0 முழுமையான noise-ஐக் குறிக்கும், 0-க்கு நெருக்கமான அமைப்புகள் குறைந்தபட்ச noise-ஐக் குறிக்கும். இது வழங்கப்பட்ட image_url உடன் மட்டுமே பொருந்தும். |
| `loras` |  | array of object {path, scale} | no | `[]` |  | அவற்றின் ஒருங்கிணைந்த விளைவு உருவாக்கப்பட்ட படத்தை உருவாக்கும் LoRA-கள்; வழங்கக்கூடியவற்றின் எண்ணிக்கைக்கு வரம்பில்லை. |
| `loras[].path` |  | string | yes |  |  | URL அல்லது பாதையாகக் குறிப்பிடப்படும் LoRA எடைகளின் இருப்பிடம். |
| `loras[].scale` |  | number | no | `1` | 0 – 4 | அடிப்படை மாதிரியில் இணைப்பதற்கு முன் LoRA எடைக்கு பயன்படுத்தப்படும் பெருக்கி. |
| `embeddings` |  | array of object {path, tokens} | no | `[]` |  | பட உருவாக்கத்தின்போது பயன்படுத்தப்படும் embeddings; இவை ப்ராம்ப்ட் டோக்கன்களை embedding weights-க்கு map செய்கின்றன. தற்போது ஒரு embedding மட்டுமே ஆதரிக்கப்படுகிறது. |
| `embeddings[].path` |  | string | yes |  |  | URL அல்லது கோப்பு path மூலம் குறிப்பிடப்படும் Embedding weights. |
| `embeddings[].tokens` |  | array of string \| null | no |  |  | Embedding weights-க்கு map செய்யப்படும் ப்ராம்ப்ட் டோக்கன்கள். இவற்றைத் தவிர்த்தால், embedding-file vector ஒன்றுக்கு ஒரு டோக்கன் உருவாகும்; அவை <s0>, <s1>, ... எனப் பெயரிடப்படும். உங்கள் ப்ராம்ப்ட்களில் map செய்யப்பட்ட டோக்கன்களைப் பயன்படுத்தவும். |
| `controlnets` |  | array of object {path, config_url, variant, image_url, mask_url, conditioning_scale, start_percentage, end_percentage, ip_adapter_index} | no | `[]` |  | உருவாக்கத்தின்போது குறிப்பிட்ட timesteps-ல் படத்திற்குப் பயன்படுத்த திட்டமிடப்பட்ட Control nets; வழங்கக்கூடியவற்றின் எண்ணிக்கைக்கு வரம்பில்லை. |
| `controlnets[].path` |  | string | yes |  |  | ControlNet எடையின் இருப்பிடம்; URL அல்லது பாதையாகக் குறிப்பிடப்படும். |
| `controlnets[].config_url` |  | string \| null | no |  |  | ControlNet-ன் config.json கோப்பைச் சுட்டும் விருப்ப URL. |
| `controlnets[].variant` |  | string \| null | no |  |  | Hugging Face களஞ்சிய விசையுடன் பயன்படுத்தக்கூடிய விருப்ப மாறுபாடு. |
| `controlnets[].image_url` |  | string (image URL) | yes |  |  | ControlNet உள்ளீடாக வழங்கப்படும் பட URL. |
| `controlnets[].mask_url` |  | string (image URL) \| null | no |  |  | ControlNet mask; வழங்கப்பட்டால் கட்டுப்பாட்டுப் படத்தின் அளவுடன் பொருந்த வேண்டும்; width மற்றும் height இரண்டும் 32-ஆல் வகுபட வேண்டும். |
| `controlnets[].conditioning_scale` |  | number | no | `1` | 0 – 2 | அடிப்படை மாதிரியுடன் இணைக்கப்படுவதற்கு முன் ControlNet எடைகளுக்குப் பயன்படுத்தப்படும் அளவிடுதல். |
| `controlnets[].start_percentage` |  | number | no | `0` | 0 – 1 | மொத்த timestep-களில் எந்த சதவீதத்தில் ControlNet படம் உருவாக்கத்தைப் பாதிக்கத் தொடங்கும் என்பதைக் குறிப்பிடுகிறது. |
| `controlnets[].end_percentage` |  | number | no | `1` | 0 – 1 | மொத்த timestep-களில் எந்த சதவீதத்தில் ControlNet படம் உருவாக்கத்தைப் பாதிப்பதை நிறுத்தும் என்பதைக் குறிப்பிடுகிறது. |
| `controlnets[].ip_adapter_index` |  | integer \| null | no |  |  | InstantID ControlNet-க்கான index மூலம் IP adapter தேர்வு; பிற ControlNets-க்கு இந்த அமைப்பு தேவையில்லை. |
| `controlnet_guess_mode` |  | boolean | no | `false` |  | true ஆக இருக்கும்போது ControlNet பயன்பாட்டை conditional predictions-க்கு மட்டும் கட்டுப்படுத்தும். |
| `ip_adapter` |  | array of object {ip_adapter_image_url, ip_adapter_mask_url, path, model_subfolder, weight_name, insight_face_model_path, scale, scale_json, unconditional_noising_factor, image_projection_shortcut} | no | `[]` |  | படங்களை உருவாக்கப் பயன்படுத்தப்படும் IP adapters. ஏதேனும் உள்ளீடுகளை வழங்கினால் image_encoder_path தேவை. |
| `ip_adapter[].ip_adapter_image_url` |  | string (image URL) \| array of image URL | yes |  |  | IP adapter உள்ளீடாக வழங்கப்படும் பட URL. |
| `ip_adapter[].ip_adapter_mask_url` |  | string (image URL) \| null | no |  |  | வழங்கும்போது அளவுக் கட்டுப்பாட்டுக்கு உட்படும் IP adapter mask: அதன் பரிமாணங்கள் adapter படத்தின் பரிமாணங்களுக்குச் சமமாக இருக்க வேண்டும். |
| `ip_adapter[].path` |  | string | yes |  |  | URL அல்லது பாதையாகக் குறிப்பிடப்படும் IP adapter எடைகளின் இருப்பிடம். |
| `ip_adapter[].model_subfolder` |  | string \| null | no |  |  | மாதிரிக் கோப்பகத்துக்குள் துணைக்கோப்பகமாகக் குறிப்பிடப்படும் IP adapter எடையின் இருப்பிடம். |
| `ip_adapter[].weight_name` |  | string \| null | no |  |  | எடைகளின் கோப்புப்பெயர். |
| `ip_adapter[].insight_face_model_path` |  | string \| null | no |  |  | URL அல்லது பாதையாகக் குறிப்பிடப்படும் InsightFace மாதிரி எடைகளின் இருப்பிடம். |
| `ip_adapter[].scale` |  | number | no | `1` | ≥ 0 | IP adapter எடைகளுக்கான அளவுகோல்; அவை அடிப்படை மாதிரியுடன் இணைக்கப்படுவதற்கு முன் பயன்படுத்தப்படும். |
| `ip_adapter[].scale_json` |  | object \| null | no |  |  | IP adapter எடைகளுக்கான அளவுகோல்; அவை அடிப்படை மாதிரியுடன் இணைக்கப்படுவதற்கு முன் பயன்படுத்தப்படும். |
| `ip_adapter[].unconditional_noising_factor` |  | number | no | `0` | 0 – 1 | IP adapter-க்கான நிபந்தனையற்ற noise-ஐக் கட்டுப்படுத்தும் காரணி. |
| `ip_adapter[].image_projection_shortcut` |  | boolean | no | `true` |  | True இயல்புநிலையாக உள்ள படம் projection shortcut அமைப்பு. FaceID plus V1 மாதிரிகளுக்கு False-ஐயும், FaceID plus V2 மாதிரிகளுக்கு True-ஐயும் பயன்படுத்தவும். |
| `image_encoder_path` |  | string \| null | no |  |  | HTTPS URL அல்லது Hugging Face ID மூலம் குறிப்பிடப்படும் படம் encoder; பொருந்தக்கூடிய தன்மை IP-Adapter எடைகளால் தீர்மானிக்கப்படுகிறது: SD1.5 `image_encoder_subfolder='models/image_encoder'`-ஐப் பயன்படுத்துகிறது, h94/IP-Adapter SDXL h94/IP-Adapter மற்றும் `image_encoder_subfolder='sdxl_models/image_encoder'`-ஐப் பயன்படுத்துகிறது. ip_adapter-ல் மதிப்பு இருக்கும் போதெல்லாம் encoder தேவை. |
| `image_encoder_subfolder` |  | string \| null | no |  |  | பட encoder எடைகளைக் கொண்ட image_encoder_path-க்குள் உள்ள துணைக்கோப்பகம். |
| `image_encoder_weight_name` |  | string \| null | no | `pytorch_model.bin` |  | படங்களை உருவாக்கப் பயன்படுத்த, பெயரின்படி படம் encoder-ன் எடைகளைத் தேர்ந்தெடுக்கவும். |
| `ic_light_model_url` |  | string \| null | no |  |  | படங்களை உருவாக்கப் பயன்படுத்தப்படும் IC Light மாதிரி URL. |
| `ic_light_model_background_image_url` |  | string (image URL) \| null | no |  |  | IC Light படம் உருவாக்கத்திற்கான மாதிரியுடன் பொருந்தும் பின்னணி; படம் URL ஆக வழங்கப்படுகிறது. |
| `ic_light_image_url` |  | string (image URL) \| null | no |  |  | IC Light மாதிரியுடன் உருவாக்குவதற்கான உள்ளீட்டுப் படம் URL. |
| `seed` |  | integer \| null | no |  |  | Stable Diffusion-ல் படங்களை மீண்டும் உருவாக்குவதற்கான seed. மாதிரி பதிப்பு, ப்ராம்ப்ட் மற்றும் seed ஆகியவற்றை மாற்றாமல் வைத்தால், ஒவ்வொரு இயக்கத்திலும் ஒரு படத்தைத் துல்லியமாக மீண்டும் உருவாக்கலாம். |
| `num_inference_steps` |  | integer | no | `30` | 1 – 150 | Stable Diffusion செய்யும் உருவாக்கப் படிநிலைகளின் எண்ணிக்கையைக் கட்டுப்படுத்துகிறது; கூடுதல் படிநிலைகள் இறுதிப் படத்தை மேலும் விரிவானதாக உருவாக்கலாம். |
| `guidance_scale` |  | number | no | `7.5` | 0 – 20 | படத் தேர்வுக்கான ப்ராம்ப்ட்-பின்பற்றல் வலிமை, CFG (Classifier Free Guidance) ஆக வெளிப்படுத்தப்படுகிறது. |
| `clip_skip` |  | integer | no | `0` | 0 – 2 | பட உருவாக்கத்தின் ஒரு பகுதியைத் தவிர்த்து வேகமாக render செய்யும்; இதனால் சற்றே மாறுபட்ட முடிவுகள் கிடைக்கும். |
| `scheduler` |  | enum (string) \| null | no |  | `DPM++ 2M`, `DPM++ 2M Karras`, `DPM++ 2M SDE`, `DPM++ 2M SDE Karras`, `Euler`, `Euler A`, `Euler (trailing timesteps)`, `LCM`, `LCM (trailing timesteps)`, `DDIM`, `TCD` | படத்தின் noise நீக்கத்திற்குப் பயன்படுத்தப்படும் Scheduler அல்லது sampler. |
| `timesteps` |  | object {method, array} | no | `{"array":[],"method":"default"}` |  | sigmas-க்கு பரஸ்பரம் விலக்கான denoising timestep அட்டவணை மேலெழுதல். மேலெழுதல் இல்லையெனில்—இயல்புநிலையில்—scheduler, num_inference_steps-இலிருந்து timesteps-ஐக் கணக்கிடும்; தனிப்பயன் அட்டவணையை வழங்கினால் num_inference_steps பொருத்தமற்றதாகும். மேலெழுதலுக்கு set_timesteps-ன் timesteps argument-ஐ ஆதரிக்கும் scheduler தேவை. |
| `timesteps.method` |  | enum (string) | no | `default` | `default`, `array` | timesteps எவ்வாறு தீர்மானிக்கப்பட வேண்டும் என்பதைத் தேர்ந்தெடுக்கவும்: இயல்புநிலை அமைப்பான 'default', scheduler-ஐ `num_inference_steps` பயன்படுத்த அனுமதிக்கிறது. timestep அட்டவணையை நீங்களே வழங்க, 'array' என்பதைத் தேர்ந்தெடுத்து அட்டவணையை `array` புலத்தில் வைக்கவும். |
| `timesteps.array` |  | array of integer | no | `[]` |  | தேர்ந்தெடுக்கப்பட்ட முறை 'custom' ஆக இருக்கும்போது பயன்படுத்தப்படும் timestep அட்டவணை. |
| `sigmas` |  | object {method, array} | no | `{"array":[],"method":"default"}` |  | timesteps-க்கு பரஸ்பரம் விலக்கான denoising sigma அட்டவணை மேலெழுதல். மேலெழுதல் இல்லையெனில்—இயல்புநிலையில்—scheduler, num_inference_steps-இலிருந்து sigmas-ஐக் கணக்கிடும்; தனிப்பயன் அட்டவணையை வழங்கினால் num_inference_steps பொருத்தமற்றதாகும். மேலெழுதலுக்கு set_sigmas-ன் sigmas argument-ஐ ஆதரிக்கும் scheduler தேவை. |
| `sigmas.method` |  | enum (string) | no | `default` | `default`, `array` | sigmas எவ்வாறு தீர்மானிக்கப்பட வேண்டும் என்பதைத் தேர்ந்தெடுக்கவும்: இயல்புநிலை அமைப்பான 'default', scheduler-ன் சொந்த sigma மதிப்புகளைப் பயன்படுத்துகிறது. sigma அட்டவணையை நீங்களே வழங்க, 'custom' என்பதைத் தேர்ந்தெடுத்து அட்டவணையை `array` புலத்தில் வைக்கவும். |
| `sigmas.array` |  | array of number | no | `[]` |  | தேர்ந்தெடுக்கப்பட்ட முறை 'custom' ஆக இருக்கும்போது பயன்படுத்தப்படும் Sigma அட்டவணை. |
| `prediction_type` |  | enum (string) | no | `epsilon` | `v_prediction`, `epsilon` | படங்களை உருவாக்குவதற்கான prediction வகையைத் தேர்ந்தெடுக்கவும்; வேறு தேர்வு இல்லையெனில் `epsilon` பயன்படுத்தப்படும். |
| `rescale_betas_snr_zero` |  | boolean | no | `false` |  | sampler rescale_betas_snr_zero-ஐ இயக்குகிறதா என்பதைக் கட்டுப்படுத்துகிறது. |
| `image_format` |  | enum (string) | no | `png` | `jpeg`, `png` | விளைவாக வரும் படத்திற்கான கோப்பு வடிவம். |
| `num_images` | `num_outputs` | integer | no | `1` | 1 – 8 | ஒரு கோரிக்கை உருவாக்கும் படங்களின் எண்ணிக்கையை அமைக்கவும்; பெரிய batch-க்கு அதிக உருவாக்க நேரத்தை அனுமதிக்கிறது. |
| `enable_safety_checker` |  | boolean | no | `false` |  | பாதுகாப்புச் சரிபார்ப்பைச் செயல்படுத்துதல்; true எனில் சரிபார்ப்பு இயக்கப்படும். |
| `tile_width` |  | integer | no | `4096` | 128 – 4,096 | பட உருவாக்கத்தின்போது ஒவ்வொரு tile-ன் அளவை அமைக்கவும். |
| `tile_height` |  | integer | no | `4096` | 128 – 4,096 | பட உருவாக்கத்தின்போது ஒவ்வொரு tile-ன் அளவை அமைக்கவும். |
| `tile_stride_width` |  | integer | no | `2048` | 64 – 2,048 | பட உருவாக்கத்தின்போது தொடர்ச்சியான tile நிலைகளுக்கு இடையிலான இடைவெளியை அமைக்கவும். |
| `tile_stride_height` |  | integer | no | `2048` | 64 – 2,048 | பட உருவாக்கத்தின்போது தொடர்ச்சியான tile நிலைகளுக்கு இடையிலான இடைவெளியை அமைக்கவும். |
| `eta` |  | number | no | `0` | 0 – 1 | படங்களை உருவாக்கும்போது பயன்படுத்தப்படும் Eta அமைப்பு. |
| `debug_latents` |  | boolean | no | `false` |  | true ஆக இருக்கும்போது debugging-க்காக latents-ஐச் சேமிக்கிறது. |
| `debug_per_pass_latents` |  | boolean | no | `false` |  | இதை true என அமைப்பதன் மூலம் ஒவ்வொரு pass-க்குமான debugging-ஐ இயக்கவும்; இது ஒவ்வொரு pass-இலிருந்தும் latents-ஐச் சேமிக்கிறது. |

File parameters (`image`, `mask`, `ic_light_model_background_image_url`, `ic_light_image_url`) take a public `https://` URL, a `data:` URI up to 10 MB, or the `file_url` of an upload from `POST /files`.

## Example input

Required parameters only:

```json
{
  "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"
}
```

A fuller example:

```json
{
  "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"
}
```

## Run it

Set `DOITONG_API_KEY` to a key from https://doitong.com/developers/dashboard#keys. `?wait=20` returns the finished request in the same call when it is ready within 20 seconds; otherwise poll `GET /requests/{id}` (it also accepts `?wait=`), or pass `webhook_url`.

### curl

```bash
# 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"
```

### JavaScript

```javascript
const API = "https://api.doitong.com/v1";
const headers = {
  "Authorization": "Bearer " + process.env.DOITONG_API_KEY,
  "Content-Type": "application/json",
};

// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/lora/inpaint?wait=20", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "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"
  }),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);

// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
  res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
  request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
```

### Python

```python
import os
import requests

API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}

payload = {
    "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",
}

# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/lora/inpaint", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
    raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])

# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
    request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
    raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
```

### MCP

The MCP server at `https://api.doitong.com/v1/mcp` exposes the tools `search_models`, `get_model`, `quote`, `run`, `get_request`, `cancel_request`, `list_requests`, `create_upload` and `get_account`. A `run` call for this model:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "run",
    "arguments": {
      "model_id": "lora/inpaint",
      "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"
      },
      "wait_seconds": 20
    }
  }
}
```

## Response

Every call returns a request object. `status` is one of `queued`, `running`, `succeeded`, `failed`, `canceled`. `outputs` lists the generated files with URLs on our storage (kept forever, or 7 days with `?storage=temporary`; `storage` says which); `output` is the model's own result object with the same URLs.

```json
{
  "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"
  }
}
```

### Output fields (`output`)

| Field | Type | Description |
|---|---|---|
| `images` | array of object {url, content_type, file_name, file_size, width, height} | உருவாக்கப்பட்ட படங்களுக்கான கோப்புத் தகவல். |
| `seed` | integer | பட உருவாக்க விதை; உள்ளீட்டில் விதை விடுபட்டிருந்தால் தோராயமாகத் தேர்ந்தெடுக்கப்பட்ட மதிப்பும் இதில் அடங்கும்; இல்லையெனில் வழங்கப்பட்ட மதிப்பை மீண்டும் பயன்படுத்தும். |
| `has_nsfw_concepts` | array of boolean | உருவாக்கப்பட்ட படங்களில் NSFW கருத்துகள் உள்ளனவா என்பதைக் குறிப்பிடுகிறது. |
| `debug_latents` | object {url, content_type, file_name, file_size} \| null | debugging-க்காகச் சேமிக்கப்பட்ட latent தரவு. |
| `debug_per_pass_latents` | object {url, content_type, file_name, file_size} \| null | debugging-க்காகச் சேமிக்கப்பட்ட ஒவ்வொரு pass-க்குமான latent தரவு. |

## Related models

- [Stable Diffusion with LoRAs](https://doitong.com/developers/models/lora.md) (`lora`): $0.057 / image
- [Stable Diffusion with LoRAs · Image to Image](https://doitong.com/developers/models/lora/image-to-image.md) (`lora/image-to-image`): $0.264 / image
- [FLUX.1 Kontext \[pro\]](https://doitong.com/developers/models/flux-pro/kontext.md) (`flux-pro/kontext`): $0.04 / image
- [GPT Image 2.5 Edit](https://doitong.com/developers/models/openai/gpt-image-2.5/flare/edit.md) (`openai/gpt-image-2.5/flare/edit`): from $0.12 / image
- [Nano Banana 2 Edit](https://doitong.com/developers/models/nano-banana-2/edit.md) (`nano-banana-2/edit`): from $0.06 / image
- [Nano Banana Pro Edit](https://doitong.com/developers/models/nano-banana-pro/edit.md) (`nano-banana-pro/edit`): from $0.15 / image
- [Qwen Image 3 Edit](https://doitong.com/developers/models/alibaba/qwen-image-3/edit.md) (`alibaba/qwen-image-3/edit`): from $0.04 / image
- [Seedream 5.0 Pro Edit](https://doitong.com/developers/models/bytedance/seedream/v5/pro/edit.md) (`bytedance/seedream/v5/pro/edit`): from $0.0675 / run of output image

## Links

- HTML page: https://doitong.com/developers/models/lora/inpaint
- All models and guides for AI agents: https://doitong.com/developers/llms.txt
- OpenAPI 3.1 with this model's typed request body: https://doitong.com/developers/openapi.json?model=lora/inpaint
- Errors: https://doitong.com/developers/docs/errors
- Model details as JSON: https://api.doitong.com/v1/models/lora/inpaint
