This commit is contained in:
moosecrap 2026-07-24 23:31:47 -07:00
parent 31dc984197
commit d8a2a102e4

View File

@ -63,7 +63,20 @@ pip install uvicorn starlette Pillow
## Configuration (`config.py`)
You can tune the server's behavior in `config.py`:
### Server & Logging
- **`HOST` / `PORT`**: The network address and port the server binds to.
- **`LOG_LEVEL`**: Logging verbosity (`DEBUG`, `INFO`, `WARNING`, `ERROR`).
- **`LOG_FILE`**: Path to the server log file.
- **`USER_AGENT`**: The User-Agent string used for API requests (e.g., Wikipedia). Use a browser-like string to avoid 403 Forbidden errors.
### Model & Token Tuning
- **`PATCH_SIZE`**: Set this to `(clip.vision.patch_size * n_merge)` for your specific model to ensure token-perfect resizing.
- **`PREVIEW_TOKEN_BUDGET`**: Controls how many tokens the `preview_image` tool aims for (default: 70).
- **`CONTACT_SHEET_COLS/ROWS`**: Adjust the grid size to fit within your model's maximum context window.
- **`CONTACT_SHEET_COLS` / `ROWS`**: Adjust the grid size to fit within your model's maximum context window.
- **`CONTACT_SHEET_THUMB_SIZE`**: The pixel size of thumbnails in the contact sheet.
### Image & Font Settings
- **`IMAGE_QUALITY`**: Adjust JPEG compression (1-100).
- **`SYSTEM_FONT_NAMES`**: A list of font names Pillow should attempt to find in the system path.
- **`FALLBACK_FONT_PATHS`**: Absolute paths to `.ttf` files used if no system fonts are found.