Readme
This commit is contained in:
@@ -79,21 +79,37 @@ pip install uvicorn starlette Pillow requests
|
|||||||
|
|
||||||
## Configuration (`config.py`)
|
## Configuration (`config.py`)
|
||||||
|
|
||||||
You can tune the server's behavior in `config.py`:
|
Tuning the server's behavior is done via `config.py`.
|
||||||
|
|
||||||
### Server & Logging
|
### 🌐 Server & Logging
|
||||||
- **`HOST` / `PORT`**: The network address and port the server binds to.
|
| Parameter | Description | Default |
|
||||||
- **`LOG_LEVEL`**: Logging verbosity (`DEBUG`, `INFO`, `WARNING`, `ERROR`).
|
| :--- | :--- | :--- |
|
||||||
- **`LOG_FILE`**: Path to the server log file.
|
| `HOST` | The network address the server binds to. | `"127.0.0.1"` |
|
||||||
- **`USER_AGENT`**: The User-Agent string used for API requests (e.g., Wikipedia). Use a browser-like string to avoid 403 Forbidden errors.
|
| `PORT` | The port the server listens on. | `8000` |
|
||||||
|
| `LOG_LEVEL` | Logging verbosity (`DEBUG`, `INFO`, `WARNING`, `ERROR`). | `"WARNING"` |
|
||||||
|
| `LOG_FILE` | Absolute path to the server log file. | `ROOT_DIR / "debug.log"` |
|
||||||
|
| `USER_AGENT` | User-Agent string for API requests (e.g., Wikipedia). | Browser-like string |
|
||||||
|
|
||||||
### Model & Token Tuning
|
### 🎨 Stable Diffusion Integration
|
||||||
- **`PATCH_SIZE`**: Set this to `(clip.vision.patch_size * n_merge)` for your specific model to ensure token-perfect resizing.
|
| Parameter | Description | Default |
|
||||||
- **`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.
|
| `SD_URL` | Base URL of the SD WebUI/Forge instance. | `"http://127.0.0.1:7860"` |
|
||||||
- **`CONTACT_SHEET_THUMB_SIZE`**: The pixel size of thumbnails in the contact sheet.
|
| `MODEL_PRESETS_PATH` | Path to the `model_presets.toml` file. | `ROOT_DIR / "model_presets.toml"` |
|
||||||
|
| `RES_PRESETS_PATH` | Path to the `resolution_presets.toml` file. | `ROOT_DIR / "resolution_presets.toml"` |
|
||||||
|
| `TAG_DATABASE_PATH` | Path to the Danbooru `tags.csv` file. | (Path to extension folder) |
|
||||||
|
|
||||||
### Image & Font Settings
|
### 🧠 Model & Token Tuning (Optimized for Gemma 4)
|
||||||
- **`IMAGE_QUALITY`**: Adjust JPEG compression (1-100).
|
| Parameter | Description | Default |
|
||||||
- **`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.
|
| `PATCH_SIZE` | Model's vision patch size in pixels. | `48` |
|
||||||
|
| `PREVIEW_TOKEN_BUDGET` | Target token count for `preview_image` thumbnails. | `70` |
|
||||||
|
| `CONTACT_SHEET_COLS` | Number of columns in the contact sheet grid. | `10` |
|
||||||
|
| `CONTACT_SHEET_ROWS` | Number of rows in the contact sheet grid. | `7` |
|
||||||
|
| `CONTACT_SHEET_THUMB_SIZE` | Pixel size of thumbnails in the contact sheet. | `192` |
|
||||||
|
|
||||||
|
### 🖼️ Image & Font Settings
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
| :--- | :--- | :--- |
|
||||||
|
| `IMAGE_QUALITY` | JPEG compression quality (1-100). | `95` |
|
||||||
|
| `SYSTEM_FONT_NAMES` | List of font names for Pillow to try in system paths. | Arial, DejaVu, etc. |
|
||||||
|
| `FALLBACK_FONT_PATHS` | List of absolute paths to `.ttf` files. | Linux-specific paths |
|
||||||
|
|||||||
Reference in New Issue
Block a user