This commit implements a full-stack AI photo editing application that allows users to regenerate only selected areas of images using AI. Features implemented: - Frontend (React + Fabric.js): * Interactive canvas with selection tools (rectangle, ellipse, lasso) * Real-time selection preview and editing * Mode toggle (A: patch only, B: patch + context) * Feather slider for edge blending (0-50px) * Prompt input for AI instructions * Edit history viewer with revert capability * Responsive UI with dark theme - Backend (FastAPI): * RESTful API for projects and edits * SQLite database for metadata storage * Image processing pipeline with PIL/OpenCV * AI provider interface (pluggable) * Support for OpenAI, Stability AI, and mock providers * Feathered alpha blending for smooth compositing * Complete edit history tracking * File-based storage for images and edits - Image Processing: * Patch extraction from bounding boxes * Mask generation for all selection types * Feathered edge blending * Patch compositing back to full image * No pixels modified outside selection * All edits reversible - Infrastructure: * Docker Compose orchestration * Production and development configurations * Nginx reverse proxy for frontend * Hot-reload support for development * Volume persistence for data Architecture follows specification exactly: - Only selected regions are regenerated - Full image pixels preserved outside mask - Two-mode operation (cost vs quality) - Complete edit history and reversibility - Self-hosted with external AI API calls All components are fully functional and ready for deployment.
132 lines
2.0 KiB
CSS
132 lines
2.0 KiB
CSS
.history {
|
|
padding: 20px;
|
|
background-color: #2a2a2a;
|
|
border-radius: 8px;
|
|
border: 1px solid #444;
|
|
max-height: 600px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.history-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.history-header h3 {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: #ffffff;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.reset-btn {
|
|
background-color: #ff4444;
|
|
color: white;
|
|
padding: 6px 12px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.reset-btn:hover:not(:disabled) {
|
|
background-color: #cc0000;
|
|
}
|
|
|
|
.empty-message {
|
|
text-align: center;
|
|
color: #666;
|
|
padding: 40px 20px;
|
|
font-style: italic;
|
|
}
|
|
|
|
.history-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
}
|
|
|
|
.history-item {
|
|
background-color: #1a1a1a;
|
|
border: 1px solid #333;
|
|
border-radius: 6px;
|
|
padding: 12px;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.history-item:hover {
|
|
border-color: #555;
|
|
}
|
|
|
|
.edit-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.edit-id {
|
|
font-weight: 600;
|
|
color: #ffffff;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.edit-status {
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.edit-prompt {
|
|
color: #cccccc;
|
|
font-size: 13px;
|
|
margin-bottom: 8px;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.edit-details {
|
|
display: flex;
|
|
gap: 12px;
|
|
margin-bottom: 6px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.edit-mode,
|
|
.edit-type,
|
|
.edit-feather {
|
|
font-size: 11px;
|
|
color: #888;
|
|
background-color: #2a2a2a;
|
|
padding: 2px 8px;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.edit-date {
|
|
font-size: 11px;
|
|
color: #666;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.revert-btn {
|
|
width: 100%;
|
|
background-color: #0066ff;
|
|
color: white;
|
|
padding: 8px 12px;
|
|
font-size: 12px;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.revert-btn:hover:not(:disabled) {
|
|
background-color: #0055dd;
|
|
}
|
|
|
|
.error-message {
|
|
color: #ff4444;
|
|
font-size: 11px;
|
|
margin-top: 8px;
|
|
padding: 6px;
|
|
background-color: rgba(255, 68, 68, 0.1);
|
|
border-radius: 3px;
|
|
}
|