Customizing Fooocus
Fooocus is highly customizable through configuration files, presets, and command-line options. This guide covers all customization options to tailor Fooocus to your specific needs and workflow.
Configuration Files
The main configuration file is config.txt, located in the Fooocus root directory. This file allows you to set default values and customize behavior.
Basic Configuration Structure
# Model Paths
base_model_path = models/checkpoints/
lora_path = models/loras/
vae_path = models/vae/
# Default Parameters
default_steps = 30
default_cfg_scale = 7.0
default_sampler = dpmpp_2m_sde_gpu
# Output Settings
output_path = outputs/
output_format = png
output_quality = 95
# Performance Settings
always_low_vram = false
always_offload_from_vram = false
Model Path Configuration
Customize where Fooocus looks for models:
base_model_path- SDXL base modelslora_path- LoRA filesvae_path- VAE modelsupscale_path- Upscaling modelsinpaint_path- Inpainting models
Default Parameters
Set default values that will be used when Fooocus starts:
Generation Parameters
| Parameter | Description | Default |
|---|---|---|
default_steps |
Number of sampling steps | 30 |
default_cfg_scale |
CFG scale for prompt adherence | 7.0 |
default_sampler |
Sampling method | dpmpp_2m_sde_gpu |
default_aspect_ratio |
Default image aspect ratio | 1152*896 |
default_style |
Default style preset | auto |
Quality Settings
default_quality- Quality preset (speed, quality, extreme)default_performance- Performance modeenable_refiner- Enable refiner by defaultrefiner_switch- When to apply refiner
Style Presets
Create and customize style presets for consistent image generation:
Built-in Styles
Fooocus includes several built-in styles:
- Auto: Automatic style selection
- Cinematic: Movie-like quality
- Photographic: Realistic photography
- Anime: Anime/manga style
- Digital Art: Digital artwork style
- Neon Punk: Cyberpunk aesthetic
- Enhance: Quality enhancement
Creating Custom Styles
Define custom styles in your configuration:
# Custom Style Definition
style_custom_name = {
"prompt": "your style prompt here",
"negative": "unwanted elements",
"steps": 30,
"cfg_scale": 7.0
}
Style Files
Styles can also be defined in separate files in the styles/ directory for better organization.
LoRA Presets
Create LoRA presets for quick application of common LoRA combinations:
Defining LoRA Presets
# LoRA Preset
lora_preset_anime = {
"loras": [
{"name": "anime_style", "strength": 1.0},
{"name": "character_lora", "strength": 0.8}
]
}
Using Presets
Apply presets via UI dropdown or command line: --preset anime
Default Prompts
Set default positive and negative prompts that will be used automatically:
Default Positive Prompt
default_positive_prompt = "high quality, detailed, professional"
Default Negative Prompt
default_negative_prompt = "blurry, low quality, artifacts, watermark"
Prompt Templates
Create prompt templates for common use cases:
template_photography = "photorealistic, {subject}, professional photography, 8k, sharp focus"
template_anime = "anime style, {subject}, high quality, detailed"
Output Configuration
Customize how and where Fooocus saves generated images:
Output Settings
output_path- Directory for generated imagesoutput_format- Image format (png, jpg, webp)output_quality- JPEG quality (1-100)save_metadata- Embed generation parametersfilename_template- Custom filename pattern
Filename Templates
Customize output filenames:
filename_template = "{seed}_{steps}_{cfg_scale}"
Available variables: {seed}, {steps}, {cfg_scale}, {timestamp}
Performance Customization
Optimize Fooocus performance for your hardware:
Memory Settings
always_low_vram- Always use low VRAM modealways_offload_from_vram- Offload models when idlemax_vram_usage- Maximum VRAM to usecpu_offload- Offload to CPU when possible
Speed Settings
async_cuda_alloc- Async CUDA memory allocationattention_optimization- Optimize attention mechanismenable_xformers- Use xFormers for faster attention
UI Customization
Customize the user interface appearance and behavior:
Theme Settings
theme- UI theme (light, dark, auto)language- UI language codefont_size- Base font size
Layout Settings
show_advanced_options- Show advanced UI optionscompact_mode- Use compact UI layoutsidebar_position- Sidebar placement
Wildcard Customization
Organize and customize wildcard files:
Wildcard Directory Structure
wildcards/
├── colors/
│ ├── basic.txt
│ └── extended.txt
├── styles/
│ ├── art.txt
│ └── photography.txt
└── subjects/
├── animals.txt
└── objects.txt
Creating Wildcard Files
Create text files with one option per line:
# wildcards/colors/basic.txt
red
blue
green
yellow
orange
purple
Use in prompts: __colors/basic__ flower
Command-Line Presets
Create batch files or scripts for common configurations:
Windows Batch Files
@echo off
REM run_anime.bat
python entry_with_update.py --preset anime --always-low-vram
Linux/macOS Scripts
#!/bin/bash
# run_realistic.sh
python entry_with_update.py --preset realistic --port 7860
Advanced Customization
For advanced users, Fooocus supports deeper customization:
Custom Models
- Add custom SDXL models to checkpoints directory
- Configure model-specific settings
- Create model presets
API Customization
- Custom API endpoints
- Webhook configurations
- Integration settings
Workflow Automation
- Batch processing scripts
- Automated generation pipelines
- Integration with other tools
Configuration Examples
Example configurations for common use cases:
High Quality Configuration
default_steps = 50
default_cfg_scale = 7.0
default_quality = extreme
enable_refiner = true
refiner_switch = 0.8
Fast Generation Configuration
default_steps = 20
default_cfg_scale = 5.0
default_quality = speed
enable_refiner = false
Low VRAM Configuration
always_low_vram = true
always_offload_from_vram = true
max_vram_usage = 4096
cpu_offload = true
Best Practices
Configuration Tips
- Backup your config files before making changes
- Test changes incrementally
- Document custom configurations
- Share useful presets with the community
- Keep config files organized and commented