Add SAM Smart Select and AI Inpaint tools to miniPaint

New features:
- Smart Select tool: Click to select objects using SAM (Segment Anything)
- AI Inpaint tool: Edit selected regions with text prompts

Changes:
- frontend/src/js/tools/smart_select.js: SAM-powered selection tool
- frontend/src/js/tools/ai_inpaint.js: AI inpainting with prompt dialog
- frontend/src/js/services/api.js: API service for backend communication
- frontend/src/js/config.js: Register new tools
- frontend/src/css/layout.css: Tool icon styles
- frontend/images/icons/: SVG icons for new tools
- backend/app/routers/tools.py: New base64 API endpoints
- frontend/Dockerfile: Updated for miniPaint build
- frontend/nginx.conf: Added /api prefix proxy
This commit is contained in:
Claude
2026-01-26 17:34:20 +00:00
parent d009a2c0f0
commit bf83ecc8ad
10 changed files with 816 additions and 5 deletions
+12
View File
@@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Paint brush -->
<path d="M18.37 2.63L14 7l-1.59-1.59a2 2 0 00-2.82 0L8 7l9 9 1.59-1.59a2 2 0 000-2.82L17 10l4.37-4.37a2.12 2.12 0 10-3-3z"/>
<path d="M9 8c-2 3-4 3.5-7 4l8 10c2-1 6-5 6-7"/>
<path d="M14.5 17.5L4.5 15"/>
<!-- AI sparkle -->
<circle cx="19" cy="19" r="1" fill="currentColor"/>
<path d="M19 16v1"/>
<path d="M19 21v1"/>
<path d="M16 19h1"/>
<path d="M21 19h1"/>
</svg>

After

Width:  |  Height:  |  Size: 567 B

+15
View File
@@ -0,0 +1,15 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Magic wand with AI sparkle -->
<path d="M15 4V2"/>
<path d="M15 16v-2"/>
<path d="M8 9h2"/>
<path d="M20 9h2"/>
<path d="M17.8 11.8L19 13"/>
<path d="M15 9h0"/>
<path d="M17.8 6.2L19 5"/>
<path d="M12.2 6.2L11 5"/>
<path d="M3 21l9-9"/>
<path d="M12.2 11.8L11 13"/>
<!-- Selection indicator -->
<rect x="2" y="2" width="6" height="6" rx="1" stroke-dasharray="2 1"/>
</svg>

After

Width:  |  Height:  |  Size: 563 B