- Quick start guide - Feature list - Usage workflow - API reference - Testing commands
67 lines
2.0 KiB
Markdown
67 lines
2.0 KiB
Markdown
# ORA Editor - Browser-based OpenRaster Editor
|
|
|
|
A web-based tool for editing ORA (OpenRaster) files with layer management, polygon drawing, and AI-powered mask extraction.
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
cd tools/ora_editor
|
|
|
|
# Activate venv and install dependencies
|
|
source ../venv/bin/activate # or your Python environment
|
|
pip install -r requirements.txt
|
|
|
|
# Run the Flask server
|
|
python app.py
|
|
```
|
|
|
|
The editor will be available at: http://localhost:5000
|
|
|
|
## Features
|
|
|
|
- **Open PNG/ORA files**: Enter file path relative to project root
|
|
- **Layer management**: Toggle visibility, rename, delete, reorder layers
|
|
- **Polygon drawing**: Draw polygons to guide mask extraction
|
|
- **Mask extraction**: Use ComfyUI to extract masks from images
|
|
- **Krita integration**: Open layers in Krita for manual editing
|
|
- **Settings**: Configure ComfyUI server URL
|
|
|
|
## Usage Workflow
|
|
|
|
1. **Open a file**: Enter path to PNG or ORA file (relative to `/home/noti/dev/ai-game-2`)
|
|
2. **View layers**: See all layers with visibility checkboxes
|
|
3. **Draw polygon** (optional): Describe the area you want separated
|
|
4. **Extract mask**: Enter subject description and click "Extract Mask"
|
|
5. **Review results**: See preview modal with extracted mask
|
|
6. **Add to ORA**: Click "Use This Mask" to add as new layer
|
|
7. **Edit in Krita** (optional): Select layer, open in Krita for manual work
|
|
8. **Save**: Persist all changes
|
|
|
|
## ComfyUI Setup
|
|
|
|
- Default URL: `127.0.0.1:8188`
|
|
- Configure via Settings gear icon
|
|
- Workflow file must exist at `tools/image_mask_extraction.json`
|
|
|
|
## API Endpoints
|
|
|
|
| Endpoint | Method | Purpose |
|
|
|----------|--------|---------|
|
|
| `/api/open` | POST | Open PNG/ORA file |
|
|
| `/api/save` | POST | Save current state |
|
|
| `/api/layers` | GET | Get layer list |
|
|
| `/api/layer/*` | POST | Layer operations (add, rename, delete, reorder) |
|
|
| `/api/polygon` | POST | Draw polygon overlay |
|
|
| `/api/mask/extract` | POST | Extract mask via ComfyUI |
|
|
| `/api/krita/open` | POST | Open layer in Krita |
|
|
|
|
## Testing
|
|
|
|
```bash
|
|
# Test ORA operations
|
|
python test_ora_ops.py
|
|
|
|
# Test Flask API
|
|
python test_app.py
|
|
```
|