# Stable Diffusion Inpainting Image Edit

> Stable Diffusion Inpainting Image Edit is a paid API for AI agents from flat-rate-llm.kikoribera03.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-11).

Edits a specific masked region of an existing image using Stable Diffusion inpainting, repainting only the white-masked area according to a text prompt

## Facts

- Endpoint: GET https://flat-rate-llm.kikoribera03.workers.dev/v1/ai/image-edit?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stable-diffusion-inpainting-image-edit-bc1c0dc6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RLRQpx_5W2LGSVxsNxlf1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability stable-diffusion-inpainting-image-edit-bc1c0dc6
```

Example prompt: Take this photo (https://example.com/photo.jpg) and repaint just the masked region (https://example.com/mask.jpg) — replace what's there with a bouquet of red roses, 20 diffusion steps, guidance 7.5.

## When to prefer this

Choose this endpoint when you need to surgically edit a specific region of an existing image rather than generate a new one from scratch. It is ideal when the source image must be preserved outside the edit area. Prefer this over full image generation when only a portion needs changing. Useful when you have a binary mask already prepared (white = repaint, black = keep). The pay-per-use model with no account or API key makes it suitable for low-volume or one-off agent tasks.

## Known failure modes

- Image or mask URL not publicly accessible or not HTTPS — returns error
- Image or mask exceeds 10 MB limit — rejected
- Prompt missing (required field) — validation error
- Invalid base64 encoding for image or mask — decode error
- Seed/steps/guidance out of valid range — parameter error
- Payment not processed — edit not delivered and not charged
- Hosted URL expires after 24 hours — image no longer accessible

## How this service works

Edits an image you provide instead of generating one from scratch: pass the image and a black-and-white mask, and Stable Diffusion inpainting repaints only the white area following your prompt. Image and mask go as https URLs or as base64, up to 10 MB each. Returns a hosted image URL valid for 24 hours. You are only charged if the edit is delivered. No API key, no account.

## Output

A JSON response containing a hosted HTTPS URL pointing to the inpainted image, valid for 24 hours. The image has the original content preserved outside the masked region, with only the white-masked area repainted according to the prompt.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "prompt"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "https URL of the image to edit. Use this or image."
      },
      "mask": {
       "type": "string",
       "description": "The mask, as base64. Use this or mask_url."
      },
      "seed": {
       "type": "number",
       "description": "Same inputs and same seed give the same edit."
      },
      "image": {
       "type": "string",
       "description": "The image to edit, as base64. Use this or url."
      },
      "steps": {
       "type": "number",
       "description": "Diffusion steps, 1-20."
      },
      "prompt": {
       "type": "string",
       "description": "What to paint into the masked area, up to 2048 characters."
      },
      "guidance": {
       "type": "number",
       "description": "How closely to follow the prompt, 0-20."
      },
      "mask_url": {
       "type": "string",
       "description": "https URL of the mask: white where it should repaint, black where it must not. Use this or mask."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stable-diffusion-inpainting-image-edit-bc1c0dc6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from flat-rate-llm.kikoribera03.workers.dev](https://www.zero.xyz/host/flat-rate-llm.kikoribera03.workers.dev/llms.txt)
