AI-Powered Object Removal Plugin for GIMP 3.0
Created by Jakub Pas
A GIMP plugin for AI object removal from photos. It creates black and white masks from user selections and uses IOPaint's advanced AI models to intelligently remove objects from images.
This plugin transforms your GIMP selection workflow by:
- Selection to Mask: Converts any GIMP selection into a binary mask (white selected area, black background)
- AI Inpainting: Uses IOPaint's LaMa model to intelligently fill the selected area
- Seamless Integration: Returns the result as a new layer in your GIMP image
Perfect for removing unwanted objects, people, text, watermarks, or any other elements from your photos.
- β¨ One-Click Object Removal: Simply select and remove
- π― Precise Selection Support: Works with any GIMP selection tool
- π€ AI-Powered: Uses a state-of-the-art LaMa (Large Mask Inpainting) model
- π Progress Tracking: Real-time progress updates
- π§ Configurable: Support for multiple AI models and devices
- π§Ή Auto Cleanup: Handles temporary files automatically
- π Debug Logging: Comprehensive error reporting
- GIMP 3.0+
- Python 3.10+
- IOPaint installed:
pip install iopaint
-
Download the Plugin
wget https://raw.githubusercontent.com/jakubpas/iopaint_gimp3_plugin/refs/heads/main/iopaint_gimp3_plugin.py
-
Copy to GIMP Plugin Directory
# macOS mkdir -p ~/Library/Application\ Support/GIMP/3.0/plug-ins/iopaint_gimp3_plugim cp iopaint_gimp3_plugin.py ~/Library/Application\ Support/GIMP/3.0/plug-ins/iopaint_gimp3_plugin/ # Linux mkdir -p ~/.config/GIMP/3.0/plug-ins/iopaint_gimp3_plugin cp iopaint_gimp3_plugin.py ~/.config/GIMP/3.0/plug-ins/iopaint_gimp3_plugin/ # Windows mkdir %APPDATA%\GIMP\3.0\plug-ins\opaint_gimp3_plugim copy iopaint_gimp3_plugin.py %APPDATA%\GIMP\3.0\plug-ins\opaint_gimp3_plugim\
-
Make Executable (Unix-like systems)
chmod +x ~/Library/Application\ Support/GIMP/3.0/plug-ins/iopaint_gimp3_plugin.py
-
Configure Plugin
Edit the plugin file to set your IOPaint path for example:
IOPAINT_EXECUTABLE = "/Library/Frameworks/Python.framework/Versions/3.10/bin/iopaint" # Update this path
You can find your IOPaint path with:
which iopaintorwhere iopainton Windows.
- Open Image in GIMP 3.0
- Select Area to remove using any selection tool
- Run Plugin:
ToolsβIOPaint Erase - Wait for AI processing (progress bar shown)
- Review Result in a new layer
Edit the plugin to change the AI model:
MODEL = "lama" # Default - best for most cases
# MODEL = "ldm" # Latent Diffusion Model
# MODEL = "zits" # ZITS inpainting
# MODEL = "mat" # Mask-Aware Transformer
# MODEL = "fcf" # Foreground-aware Content FillDEVICE = "cpu" # CPU processing (slower, compatible)
# DEVICE = "cuda" # GPU acceleration (faster, requires NVIDIA GPU)- Precise Selections: Use the Free Select tool for irregular objects
- Prefer convex figures: Avoid concave figure for the proper center of mass calculation to accurate mask creation
- Feathered Edges: Add slight feather to selections for smoother results
- Multiple Passes: For complex removals, work in smaller sections
- Layer Management: Keep the original layer intact, work with copies
- Free Select Tool: Best for irregular objects
- Fuzzy Select: Good for areas with similar colors
- By Color Select: Effective for backgrounds
- Rectangle/Ellipse: Perfect for geometric objects
| Problem | Solution |
|---|---|
| Plugin not in menu | Restart GIMP, check file permissions |
| "IOPaint not found" | Update IOPAINT_EXECUTABLE path |
| "No selection" error | Make sure area is selected before running |
| Slow processing | Switch to GPU mode or use smaller images |
| Out of memory | Use CPU mode, close other applications |
Check the debug log for detailed error information:
tail -f /tmp/iopaint_gimp_debug.log- Image Size: Smaller images process faster
- GPU vs CPU: GPU is 5-10x faster if available
- Model Choice: LAMA is fastest, LDM is most accurate
- Selection Size: Smaller selections process quicker
User Selection β Binary Mask β IOPaint AI β Result Layer
- Mask Creation: Selection converted to black/white PNG
- AI Processing: IOPaint command-line tool processes image
- Result Import: Processed image loaded as new GIMP layer
- Cleanup: Temporary files automatically removed
- Plugin:
~/.config/GIMP/3.0/plug-ins/iopaint_gimp3_plugin.py - Debug Log:
/tmp/iopaint_gimp_debug.log - Temp Files: System temp directory (auto-cleaned)
For multiple images, consider using IOPaint directly:
iopaint run --model lama --device cpu --image input.jpg --mask mask.png --output results/To use custom trained models, modify the plugin:
MODEL = "path/to/your/custom/model"This plugin works well with:
- G'MIC: For advanced selections
- Resynthesizer: For texture synthesis
- Layer Effects: For post-processing
- Clone the repository
- Install development dependencies
- Set up GIMP 3.0 development environment
- Test with sample images in
assets/
Please include:
- GIMP version
- Python version
- IOPaint version
- Debug log contents
- Sample image (if possible)
This plugin is released under the MIT License. See LICENSE for details.
- IOPaint Team: For the amazing AI inpainting library
- GIMP Developers: For the powerful image editing platform
- LaMa Authors: For the state-of-the-art inpainting model
- Community: For testing and feedback
- IOPaint - The AI inpainting library
- GIMP - GNU Image Manipulation Program
- LaMa - Large Mask Inpainting model
Made with β€οΈ for the GIMP community
Need help? Open an issue or check the troubleshooting guide above.