Files
Claude 27261c4ef4 Add LaMa magic eraser, remote provider abstraction, and AI tool infrastructure
Backend:
- requirements.txt: add simple-lama-inpainting, rembg[gpu]; upgrade opencv to 4.10+
- app/config.py: add InvokeAI (url, model) and ComfyUI (url, model) settings; OPENAI_MODEL
- app/services/local_inpaint.py: LaMa, OpenCV, rembg wrappers (auto GPU/CPU)
- app/services/remote_provider.py: abstract RemoteAIProvider + OpenAI, InvokeAI, ComfyUI drivers
- app/routers/ai_tools.py: new /api/* endpoints — /erase, /inpaint/lama, /inpaint/fast,
  /background/remove, /inpaint/remote, /generate/txt2img, /generate/img2img,
  /generate/outpaint, GET /config (capability flags)
- app/main.py: register ai_tools router

Frontend:
- services/api.js: add erase(), textToImage(), imageToImage(), remoteInpaint(), getConfig()
- api/capabilities.js: lazy-fetch /api/config singleton; hasRemote() helper
- tools/ai_lama_erase.js: brush-paint mask → LaMa erase → apply to layer
- tools/ai_smart_inpaint.js: brush mask + dialog (Fast/Quality mode + prompt) → inpaint
- core/components/provider-badge.js: shows active provider + health in toolbar
- config.js: register ai_lama_erase and ai_smart_inpaint tools
- main.js: mount provider badge on load
- .env.example: document InvokeAI, ComfyUI, OpenAI provider settings

https://claude.ai/code/session_01B58MaJCU1R6KwBDJCp8AfN
2026-06-09 17:42:48 +00:00

26 lines
706 B
Plaintext

fastapi==0.109.0
uvicorn[standard]==0.27.0
python-multipart==0.0.6
Pillow>=10.0.0,<11.0.0
numpy<2.0.0
sqlalchemy==2.0.25
python-jose[cryptography]==3.3.0
passlib[bcrypt]==1.7.4
python-dotenv==1.0.0
aiofiles==23.2.1
httpx==0.26.0
pydantic==2.5.3
pydantic-settings==2.1.0
email-validator==2.1.0
opencv-python-headless>=4.10.0
# SAM (Segment Anything) for smart object selection - runs locally, no API needed
torch==2.1.2
torchvision==0.16.2
segment-anything @ git+https://github.com/facebookresearch/segment-anything.git
# Local AI inpainting — LaMa model (auto GPU/CPU, no API key needed)
simple-lama-inpainting
# Background removal — rembg enabled now that opencv 4.10+ supports numpy 2.x
rembg[gpu]