Image-to-image
Send a source image and a text prompt that describes the edit. Some models also take several source images, for example to put the subject of one image into the scene of another. The response contains the edited image. The request is synchronous. There is no task to poll.Models
See Choosing a model for a comparison, and Performance tiers for the tiers that each model serves.
Endpoint
Request
Every request must include your API key and a JSON content type. See Authentication.The model that edits the image.Options:
nunchux-flux.2-klein-4b-edit, nunchux-flux.2-klein-9b-edit, nunchux-flux.2-klein-4b-base-edit, nunchux-flux.2-klein-9b-base-edit, nunchux-qwen-image-edit-2511-lightning, nunchux-qwen-image-edit-2511, nunchux-qwen-image-edit-2509-lightning, nunchux-qwen-image-edit-2509, nunchux-qwen-image-edit, nunchux-flux.2-dev, nunchux-flux.3-image-klein-edit, nunchux-flux.3-image-klein-base-edit, nunchux-qwen-image-2.1-edit, nunchux-qwen-image-2.1-turbo-editThe source image, as a data URI (for example
data:image/png;base64,...) or as a public URL. Send the source image in url or in image, not in both. Supported formats: PNG, JPEG, WebP. Maximum size: 10 MB. Each side must be at least 64 px. The aspect ratio must be no more extreme than 8:1 in either orientation. A remote URL must resolve to a public host. Nunchux does not follow redirects.When you send a data URI, Nunchux keeps a copy of the image so that it appears in your request history for 7 days.One source image, or a list of source images. Use a list to send more than one image. Each item follows the same rules as
url: a data URI or a public URL. You can mix both kinds in one list. The model receives the images in the order of the list.The number of images that each model takes is in the Models table. A list with more images than the model takes, or an empty list, returns a 400 with the invalid_request code.A text description of the edit. Say what to change, add or remove.On Qwen Image 2.1 Edit, the prompt and the source images share 8192 positions. Each prompt token uses one. Each source image uses 64 when it is square, and up to 182 when it is long and narrow, such as 8:1. A request that needs more positions returns a 400 with
error.details.field set to prompt.The balance of speed and cost. See Performance tiers.Options:
radical_speed, radical_valueQwen Image Edit and FLUX.2 dev have radical_speed only. On them, radical_value returns a 400.Output width in pixels. Send it together with
height. Range: 1 to 8192. On Qwen Image Edit, Qwen Image Edit 2511, Qwen Image Edit 2511 Lightning, Qwen Image Edit 2509, Qwen Image Edit 2509 Lightning, FLUX.2 dev and FLUX.2 Klein 4B Base Edit, FLUX.2 Klein 9B Base Edit: 256 to 2048, in steps of 16. On FLUX 3 Image Klein Edit and FLUX 3 Image Klein Base Edit: 256 to 4096, in steps of 16. On Radical Value, FLUX 3 Image Klein Edit and FLUX 3 Image Klein Base Edit take at most 4,194,304 pixels (width times height, the area of 2048x2048), so 4096x1024 works and 2576x1632 returns a 400. On Qwen Image 2.1 Edit and Qwen Image 2.1 Turbo Edit: 256 to 2752, in steps of 32. A size that is a multiple of 16 but not of 32, such as 1040, returns a 400 on them.Output height in pixels. Send it together with
width. Range: 1 to 8192. On Qwen Image Edit, Qwen Image Edit 2511, Qwen Image Edit 2511 Lightning, Qwen Image Edit 2509, Qwen Image Edit 2509 Lightning, FLUX.2 dev and FLUX.2 Klein 4B Base Edit, FLUX.2 Klein 9B Base Edit: 256 to 2048, in steps of 16. On FLUX 3 Image Klein Edit and FLUX 3 Image Klein Base Edit: 256 to 4096, in steps of 16. On Radical Value, FLUX 3 Image Klein Edit and FLUX 3 Image Klein Base Edit take at most 4,194,304 pixels (width times height, the area of 2048x2048), so 4096x1024 works and 2576x1632 returns a 400. On Qwen Image 2.1 Edit and Qwen Image 2.1 Turbo Edit: 256 to 2752, in steps of 32. A size that is a multiple of 16 but not of 32, such as 1040, returns a 400 on them.The format of the returned image.Options:
url, b64_jsonIn both formats, Nunchux keeps the generated image for 7 days, so that it appears in your request history. Then Nunchux deletes it.Qwen Image Edit, Qwen Image Edit 2511, Qwen Image Edit 2511 Lightning, Qwen Image Edit 2509, Qwen Image Edit 2509 Lightning, FLUX.2 dev, FLUX.2 Klein 4B Base Edit, FLUX.2 Klein 9B Base Edit, FLUX 3 Image Klein Edit, FLUX 3 Image Klein Base Edit and Qwen Image 2.1 Edit only. The number of denoising steps. Range: 1 to 8 on the two Lightning models, 1 to 16 on FLUX 3 Image Klein Edit, 16 to 50 on FLUX 3 Image Klein Base Edit, 1 to 50 on the others. Default: 8 on the two Lightning models, 16 on FLUX 3 Image Klein Edit, 40 on Qwen Image Edit 2511, Qwen Image Edit 2509 and Qwen Image 2.1 Edit, 50 on the others. More steps give more detail, but take longer. Qwen Image 2.1 Turbo Edit takes no
steps: it returns a 400.Qwen Image Edit, Qwen Image Edit 2511, Qwen Image Edit 2509 and Qwen Image 2.1 Edit only. How closely the edit follows the prompt, and how strongly it avoids the
negative_prompt. Range: 0.0 to 20.0. Default: 4.0 on Qwen Image Edit, Qwen Image Edit 2511 and Qwen Image Edit 2509, 1.0 on Qwen Image 2.1 Edit.On Qwen Image 2.1 Edit, the default 1.0 has no effect. Send a value above 1.0 together with negative_prompt.FLUX.2 dev, FLUX.2 Klein 4B Base Edit, FLUX.2 Klein 9B Base Edit and FLUX 3 Image Klein Base Edit only. How closely the edit follows the prompt. Range: 0.0 to 20.0. Default: 4.0.
Qwen Image Edit, Qwen Image Edit 2511, Qwen Image Edit 2509, Qwen Image 2.1 Edit, FLUX.2 Klein 4B Base Edit, FLUX.2 Klein 9B Base Edit and FLUX 3 Image Klein Base Edit only. What the edited image must not show. On Qwen Image 2.1 Edit, it takes effect only when you also send
true_cfg_scale above 1.0.FLUX 3 Image Klein Edit, FLUX 3 Image Klein Base Edit, Qwen Image 2.1 Edit and Qwen Image 2.1 Turbo Edit only. With
standard, Nunchux rewrites the prompt into a detailed description of the result before the image renders. The response returns the rewritten prompt as revised_prompt. On FLUX.2 Klein 4B Base Edit and FLUX.2 Klein 9B Base Edit, any value other than off returns a 400.On FLUX 3 Image Klein Edit and FLUX 3 Image Klein Base Edit, the rewrite adds about 3 to 4 seconds. These models follow a full description much better than a short prompt, so send standard unless your prompt already describes the whole result. On Qwen Image 2.1 Edit and Qwen Image 2.1 Turbo Edit, it can add 10 to 20 seconds.Options: off, standardWhether Nunchux’s content filter checks this request. Only accounts approved to turn moderation off may send
false. Others get a 403. See Content moderation.Dimensions
- Send
widthandheighttogether. A request with only one of them returns a 400. - Every image-to-image model is priced per megapixel today and charges from the output area. A request with no dimensions returns a 400. The API does not use the source image size or a default size.
- Both values must be integers. The string
"1024"is rejected, not converted. - The source image is a reference, not a canvas. The model does not crop or stretch it to
widthandheight. When the source ratio is different from the output ratio, the model re-frames the content. With several source images,widthandheightalone set the output size. - Smaller source images process faster. Larger output images take longer to generate.
width and height are multiples of 32:
data[0].revised_prompt:
Response
The response is JSON. Thedata array contains the edited image, as base64 data or as a URL.
Base64 format
URL format
Example
Several source images
Send a list inimage. Say in the prompt what to take from each image. This request puts the person from the first image into the scene of the second:
Upload limit with the OpenAI SDKThe OpenAI SDK uploads the files as a form, with one
image[] part for each file. A form takes up to 10 image files, so it can send as many images as any model takes. Each file must be PNG, JPEG or WebP, and 10 MB or smaller.Tips
- Say exactly what to change, add or remove. The models can follow instructions with more than one change.
- With several source images, refer to each one by its place in the list, for example “the person from the first image”.
- Use Qwen Image Edit 2511 Lightning when the edit must keep the identity of the subject, or when it changes text in the image.
- Use FLUX.2 Klein 4B Edit for fast, high-volume edit passes.
- Use Qwen Image Edit 2511 or Qwen Image Edit when you want more detail than the Lightning model gives and the extra time is acceptable. Qwen Image Edit 2511 takes up to 3 source images. Use
negative_promptto keep things out of the edit. - Use Qwen Image Edit 2509 or Qwen Image Edit 2509 Lightning when your work already depends on the 2509 release. For new work, use Qwen Image Edit 2511 or Qwen Image Edit 2511 Lightning.
- Use FLUX.2 dev for detailed edits when you already generate with FLUX.2 dev. Steer it with
guidance_scale. - Use FLUX 3 Image Klein Edit for fast edits, and to combine up to 10 source images. Describe the whole result in the prompt: the subject, the setting, the light and the style, or send
prompt_expansionset tostandardto have Nunchux write the description. It takes no guidance and no negative prompt. - Use FLUX 3 Image Klein Base Edit when you want more detail or more control than FLUX 3 Image Klein Edit gives, and the extra time is acceptable. It also takes up to 10 source images. Steer it with
guidance_scaleandnegative_prompt, and sendprompt_expansionset tostandardfor a short prompt. - Use Qwen Image 2.1 Edit for edits up to 2752x2752, or with up to 10 source images. Send
widthandheightin multiples of 32. - Use Qwen Image 2.1 Turbo Edit for the same sizes and source images in less time. It takes no
steps, guidance or negative prompt, so put everything in the prompt. - Use FLUX.2 Klein 4B Base Edit or 9B Base Edit when you want more control than FLUX.2 Klein Edit gives, and the extra time is acceptable. Steer them with
guidance_scaleandnegative_prompt. They default to 50 steps. - Use
radical_speedwhen response time is important. Useradical_valuefor large batches where cost per image is more important. Qwen Image Edit and FLUX.2 dev haveradical_speedonly. - Send smaller source images for faster processing.
Errors and limits
Refused requests
- Nunchux charges only after a successful generation. A refused request is never billed.
- Do not branch on a dimension-specific code. A refused size, field or image list returns
invalid_request, anderror.details.fieldnames the field.engine_errormeans the model could not render the request, or a source image was rejected.