Run Edit Tool
run_edit_toolRun a canvas edit tool on an image via /v1/edit/tools/{tool_id}.
Free tools: color_reducer, palette_converter, pixel_correction, k_centroid_downscale, rotate. $0.01 tools: background_remover, color_style_transfer. Premium ($0.18): image_edit, inpainting, outpainting, seam_tiling. Use estimate_edit_tool_cost first for anything that charges — estimation is free. The edited image is returned in base64_images.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Seed for reproducible results; reuse the same seed to iterate on one composition. | |
| width | No | k_centroid_downscale: target width in pixels (required for that tool). | |
| height | No | k_centroid_downscale: target height in pixels (required for that tool). | |
| prompt | No | What to generate or change (required by image_edit and inpainting; optional for outpainting). | |
| tile_x | No | seam_tiling: repair the horizontal seam (tool default applies when omitted). | |
| tile_y | No | seam_tiling: repair the vertical seam (tool default applies when omitted). | |
| tool_id | Yes | Edit tool id. One of: image_edit, inpainting, outpainting, seam_tiling, background_remover, color_style_transfer, color_reducer, palette_converter, pixel_correction, k_centroid_downscale, rotate. Use list_edit_tools for authoritative fields, costs, and limits. | |
| expand_top | No | Outpainting: pixels to add on the top edge. | |
| mask_image | No | Base64 mask for inpainting: white pixels are regenerated, black pixels are kept. | |
| rd_api_key | No | RetroDiffusion API key (rdpk-...) for this call only; overrides session or header auth. | |
| seam_width | No | seam_tiling: width in pixels of the seam band to repair. | |
| color_count | No | color_reducer: target number of colors. | |
| dither_mode | No | color_reducer/palette_converter: dithering mode. | |
| expand_left | No | Outpainting: pixels to add on the left edge. | |
| input_image | Yes | Base64 PNG of the image to edit (raw base64 or a data URL). Required by every edit tool. | |
| expand_right | No | Outpainting: pixels to add on the right edge. | |
| soft_inpaint | No | Inpainting/outpainting: blend edits softly with the surrounding pixels. | |
| expand_bottom | No | Outpainting: pixels to add on the bottom edge. | |
| input_palette | No | Base64 image of a color palette; output colors are constrained to it. | |
| dither_strength | No | color_reducer/palette_converter: dithering strength, 0-10 (0 disables, default 5). | |
| timeout_seconds | No | Read-timeout override in seconds for this call; increase for animations or large batches. | |
| rotation_degrees | No | rotate: rotation angle in degrees (clean-edge pixel rotation). | |
| extra_input_image | No | Second base64 input image for styles that use one (e.g. the second texture in rd_tile__tileset_advanced). | |
| force_solid_pixels | No | background_remover: force fully solid or fully transparent pixels (tool default applies when omitted). | |
| repair_window_size | No | seam_tiling: size of the repair window. | |
| transparency_threshold | No | background_remover: alpha threshold for treating pixels as transparent. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||