autoforge 2.1.0__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. {autoforge-2.1.0 → autoforge-2.2.0}/PKG-INFO +105 -8
  2. {autoforge-2.1.0 → autoforge-2.2.0}/README.md +104 -7
  3. {autoforge-2.1.0 → autoforge-2.2.0}/pyproject.toml +2 -2
  4. {autoforge-2.1.0 → autoforge-2.2.0}/src/AutoForge.egg-info/PKG-INFO +105 -8
  5. {autoforge-2.1.0 → autoforge-2.2.0}/src/AutoForge.egg-info/SOURCES.txt +18 -1
  6. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/AmpUtils.py +13 -7
  7. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/CAdamW.py +9 -0
  8. autoforge-2.2.0/src/autoforge/Helper/ConstraintHelper.py +495 -0
  9. autoforge-2.2.0/src/autoforge/Helper/DeterministicOps.py +82 -0
  10. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/DeviceUtils.py +19 -0
  11. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/FilamentHelper.py +71 -16
  12. autoforge-2.2.0/src/autoforge/Helper/FusedComposite.py +1757 -0
  13. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/HeightAssign.py +6 -1
  14. autoforge-2.2.0/src/autoforge/Helper/HeightGuidance.py +617 -0
  15. autoforge-2.2.0/src/autoforge/Helper/HeightfieldMesh.py +504 -0
  16. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/Heightmaps/ChristofidesHeightMap.py +22 -9
  17. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/Heightmaps/DepthEstimateHeightMap.py +13 -10
  18. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/Heightmaps/FastTSPHeightMap.py +75 -25
  19. autoforge-2.2.0/src/autoforge/Helper/Heightmaps/_cluster.py +225 -0
  20. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/ImageHelper.py +55 -3
  21. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/OptimizerHelper.py +167 -36
  22. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/OtherHelper.py +9 -0
  23. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/OutputHelper.py +94 -177
  24. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/PixelHeightRefine.py +388 -100
  25. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/PruningHelper.py +254 -149
  26. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Init_comparer/auto_forge_init_check.py +1 -1
  27. autoforge-2.2.0/src/autoforge/Init_comparer/plot_results.py +124 -0
  28. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Loss/LossFunctions.py +17 -4
  29. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Modules/Optimizer.py +767 -169
  30. autoforge-2.2.0/src/autoforge/__init__.py +6 -0
  31. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/auto_forge.py +241 -50
  32. autoforge-2.2.0/src/autoforge/default_materials.csv +15 -0
  33. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/priority_mask_editor.py +23 -15
  34. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/filaments.py +4 -1
  35. autoforge-2.2.0/src/autoforge/webui/api/guidance.py +105 -0
  36. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/images.py +22 -3
  37. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/init.py +50 -1
  38. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/optimization.py +76 -8
  39. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/outputs.py +163 -16
  40. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/preview.py +58 -29
  41. autoforge-2.2.0/src/autoforge/webui/api/project.py +221 -0
  42. autoforge-2.2.0/src/autoforge/webui/api/pruning.py +832 -0
  43. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/sliders.py +24 -6
  44. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/system.py +31 -4
  45. autoforge-2.2.0/src/autoforge/webui/api/workers.py +63 -0
  46. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/ws.py +50 -4
  47. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/config.py +13 -1
  48. autoforge-2.2.0/src/autoforge/webui/helpers/auto_prune.py +186 -0
  49. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/helpers/colored_mesh.py +7 -7
  50. autoforge-2.2.0/src/autoforge/webui/helpers/edited_export.py +147 -0
  51. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/helpers/gpu_memory.py +13 -2
  52. autoforge-2.2.0/src/autoforge/webui/helpers/guidance_views.py +224 -0
  53. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/helpers/mesh_persist.py +5 -0
  54. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/helpers/pipeline_runner.py +220 -91
  55. autoforge-2.2.0/src/autoforge/webui/helpers/project_heightmap.py +134 -0
  56. autoforge-2.2.0/src/autoforge/webui/helpers/result_store.py +444 -0
  57. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/helpers/slider_render.py +46 -28
  58. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/helpers/sliders.py +19 -0
  59. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/helpers/telemetry.py +20 -6
  60. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/models.py +101 -8
  61. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/server.py +94 -11
  62. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/services/catalog_service.py +1 -1
  63. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/services/filament_service.py +51 -12
  64. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/services/image_service.py +15 -5
  65. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/services/optimization_service.py +28 -2
  66. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/services/project_service.py +19 -3
  67. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_amp_utils.py +14 -0
  68. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_auto_forge_cli.py +1 -1
  69. autoforge-2.2.0/tests/test_bugreport_2026_10_01.py +635 -0
  70. autoforge-2.2.0/tests/test_bugreport_2026_10_03.py +418 -0
  71. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_composite_image.py +16 -2
  72. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_constrained_opt.py +35 -0
  73. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_device_utils.py +134 -4
  74. autoforge-2.2.0/tests/test_edge_bleed.py +96 -0
  75. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_fasttsp_heightmap.py +23 -0
  76. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_filamentcolors_library.py +5 -2
  77. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_graph_cache_eviction.py +47 -0
  78. autoforge-2.2.0/tests/test_height_guidance.py +590 -0
  79. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_optimizer_training.py +39 -1
  80. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_prune_repeatability.py +4 -2
  81. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_remove_height_spikes.py +63 -0
  82. autoforge-2.2.0/tests/test_worktree_bugs_2026_10_01.py +376 -0
  83. autoforge-2.1.0/src/autoforge/Helper/ConstraintHelper.py +0 -279
  84. autoforge-2.1.0/src/autoforge/Helper/FusedComposite.py +0 -900
  85. autoforge-2.1.0/src/autoforge/Init_comparer/plot_results.py +0 -116
  86. autoforge-2.1.0/src/autoforge/webui/api/project.py +0 -43
  87. autoforge-2.1.0/src/autoforge/webui/api/pruning.py +0 -489
  88. autoforge-2.1.0/src/autoforge/webui/services/__init__.py +0 -0
  89. {autoforge-2.1.0 → autoforge-2.2.0}/setup.cfg +0 -0
  90. {autoforge-2.1.0 → autoforge-2.2.0}/src/AutoForge.egg-info/dependency_links.txt +0 -0
  91. {autoforge-2.1.0 → autoforge-2.2.0}/src/AutoForge.egg-info/entry_points.txt +0 -0
  92. {autoforge-2.1.0 → autoforge-2.2.0}/src/AutoForge.egg-info/requires.txt +0 -0
  93. {autoforge-2.1.0 → autoforge-2.2.0}/src/AutoForge.egg-info/top_level.txt +0 -0
  94. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/Heightmaps/__init__.py +0 -0
  95. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/__init__.py +0 -0
  96. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Helper/filamentcolors_library.py +0 -0
  97. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Init_comparer/__init__.py +0 -0
  98. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Loss/PerceptionLoss.py +0 -0
  99. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Loss/__init__.py +0 -0
  100. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Misc/__init__.py +0 -0
  101. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Misc/color_fit_all.py +0 -0
  102. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/Modules/__init__.py +0 -0
  103. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/__main__.py +0 -0
  104. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/data/filamentcolors_catalog.json +0 -0
  105. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/__init__.py +0 -0
  106. {autoforge-2.1.0/src/autoforge → autoforge-2.2.0/src/autoforge/webui/api}/__init__.py +0 -0
  107. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/settings.py +0 -0
  108. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/api/state.py +0 -0
  109. {autoforge-2.1.0 → autoforge-2.2.0}/src/autoforge/webui/helpers/__init__.py +0 -0
  110. {autoforge-2.1.0/src/autoforge/webui/api → autoforge-2.2.0/src/autoforge/webui/services}/__init__.py +0 -0
  111. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_bug_regressions.py +0 -0
  112. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_bugfixes_2026_09_26.py +0 -0
  113. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_cadamw.py +0 -0
  114. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_christofides_heightmap.py +0 -0
  115. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_depth_adjusted_height_map.py +0 -0
  116. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_depth_estimate_height_map.py +0 -0
  117. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_end_to_end_optimizer.py +0 -0
  118. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_filament_helper.py +0 -0
  119. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_flatforge.py +0 -0
  120. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_graph_capture_threads.py +0 -0
  121. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_gumbel_nan.py +0 -0
  122. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_image_helper.py +0 -0
  123. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_loss_functions.py +0 -0
  124. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_optimizer_module.py +0 -0
  125. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_other_helper.py +0 -0
  126. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_output_helper.py +0 -0
  127. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_perception_loss.py +0 -0
  128. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_pipeline_smoke.py +0 -0
  129. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_property_based.py +0 -0
  130. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_pruning_helper.py +0 -0
  131. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_webui_backend.py +0 -0
  132. {autoforge-2.1.0 → autoforge-2.2.0}/tests/test_webui_regressions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AutoForge
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: AutoForge - 3D color prints made easy
5
5
  Author-email: Hendric Voss <hvoss@techfak.uni-bielefeld.de>
