Problem
The image_generate MCP tool currently exposes input_asset_url and mode for img2img chaining, but inpainting params are missing entirely:
- No
input_image (base64 source)
- No
mask_image (base64 mask — white = regenerate, black = keep)
- No
cf_model field to target the inpainting model
Inpainting is not callable via MCP at all today.
Proposed Changes
Add to the image_generate tool schema in tool-registry.ts:
cf_model: {
type: "string",
description: "Target a specific CF Workers AI model. Use '@cf/runwayml/stable-diffusion-v1-5-inpainting' for surgical region edits.",
},
input_image: {
type: "string",
description: "Base64-encoded source image. Required for inpainting when input_asset_url is not available.",
},
mask_image: {
type: "string",
description: "Base64-encoded mask. White pixels = regenerate, black = keep. Required for inpainting.",
},
Note on base64 UX
Once img-forge supports input_asset_url for the inpainting model (tracked in img-forge#N), the canonical MCP flow becomes:
image_generate({
prompt: "clean background",
cf_model: "@cf/runwayml/stable-diffusion-v1-5-inpainting",
input_asset_url: draft.asset_url, // no base64 for source
mask_image: "<small base64 mask>", // mask stays small
})
Both issues should ship together so the end-to-end MCP inpainting flow works without base64 source images.
Acceptance Criteria
Problem
The
image_generateMCP tool currently exposesinput_asset_urlandmodefor img2img chaining, but inpainting params are missing entirely:input_image(base64 source)mask_image(base64 mask — white = regenerate, black = keep)cf_modelfield to target the inpainting modelInpainting is not callable via MCP at all today.
Proposed Changes
Add to the
image_generatetool schema intool-registry.ts:Note on base64 UX
Once img-forge supports
input_asset_urlfor the inpainting model (tracked in img-forge#N), the canonical MCP flow becomes:Both issues should ship together so the end-to-end MCP inpainting flow works without base64 source images.
Acceptance Criteria
cf_model,input_image,mask_imageadded toimage_generatetool schema/mcphandler unchanged