# FLUX.1 [dev] with Controlnets and Loras · Differential Diffusion API

> ஒவ்வொரு பகுதியும் எவ்வளவு வலுவாக மாற்றப்பட வேண்டும் என்பதை அமைக்கும் மாற்ற வரைபடத்தால் இயக்கப்படும் FLUX.1 [dev] படத் திருத்தம்

ஒவ்வொரு பகுதியையும் தனித்தனியாக மாற்றுகிறது; ஒவ்வொரு பகுதியும் எவ்வளவு மாற்றப்பட வேண்டும் என்பதைக் கட்டுப்படுத்த மாற்ற வரைபடப் படத்தைப் பயன்படுத்துகிறது. `prompt`, `image_url` மற்றும் `change_map_image_url` தேவை. LoRAs, ControlNets, IP-Adapters மற்றும் குறிப்பு படத்தையும் ஏற்கிறது. `num_inference_steps` 1 முதல் 50 வரை, `num_images` அதிகபட்சம் 10 வரை; வெளியீடு png அல்லது jpeg வடிவில் இருக்கும்.

- Model id: `flux-general/differential-diffusion`
- Made by: Black Forest Labs
- Category: Image Editing
- Output: image
- Estimated price per run: $0.138 / image (cheapest run $0.138 (138 API credits))
- Run: `POST https://api.doitong.com/v1/run/flux-general/differential-diffusion`
- Quote: `POST https://api.doitong.com/v1/quote/flux-general/differential-diffusion`
- Docs page: https://doitong.com/ta/developers/models/flux-general/differential-diffusion

## Pricing

