Skip to content

Configuration

mold looks for config.toml inside the base mold directory (~/.mold/ by default, or override with MOLD_HOME).

Config File

toml
default_model = "flux2-klein:q8"
models_dir = "~/.mold/models"
server_port = 7680
default_width = 1024
default_height = 1024

# Global default negative prompt (CFG models only)
# default_negative_prompt = "low quality, worst quality, blurry, watermark"

[models."flux-dev:bf16"]
default_steps = 25
default_guidance = 3.5
# lora = "/path/to/adapter.safetensors"
# lora_scale = 0.8

[models."sd15:fp16"]
default_steps = 25
default_guidance = 7.5
negative_prompt = "worst quality, low quality, bad anatomy"

[expand]
enabled = false
backend = "local"
model = "qwen3-expand:q8"
temperature = 0.7

# Per-family expansion tuning
# [expand.families.sd15]
# word_limit = 50
# style_notes = "Short keyword phrases for CLIP-L."

# [expand.families.flux]
# word_limit = 200
# style_notes = "Rich natural language descriptions."

Environment Variables

Environment variables take precedence over config file values.

Core

VariableDefaultDescription
MOLD_HOME~/.moldBase directory for config and cache
MOLD_DEFAULT_MODELflux2-kleinDefault model name
MOLD_HOSThttp://localhost:7680Remote server URL
MOLD_MODELS_DIR$MOLD_HOME/modelsModel storage directory
MOLD_PORT7680Server port
MOLD_LOGwarn / infoLog level

Generation

VariableDefaultDescription
MOLD_EAGER1 to keep all components loaded
MOLD_OFFLOAD1 to force CPU↔GPU block streaming
MOLD_EMBED_METADATA10 to disable PNG metadata
MOLD_PREVIEW1 to display images inline in terminal
MOLD_T5_VARIANTautoT5 encoder: auto/fp16/q8/q6/q5/q4/q3
MOLD_QWEN3_VARIANTautoQwen3 encoder: auto/bf16/q8/q6/iq4/q3
MOLD_SCHEDULERSD1.5/SDXL: ddim/euler-ancestral/uni-pc

Prompt Expansion

VariableDefaultDescription
MOLD_EXPAND1 to enable expansion
MOLD_EXPAND_BACKENDlocallocal or OpenAI-compatible URL
MOLD_EXPAND_MODELqwen3-expand:q8LLM model for expansion
MOLD_EXPAND_TEMPERATURE0.7Sampling temperature
MOLD_EXPAND_THINKING1 to enable thinking mode
MOLD_EXPAND_SYSTEM_PROMPTCustom system prompt template
MOLD_EXPAND_BATCH_PROMPTCustom batch prompt template

Server

VariableDefaultDescription
MOLD_OUTPUT_DIR~/.mold/outputImage output directory (set empty to disable)
MOLD_CORS_ORIGINRestrict CORS to specific origin

Auth

VariableDefaultDescription
HF_TOKENHuggingFace token for gated models

Advanced

Device and Path Overrides

VariableDefaultDescription
MOLD_DEVICEForce device placement, currently cpu for debugging
MOLD_TRANSFORMER_PATHOverride transformer weights path
MOLD_VAE_PATHOverride VAE weights path
MOLD_T5_PATHOverride T5 encoder path
MOLD_CLIP_PATHOverride CLIP-L encoder path
MOLD_CLIP2_PATHOverride CLIP-G encoder path for SDXL
MOLD_T5_TOKENIZER_PATHOverride T5 tokenizer path
MOLD_CLIP_TOKENIZER_PATHOverride CLIP-L tokenizer path
MOLD_CLIP2_TOKENIZER_PATHOverride CLIP-G tokenizer path for SDXL
MOLD_TEXT_TOKENIZER_PATHOverride generic text tokenizer path for Qwen/Z-Image
MOLD_DECODER_PATHOverride Wuerstchen decoder weights path

These are mainly useful for custom local model layouts, manual debugging, or testing alternative weight files without editing config.toml.

Debug and Family-Specific Knobs

VariableDefaultDescription
MOLD_SD3_DEBUGEnable verbose SD3.5 pipeline logging
MOLD_QWEN_DEBUGEnable verbose Qwen-Image pipeline logging
MOLD_WUERSTCHEN_DEBUGEnable verbose Wuerstchen pipeline logging
MOLD_WUERSTCHEN_DECODER_GUIDANCE0.0Override decoder-stage CFG guidance for Wuerstchen

These are intended for troubleshooting and development rather than normal use.