Guidance for AI coding agents working in this repository.
thenoise is a focused diffusion inference engine for ROCm (Strix Halo /
gfx1151, RDNA 3.5, native BF16/FP16, 128GB unified RAM). It loads one model at
a time and exposes a small, explicit surface.
- Layout:
thenoise/— server package:__main__.py+cli.py(CLI entrypoints),api.py(FastAPI/text2image),runtime.py(single-model runtime),models/(adapters + catalog + detect),dit/(per-model compute),vae/(shared Qwen-Image VAE),utils/(safetensors, lora, attention, device).scripts/— model download helpers.tests/— CLI + runtime + detection tests (no torch needed).
- Invocation:
python -m thenoise serve ...andpython -m thenoise generate ....
-
Never run
uv sync. It would replace/break the ROCmtorchbuild that the maintainer installs directly into the venv. Useuv pip installinstead (e.g.uv pip install -e .).torchis intentionally not listed inpyproject.toml. -
Never run the program yourself. You are in a containerized environment that cannot run the project with real models — there is no GPU and not enough RAM. Do not attempt to start the server, run
generate, or load a model. -
When unsure on the correct way to proceed, ALWAYS ask the user rather than guessing or overthinking.
-
The user is happy to test. Do not be too afraid of breaking stuff, just inform the user of potentially risky changes and ask them to test them out.
- Verify changes with the test suite:
.venv/bin/python -m pytest tests/ -q(tests are designed to run without torch or real weights). - Do not run heavy/compute-heavy commands.