Price: **$0.138 / 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.138 = 138 API credits (1 image × 138 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/flux-general/differential-diffusion` 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 |
|---|---|---|---|---|---|---|
| `prompt` |  | string | yes |  |  | பட உருவாக்கத்தை வழிநடத்தும் ப்ராம்ப்ட். |
| `image_size` |  | object {width, height} \| enum (string) | no |  | `square_hd`, `square`, `portrait_4_3`, `portrait_16_9`, `landscape_4_3`, `landscape_16_9` | உருவாக்கப்பட்ட படத்தின் பரிமாணங்கள். |
| `num_inference_steps` |  | integer | no | `28` | 1 – 50 | இயக்க வேண்டிய inference படிகளின் எண்ணிக்கை. |
| `seed` |  | integer \| null | no |  |  | மீண்டும் உருவாக்கக்கூடிய படங்களுக்கான seed: மாதிரி பதிப்பு மாறாதபோது, ஒரே ப்ராம்ப்ட் மற்றும் seed ஒரே படத்தை உருவாக்கும். |
| `loras` |  | array of object {path, scale} | no | `[]` |  | அவற்றின் ஒருங்கிணைந்த விளைவு உருவாக்கப்பட்ட படத்தை உருவாக்கும் LoRA-கள்; வழங்கக்கூடியவற்றின் எண்ணிக்கைக்கு வரம்பில்லை. |
| `loras[].path` |  | string | yes |  |  | URL அல்லது பாதையாகக் குறிப்பிடப்படும் LoRA எடைகளின் இருப்பிடம். |
| `loras[].scale` |  | object \| number | no | `1` |  | அடிப்படை மாதிரியுடன் இணைக்கப்படுவதற்கு முன் LoRA எடைகளுக்குப் பயன்படுத்தப்படும் அளவீடு. தனிப்பட்ட அடுக்கு அளவீடுகளை அமைக்க {"layer_name":layer_scale} வடிவிலான அகராதியை வழங்கவும்; குறிப்பிடப்படாத அடுக்குகள் 1.0-ஐப் பயன்படுத்தும். |
| `control_loras` |  | array of object {path, scale, control_image_url, preprocess} | no | `[]` |  | இறுதிப் படத்தை உருவாக்க ஒருங்கிணைந்த உள்ளமைவாக இணைக்கப்படும் கட்டுப்பாட்டுப் பட LoRA-கள்; வழங்கப்படும் எண்ணிக்கைக்கு வரம்பில்லை. |
| `control_loras[].path` |  | string | yes |  |  | URL அல்லது பாதையாகக் குறிப்பிடப்படும் LoRA எடைகளின் இருப்பிடம். |
| `control_loras[].scale` |  | object \| number | no | `1` |  | அடிப்படை மாதிரியுடன் இணைக்கப்படுவதற்கு முன் LoRA எடைகளுக்குப் பயன்படுத்தப்படும் அளவீடு. தனிப்பட்ட அடுக்கு அளவீடுகளை அமைக்க {"layer_name":layer_scale} வடிவிலான அகராதியை வழங்கவும்; குறிப்பிடப்படாத அடுக்குகள் 1.0-ஐப் பயன்படுத்தும். |
| `control_loras[].control_image_url` |  | string (image URL) | yes |  |  | கட்டுப்பாட்டுப் படத்தை வழங்கும் பட URL. |
| `control_loras[].preprocess` |  | enum (string) | no | `None` | `canny`, `depth`, `None` | வழங்கப்பட்ட படத்திற்குப் பயன்படுத்தப்படும் முன்செயலாக்க முறை. |
| `controlnets` |  | array of object {path, config_url, variant, control_image_url, mask_image_url, mask_threshold, conditioning_scale, start_percentage, end_percentage} | no | `[]` |  | பட உருவாக்கத்திற்கான ControlNet உள்ளமைவு; தற்போது ஒரே ControlNet-க்கு மட்டுப்படுத்தப்பட்டுள்ளது. |
| `controlnets[].path` |  | string | yes |  |  | ControlNet எடையின் இருப்பிடம்; URL அல்லது பாதையாகக் குறிப்பிடப்படும். |
| `controlnets[].config_url` |  | string \| null | no |  |  | ControlNet-ன் config.json கோப்பைச் சுட்டும் விருப்ப URL. |
| `controlnets[].variant` |  | string \| null | no |  |  | Hugging Face களஞ்சிய விசையுடன் பயன்படுத்தக்கூடிய விருப்ப மாறுபாடு. |
| `controlnets[].control_image_url` |  | string (image URL) | yes |  |  | கட்டுப்பாட்டுப் படத்தை வழங்கும் பட URL. |
| `controlnets[].mask_image_url` |  | string (image URL) | no |  |  | கட்டுப்பாட்டுப் படத்துடன் தொடர்புடைய முகமூடி URL. |
| `controlnets[].mask_threshold` |  | number | no | `0.5` | 0.01 – 0.99 | முகமூடி வரம்பு மதிப்பு. |
| `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 படம் உருவாக்கத்தைப் பாதிப்பதை நிறுத்தும் என்பதைக் குறிப்பிடுகிறது. |
| `controlnet_unions` |  | array of object {path, config_url, variant, controls} | no | `[]` |  | படம் உருவாக்கத்திற்கான ControlNet union உள்ளமைவு; தற்போதைய ஒற்றை-ControlNet கட்டுப்பாட்டிற்கு உட்பட்டது. |
| `controlnet_unions[].path` |  | string | yes |  |  | ControlNet எடையின் இருப்பிடம்; URL அல்லது பாதையாகக் குறிப்பிடப்படும். |
| `controlnet_unions[].config_url` |  | string \| null | no |  |  | ControlNet-ன் config.json கோப்பைச் சுட்டும் விருப்ப URL. |
| `controlnet_unions[].variant` |  | string \| null | no |  |  | Hugging Face களஞ்சிய விசையுடன் பயன்படுத்தக்கூடிய விருப்ப மாறுபாடு. |
| `controlnet_unions[].controls` |  | array of object {control_image_url, mask_image_url, control_mode, conditioning_scale, mask_threshold, start_percentage, end_percentage} | yes |  |  | ControlNet-க்கு வழங்கப்படும் கட்டுப்பாட்டுப் படங்களும் அவற்றுடன் தொடர்புடைய முறைகளும். |
| `controlnet_unions[].controls[].control_image_url` |  | string (image URL) | yes |  |  | கட்டுப்பாட்டுப் படத்தை வழங்கும் பட URL. |
| `controlnet_unions[].controls[].mask_image_url` |  | string (image URL) | no |  |  | கட்டுப்பாட்டுப் படத்துடன் தொடர்புடைய முகமூடி URL. |
| `controlnet_unions[].controls[].control_mode` |  | enum (string) | yes |  | `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, `low-quality` | Flux Controlnet Union பயன்படுத்தும் கட்டுப்பாட்டு முறை. Options: canny விளிம்புகளைப் பயன்படுத்தி உருவாக்கத்தை வழிநடத்தும்; tile tiles-ஐப் பயன்படுத்தி வழிநடத்தும்; depth grayscale depth map-ஐப் பயன்படுத்தி வழிநடத்தும்; blur படத்தை மங்கலாக்கும்; pose படத்தின் pose-ஐப் பயன்படுத்தி உருவாக்கத்தை வழிநடத்தும்; gray படத்தை grayscale-ஆக மாற்றும்; low-quality படத்தின் குறைந்த தரப் பதிப்பை உருவாக்கும். |
| `controlnet_unions[].controls[].conditioning_scale` |  | number | no | `1` | 0 – 2 | அடிப்படை மாதிரியுடன் இணைக்கப்படுவதற்கு முன் ControlNet எடைகளுக்குப் பயன்படுத்தப்படும் அளவிடுதல். |
| `controlnet_unions[].controls[].mask_threshold` |  | number | no | `0.5` | 0.01 – 0.99 | முகமூடி வரம்பு மதிப்பு. |
| `controlnet_unions[].controls[].start_percentage` |  | number | no | `0` | 0 – 1 | மொத்த timestep-களில் எந்த சதவீதத்தில் ControlNet படம் உருவாக்கத்தைப் பாதிக்கத் தொடங்கும் என்பதைக் குறிப்பிடுகிறது. |
| `controlnet_unions[].controls[].end_percentage` |  | number | no | `1` | 0 – 1 | மொத்த timestep-களில் எந்த சதவீதத்தில் ControlNet படம் உருவாக்கத்தைப் பாதிப்பதை நிறுத்தும் என்பதைக் குறிப்பிடுகிறது. |
| `ip_adapters` |  | array of object {path, subfolder, weight_name, image_encoder_path, image_encoder_subfolder, image_encoder_weight_name, image_url, mask_image_url, mask_threshold, scale} | no | `[]` |  | படம் உருவாக்கத்தின்போது பயன்படுத்தப்படும் IP-Adapter. |
| `ip_adapters[].path` |  | string | yes |  |  | Hugging Face-இல் IP-Adapter இருக்கும் இடம். |
| `ip_adapters[].subfolder` |  | string \| null | no |  |  | ip_adapter எடைகளைக் கொண்ட துணைக் கோப்புறை. |
| `ip_adapters[].weight_name` |  | string \| null | no |  |  | IP-Adapter-ன் எடைகளுக்கான Safetensors கோப்புப் பெயர். |
| `ip_adapters[].image_encoder_path` |  | string | yes |  |  | IP-Adapter படக் குறியாக்கியின் இருப்பிடம், உதாரணமாக 'openai/clip-vit-large-patch14'. |
| `ip_adapters[].image_encoder_subfolder` |  | string \| null | no |  |  | படக் குறியாக்கிக்கான எடைகளைக் கொண்ட துணைக் கோப்புறை. |
| `ip_adapters[].image_encoder_weight_name` |  | string \| null | no |  |  | படக் குறியாக்கியின் பெயர். |
| `ip_adapters[].image_url` |  | string (image URL) | yes |  |  | IP-Adapter-க்கு வழங்கப்படும் conditioning பட URL. |
| `ip_adapters[].mask_image_url` |  | string (image URL) \| null | no |  |  | கட்டுப்பாட்டுப் படத்துடன் தொடர்புடைய முகமூடி URL. |
| `ip_adapters[].mask_threshold` |  | number | no | `0.5` | 0.01 – 0.99 | முகமூடி வரம்பு மதிப்பு. |
| `ip_adapters[].scale` |  | number | yes |  |  | IP-Adapter அளவிடுதல் காரணி. |
| `easycontrols` |  | array of object {control_method_url, scale, image_url, image_control_type} | no | `[]` |  | படம் உருவாக்கத்தின்போது பயன்படுத்தப்படும் EasyControl உள்ளீடுகள். |
| `easycontrols[].control_method_url` |  | string | yes |  |  | கட்டுப்பாட்டு முறையின் safetensor எடை URL அல்லது ஆதரிக்கப்படும் அடையாளங்காட்டி: `canny`, `depth`, `hedsketch`, `inpainting`, `pose`, `seg`, `subject`, `ghibli`. |
| `easycontrols[].scale` |  | number | no | `1` | 0 – 2 | கட்டுப்பாட்டு முறையின் அளவிடுதல் காரணி. |
| `easycontrols[].image_url` |  | string (image URL) | yes |  |  | கட்டுப்பாட்டு உள்ளீட்டை வழங்கும் படம் URL. |
| `easycontrols[].image_control_type` |  | enum (string) | yes |  | `subject`, `spatial` | படக் கட்டுப்பாட்டு முறை; `spatial` அல்லது `subject` ஆகியவற்றில் ஒன்றை ஏற்கும். |
| `fill_image` |  | object {fill_image_url} \| null | no |  |  | உருவாக்கத்தை வழிநடத்தும் உள்ளீட்டுப் படம்; முகமூடி பகுதிகளுக்கான உள்ளடக்கத்தையும் வழங்கலாம். |
| `fill_image.fill_image_url` |  | string (image URL) \| array of image URL | no | `[]` |  | redux prompting மூலம் நிரப்புவதற்கான பட URL-கள். |
| `guidance_scale` |  | number | no | `3.5` | 0 – 20 | படத் தேர்வுக்கான ப்ராம்ப்ட்-பின்பற்றல் வலிமை, CFG (Classifier Free Guidance) ஆக வெளிப்படுத்தப்படுகிறது. |
| `real_cfg_scale` |  | number | no | `3.5` | 0 – 5 | படத் தேர்வுக்கான ப்ராம்ப்ட்-பின்பற்றல் வலிமை, CFG (Classifier Free Guidance) ஆக வெளிப்படுத்தப்படுகிறது. |
| `use_real_cfg` |  | boolean | no | `false` |  | Classical CFG switch, XLabs IP-Adapter v1 உடன் தானாக இயக்கப்படும். வழிகாட்டும் நடத்தை SD1.5 மற்றும் SDXL போன்ற மாதிரிகளுக்கு ஒத்ததாகும். |
| `use_cfg_zero` |  | boolean | no | `false` |  | https://arxiv.org/abs/2503.18886 இல் விவரிக்கப்பட்ட CFG-zero initialization sampling-ஐ இயக்கும். |
| `num_images` | `num_outputs` | integer | no | `1` | 1 – 10 | உருவாக்க வேண்டிய படங்களின் எண்ணிக்கையை அமைக்கவும்; வெளியீடு stream செய்யப்படும்போது இந்தத் தேர்வு 1 என நிலைப்படுத்தப்படும். |
| `enable_safety_checker` |  | boolean | no | `true` |  | பாதுகாப்புச் சரிபார்ப்பு; பாதுகாப்பற்றதாகக் குறிக்கப்பட்ட படங்களுக்குப் பதிலாகக் கருப்புப் படங்களைத் திருப்பியளிக்கும். true எனில் சரிபார்ப்பு இயக்கப்படும்; false எனில் அங்கீகரிக்கப்பட்ட கணக்குகளுக்கு மட்டும் முடக்கப்படும்; அங்கீகாரம் இல்லாத கோரிக்கைகள் எப்போதும் சரிபார்க்கப்படும். |
| `reference_image_url` |  | string (image URL) | no |  |  | Reference-Only வழிகாட்டலுக்குப் பயன்படுத்தப்படும் படம் URL. |
| `reference_strength` |  | number | no | `0.65` | -3 – 3 | reference_only உருவாக்கத்தின்போது reference படத்தின் தாக்கம்; reference படம் வழங்கப்படாவிட்டால், இந்த வலிமை அமைப்பு எந்த விளைவையும் ஏற்படுத்தாது. |
| `reference_start` |  | number | no | `0` | 0 – 1 | அனைத்து timestep-களின் சதவீதமாகக் குறிப்பிடப்படும் reference வழிகாட்டலின் தொடக்கப் புள்ளி. |
| `reference_end` |  | number | no | `1` | 0 – 1 | அனைத்து timestep-களின் சதவீதமாகக் குறிப்பிடப்படும் reference வழிகாட்டலின் முடிவுப் புள்ளி. |
| `base_shift` |  | number | no | `0.5` | 0.01 – 5 | திட்டமிடப்பட்ட timestep-களுக்குப் பயன்படுத்தப்படும் அடிப்படை shift. |
| `max_shift` |  | number | no | `1.15` | 0.01 – 5 | திட்டமிடப்பட்ட timestep-களுக்குப் பயன்படுத்தப்படும் அதிகபட்ச shift. |
| `output_format` |  | enum (string) | no | `png` | `jpeg`, `png` | விளைவாக வரும் படத்திற்கான கோப்பு வடிவம். |
| `use_beta_schedule` |  | boolean | no | `false` |  | beta sigmas-ஐப் பயன்படுத்த வேண்டுமா என்பதைக் கட்டுப்படுத்தும். |
| `sigma_schedule` |  | string \| null | no |  |  | denoising-இல் பயன்படுத்தப்படும் Sigma schedule. |
| `scheduler` |  | enum (string) | no | `euler` | `euler`, `dpmpp_2m` | denoising-இல் பயன்படுத்தப்படும் Scheduler. |
| `negative_prompt` |  | string | no | `` |  | உருவாக்கப்பட்ட படங்களில் குறிப்பிடப்பட்ட தேவையற்ற அம்சங்களைத் தவிர்க்க, இயல்புநிலையாக NAG மூலம் செயலாக்கப்படும் எதிர்மறை ப்ராம்ப்ட். |
| `nag_scale` |  | number | no | `3` | ≤ 10, > 1 | NAG scale மூலம் கட்டுப்படுத்தப்படும் எதிர்மறை ப்ராம்ப்ட் தவிர்ப்பு: இதை அதிகரித்தால், உருவாக்கப்பட்ட படம் எதிர்மறை விளக்கத்தைப் போல இருப்பது குறையும். |
| `nag_tau` |  | number | no | `2.5` | > 0 | hidden-state normalization-க்கான NAG tau அமைப்பு; இதை மாற்றாமல் விடுவது பரிந்துரைக்கப்படுகிறது. இதை அதிகரிப்பது normalization-ஐ வலுவிழக்கச் செய்து, அசல் படத்திலிருந்து எதிர்பாராத விலகல்களை ஏற்படுத்தக்கூடும். |
| `nag_alpha` |  | number | no | `0.25` | ≤ 1, > 0 | நேர்மறை மற்றும் எதிர்மறை ப்ராம்ப்ட்களை இணைக்கும் normalized guidance-ஐ நேர்மறை ப்ராம்ப்ட் எவ்வளவு திசைதிருப்பும் என்பதை NAG alpha அமைக்கிறது. இந்த இறுதி weighting, குறைந்த அமைப்புகளில் நேர்மறை ப்ராம்ப்ட்டுக்கு அதிக தாக்கத்தையும், அதிக அமைப்புகளில் குறைந்த திசைதிருப்பலையும் வழங்குகிறது. |
| `nag_end` |  | number | no | `0.25` | ≤ 1, > 0 | உருவாக்கப் படிகளின் விகிதமாகக் குறிப்பிடப்படும் NAG cutoff. NAG ஆரம்ப விகிதத்தில் இயங்கிய பிறகு FLUX-ன் அசல் attention processors பொறுப்பேற்கும். |
| `image_url` | `image` | string (image URL) | yes |  |  | ஆரம்பப் படத்தை வழங்கும் படம் URL. |
| `change_map_image_url` |  | string (image URL) | yes |  |  | change map-ஐச் சுட்டும் URL. |
| `strength` |  | number | no | `0.85` | 0.01 – 1 | 0.0-இல் அசலைப் பாதுகாப்பதிலிருந்து 1.0-இல் முழுமையாக மறுஉருவாக்குவது வரை உள்ள differential diffusion வலிமை. |

File parameters (`reference_image_url`, `image`, `change_map_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
{
  "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
  "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
  "change_map_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
```

A fuller example:

```json
{
  "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
  "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
  "change_map_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
```

## 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/flux-general/differential-diffusion?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "change_map_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.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/flux-general/differential-diffusion?wait=20", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "change_map_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }),
});
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 = {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "change_map_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
}

# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/flux-general/differential-diffusion", 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": "flux-general/differential-diffusion",
      "input": {
        "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
        "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
        "change_map_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
      },
      "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": "flux-general/differential-diffusion",
  "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": 138,
    "usd": "0.138",
    "charged": 138,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "change_map_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",
        "width": 1024,
        "height": 768,
        "content_type": "image/jpeg"
      }
    ],
    "timings": {},
    "seed": 42,
    "has_nsfw_concepts": [
      false
    ],
    "prompt": "string"
  },
  "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, width, height, content_type} | உருவாக்கப்பட்ட படங்களுக்கான கோப்புத் தகவல். |
| `timings` | object |  |
| `seed` | integer | பட உருவாக்க விதை; உள்ளீட்டில் விதை விடுபட்டிருந்தால் தோராயமாகத் தேர்ந்தெடுக்கப்பட்ட மதிப்பும் இதில் அடங்கும்; இல்லையெனில் வழங்கப்பட்ட மதிப்பை மீண்டும் பயன்படுத்தும். |
| `has_nsfw_concepts` | array of boolean | உருவாக்கப்பட்ட படங்களில் NSFW கருத்துகள் உள்ளனவா என்பதைக் குறிப்பிடுகிறது. |
| `prompt` | string | பட உருவாக்கத்தின்போது பயன்படுத்தப்படும் ப்ராம்ப்ட். |

## Related models

- [FLUX.1 \[dev\] with Controlnets and Loras](https://doitong.com/developers/models/flux-general.md) (`flux-general`): $0.30 / image
- [FLUX.1 \[dev\] with Controlnets and Loras · Image to Image](https://doitong.com/developers/models/flux-general/image-to-image.md) (`flux-general/image-to-image`): $0.15 / image
- [FLUX.1 \[dev\] with Controlnets and Loras · Inpainting](https://doitong.com/developers/models/flux-general/inpainting.md) (`flux-general/inpainting`): $0.192 / image
- [FLUX.1 \[dev\] with Controlnets and Loras · Rf Inversion](https://doitong.com/developers/models/flux-general/rf-inversion.md) (`flux-general/rf-inversion`): $0.025 / 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

## Links

- HTML page: https://doitong.com/developers/models/flux-general/differential-diffusion
- 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=flux-general/differential-diffusion
- Errors: https://doitong.com/developers/docs/errors
- Model details as JSON: https://api.doitong.com/v1/models/flux-general/differential-diffusion
