Configuration
All configuration surfaces: environment variables, data files, Django settings, and Docker services.
Environment Variables
Set in .env at the project root. Variables with defaults shown can be omitted for local development.
Database
Variable |
Default |
Description |
|---|---|---|
|
|
Database name |
|
|
Database user |
|
|
Database password |
|
|
Database host |
|
|
Database port (non-standard to avoid conflicts) |
Broker
Variable |
Default |
Description |
|---|---|---|
|
|
Valkey/Redis host |
|
|
Valkey/Redis port |
Application
Variable |
Default |
Description |
|---|---|---|
|
(required) |
Django secret key for sessions and CSRF |
|
|
Debug mode (set |
|
(empty) |
Anthropic API key for LLM prompt enhancement |
|
(empty) |
CivitAI API key for LoRA auto-downloads |
|
|
Base directory for local |
Video Upload
Variable |
Default |
Description |
|---|---|---|
|
|
Maximum upload size (500 MB) |
Presets Configuration
data/presets.json defines diffusion models and LoRAs. Synced to the database via import_presets.
Top-Level Structure
{
"models": [ ... ],
"loras": [ ... ]
}
Model Fields
Field |
Type |
Description |
|---|---|---|
|
string |
Unique identifier (e.g., |
|
string |
Display name |
|
string |
HuggingFace repo ID or local |
|
string |
Diffusers pipeline class (e.g., |
|
string |
Model family: |
|
object |
Generation parameters and behavior flags (see below) |
Model Settings
Setting |
Type |
Description |
|---|---|---|
|
int |
Default inference steps |
|
float |
Default classifier-free guidance strength |
|
int |
Default image width (pixels) |
|
int |
Default image height (pixels) |
|
int |
Maximum total pixels (width x height) |
|
string |
Tensor type: |
|
bool |
Whether the model uses negative prompts |
|
string |
Diffusers scheduler class name |
|
int |
Maximum prompt tokens (77 for CLIP, 512 for Flux) |
|
int |
Estimated VRAM in MB |
Behavior Flags
Optional flags within settings that enable special model behavior:
Flag |
Applicable Models |
Description |
|---|---|---|
|
Turbo models |
Ignore user guidance_scale, use model default |
|
Any |
Enable debug print statements via |
|
CUDA models |
Use sequential CPU offload (more memory-efficient) |
|
Flux variants |
Maximum context length for prompt encoding (512) |
|
Qwen |
8-bit quantization to reduce VRAM usage |
LoRA Fields
Field |
Type |
Description |
|---|---|---|
|
string |
Display name |
|
string |
Target model family (must match model’s architecture) |
|
string |
Category tag (e.g., |
|
string |
CivitAI AIR URN: |
|
string |
Trigger words appended when LoRA is active |
|
string |
Negative prompt to use with this LoRA |
|
string |
Metadata or CivitAI stats |
LoRA Settings
Setting |
Type |
Description |
|---|---|---|
|
float |
LoRA weight multiplier (typical range 0.5–1.3) |
|
float |
Recommended guidance when using this LoRA |
|
int |
CLIP layer skip (1–2) for SD models |
Django Settings
Key settings in src/cw/settings.py.
Celery
Setting |
Value |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Logging
JSON-structured logging via pythonjsonlogger.JsonFormatter. Rotating file handlers with 10 MB limit and 5 backups per file.
Logger |
Handler |
Level |
Description |
|---|---|---|---|
|
|
INFO |
Server requests and ORM |
|
|
INFO |
Worker lifecycle and routing |
|
|
INFO |
Image generation tasks |
|
|
INFO |
Adaptation and storyboard tasks |
|
|
DEBUG |
Pipeline execution |
|
|
DEBUG |
Diffusion model loading |
|
|
DEBUG |
Prompt enhancement |
|
|
DEBUG |
Storyboard generation |
|
|
DEBUG |
CivitAI LoRA downloads |
|
|
INFO |
File upload validation |
Video Upload
Setting |
Value |
|---|---|
|
|
|
|
|
|
|
|
|
|
Docker Compose Services
Service |
Image |
Port |
Purpose |
|---|---|---|---|
|
|
5435 |
PostgreSQL database |
|
|
6379 |
Celery broker (Redis-compatible) |
|
|
3100 |
Log aggregation backend |
|
|
— |
Log collector (ships |
|
|
3000 |
Log search UI (anonymous login enabled) |
Named volumes: postgres_data, valkey_data, loki_data, grafana_data.
Health checks are configured for postgres (pg_isready) and valkey (valkey-cli ping). Use ./start.sh to wait for healthy containers before starting Django.