6
6
  License: CC BY-NC-SA 4.0
@@ -93,6 +93,7 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
93
93
  - Windows: double-click `run_webui.bat`
94
94
 
95
95
  This starts the server and opens the web UI in your browser automatically (usually at `http://localhost:8000`).
96
+ It only listens on this computer by default, since the web UI has no login. To open it from other devices on your network, start it with `WEBUI_HOST=0.0.0.0 ./run_webui.sh` (Windows: `set WEBUI_HOST=0.0.0.0` before `run_webui.bat`). Open it by IP address or by this computer's name; any other name (for example one from a reverse proxy) has to be listed in `AUTOFORGE_WEBUI_ALLOWED_HOSTS` (comma separated).
96
97
 
97
98
  To make some parts of the picture come out closer than the rest (a face, the eyes, lettering), click **Focus** in the image panel and paint over them; a slider sets how much more they count (2× to 100×, default 10×). After a run, the **Differences** view shows where the print strays furthest from the picture.
98
99
 
@@ -100,7 +101,7 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
100
101
 
101
102
  To find a filament you own without measuring it yourself, click **Catalog** in the filament library. It searches every filament on [filamentcolors.xyz](https://filamentcolors.xyz) that has a measured TD (search by brand, color name, type or hex code; filter by type, brand or color family; or pick a color to see the closest matches first), and **Add** puts it straight into your library.
102
103
 
103
- The web UI sends anonymous usage telemetry to the project via [PostHog](https://posthog.com/) by default, to notify me of problems and any bugs. This includes crash reports (unhandled errors from both the browser frontend and the backend server, with the error type, message, and stack trace) so bugs can get fixed faster. No image data, filament data, or personal information is sent. To disable it, pass `--no-telemetry` (e.g. `./run_webui.sh --no-telemetry` / `run_webui.bat --no-telemetry`), or set `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false` permanently in your environment.
104
+ The web UI sends anonymous usage telemetry to the project via [PostHog](https://posthog.com/) by default, to notify me of problems and any bugs. This includes crash reports (unhandled errors from both the browser frontend and the backend server, with the error type, message, and stack trace) so bugs can get fixed faster. No image data, filament data or other personal information is sent, except that error messages and stack traces can contain file paths (the backend replaces your home folder in them with `~`, so your user name isn't sent from there; the browser's own stack traces only name the app's script files). To disable it, pass `--no-telemetry` (e.g. `./run_webui.sh --no-telemetry` / `run_webui.bat --no-telemetry`), or set `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false` permanently in your environment.
104
105
 
105
106
  4. **Update to the latest release** whenever you want, from the project folder:
106
107
  - Linux/macOS: `./update.sh`
@@ -108,8 +109,17 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
108
109
 
109
110
  This checks GitHub for a newer release and, if one exists, pulls it and reinstalls dependencies for you. Add `--check` to only check without applying it (e.g. `./update.sh --check`).
110
111
 
111
- If you have problems running the code on your GPU, please refer to the [Pytorch Homepage](https://pytorch.org/) for help. \
112
- CUDA, ROCm, and MPS (Apple Metal) are supported, but you need to install the correct version of pytorch for your system — `install.sh`/`install.bat` install whatever `uv sync` resolves by default, so swap in a GPU-specific PyTorch build afterwards if you need one. (`install.sh` handles older NVIDIA GPUs automatically, see below.)
112
+ ### GPU support
113
+
114
+ AutoForge runs on NVIDIA GPUs (CUDA), AMD GPUs (ROCm, Linux), Apple Silicon (MPS / Apple Metal) and, more slowly, on the CPU. The device is picked automatically in that order; override it with `--device` or the `AUTOFORGE_DEVICE` environment variable (e.g. `AUTOFORGE_DEVICE=cpu`).
115
+
116
+ `install.sh` installs the matching PyTorch build for you:
117
+ - **NVIDIA**: the default CUDA build; older (pre-Turing, e.g. GTX 10xx) cards automatically get the CUDA 12.6 build, the last one with kernels for them.
118
+ - **AMD (Linux)**: detected through `/dev/kfd` and given the ROCm build. Consumer Radeon cards that ROCm doesn't officially list may need e.g. `HSA_OVERRIDE_GFX_VERSION=10.3.0` (RX 6000) or `11.0.0` (RX 7000) set when running.
119
+ - **Apple Silicon**: the default macOS build already includes MPS.
120
+ - Anything else: run `AUTOFORGE_TORCH_INDEX=<PyTorch wheel index> ./install.sh`, e.g. `https://download.pytorch.org/whl/cpu`. `./update.sh` keeps whichever build was installed.
121
+
122
+ If the fused GPU kernels (Triton) cause trouble on your GPU, `AUTOFORGE_TRITON=off` switches to the plain PyTorch code path. For other GPU problems, see the [PyTorch homepage](https://pytorch.org/).
113
123
 
114
124
  ## Manual Installation (CLI only)
115
125
 
@@ -184,7 +194,7 @@ This will generate separate STL files for each color, allowing you to print face
184
194
  - `--processing_reduction_factor` Reduction factor for the processing size compared to the output size (default: 2 - half resolution).
185
195
  - `--nozzle_diameter` Diameter of the printer nozzle in millimeters (default: 0.4).
186
196
  **Note:** Details smaller than half this value will be ignored.
187
- - `--early_stopping` Number of steps without improvement before stopping (default: 10000).
197
+ - `--early_stopping` Number of steps without improvement before stopping (default: 3000).
188
198
  - `--priority_mask` *(Optional)* Path to a greyscale image the size of the input that marks the parts that matter most: white areas are matched more closely, black areas still count, just less.
189
199
  - `--priority_mask_strength` How many times more a white pixel of `--priority_mask` counts than a black one (default: 10; must be at least 1). Raise it if the marked areas still come out off, lower it for a gentler nudge.
190
200
 
@@ -234,9 +244,96 @@ After running, the following files will be created in your specified output fold
234
244
 
235
245
  *Note:* FlatForge generates multiple STL files that align perfectly when loaded together in your slicer, creating a solid rectangular print with each color as a separate object.
236
246
 
237
- ## You can now run Autoforge for free in your browser thanks to [Huggingface space support](https://huggingface.co/spaces/hvoss-techfak/Autoforge).
238
- This includes the option to run it locally if you have a powerful pc and don't want to limit yourself to the Huggingface computing limits. \
239
- For this simply go to the [Huggingface](https://huggingface.co/spaces/hvoss-techfak/Autoforge) space and pull the docker container for this project (upper right corner -> three dots -> "run locally")
247
+ ## Docker
248
+
249
+ The repository includes a Docker setup that builds the web UI, starts it automatically and serves it on http://localhost:8000. There is one compose file per kind of hardware; the first build takes a while, since it downloads PyTorch.
250
+
251
+ | Hardware | Compose file | Image |
252
+ | --- | --- | --- |
253
+ | NVIDIA GPU (Linux, Windows) | `docker-compose.yml` | `autoforge-webui:latest` |
254
+ | AMD GPU (Linux, x86_64) | `docker-compose.rocm.yml` | `autoforge-webui:rocm` |
255
+ | CPU only, and macOS (Intel and Apple Silicon) | `docker-compose.cpu.yml` | `autoforge-webui:cpu` |
256
+
257
+ Docker Compose 2.24 or newer is required. To check which device the running web UI uses, open http://localhost:8000/api/system/device: it lists `cuda:0` (NVIDIA and AMD alike) when the GPU is visible inside the container, or only `cpu` when it is not.
258
+
259
+ ### NVIDIA
260
+
261
+ 1. Install the NVIDIA driver and the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html), then restart Docker. On Windows, Docker Desktop with the WSL 2 backend already includes GPU support; only the NVIDIA driver is needed.
262
+ 2. Start AutoForge:
263
+ ```bash
264
+ docker compose up -d --build
265
+ ```
266
+
267
+ Older cards (GTX 10xx and other pre-Turing GPUs) need the CUDA 12.6 build of PyTorch, since the default build no longer has kernels for them:
268
+ ```bash
269
+ TORCH_INDEX_URL=https://download.pytorch.org/whl/cu126 docker compose up -d --build
270
+ ```
271
+
272
+ ### AMD
273
+
274
+ 1. Linux only. The host needs the `amdgpu` kernel driver (included in current kernels); `/dev/kfd` must exist. The ROCm runtime itself ships inside the image, so ROCm does not need to be installed on the host.
275
+ 2. Start AutoForge:
276
+ ```bash
277
+ docker compose -f docker-compose.rocm.yml up -d --build
278
+ ```
279
+
280
+ Consumer Radeon cards that ROCm doesn't officially list often need a GFX version override. Uncomment the `environment` block in `docker-compose.rocm.yml` and set `HSA_OVERRIDE_GFX_VERSION` to `10.3.0` for RDNA2 (RX 6000) or `11.0.0` for RDNA3 (RX 7000), then run the command again. If optimization fails with a Triton compilation error, add `AUTOFORGE_TRITON: "off"` to the same block to use the plain PyTorch code path.
281
+
282
+ AMD GPUs aren't supported by Docker on Windows or macOS; use the CPU image there.
283
+
284
+ ### Apple Silicon (MPS)
285
+
286
+ Docker containers on macOS run in a Linux VM with no access to Apple Metal, so the GPU cannot be used from Docker on a Mac. You have two options:
287
+ - **Use the GPU:** install AutoForge natively with `./install.sh` and start it with `./run_webui.sh`. The macOS build of PyTorch includes MPS, and AutoForge picks it automatically.
288
+ - **Use Docker (CPU only):**
289
+ ```bash
290
+ docker compose -f docker-compose.cpu.yml up -d --build
291
+ ```
292
+ This builds a native arm64 image. In Docker Desktop, raise the memory limit (Settings → Resources) if large images fail with out-of-memory errors.
293
+
294
+ ### CPU only
295
+
296
+ Works on any machine with Docker, but optimization is much slower than on a GPU:
297
+ ```bash
298
+ docker compose -f docker-compose.cpu.yml up -d --build
299
+ ```
300
+
301
+ ### Everyday use
302
+
303
+ The commands below use the NVIDIA compose file; add `-f docker-compose.rocm.yml` or `-f docker-compose.cpu.yml` for the other images.
304
+
305
+ | Task | Command |
306
+ | --- | --- |
307
+ | Show the logs | `docker compose logs -f` |
308
+ | Stop | `docker compose down` |
309
+ | Update to a newer version | `git pull && docker compose up -d --build` |
310
+ | Use another port | `WEBUI_PORT=9000 docker compose up -d` |
311
+ | Disable telemetry | `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false docker compose up -d` |
312
+
313
+ All the images start a container named `autoforge`, so stop the running one with its own compose file before switching to another.
314
+
315
+ Your projects, uploaded images, filament library and downloaded models are kept in the `autoforge-data` Docker volume, which survives restarts, updates and switching between the images. `docker compose down -v` deletes it along with the container.
316
+
317
+ To use your HueForge filament library, uncomment the HueForge lines in `docker-compose.yml` (the `AUTOFORGE_WEBUI_HUEFORGE_LIBRARY` variable and the volume mount) and point the mount at the folder containing `personal_library.json`.
318
+
319
+ ### Command-line tool
320
+
321
+ The `autoforge` CLI is included in every image. Mount the folder with your image and filament CSV into the container and run it from there; results are written into that folder:
322
+ ```bash
323
+ # NVIDIA
324
+ docker run --rm --gpus all -v "$PWD:/work" -w /work autoforge-webui:latest \
325
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
326
+
327
+ # AMD
328
+ docker run --rm --device /dev/kfd --device /dev/dri --group-add video --group-add render \
329
+ -v "$PWD:/work" -w /work autoforge-webui:rocm \
330
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
331
+
332
+ # CPU / macOS
333
+ docker run --rm -v "$PWD:/work" -w /work autoforge-webui:cpu \
334
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
335
+ ```
336
+ The container runs as root, so on Linux the output files belong to root; `sudo chown -R "$USER" output` makes them yours again.
240
337
 
241
338
  ## Development
242
339
 
@@ -56,6 +56,7 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
56
56
  - Windows: double-click `run_webui.bat`
57
57
 
58
58
  This starts the server and opens the web UI in your browser automatically (usually at `http://localhost:8000`).
59
+ It only listens on this computer by default, since the web UI has no login. To open it from other devices on your network, start it with `WEBUI_HOST=0.0.0.0 ./run_webui.sh` (Windows: `set WEBUI_HOST=0.0.0.0` before `run_webui.bat`). Open it by IP address or by this computer's name; any other name (for example one from a reverse proxy) has to be listed in `AUTOFORGE_WEBUI_ALLOWED_HOSTS` (comma separated).
59
60
 
60
61
  To make some parts of the picture come out closer than the rest (a face, the eyes, lettering), click **Focus** in the image panel and paint over them; a slider sets how much more they count (2× to 100×, default 10×). After a run, the **Differences** view shows where the print strays furthest from the picture.
61
62
 
@@ -63,7 +64,7 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
63
64
 
64
65
  To find a filament you own without measuring it yourself, click **Catalog** in the filament library. It searches every filament on [filamentcolors.xyz](https://filamentcolors.xyz) that has a measured TD (search by brand, color name, type or hex code; filter by type, brand or color family; or pick a color to see the closest matches first), and **Add** puts it straight into your library.
65
66
 
66
- The web UI sends anonymous usage telemetry to the project via [PostHog](https://posthog.com/) by default, to notify me of problems and any bugs. This includes crash reports (unhandled errors from both the browser frontend and the backend server, with the error type, message, and stack trace) so bugs can get fixed faster. No image data, filament data, or personal information is sent. To disable it, pass `--no-telemetry` (e.g. `./run_webui.sh --no-telemetry` / `run_webui.bat --no-telemetry`), or set `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false` permanently in your environment.
67
+ The web UI sends anonymous usage telemetry to the project via [PostHog](https://posthog.com/) by default, to notify me of problems and any bugs. This includes crash reports (unhandled errors from both the browser frontend and the backend server, with the error type, message, and stack trace) so bugs can get fixed faster. No image data, filament data or other personal information is sent, except that error messages and stack traces can contain file paths (the backend replaces your home folder in them with `~`, so your user name isn't sent from there; the browser's own stack traces only name the app's script files). To disable it, pass `--no-telemetry` (e.g. `./run_webui.sh --no-telemetry` / `run_webui.bat --no-telemetry`), or set `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false` permanently in your environment.
67
68
 
68
69
  4. **Update to the latest release** whenever you want, from the project folder:
69
70
  - Linux/macOS: `./update.sh`
@@ -71,8 +72,17 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
71
72
 
72
73
  This checks GitHub for a newer release and, if one exists, pulls it and reinstalls dependencies for you. Add `--check` to only check without applying it (e.g. `./update.sh --check`).
73
74
 
74
- If you have problems running the code on your GPU, please refer to the [Pytorch Homepage](https://pytorch.org/) for help. \
75
- CUDA, ROCm, and MPS (Apple Metal) are supported, but you need to install the correct version of pytorch for your system — `install.sh`/`install.bat` install whatever `uv sync` resolves by default, so swap in a GPU-specific PyTorch build afterwards if you need one. (`install.sh` handles older NVIDIA GPUs automatically, see below.)
75
+ ### GPU support
76
+
77
+ AutoForge runs on NVIDIA GPUs (CUDA), AMD GPUs (ROCm, Linux), Apple Silicon (MPS / Apple Metal) and, more slowly, on the CPU. The device is picked automatically in that order; override it with `--device` or the `AUTOFORGE_DEVICE` environment variable (e.g. `AUTOFORGE_DEVICE=cpu`).
78
+
79
+ `install.sh` installs the matching PyTorch build for you:
80
+ - **NVIDIA**: the default CUDA build; older (pre-Turing, e.g. GTX 10xx) cards automatically get the CUDA 12.6 build, the last one with kernels for them.
81
+ - **AMD (Linux)**: detected through `/dev/kfd` and given the ROCm build. Consumer Radeon cards that ROCm doesn't officially list may need e.g. `HSA_OVERRIDE_GFX_VERSION=10.3.0` (RX 6000) or `11.0.0` (RX 7000) set when running.
82
+ - **Apple Silicon**: the default macOS build already includes MPS.
83
+ - Anything else: run `AUTOFORGE_TORCH_INDEX=<PyTorch wheel index> ./install.sh`, e.g. `https://download.pytorch.org/whl/cpu`. `./update.sh` keeps whichever build was installed.
84
+
85
+ If the fused GPU kernels (Triton) cause trouble on your GPU, `AUTOFORGE_TRITON=off` switches to the plain PyTorch code path. For other GPU problems, see the [PyTorch homepage](https://pytorch.org/).
76
86
 
77
87
  ## Manual Installation (CLI only)
78
88
 
@@ -147,7 +157,7 @@ This will generate separate STL files for each color, allowing you to print face
147
157
  - `--processing_reduction_factor` Reduction factor for the processing size compared to the output size (default: 2 - half resolution).
148
158
  - `--nozzle_diameter` Diameter of the printer nozzle in millimeters (default: 0.4).
149
159
  **Note:** Details smaller than half this value will be ignored.
150
- - `--early_stopping` Number of steps without improvement before stopping (default: 10000).
160
+ - `--early_stopping` Number of steps without improvement before stopping (default: 3000).
151
161
  - `--priority_mask` *(Optional)* Path to a greyscale image the size of the input that marks the parts that matter most: white areas are matched more closely, black areas still count, just less.
152
162
  - `--priority_mask_strength` How many times more a white pixel of `--priority_mask` counts than a black one (default: 10; must be at least 1). Raise it if the marked areas still come out off, lower it for a gentler nudge.
153
163
 
@@ -197,9 +207,96 @@ After running, the following files will be created in your specified output fold
197
207
 
198
208
  *Note:* FlatForge generates multiple STL files that align perfectly when loaded together in your slicer, creating a solid rectangular print with each color as a separate object.
199
209
 
200
- ## You can now run Autoforge for free in your browser thanks to [Huggingface space support](https://huggingface.co/spaces/hvoss-techfak/Autoforge).
201
- This includes the option to run it locally if you have a powerful pc and don't want to limit yourself to the Huggingface computing limits. \
202
- For this simply go to the [Huggingface](https://huggingface.co/spaces/hvoss-techfak/Autoforge) space and pull the docker container for this project (upper right corner -> three dots -> "run locally")
210
+ ## Docker
211
+
212
+ The repository includes a Docker setup that builds the web UI, starts it automatically and serves it on http://localhost:8000. There is one compose file per kind of hardware; the first build takes a while, since it downloads PyTorch.
213
+
214
+ | Hardware | Compose file | Image |
215
+ | --- | --- | --- |
216
+ | NVIDIA GPU (Linux, Windows) | `docker-compose.yml` | `autoforge-webui:latest` |
217
+ | AMD GPU (Linux, x86_64) | `docker-compose.rocm.yml` | `autoforge-webui:rocm` |
218
+ | CPU only, and macOS (Intel and Apple Silicon) | `docker-compose.cpu.yml` | `autoforge-webui:cpu` |
219
+
220
+ Docker Compose 2.24 or newer is required. To check which device the running web UI uses, open http://localhost:8000/api/system/device: it lists `cuda:0` (NVIDIA and AMD alike) when the GPU is visible inside the container, or only `cpu` when it is not.
221
+
222
+ ### NVIDIA
223
+
224
+ 1. Install the NVIDIA driver and the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html), then restart Docker. On Windows, Docker Desktop with the WSL 2 backend already includes GPU support; only the NVIDIA driver is needed.
225
+ 2. Start AutoForge:
226
+ ```bash
227
+ docker compose up -d --build
228
+ ```
229
+
230
+ Older cards (GTX 10xx and other pre-Turing GPUs) need the CUDA 12.6 build of PyTorch, since the default build no longer has kernels for them:
231
+ ```bash
232
+ TORCH_INDEX_URL=https://download.pytorch.org/whl/cu126 docker compose up -d --build
233
+ ```
234
+
235
+ ### AMD
236
+
237
+ 1. Linux only. The host needs the `amdgpu` kernel driver (included in current kernels); `/dev/kfd` must exist. The ROCm runtime itself ships inside the image, so ROCm does not need to be installed on the host.
238
+ 2. Start AutoForge:
239
+ ```bash
240
+ docker compose -f docker-compose.rocm.yml up -d --build
241
+ ```
242
+
243
+ Consumer Radeon cards that ROCm doesn't officially list often need a GFX version override. Uncomment the `environment` block in `docker-compose.rocm.yml` and set `HSA_OVERRIDE_GFX_VERSION` to `10.3.0` for RDNA2 (RX 6000) or `11.0.0` for RDNA3 (RX 7000), then run the command again. If optimization fails with a Triton compilation error, add `AUTOFORGE_TRITON: "off"` to the same block to use the plain PyTorch code path.
244
+
245
+ AMD GPUs aren't supported by Docker on Windows or macOS; use the CPU image there.
246
+
247
+ ### Apple Silicon (MPS)
248
+
249
+ Docker containers on macOS run in a Linux VM with no access to Apple Metal, so the GPU cannot be used from Docker on a Mac. You have two options:
250
+ - **Use the GPU:** install AutoForge natively with `./install.sh` and start it with `./run_webui.sh`. The macOS build of PyTorch includes MPS, and AutoForge picks it automatically.
251
+ - **Use Docker (CPU only):**
252
+ ```bash
253
+ docker compose -f docker-compose.cpu.yml up -d --build
254
+ ```
255
+ This builds a native arm64 image. In Docker Desktop, raise the memory limit (Settings → Resources) if large images fail with out-of-memory errors.
256
+
257
+ ### CPU only
258
+
259
+ Works on any machine with Docker, but optimization is much slower than on a GPU:
260
+ ```bash
261
+ docker compose -f docker-compose.cpu.yml up -d --build
262
+ ```
263
+
264
+ ### Everyday use
265
+
266
+ The commands below use the NVIDIA compose file; add `-f docker-compose.rocm.yml` or `-f docker-compose.cpu.yml` for the other images.
267
+
268
+ | Task | Command |
269
+ | --- | --- |
270
+ | Show the logs | `docker compose logs -f` |
271
+ | Stop | `docker compose down` |
272
+ | Update to a newer version | `git pull && docker compose up -d --build` |
273
+ | Use another port | `WEBUI_PORT=9000 docker compose up -d` |
274
+ | Disable telemetry | `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false docker compose up -d` |
275
+
276
+ All the images start a container named `autoforge`, so stop the running one with its own compose file before switching to another.
277
+
278
+ Your projects, uploaded images, filament library and downloaded models are kept in the `autoforge-data` Docker volume, which survives restarts, updates and switching between the images. `docker compose down -v` deletes it along with the container.
279
+
280
+ To use your HueForge filament library, uncomment the HueForge lines in `docker-compose.yml` (the `AUTOFORGE_WEBUI_HUEFORGE_LIBRARY` variable and the volume mount) and point the mount at the folder containing `personal_library.json`.
281
+
282
+ ### Command-line tool
283
+
284
+ The `autoforge` CLI is included in every image. Mount the folder with your image and filament CSV into the container and run it from there; results are written into that folder:
285
+ ```bash
286
+ # NVIDIA
287
+ docker run --rm --gpus all -v "$PWD:/work" -w /work autoforge-webui:latest \
288
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
289
+
290
+ # AMD
291
+ docker run --rm --device /dev/kfd --device /dev/dri --group-add video --group-add render \
292
+ -v "$PWD:/work" -w /work autoforge-webui:rocm \
293
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
294
+
295
+ # CPU / macOS
296
+ docker run --rm -v "$PWD:/work" -w /work autoforge-webui:cpu \
297
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
298
+ ```
299
+ The container runs as root, so on Linux the output files belong to root; `sudo chown -R "$USER" output` makes them yours again.
203
300
 
204
301
  ## Development
205
302
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "AutoForge"
7
- version="2.1.0"
7
+ version="2.2.0"
8
8
  description = "AutoForge - 3D color prints made easy"
9
9
  authors = [{ name = "Hendric Voss", email = "hvoss@techfak.uni-bielefeld.de" }]
10
10
  readme = "README.md"
@@ -51,7 +51,7 @@ test = [
51
51
  package-dir = {"" = "src"}
52
52
 
53
53
  [tool.setuptools.package-data]
54
- autoforge = ["data/*.json"]
54
+ autoforge = ["data/*.json", "default_materials.csv"]
55
55
 
56
56
  [project.scripts]
57
57
  autoforge = "autoforge.auto_forge:main"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AutoForge
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: AutoForge - 3D color prints made easy
5
5
  Author-email: Hendric Voss <hvoss@techfak.uni-bielefeld.de>
6
6
  License: CC BY-NC-SA 4.0
@@ -93,6 +93,7 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
93
93
  - Windows: double-click `run_webui.bat`
94
94
 
95
95
  This starts the server and opens the web UI in your browser automatically (usually at `http://localhost:8000`).
96
+ It only listens on this computer by default, since the web UI has no login. To open it from other devices on your network, start it with `WEBUI_HOST=0.0.0.0 ./run_webui.sh` (Windows: `set WEBUI_HOST=0.0.0.0` before `run_webui.bat`). Open it by IP address or by this computer's name; any other name (for example one from a reverse proxy) has to be listed in `AUTOFORGE_WEBUI_ALLOWED_HOSTS` (comma separated).
96
97
 
97
98
  To make some parts of the picture come out closer than the rest (a face, the eyes, lettering), click **Focus** in the image panel and paint over them; a slider sets how much more they count (2× to 100×, default 10×). After a run, the **Differences** view shows where the print strays furthest from the picture.
98
99
 
@@ -100,7 +101,7 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
100
101
 
101
102
  To find a filament you own without measuring it yourself, click **Catalog** in the filament library. It searches every filament on [filamentcolors.xyz](https://filamentcolors.xyz) that has a measured TD (search by brand, color name, type or hex code; filter by type, brand or color family; or pick a color to see the closest matches first), and **Add** puts it straight into your library.
102
103
 
103
- The web UI sends anonymous usage telemetry to the project via [PostHog](https://posthog.com/) by default, to notify me of problems and any bugs. This includes crash reports (unhandled errors from both the browser frontend and the backend server, with the error type, message, and stack trace) so bugs can get fixed faster. No image data, filament data, or personal information is sent. To disable it, pass `--no-telemetry` (e.g. `./run_webui.sh --no-telemetry` / `run_webui.bat --no-telemetry`), or set `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false` permanently in your environment.
104
+ The web UI sends anonymous usage telemetry to the project via [PostHog](https://posthog.com/) by default, to notify me of problems and any bugs. This includes crash reports (unhandled errors from both the browser frontend and the backend server, with the error type, message, and stack trace) so bugs can get fixed faster. No image data, filament data or other personal information is sent, except that error messages and stack traces can contain file paths (the backend replaces your home folder in them with `~`, so your user name isn't sent from there; the browser's own stack traces only name the app's script files). To disable it, pass `--no-telemetry` (e.g. `./run_webui.sh --no-telemetry` / `run_webui.bat --no-telemetry`), or set `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false` permanently in your environment.
104
105
 
105
106
  4. **Update to the latest release** whenever you want, from the project folder:
106
107
  - Linux/macOS: `./update.sh`
@@ -108,8 +109,17 @@ The easiest way to use AutoForge is the web UI, a local app with drag-and-drop i
108
109
 
109
110
  This checks GitHub for a newer release and, if one exists, pulls it and reinstalls dependencies for you. Add `--check` to only check without applying it (e.g. `./update.sh --check`).
110
111
 
111
- If you have problems running the code on your GPU, please refer to the [Pytorch Homepage](https://pytorch.org/) for help. \
112
- CUDA, ROCm, and MPS (Apple Metal) are supported, but you need to install the correct version of pytorch for your system — `install.sh`/`install.bat` install whatever `uv sync` resolves by default, so swap in a GPU-specific PyTorch build afterwards if you need one. (`install.sh` handles older NVIDIA GPUs automatically, see below.)
112
+ ### GPU support
113
+
114
+ AutoForge runs on NVIDIA GPUs (CUDA), AMD GPUs (ROCm, Linux), Apple Silicon (MPS / Apple Metal) and, more slowly, on the CPU. The device is picked automatically in that order; override it with `--device` or the `AUTOFORGE_DEVICE` environment variable (e.g. `AUTOFORGE_DEVICE=cpu`).
115
+
116
+ `install.sh` installs the matching PyTorch build for you:
117
+ - **NVIDIA**: the default CUDA build; older (pre-Turing, e.g. GTX 10xx) cards automatically get the CUDA 12.6 build, the last one with kernels for them.
118
+ - **AMD (Linux)**: detected through `/dev/kfd` and given the ROCm build. Consumer Radeon cards that ROCm doesn't officially list may need e.g. `HSA_OVERRIDE_GFX_VERSION=10.3.0` (RX 6000) or `11.0.0` (RX 7000) set when running.
119
+ - **Apple Silicon**: the default macOS build already includes MPS.
120
+ - Anything else: run `AUTOFORGE_TORCH_INDEX=<PyTorch wheel index> ./install.sh`, e.g. `https://download.pytorch.org/whl/cpu`. `./update.sh` keeps whichever build was installed.
121
+
122
+ If the fused GPU kernels (Triton) cause trouble on your GPU, `AUTOFORGE_TRITON=off` switches to the plain PyTorch code path. For other GPU problems, see the [PyTorch homepage](https://pytorch.org/).
113
123
 
114
124
  ## Manual Installation (CLI only)
115
125
 
@@ -184,7 +194,7 @@ This will generate separate STL files for each color, allowing you to print face
184
194
  - `--processing_reduction_factor` Reduction factor for the processing size compared to the output size (default: 2 - half resolution).
185
195
  - `--nozzle_diameter` Diameter of the printer nozzle in millimeters (default: 0.4).
186
196
  **Note:** Details smaller than half this value will be ignored.
187
- - `--early_stopping` Number of steps without improvement before stopping (default: 10000).
197
+ - `--early_stopping` Number of steps without improvement before stopping (default: 3000).
188
198
  - `--priority_mask` *(Optional)* Path to a greyscale image the size of the input that marks the parts that matter most: white areas are matched more closely, black areas still count, just less.
189
199
  - `--priority_mask_strength` How many times more a white pixel of `--priority_mask` counts than a black one (default: 10; must be at least 1). Raise it if the marked areas still come out off, lower it for a gentler nudge.
190
200
 
@@ -234,9 +244,96 @@ After running, the following files will be created in your specified output fold
234
244
 
235
245
  *Note:* FlatForge generates multiple STL files that align perfectly when loaded together in your slicer, creating a solid rectangular print with each color as a separate object.
236
246
 
237
- ## You can now run Autoforge for free in your browser thanks to [Huggingface space support](https://huggingface.co/spaces/hvoss-techfak/Autoforge).
238
- This includes the option to run it locally if you have a powerful pc and don't want to limit yourself to the Huggingface computing limits. \
239
- For this simply go to the [Huggingface](https://huggingface.co/spaces/hvoss-techfak/Autoforge) space and pull the docker container for this project (upper right corner -> three dots -> "run locally")
247
+ ## Docker
248
+
249
+ The repository includes a Docker setup that builds the web UI, starts it automatically and serves it on http://localhost:8000. There is one compose file per kind of hardware; the first build takes a while, since it downloads PyTorch.
250
+
251
+ | Hardware | Compose file | Image |
252
+ | --- | --- | --- |
253
+ | NVIDIA GPU (Linux, Windows) | `docker-compose.yml` | `autoforge-webui:latest` |
254
+ | AMD GPU (Linux, x86_64) | `docker-compose.rocm.yml` | `autoforge-webui:rocm` |
255
+ | CPU only, and macOS (Intel and Apple Silicon) | `docker-compose.cpu.yml` | `autoforge-webui:cpu` |
256
+
257
+ Docker Compose 2.24 or newer is required. To check which device the running web UI uses, open http://localhost:8000/api/system/device: it lists `cuda:0` (NVIDIA and AMD alike) when the GPU is visible inside the container, or only `cpu` when it is not.
258
+
259
+ ### NVIDIA
260
+
261
+ 1. Install the NVIDIA driver and the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html), then restart Docker. On Windows, Docker Desktop with the WSL 2 backend already includes GPU support; only the NVIDIA driver is needed.
262
+ 2. Start AutoForge:
263
+ ```bash
264
+ docker compose up -d --build
265
+ ```
266
+
267
+ Older cards (GTX 10xx and other pre-Turing GPUs) need the CUDA 12.6 build of PyTorch, since the default build no longer has kernels for them:
268
+ ```bash
269
+ TORCH_INDEX_URL=https://download.pytorch.org/whl/cu126 docker compose up -d --build
270
+ ```
271
+
272
+ ### AMD
273
+
274
+ 1. Linux only. The host needs the `amdgpu` kernel driver (included in current kernels); `/dev/kfd` must exist. The ROCm runtime itself ships inside the image, so ROCm does not need to be installed on the host.
275
+ 2. Start AutoForge:
276
+ ```bash
277
+ docker compose -f docker-compose.rocm.yml up -d --build
278
+ ```
279
+
280
+ Consumer Radeon cards that ROCm doesn't officially list often need a GFX version override. Uncomment the `environment` block in `docker-compose.rocm.yml` and set `HSA_OVERRIDE_GFX_VERSION` to `10.3.0` for RDNA2 (RX 6000) or `11.0.0` for RDNA3 (RX 7000), then run the command again. If optimization fails with a Triton compilation error, add `AUTOFORGE_TRITON: "off"` to the same block to use the plain PyTorch code path.
281
+
282
+ AMD GPUs aren't supported by Docker on Windows or macOS; use the CPU image there.
283
+
284
+ ### Apple Silicon (MPS)
285
+
286
+ Docker containers on macOS run in a Linux VM with no access to Apple Metal, so the GPU cannot be used from Docker on a Mac. You have two options:
287
+ - **Use the GPU:** install AutoForge natively with `./install.sh` and start it with `./run_webui.sh`. The macOS build of PyTorch includes MPS, and AutoForge picks it automatically.
288
+ - **Use Docker (CPU only):**
289
+ ```bash
290
+ docker compose -f docker-compose.cpu.yml up -d --build
291
+ ```
292
+ This builds a native arm64 image. In Docker Desktop, raise the memory limit (Settings → Resources) if large images fail with out-of-memory errors.
293
+
294
+ ### CPU only
295
+
296
+ Works on any machine with Docker, but optimization is much slower than on a GPU:
297
+ ```bash
298
+ docker compose -f docker-compose.cpu.yml up -d --build
299
+ ```
300
+
301
+ ### Everyday use
302
+
303
+ The commands below use the NVIDIA compose file; add `-f docker-compose.rocm.yml` or `-f docker-compose.cpu.yml` for the other images.
304
+
305
+ | Task | Command |
306
+ | --- | --- |
307
+ | Show the logs | `docker compose logs -f` |
308
+ | Stop | `docker compose down` |
309
+ | Update to a newer version | `git pull && docker compose up -d --build` |
310
+ | Use another port | `WEBUI_PORT=9000 docker compose up -d` |
311
+ | Disable telemetry | `AUTOFORGE_WEBUI_TELEMETRY_ENABLED=false docker compose up -d` |
312
+
313
+ All the images start a container named `autoforge`, so stop the running one with its own compose file before switching to another.
314
+
315
+ Your projects, uploaded images, filament library and downloaded models are kept in the `autoforge-data` Docker volume, which survives restarts, updates and switching between the images. `docker compose down -v` deletes it along with the container.
316
+
317
+ To use your HueForge filament library, uncomment the HueForge lines in `docker-compose.yml` (the `AUTOFORGE_WEBUI_HUEFORGE_LIBRARY` variable and the volume mount) and point the mount at the folder containing `personal_library.json`.
318
+
319
+ ### Command-line tool
320
+
321
+ The `autoforge` CLI is included in every image. Mount the folder with your image and filament CSV into the container and run it from there; results are written into that folder:
322
+ ```bash
323
+ # NVIDIA
324
+ docker run --rm --gpus all -v "$PWD:/work" -w /work autoforge-webui:latest \
325
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
326
+
327
+ # AMD
328
+ docker run --rm --device /dev/kfd --device /dev/dri --group-add video --group-add render \
329
+ -v "$PWD:/work" -w /work autoforge-webui:rocm \
330
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
331
+
332
+ # CPU / macOS
333
+ docker run --rm -v "$PWD:/work" -w /work autoforge-webui:cpu \
334
+ autoforge --input_image input.jpg --csv_file materials.csv --output_folder output
335
+ ```
336
+ The container runs as root, so on Linux the output files belong to root; `sudo chown -R "$USER" output` makes them yours again.
240
337
 
241
338
  ## Development
242
339
 
@@ -9,14 +9,18 @@ src/AutoForge.egg-info/top_level.txt
9
9
  src/autoforge/__init__.py
10
10
  src/autoforge/__main__.py
11
11
  src/autoforge/auto_forge.py
12
+ src/autoforge/default_materials.csv
12
13
  src/autoforge/priority_mask_editor.py
13
14
  src/autoforge/Helper/AmpUtils.py
14
15
  src/autoforge/Helper/CAdamW.py
15
16
  src/autoforge/Helper/ConstraintHelper.py
17
+ src/autoforge/Helper/DeterministicOps.py
16
18
  src/autoforge/Helper/DeviceUtils.py
17
19
  src/autoforge/Helper/FilamentHelper.py
18
20
  src/autoforge/Helper/FusedComposite.py
19
21
  src/autoforge/Helper/HeightAssign.py
22
+ src/autoforge/Helper/HeightGuidance.py
23
+ src/autoforge/Helper/HeightfieldMesh.py
20
24
  src/autoforge/Helper/ImageHelper.py
21
25
  src/autoforge/Helper/OptimizerHelper.py
22
26
  src/autoforge/Helper/OtherHelper.py
@@ -29,6 +33,7 @@ src/autoforge/Helper/Heightmaps/ChristofidesHeightMap.py
29
33
  src/autoforge/Helper/Heightmaps/DepthEstimateHeightMap.py
30
34
  src/autoforge/Helper/Heightmaps/FastTSPHeightMap.py
31
35
  src/autoforge/Helper/Heightmaps/__init__.py
36
+ src/autoforge/Helper/Heightmaps/_cluster.py
32
37
  src/autoforge/Init_comparer/__init__.py
33
38
  src/autoforge/Init_comparer/auto_forge_init_check.py
34
39
  src/autoforge/Init_comparer/plot_results.py
@@ -46,6 +51,7 @@ src/autoforge/webui/models.py
46
51
  src/autoforge/webui/server.py
47
52
  src/autoforge/webui/api/__init__.py
48
53
  src/autoforge/webui/api/filaments.py
54
+ src/autoforge/webui/api/guidance.py
49
55
  src/autoforge/webui/api/images.py
50
56
  src/autoforge/webui/api/init.py
51
57
  src/autoforge/webui/api/optimization.py
@@ -57,12 +63,18 @@ src/autoforge/webui/api/settings.py
57
63
  src/autoforge/webui/api/sliders.py
58
64
  src/autoforge/webui/api/state.py
59
65
  src/autoforge/webui/api/system.py
66
+ src/autoforge/webui/api/workers.py
60
67
  src/autoforge/webui/api/ws.py
61
68
  src/autoforge/webui/helpers/__init__.py
69
+ src/autoforge/webui/helpers/auto_prune.py
62
70
  src/autoforge/webui/helpers/colored_mesh.py
71
+ src/autoforge/webui/helpers/edited_export.py
63
72
  src/autoforge/webui/helpers/gpu_memory.py
73
+ src/autoforge/webui/helpers/guidance_views.py
64
74
  src/autoforge/webui/helpers/mesh_persist.py
65
75
  src/autoforge/webui/helpers/pipeline_runner.py
76
+ src/autoforge/webui/helpers/project_heightmap.py
77
+ src/autoforge/webui/helpers/result_store.py
66
78
  src/autoforge/webui/helpers/slider_render.py
67
79
  src/autoforge/webui/helpers/sliders.py
68
80
  src/autoforge/webui/helpers/telemetry.py
@@ -76,6 +88,8 @@ tests/test_amp_utils.py
76
88
  tests/test_auto_forge_cli.py
77
89
  tests/test_bug_regressions.py
78
90
  tests/test_bugfixes_2026_09_26.py
91
+ tests/test_bugreport_2026_10_01.py
92
+ tests/test_bugreport_2026_10_03.py
79
93
  tests/test_cadamw.py
80
94
  tests/test_christofides_heightmap.py
81
95
  tests/test_composite_image.py
@@ -83,6 +97,7 @@ tests/test_constrained_opt.py
83
97
  tests/test_depth_adjusted_height_map.py
84
98
  tests/test_depth_estimate_height_map.py
85
99
  tests/test_device_utils.py
100
+ tests/test_edge_bleed.py
86
101
  tests/test_end_to_end_optimizer.py
87
102
  tests/test_fasttsp_heightmap.py
88
103
  tests/test_filament_helper.py
@@ -91,6 +106,7 @@ tests/test_flatforge.py
91
106
  tests/test_graph_cache_eviction.py
92
107
  tests/test_graph_capture_threads.py
93
108
  tests/test_gumbel_nan.py
109
+ tests/test_height_guidance.py
94
110
  tests/test_image_helper.py
95
111
  tests/test_loss_functions.py
96
112
  tests/test_optimizer_module.py
@@ -104,4 +120,5 @@ tests/test_prune_repeatability.py
104
120
  tests/test_pruning_helper.py
105
121
  tests/test_remove_height_spikes.py
106
122
  tests/test_webui_backend.py
107
- tests/test_webui_regressions.py
123
+ tests/test_webui_regressions.py
124
+ tests/test_worktree_bugs_2026_10_01.py
@@ -30,17 +30,23 @@ def _probe_backward(device: torch.device, dtype: torch.dtype) -> bool:
30
30
  here.
31
31
  """
32
32
  try:
33
- x = torch.randn(8, 8, device=device, dtype=torch.float32, requires_grad=False)
34
- w = torch.randn(8, 8, device=device, dtype=torch.float32, requires_grad=True)
35
- target = torch.randn(8, 8, device=device, dtype=torch.float32)
33
+ # Fixed inputs, not torch.randn: the probe runs once per process, and
34
+ # drawing from the device's generator there shifted the random
35
+ # stream of only the first run - the same seed gave a different
36
+ # result in the first webui job than in every later one.
37
+ base = torch.linspace(-1.0, 1.0, 64, device=device, dtype=torch.float32).view(8, 8)
38
+ x = base.clone()
39
+ w = base.t().contiguous().requires_grad_(True)
40
+ target = base.flip(0)
36
41
  with torch.autocast(device_type=device.type, dtype=dtype):
37
42
  y = x @ w
38
43
  loss = torch.nn.functional.mse_loss(y, target)
39
44
  loss.backward()
40
- # Step with a dummy optimizer to ensure gradients are usable
41
- opt = torch.optim.SGD([w], lr=1e-3)
42
- opt.step()
43
- return True
45
+ # Apply the gradient to make sure it is usable (a plain update: a
46
+ # torch.optim optimizer would import torch._dynamo, ~0.7 s).
47
+ with torch.no_grad():
48
+ w.add_(w.grad, alpha=-1e-3)
49
+ return bool(torch.isfinite(w).all())
44
50
  except Exception:
45
51
  return False
46
52
 
@@ -61,6 +61,15 @@ class CAdamW(Optimizer):
61
61
  super().__init__(params, defaults)
62
62
  self.init_lr = lr
63
63
 
64
+ # torch.optim.Optimizer wraps these two in torch._disable_dynamo, whose
65
+ # first call imports all of torch._dynamo (sympy, fsdp, ...): ~0.7 s per
66
+ # run for machinery nothing here uses. The undecorated originals.
67
+ def add_param_group(self, param_group: dict) -> None:
68
+ return getattr(Optimizer.add_param_group, "__wrapped__", Optimizer.add_param_group)(self, param_group)
69
+
70
+ def zero_grad(self, set_to_none: bool = True) -> None:
71
+ return getattr(Optimizer.zero_grad, "__wrapped__", Optimizer.zero_grad)(self, set_to_none)
72
+
64
73
  @torch.no_grad()
65
74
  def step(self, closure: Callable = None):
66
75
  """