fix_region
Crop and repair a specific region of an image where text is garbled or distorted. Automatically snaps to supported aspect ratio for precise fixes.
Instructions
Fix a specific region of an image by cropping it out, sending it for repair, and reinserting it. The crop is automatically snapped to the nearest supported aspect ratio. Use this when only part of an image has glitched text or artifacts — more precise than fix_image's grid approach.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Filename of the source image in /root/Pictures/pixel-surgeon | |
| prompt | No | Instructions for fixing the selected region | Clean up and fix any garbled, glitched, or distorted text in this image region. Preserve the style, colors, and layout exactly but make all text crisp and legible. |
| x | Yes | Left edge of region as percentage of image width (0-100) | |
| y | Yes | Top edge of region as percentage of image height (0-100) | |
| width | Yes | Width of region as percentage of image width (1-100) | |
| height | Yes | Height of region as percentage of image height (1-100) | |
| image_size | No | Resolution for the cropped region | 1K |
| model | No | Model to use. Available: 'gemini-3.1-flash-image' (Gemini 3.1 Flash Image), 'gemini-2.5-flash-image' (Gemini 2.5 Flash Image), 'gpt-image-1' (GPT Image 1 (OpenAI)), 'gpt-image-2' (GPT Image 2 (OpenAI)), 'grok-imagine' (Grok Imagine (xAI)). Default: 'gpt-image-2'. Set DEFAULT_IMAGE_MODEL env var to change the default. Provider tradeoffs: grok-imagine is fastest and cheapest; gemini is mid-quality with the best price/performance ratio (free tier available); gpt-image-2 is highest quality but slower and more expensive. Gemini models fall back to free tier on billing errors. OpenAI requires OPENAI_API_KEY. Grok requires XAI_API_KEY. |