Automated pipeline to upgrade low-resolution game textures into PBR-ready outputs at scale. Built for large batch runs with checkpoint resume, timeout handling, compression tool integration, and GPU memory safeguards.
| Phase | What it does |
|---|---|
| 0. Scan | Classify textures by type/material and write a manifest with file hashes |
| 1. AI Upscale | Real-ESRGAN upscale with tiling preservation, OOM recovery, adaptive tile sizing |
| 2. PBR | Generate roughness, metalness, AO, optional gloss, de-lit albedo, and zone masks |
| 3. Normal | Generate normal + height maps (Sobel, hybrid, optional DeepBump) |
| 4. POM | Refine height for parallax mapping and export reference shaders |
| 5. Post-Process | Seam repair, color consistency/grading/LUT, specular AA, detail overlay, emissive/env masks, engine presets |
| 6. Mipmap | Per-map-type mip generation and normal renormalization |
| 7. Validate | Structural checks, semantic plausibility/albedo checks, tiling scores, and preview renders |
- PBR and normal/height synthesis from diffuse/albedo are still heuristic. Treat them as generated drafts unless validated against authored ground truth.
- Validation now supports strict production gates:
validation.strict_material_semantics: trueto turn semantic plausibility warnings into errors.validation.fail_on_heuristic_maps: trueto fail runs when heuristic maps are generated.validation.enforce_material_semantics: trueto check roughness/metalness/AO plausibility.validation.enforce_plausible_albedo: trueto gate out physically implausible albedo values.tiling_quality.*writestiling_quality_report.jsonwith per-asset quality scores and review flags.- Model auto-download is checksum-hardened by default. Unverified downloads require explicit opt-in:
upscale.allow_unverified_model_download: true
- Python 3.10 or newer (3.10-3.12 recommended for GPU upscaling)
- pip (ships with Python)
- Git (to clone the repo)
GPU upscaling (Real-ESRGAN / BasicSR) is incompatible with Python 3.13+. Use 3.10-3.12 if you need GPU acceleration.
python --version # should print 3.10.x or higher
pip --version # should print pip 23+ or higherOn some systems, use python3 and pip3 instead of python and pip.
Always install into a virtual environment to avoid polluting your system Python.
git clone https://github.com/mq1n/AssetBrew AssetBrew
cd AssetBrewWindows (cmd):
python -m venv .venv
.venv\Scripts\activateWindows (PowerShell):
python -m venv .venv
.venv\Scripts\Activate.ps1Linux / macOS:
python3 -m venv .venv
source .venv/bin/activateYour terminal prompt should now show (.venv) to confirm the environment is active.
pip install --upgrade pip setuptoolsPython 3.13+:
setuptoolsis no longer bundled with the standard library. If you skip this step, editable installs will fail withCannot import 'setuptools.build_meta'.
Pick one of the profiles below depending on your hardware and use case.
pip install -r requirements.txt
pip install -e . --no-build-isolationThis gives you PBR generation, normal/height maps (Sobel & hybrid), mipmaps, validation, and compression. AI upscale is skipped at runtime when torch is absent.
pip install -e ".[cpu]" --no-build-isolationAdds onnxruntime for the DeepBump ONNX model (AI-based normal map generation on CPU).
pip install -e ".[gpu]" --no-build-isolationInstalls PyTorch, Real-ESRGAN, BasicSR, and onnxruntime-gpu. Requires an NVIDIA GPU with CUDA support. Do not mix [gpu] and [cpu] extras in the same environment -- the ONNX runtimes conflict.
If PyTorch does not detect your GPU after install, you may need to install a CUDA-specific PyTorch build. See https://pytorch.org/get-started/locally/ for the correct command for your CUDA version.
pip install -e ".[ui]" --no-build-isolationOr layer it on top of GPU:
pip install -e ".[gpu,ui]" --no-build-isolationpip install -e ".[dev]" --no-build-isolationOr combine all extras:
pip install -e ".[gpu,ui,dev]" --no-build-isolationpython -m AssetBrew --helpYou should see the full CLI options. If you installed the UI extra:
python -m AssetBrew --ui# Generate a default config file
python -m AssetBrew --generate-config
# Run the full pipeline
python -m AssetBrew --input ./assets/source --output ./assets/output
# Run specific phases only
python -m AssetBrew -i ./assets/source --phases upscale,pbr,normal
# Dry run (preview what would happen)
python -m AssetBrew -i ./assets/source --dry-run
# Force full reprocess (clear checkpoint)
python -m AssetBrew -i ./assets/source --reset-checkpoint
# CPU-only run (skip GPU even if available)
python -m AssetBrew -i ./assets/source --device cpu
# Use a custom config
python -m AssetBrew --config config.yamlTexture compression depends on external CLI tools that are not Python packages. Place them in the bin/ directory or set their paths in config.yaml.
| Tool | Purpose | Source |
|---|---|---|
compressonatorcli |
BC1-BC7 GPU texture compression | GPUOpen Compressonator |
texconv.exe |
DirectXTex DDS conversion (Windows) | DirectXTex |
toktx |
KTX2 format support | KTX-Software |
DeepBump-8/ |
ONNX model for AI normal maps | DeepBumb |
pip install -e ".[ui]" --no-build-isolation
python -m AssetBrew --uiOr via the console script:
AssetBrew-uiUI capabilities:
- Runtime config editing and validation
- Phase selection and run control
- Asset browsing and filtering
- Interactive preview with split/before/after
- Map mode selector for base, albedo, roughness, metalness, AO, normal, height, ORM
python -m AssetBrew [OPTIONS]
Options:
--input, -i DIR Input assets directory
--output, -o DIR Output directory
--config, -c FILE Path to config YAML
--phases, -p PHASES Comma-separated: upscale,pbr,normal,pom,mipmap,postprocess,validate
--device DEVICE auto | cuda | cuda:N | cpu
--workers N Max parallel workers
--dry-run Preview without writing files
--reset-checkpoint Clear checkpoint, reprocess everything
--generate-config Write default config.yaml and exit
--log-level LEVEL DEBUG | INFO | WARNING | ERROR
--ui Launch the desktop UI
assets/output/
|-- brick_wall_diff.png
|-- brick_wall_diff_albedo.png
|-- brick_wall_diff_normal.png
|-- brick_wall_diff_roughness.png
|-- brick_wall_diff_metalness.png
|-- brick_wall_diff_ao.png
|-- brick_wall_diff_gloss.png
|-- brick_wall_diff_height.png
|-- brick_wall_diff_orm.png
|-- brick_wall_diff_emissive.png
|-- brick_wall_diff_envmask.png
|-- brick_wall_diff_zones.png
|-- _shaders/
| |-- pom_reference.glsl
| \-- pom_reference.hlsl
|-- validation_report.txt
|-- tiling_quality_report.json
|-- pipeline_results.json
\-- pipeline.log
Upscaling:
upscale.target_resolutionupscale.hero_resolutionupscale.tile_sizeupscale.enforce_power_of_twoupscale.model_sha256.<model_name>upscale.allow_unverified_model_download
PBR and normal generation:
pbr.material_roughness_defaultspbr.material_metalness_defaultspbr.delight_methodpbr.material_zone_maskspbr.apply_zone_pbr_adjustmentspbr.generate_glossnormal.methodnormal.invert_y
Color grading and postprocess:
color_grading.white_balance_shiftcolor_grading.exposure_evcolor_grading.midtone_gammacolor_grading.saturationcolor_grading.lut_pathseam_repair.detect_thresholdorm_packing.presetemissive.enabledreflection_mask.enabled
Validation and quality gates:
validation.enforce_material_semanticsvalidation.strict_material_semanticsvalidation.fail_on_heuristic_mapsvalidation.enforce_plausible_albedovalidation.require_full_mipchainvalidation.metalness_nonmetal_max_meanvalidation.metalness_metal_min_meanvalidation.roughness_min_stddevvalidation.ao_min_stddevtiling_quality.warn_scoretiling_quality.fail_score
Pipeline safety:
phase_failure_abort_ratiophase_failure_abort_min_processed
Mipmap generation:
mipmap.srgb_downsampling
Compression:
compression.toolcompression.tool_pathcompression.tool_timeout_secondscompression.compressonator_encode_withcompression.compressonator_num_threadscompression.compressonator_performancecompression.compressonator_no_progresscompression.generate_ddscompression.generate_ktx2compression.generate_tga
pip install -e ".[dev]" --no-build-isolation
python -m pytest tests/ -vTo include slow compression tests:
python -m pytest tests/ -v -m slowLint:
ruff check src/ tests/When you are done, deactivate the virtual environment:
deactivateTo completely remove the environment and start fresh:
Windows:
rmdir /s /q .venvLinux / macOS:
rm -rf .venvThen repeat from step 2 to recreate it.
Each phase exposes a process(record, ...) -> dict style interface.
To add a phase:
- Add config dataclass in
src/AssetBrew/config.py. - Implement the processor in
src/AssetBrew/phases/. - Wire it through
AssetPipelineinsrc/AssetBrew/pipeline.py. - Add behavioral tests in
tests/.
- Python 3.10+ required. 3.10-3.12 recommended for GPU support.
- GPU upscaling stack (Real-ESRGAN / BasicSR) is broken on Python 3.13+.
- CPU-only mode works for all phases; upscale is just slower.
[gpu]and[cpu]extras must not be installed together (ONNX runtime conflict).- Compression integration depends on external tools (
compressonator,texconv,toktx).
MIT
