{"uid":"cap_RLRQpx_5W2LGSVxsNxlf1","slug":"stable-diffusion-inpainting-image-edit-bc1c0dc6","name":"Stable Diffusion Inpainting Image Edit","description":"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.","url":"https://flat-rate-llm.kikoribera03.workers.dev/v1/ai/image-edit?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_tJt_IG0B4uwRaRLNQZ5Zg","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Edits a specific masked region of an existing image using Stable Diffusion inpainting, repainting only the white-masked area according to a text prompt","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Remove unwanted object from photo","prompt":"Here's my product photo (https://mysite.com/product.jpg) and a mask (https://mysite.com/mask.jpg) that covers the ugly logo on the table — paint over it with a plain wooden table surface, 15 steps, guidance 8."},{"title":"Swap background in portrait","prompt":"I have a portrait at https://cdn.myapp.com/portrait.jpg and a background mask at https://cdn.myapp.com/bg_mask.jpg — replace the background with a lush green forest, 20 diffusion steps, guidance 9."},{"title":"Add accessory to fashion image","prompt":"Edit my clothing model image at https://store.example.com/model.jpg using the mask at https://store.example.com/hat_area.jpg to add a stylish red baseball cap on her head, 20 steps, guidance 7."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T13:11:04.648Z","isFirstParty":false,"canonicalSlug":"stable-diffusion-inpainting-image-edit-bc1c0dc6"}