|
| 1 | +# MediaPilot |
| 2 | + |
| 3 | +MediaPilot is the built-in gallery and curation layer for generated images in LoRA Pilot. It is embedded into ControlPilot and optimized for large output directories. |
| 4 | + |
| 5 | +## 🎯 Overview |
| 6 | + |
| 7 | +MediaPilot gives you: |
| 8 | +- Fast gallery browsing with generated WebP thumbnails |
| 9 | +- Search over extracted metadata (prompt, LoRA, sampler, scheduler, steps, CFG) |
| 10 | +- Image curation tools: like, tag/move, delete |
| 11 | +- Bulk actions: ZIP download and ComfyUI upscale queue |
| 12 | +- Optional password gate for shared environments |
| 13 | + |
| 14 | +## 🚀 Access |
| 15 | + |
| 16 | +- **ControlPilot tab**: `MediaPilot` |
| 17 | +- **Direct route**: `http://localhost:7878/mediapilot/` |
| 18 | +- **Status check**: `GET /api/mediapilot/status` |
| 19 | + |
| 20 | +In LoRA Pilot, MediaPilot is mounted inside ControlPilot (same host/port), not exposed as a separate default port. |
| 21 | + |
| 22 | +## 📂 Data Sources and Paths |
| 23 | + |
| 24 | +Default LoRA Pilot bootstrap values: |
| 25 | +- `MEDIAPILOT_OUTPUT_DIR=/workspace/outputs/comfy` |
| 26 | +- `MEDIAPILOT_INVOKEAI_DIR=/workspace/outputs/invoke` |
| 27 | +- `MEDIAPILOT_THUMBS_DIR=/workspace/cache/mediapilot/thumbs` |
| 28 | +- `MEDIAPILOT_DB_FILE=/workspace/config/mediapilot/data.db` |
| 29 | +- `MEDIAPILOT_COMFY_API_URL=http://127.0.0.1:5555` |
| 30 | + |
| 31 | +Config file location: |
| 32 | +- `/workspace/apps/MediaPilot/.env` |
| 33 | + |
| 34 | +## ⚙️ Environment Variables |
| 35 | + |
| 36 | +Key variables: |
| 37 | + |
| 38 | +| Variable | Purpose | Default | |
| 39 | +|---|---|---| |
| 40 | +| `MEDIAPILOT_OUTPUT_DIR` | Main image root (Comfy outputs) | `./data/output` | |
| 41 | +| `MEDIAPILOT_INVOKEAI_DIR` | InvokeAI image root | `./data/invokeai` | |
| 42 | +| `MEDIAPILOT_THUMBS_DIR` | Thumbnail cache root | `./data/thumbs` | |
| 43 | +| `MEDIAPILOT_DB_FILE` | SQLite likes/tags DB file | `./data/data.db` | |
| 44 | +| `MEDIAPILOT_MAX_BULK_DOWNLOAD_FILES` | Bulk ZIP file count cap | `500` | |
| 45 | +| `MEDIAPILOT_MAX_BULK_UPSCALE_FILES` | Bulk upscale file count cap | `50` | |
| 46 | +| `MEDIAPILOT_COMFY_API_URL` | ComfyUI API base URL | `http://127.0.0.1:5555` | |
| 47 | +| `MEDIAPILOT_UPSCALE_WORKFLOW_FILE` | Workflow template JSON for upscaling | `./comfy_upscale_workflow.json` | |
| 48 | +| `MEDIAPILOT_ACCESS_PASSWORD` | Enables auth when non-empty | empty | |
| 49 | +| `MEDIAPILOT_ALLOW_ORIGINS` | CORS origins (comma-separated) | `*` | |
| 50 | + |
| 51 | +## 🔍 Search and Filtering |
| 52 | + |
| 53 | +Search supports free text and field filters: |
| 54 | + |
| 55 | +```text |
| 56 | +portrait cinematic |
| 57 | +lora:my_style |
| 58 | +sampler:uni_pc |
| 59 | +scheduler:sgm_uniform |
| 60 | +steps:24 |
| 61 | +steps>=20 |
| 62 | +cfg:4.5 |
| 63 | +cfg<7 |
| 64 | +``` |
| 65 | + |
| 66 | +Metadata is extracted from image metadata and ComfyUI prompt JSON where available. |
| 67 | + |
| 68 | +## 🧰 Common Workflows |
| 69 | + |
| 70 | +### 1. Curate Comfy/Invoke outputs |
| 71 | +1. Open `MediaPilot` in ControlPilot. |
| 72 | +2. Choose folder (`Untagged`, `InvokeAI`, or custom folders). |
| 73 | +3. Use search to isolate candidates. |
| 74 | +4. Like, tag/move, or delete in bulk. |
| 75 | + |
| 76 | +### 2. Download selected images as ZIP |
| 77 | +1. Select images in gallery. |
| 78 | +2. Use bulk download action. |
| 79 | +3. MediaPilot generates a temporary archive and streams it. |
| 80 | + |
| 81 | +### 3. Send selected images to ComfyUI upscale queue |
| 82 | +1. Configure `MEDIAPILOT_UPSCALE_WORKFLOW_FILE`. |
| 83 | +2. Use placeholder `__INPUT_IMAGE__` for input image and `__OUTPUT_PREFIX__` for output prefix. |
| 84 | +3. Select images and run bulk upscale. |
| 85 | + |
| 86 | +## 🔌 API Reference (Core) |
| 87 | + |
| 88 | +| Endpoint | Method | Description | |
| 89 | +|---|---|---| |
| 90 | +| `/healthz` | `GET` | Health check | |
| 91 | +| `/auth/status` | `GET` | Auth enabled/authenticated state | |
| 92 | +| `/auth/login` | `POST` | Login when password auth enabled | |
| 93 | +| `/folders` | `GET` | List folders | |
| 94 | +| `/folders` | `POST` | Create folder | |
| 95 | +| `/images` | `GET` | Paginated image list | |
| 96 | +| `/like/{filename}` | `POST` | Like image | |
| 97 | +| `/unlike/{filename}` | `POST` | Unlike image | |
| 98 | +| `/tag` | `POST` | Move image between folders | |
| 99 | +| `/image/{filename}` | `DELETE` | Delete image from root | |
| 100 | +| `/image/{folder}/{filename}` | `DELETE` | Delete image from folder | |
| 101 | +| `/download/bulk` | `POST` | Download selected files as ZIP | |
| 102 | +| `/upscale/bulk` | `POST` | Queue selected files to ComfyUI | |
| 103 | + |
| 104 | +## 🧪 Thumbnail Pre-generation |
| 105 | + |
| 106 | +For large libraries, you can prebuild thumbnails: |
| 107 | + |
| 108 | +```bash |
| 109 | +cd /workspace/apps/MediaPilot |
| 110 | +/opt/venvs/core/bin/python pregenerate_thumbs.py |
| 111 | +``` |
| 112 | + |
| 113 | +## 🛠️ Troubleshooting |
| 114 | + |
| 115 | +### MediaPilot section is blank in ControlPilot |
| 116 | +- Check status API: |
| 117 | +```bash |
| 118 | +curl -s http://localhost:7878/api/mediapilot/status |
| 119 | +``` |
| 120 | +- If `available=false`, confirm app files exist at `/workspace/apps/MediaPilot` (or bundled `/opt/pilot/apps/MediaPilot`). |
| 121 | + |
| 122 | +### Gallery loads but images are missing |
| 123 | +- Verify `MEDIAPILOT_OUTPUT_DIR` and `MEDIAPILOT_INVOKEAI_DIR` in `/workspace/apps/MediaPilot/.env`. |
| 124 | +- Confirm files exist and are readable. |
| 125 | + |
| 126 | +### Upscale action fails |
| 127 | +- Confirm `MEDIAPILOT_COMFY_API_URL` points to active ComfyUI. |
| 128 | +- Validate workflow JSON at `MEDIAPILOT_UPSCALE_WORKFLOW_FILE`. |
| 129 | +- Ensure workflow has either placeholders or a `LoadImage` node. |
| 130 | + |
| 131 | +### Auth issues after enabling password |
| 132 | +- Set `MEDIAPILOT_ACCESS_PASSWORD` in `.env`. |
| 133 | +- If running behind HTTPS, set `MEDIAPILOT_AUTH_COOKIE_SECURE=true`. |
| 134 | + |
| 135 | +## Related |
| 136 | + |
| 137 | +- [ControlPilot](../user-guide/control-pilot.md) |
| 138 | +- [ComfyUI](comfyui.md) |
| 139 | +- [Model Management](../user-guide/model-management.md) |
| 140 | +- [Section Index](README.md) |
| 141 | +- [Documentation Home](../README.md) |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +_Last updated: 2026-02-11_ |
0 commit comments