Can You Leave Filament Mapping to AI? Slicer Auto vs AI on Waste and Time for a 12-Color Model With More Colors Than Nozzles

When a model has more colors than your printer has nozzles, you have to decide which color goes on which nozzle. That filament mapping changes both how much material you throw away and how long the print takes. Put 12 colors on two nozzles, and every time one nozzle swaps colors, the previous color has to be pushed out and wasted. Bambu Studio decides the mapping automatically, but you can also hand the color table to an AI and let it work out a plan. So is the AI’s plan any better than the slicer’s automatic one?
This article contains affiliate links. As an Amazon Associate, we earn from qualifying purchases.
To find out, I built a 12-color test model: a cylinder split into three tiers, with each tier divided into four wedges of different sizes. I sliced it with the Bambu Studio 2.9.1 CLI using the official Bambu Lab H2D, H2C and H3C profiles. I compared four mappings: the slicer’s automatic mode (Auto For Flush), a hand-made baseline, a plan from claude -p (Claude Sonnet 5.5), and a plan from gemma4:12b running locally. Every value is a slicer estimate; nothing was printed on real hardware. Each AI condition was run three times.
Here is the result up front. In this run, the automatic mapping used the least material on all three printers. It was also the fastest on the H2D and H3C; only on the H2C was the hand-made baseline faster. claude -p predicted the number of swaps that involve a flush almost exactly: 120 predicted vs 124 actual on the H2D, 5 vs 5 on the H2C, and 40–42 vs 42 on the H3C. Even so, it used more material than the automatic mapping.
The swap counts matched but the material did not, because the flush volume of a single swap depends on which pair of colors is being swapped. The AI only received each color’s hex value, its height range and its volume; it did not get the flush volume for each color pair. Without thinking, gemma4:12b returned the same mapping as the hand-made baseline (or one close to it) on the H2D and H2C, but on the H3C it used tools that do not exist, which breaks the constraints. With thinking enabled, it used up its whole context on reasoning and returned no answer in all nine runs.
- Filament mapping becomes a problem when there are more colors than nozzles
- Bambu Studio’s automatic mapping: what Auto For Flush minimizes
- Test conditions: slicing a 12-color model with the H2D, H2C and H3C profiles
- Results: automatic mapping used the least material on all three printers
- claude -p nearly nailed the swap count, but still used more material than auto
- gemma4:12b: close to the baseline without thinking, invalid on the H3C, and no answer with thinking
- If you let AI work out filament mapping: what this run suggests
- What this run cannot tell you
- Summary: use auto as the baseline for filament mapping and compare AI plans against it
- Sources
Filament mapping becomes a problem when there are more colors than nozzles

If you have no more colors than nozzles, the mapping is simple. Put one color on each nozzle and no nozzle ever has to swap colors. In fact, in How Much Material Do Multicolor Prints Waste on Different Printers? (published 2026-11-24), the two-color model sliced for the H2D had zero flush. With two nozzles, each color got its own nozzle.
Once there are more colors than nozzles, though, at least one nozzle has to carry two or more colors. That nozzle flushes the old color every time it changes. Which colors you stack on which nozzle changes both the number of swaps and the amount per swap. When Bambu Studio 2.0.0 (released 2025-03-25) brought this feature to dual-nozzle printers, its release notes listed what directly affects material use:
In dual-nozzle 3D printing, the distribution of model colors, the sequence of color changes, and differences in flush volumes between colors all directly impact material use.
Three factors are listed: how the model’s colors are distributed, the order of color changes, and how flush volumes differ between color pairs. The last one is the key to reading the results in this article. In the Bambu Studio interface this feature is called filament grouping; in this article I use the more general term filament mapping.
The three printers, and which nozzles take more than one color
| Printer | How colors are changed | Nozzles or tools (profile) | Nozzles that take more than one color |
|---|---|---|---|
| H2D | Two nozzles, left and right | 2 | Both |
| H2C | One on the left, plus hotend swapping on the right (Vortek) | 1 + 6 | Any of the 7 |
| H3C | Tool changing | 9 | Only tool 1, which connects to the AMS |
The H2D has two extruders, each with one nozzle. The H2C swaps between up to six hotends on its right extruder. The Bambu Lab blog says “The intelligent control algorithm automatically assigns filaments to the appropriate hotends,” so mapping filaments to hotends is automatic. Paired with an AMS it is said to handle up to 24 colors, so any colors beyond the number of hotends have to be swapped inside the same hotend.
The H3C is a different case from the other two. The official press release says “By attaching a original AMS to tool 1” and that “the system can be expanded to 24 materials.” Tool 1 is the same tool the English product page calls “PrintTool No. 1” and the 2026-11-23 article calls tool number 1. In the Bambu Studio 2.9.1 H3C profile, too, the only nozzle connected to the AMS is index 0, the first one. The source code also treats every nozzle other than the AMS-connected one as a fixed nozzle that holds a single color. On top of that, the eighth of the nine nozzles has the nozzle type TPU285 in the profile, meaning it is for 2.85 mm TPU. I covered the full H3C configuration in What Changed With Multi-Tool 3D Printers? Nozzle Switching, Hotend Swapping and Tool Changing Across the H3C’s Nine Tools (published 2026-11-23).
So with 12 colors of PLA on the H3C, the seven tools other than tool 1 and the TPU tool each get one color, and the remaining 12 − 7 = 5 colors go on tool 1. Color swaps and flushes only happen inside tool 1.
Terms and how things were counted
Of the wasted material, the flush is the amount pushed out of a nozzle to clear the previous color before a new one goes in, and the prime tower is the tower built beside the model. As in the 2026-11-24 article, I counted “swaps that involve a flush”: tool changes where the target nozzle already held a different filament. This is the filament_change_times value in the result.json that the Bambu Studio CLI writes. Changes that load filament into an empty nozzle for the first time are not included in this count.
For material, I used the sum of the per-filament grams in the G-code header. This total includes the model itself and was converted by the slicer using the density in the profile (1.26 g/cm³ for the Bambu PLA Basic profile). Since only the mapping changes for the same printer and the same model, most of the difference can be read as a difference in wasted material.
When I added up the G-code section by section, using the same method as in How Much Material Do Multicolor Prints Waste on Different Printers? (published 2026-11-24), the model itself weighed the same for every mapping on a given printer (7.55 g on the H2D and H2C, 7.551 g on the H3C). On the H3C the prime tower was also the same at 8.93 g, so every difference between mappings showed up in the flush (10.861 g for auto, 21.017 g for the hand-made baseline, 20.567 g for the second claude -p run). Note that the official tool change G-code for the H2D, H2C and H3C writes the flush as ;VG1 lines used for accounting, while the printer performs the actual extrusion. The flush volume is the sum of those lines, and the estimated time is added through the SYNC lines.
Time is the total estimated time from the G-code header, an estimate that includes preparation time.
You end up with more colors than nozzles when you add an AMS to load more materials. Bambu Lab’s P2S Combo ships with the current AMS 2 Pro.
Bambu Studio’s automatic mapping: what Auto For Flush minimizes

Interface names and CLI values
The mapping mode in Bambu Studio is set by the filament_map_mode key. The names in the interface correspond to the values passed to the CLI as follows.
| Interface name | CLI value |
|---|---|
| Filament-Saving Mode | Auto For Flush |
| Convenience Mode | Auto For Match |
| Custom Mode | Manual (internally Nozzle Manual on multi-nozzle printers) |
The default is Auto For Flush, and the CLI also sets the default to Auto For Flush before slicing. The list of values for this setting also includes Nozzle Manual and Default. On the other hand, the table that converts a string passed to the CLI into a value includes Auto For Quality (a quality-first mode) and has no Default (this is from reading the source; I did not test it by passing it to the CLI). This automatic mapping is not unique to Bambu Studio, either: the OrcaSlicer 2.5.1 source has the same filament_map_mode key and values such as Auto For Flush.
The official description, and the score in the source
For Filament-Saving Mode, the 2.0.0 release notes say “The system minimizes filament waste.” They add that you may then need to adjust where filaments are placed or the AMS connection order on the printer by hand. On H3C-type printers, however, the description shown in the interface says the mode will “minimize filament time consumption.” On the H3C, the official description itself names time, not material.
Reading the source makes it more concrete. The 2.9.1 source (FilamentGroup.cpp) gives each candidate mapping a score and picks the one with the smallest score. That score is the flush volume multiplied by a factor of 0.4536 to convert it into time, plus the estimated tool change time. According to a comment in the source, the factor converts volume to mass at a density of 1.26 g/cm³, then to seconds at 180 seconds per gram, with a correction factor of 2: 1.26 × 180 × 2 ÷ 1000 = 0.4536. There is also a setting that adds print time to the score (group_algo_with_time), but it is off by default.
In other words, what Auto For Flush minimizes is the flush volume converted into time plus the estimated tool change time. It is neither the minimum grams of material nor the minimum number of swaps. The swap count does not enter as a count; it enters as time calculated from the sequence of changes. Before the score is even considered, the algorithm first avoids pairings that cannot be loaded and never exceeds the number of colors a single nozzle can hold. In addition, the exhaustive search adds 10 to the score of any plan in which fewer than half the colors land on the master extruder (set by master_extruder_id in the profile).
How it searches, and the AMS the CLI pretends to have
In the source, if there are fewer than 10,000 combinations, it enumerates all of them; otherwise it searches for up to 3,000 ms using a method called k-medoids. k-medoids starts each trial with a fixed seed, but because it stops on a time limit, the result can change with the speed and load of the PC. So I sliced the automatic mode twice on each printer, and on every printer both runs produced the same mapping and the same estimates. I did not check in the run logs which search method each printer actually used.
The CLI also differs from a real printer in one more way. The CLI does not know what is in your actual AMS, so in automatic modes it assumes one four-slot AMS per extruder and fills it with the project colors in order. The source picks, from candidates with close scores, the plan that matches the AMS colors, so on the CLI the plan is matched to these assumed colors. The automatic mappings in this article assume the AMS that the CLI made up, and they may not match what you would see in the interface on a real printer. I did not test Convenience Mode (Auto For Match), because matching to the assumed AMS colors would change what it means compared with a real printer.
Test conditions: slicing a 12-color model with the H2D, H2C and H3C profiles

The 12-color model
I made the model myself: a cylinder 40 mm in diameter and 12 mm tall, split vertically into three tiers (4 mm each), with each tier divided into wedges of 160°, 100°, 60° and 40°. Each of the 12 parts got one of 12 colors, so the four colors in a tier sit side by side on the same layers. Every tier has colors with large and small volumes.
The volumes given to the AI follow from the wedge angles. One tier has a volume of π × 20² × 4 ≈ 5026.5 mm³, so the 160° wedge is 160/360 of that, about 2234.0 mm³; 100° is about 1396.3 mm³, 60° about 837.8 mm³, and 40° about 558.5 mm³ (the 20 mm radius is half the 40 mm diameter). Colors 1–4 are the bottom tier, 5–8 the middle tier and 9–12 the top tier, numbered from the largest wedge to the smallest within each tier. The color sequence is the same as in the 2026-11-24 article.
The process layer height is 0.20 mm, so each tier is roughly 4 ÷ 0.20 = 20 layers. This number comes back later when reading the swap counts.
Slicer and printers
- Version: Bambu Studio 2.9.1 (tag v02.09.01.70, the stable release published 2026-11-03). I unpacked the official zip on a Windows 11 Pro PC and used only the CLI, with no login and no printer connection
- Printer profiles: “Bambu Lab H2D 0.4 nozzle,” “Bambu Lab H2C 0.4 nozzle” and “Bambu Lab H3C 0.4 nozzle.” The process was 0.20mm Standard and the material Bambu PLA Basic, the same combination as in the 2026-11-24 article
- Run date: 2026-11-16. The PC had an Intel Core Ultra 7 265F, 63.7 GB of RAM and an RTX 5070 Ti 16 GB
- At first I sliced without resolving the official G-code templates (includes) that the printer profiles pull in. I noticed this partway through verification and re-sliced every mapping with the official templates included. The values in this article are from the re-slice, and the AI plans are the same answers sliced again
Four ways to map filaments
- Slicer auto: no mode specified, sliced with the default Auto For Flush
- Hand-made baseline: avoid putting colors from the same tier (that is, colors on the same layers) on the same nozzle as much as possible. Where there are not enough nozzles, stack colors onto nozzles holding a color from a different tier, starting with the smallest volumes. The H2D has only two nozzles, so each tier’s four colors were split two and two. For the H3C, the five colors sent to tool 1 were limited to at most two from the same tier, and among those options I picked the set with the smallest total volume
claude -pplan: given the color table and a description of the printer, it returned a mapping as JSON- gemma4:12b plan: the same question, in two conditions, with and without thinking
The hand-made baseline and the AI plans were passed to the CLI in a manual mode: Manual with –filament-map (the nozzle number for each color) on the H2D, and Nozzle Manual with arguments such as –filament-nozzle-map on the H2C and H3C. I confirmed on the H2D and H2C that passing the automatic result through manual mode gives the same estimates (matching time and grams). Whether the assignment took effect was checked against the group_id written in slice_info in the output 3MF.
Before slicing, a script checked each AI plan against the constraints: every color appears exactly once, nozzle numbers are in range, on the H3C only tool 1 carries more than one color, and the TPU nozzle is not used. Plans that failed were not sliced; I only counted them. I do not treat the slicer accepting a plan as proof that it would print on a real machine. Reading the source, Nozzle Manual only checks that nozzle numbers are in range and that the nozzle is installed; it does not check how many colors land on one nozzle.
The H3C was re-sliced to match the real configuration
The first H3C run sliced all nine tools as normal nozzles, with every tool able to swap colors. That does not match the real machine, so those results are not used. For the re-slice, every mapping got the following arguments.
--extruder-nozzle-count 9
--extruder-nozzle-volume-type Standard,Standard,Standard,Standard,Standard,Standard,Standard,TPU285,Standard
--ams-nozzle-idx 0
The third argument is there for a reason. According to the source, when you state the nozzle count and types explicitly on the CLI, the AMS-connected nozzle is treated as “none” unless you also pass –ams-nozzle-idx. In that state, with more colors than nozzles, the slicer may add nozzles that do not exist on the real machine to its calculation (from reading the source; not confirmed in a run). So I made it explicit that the AMS is connected to tool 1 (index 0). After the re-slice, every mapping that was sliced had 42 swaps involving a flush, so the swaps do happen inside tool 1.
Nozzle numbers in the tables start at 0. On the H3C, index 0 is the official tool 1 and index 7 is the eighth tool, for TPU. On the H2C, 0 is the left nozzle and 1–6 are the right-side hotends. The H2D has two, 0 and 1. The CLI option –filament-map takes 1-based numbers (1 and 2), which I converted to 0-based in the tables. In the prompt I described nozzle 0 as the left one, but I did not confirm in this article how the slicer’s numbers map to left and right.
What the AI was given
The AI received only a table of each color’s hex value, the height range where it prints and its volume, plus a description of the printer. It did not get the flush volume for each color pair. For the H3C, the printer description read as follows.
You are planning a multi-colour FDM print on a tool-changer printer with 9 tools (tools 0-8).
- Tool 0 is the only tool connected to an AMS, so it can switch between several filaments. When tool 0 has to print a
different filament than the one it currently holds, the old filament is purged (wasted) and the new one is loaded.
- Tools 1-6 and 8 each hold exactly one filament for the whole print.
- Tool 7 is for 2.85 mm TPU and cannot print these filaments.
Switching between tools does not purge.
The H2D and H2C prompts differ in one sentence of the printer description. For the H2D it was “The printer has 2 nozzles (nozzle 0 = left, nozzle 1 = right), each on its own extruder.” For the H2C it was “nozzle 0 is on the left extruder; nozzles 1-6 are interchangeable hotends on the right extruder,” and the prompt said any nozzle could swap colors, discarding the previous color with each swap. Every prompt ended by asking for a mapping that keeps wasted material and print time as low as possible, plus a predicted swap count, returned as JSON.
The prompt simplified two things. First, on waste it only said “the old filament is purged (wasted)” and did not mention that the amount depends on the color pair. Second, it said “Switching between tools does not purge.”, but tool changes still deposit material on the prime tower. In the 2026-11-24 article, too, most of the extra material on the H3C was prime tower.
A note on the AIs’ knowledge cutoffs. Anthropic’s model overview lists Claude Sonnet 5.5’s knowledge cutoff as June 2026, and Gemma 4’s training data runs through January 2025. The H3C announcement and the Bambu Studio 2.9.1 release both came on 2026-11-03, after both cutoffs. So I treated the AIs as not knowing the H3C configuration and wrote the printer constraints into the prompt as shown above.
| Item | claude -p | gemma4:12b |
|---|---|---|
| Model | Claude Sonnet 5.5 (ID in the response log: claude-sonnet-5-5) | Ollama gemma4:12b (11.9B, Q4_K_M) |
| How it ran | Non-interactive Claude Code run, no tools | Local GPU, temperature 0, num_ctx 16384, with and without thinking |
| Runs | 3 per printer | 3 per condition per printer |
Claude Sonnet 5.5 API pricing is $2 input and $10 output per million tokens. This article made nine claude -p calls (3 printers × 3 runs, not counting the first three H3C runs that did not match the real configuration), for a total of 0.1655 USD. This is a client-side estimate reported by Claude Code. The gemma4:12b weights are published under the Apache License 2.0, and since it ran locally there was no API cost. Electricity was not counted.
Results: automatic mapping used the least material on all three printers

H2D: same number of swaps, but a 14.72 g spread in material
| Method | Run | Mapping (nozzle for colors 1–12) | Estimated time | Total material (g) | Swaps with flush | AI prediction (swaps) |
|---|---|---|---|---|---|---|
| Slicer auto | Same in both runs | [1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0] | 4h 1m 39s | 61.92 | 124 | — |
| Hand-made baseline | 1 | [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] | 4h 6m 53s | 68.11 | 124 | — |
| claude -p | 1 | [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0] | 4h 14m 32s | 76.64 | 124 | 120 |
| claude -p | 2 | [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1] | 4h 6m 57s | 66.93 | 124 | 120 |
| claude -p | 3 | [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0] | 4h 14m 32s | 76.64 | 124 | 120 |
| gemma4:12b (no thinking) | 1–3 | [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] | 4h 6m 53s | 68.11 | 124 | 6 |
| gemma4:12b (thinking) | 1–3 | No answer | — | — | — | — |
On the H2D, auto came in at 61.92 g and 4h 1m 39s, the least material and the shortest time. The hand-made baseline and the gemma4:12b plan were the same mapping, at 68.11 g. claude -p gave the same mapping in runs 1 and 3, at 76.64 g, and 66.93 g in run 2. The highest figure, 76.64 g, is 76.64 − 61.92 = 14.72 g more than auto.
Every mapping had the same 124 swaps. Even so, material varied by up to 14.72 g.
The shape of the mappings does differ. The hand-made baseline, gemma4:12b and runs 1 and 3 of claude -p split each tier’s four colors two and two across the nozzles. Auto instead split every tier three and one. In the bottom tier, for example, only color 1 went on nozzle 1, and colors 2–4 went on nozzle 0. Run 2 of claude -p also split three and one, but it chose a different single color and nozzle from auto, and came in at 66.93 g.
H2C: small differences, and the hand-made baseline is the fastest
| Method | Run | Mapping (nozzle for colors 1–12) | Estimated time | Total material (g) | Swaps with flush | AI prediction (swaps) |
|---|---|---|---|---|---|---|
| Slicer auto | Same in both runs | [3, 5, 0, 1, 2, 4, 6, 3, 3, 6, 4, 0] | 2h 14m 49s | 20.86 | 5 | — |
| Hand-made baseline | 1 | [0, 3, 6, 1, 1, 4, 0, 2, 2, 5, 0, 1] | 2h 8m 59s | 22.4 | 5 | — |
| claude -p | 1 | [0, 1, 2, 3, 4, 5, 6, 3, 0, 1, 2, 4] | 2h 16m 0s | 22.32 | 5 | 5 |
| claude -p | 2 | [0, 1, 2, 3, 4, 5, 6, 3, 4, 5, 6, 3] | 2h 23m 11s | 21.86 | 5 | 5 |
| claude -p | 3 | [1, 3, 4, 5, 2, 6, 4, 5, 0, 6, 4, 5] | 2h 22m 54s | 21.78 | 5 | 5 |
| gemma4:12b (no thinking) | 1–3 | [0, 1, 2, 3, 4, 5, 6, 1, 0, 2, 3, 4] | 2h 15m 27s | 21.55 | 5 | 0 |
| gemma4:12b (thinking) | 1–3 | No answer | — | — | — | — |
On the H2C the material differences were small. The minimum was auto at 20.86 g and the maximum the hand-made baseline at 22.4 g, a spread of 22.4 − 20.86 = 1.54 g. Every mapping had 5 swaps. Each plan put a tier’s four colors on separate nozzles, so with 12 colors on 7 nozzles, 12 − 7 = 5 colors go into a nozzle that already holds a color from an earlier tier. That is why every mapping ends up with the same count.
On time, the hand-made baseline was the fastest at 2h 8m 59s, 5 min 50 s faster than auto at 2h 14m 49s (2h 14m 49s − 2h 8m 59s). It did, however, use 22.4 − 20.86 = 1.54 g more material than auto, the most on the H2C. By default the automatic score does not include print time, so it will not necessarily pick the plan with the shortest estimated time.
H3C: 42 swaps for every mapping, and auto uses up to 10.16 g less
| Method | Run | Mapping (tool for colors 1–12) | Estimated time | Total material (g) | Swaps with flush | AI prediction (swaps) |
|---|---|---|---|---|---|---|
| Slicer auto | 1 | [0, 6, 4, 1, 0, 0, 2, 3, 0, 0, 8, 5] | 1h 24m 48s | 27.32 | 42 | — |
| Slicer auto | 2 | [0, 6, 4, 1, 0, 0, 2, 3, 0, 0, 8, 5] | 1h 24m 48s | 27.32 | 42 | — |
| Hand-made baseline | 1 | [1, 2, 0, 0, 3, 4, 0, 0, 5, 6, 8, 0] | 1h 32m 38s | 37.48 | 42 | — |
| claude -p | 1 | [1, 2, 0, 0, 3, 4, 0, 0, 5, 6, 8, 0] | 1h 32m 38s | 37.48 | 42 | 42 |
| claude -p | 2 | [1, 2, 3, 0, 4, 5, 0, 0, 6, 8, 0, 0] | 1h 32m 31s | 37.05 | 42 | 40 |
| claude -p | 3 | [1, 2, 3, 0, 4, 5, 0, 0, 6, 8, 0, 0] | 1h 32m 31s | 37.05 | 42 | 42 |
| gemma4:12b (no thinking) | 1–3 | Fails the constraints: [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12] | Not sliced | — | — | 0 |
| gemma4:12b (thinking) | 1–3 | No answer | Not sliced | — | — | — |
On the H3C, every plan other than auto used at least 30% more material than auto. Auto produced the same mapping in both runs, at 27.32 g and 1h 24m 48s. The hand-made baseline and run 1 of claude -p were the same mapping at 37.48 g, and runs 2 and 3 of claude -p came in at 37.05 g. The gap to auto is 37.48 − 27.32 = 10.16 g in material and 1h 32m 38s − 1h 24m 48s = 7 min 50 s in time.
Every plan that was sliced put five colors on tool 1, left the TPU tool (index 7) unused and met the constraints. Every one also had 42 swaps. What differed was which five colors went on tool 1.
| Method | Colors on tool 1 (index 0) | Colors per tier (bottom, middle, top) | Wedges of those colors |
|---|---|---|---|
| Slicer auto | Colors 1, 5, 6, 9, 10 | 1, 2, 2 | 160° and 100° |
| Hand-made baseline, claude -p run 1 | Colors 3, 4, 7, 8, 12 | 2, 2, 1 | 60° and 40° |
| claude -p runs 2 and 3 | Colors 4, 7, 8, 11, 12 | 1, 2, 2 | 60° and 40° |
Auto gathered the colors of the large wedges in each tier (160° and 100°) onto tool 1. The hand-made baseline and claude -p did the opposite and sent the colors of the small wedges (60° and 40°) to tool 1. Putting low-volume colors on the swapping tool looks like the natural choice, but in this run those plans used more material. Why gathering the large colors used less cannot be explained without checking the flush volumes for each color pair, and I did not do that check in this run.
claude -p nearly nailed the swap count, but still used more material than auto

Here are claude -p’s predictions next to the actual counts from result.json.
| Printer | claude -p prediction (runs 1–3) | Actual (runs 1–3) |
|---|---|---|
| H2D | 120, 120, 120 | 124, 124, 124 |
| H2C | 5, 5, 5 | 5, 5, 5 |
| H3C | 42, 40, 42 | 42, 42, 42 |
The predictions were close, likely because with this model the count can be worked out almost by straight counting. Note, though, that the prompt did not give the layer height (0.20 mm). In all six answers for the H2D and H3C, claude -p wrote in its reasoning that it assumed 0.2 mm layers. The H2C count of 5 does not depend on the number of layers. On the H3C, a tier with two colors on tool 1 swaps once per layer, so about 20 times per tier. Two such tiers give about 40, and adding the two swaps at tier boundaries that load the next tier’s color into tool 1 gives 20 × 2 + 2 = 42. On the H2C, as described above, it comes to 12 − 7 = 5.
My own rough estimate gets close on the H2D, too. Split four colors two and two across two nozzles, and each nozzle swaps once per layer, two swaps in total. Split three and one, and if the three-color nozzle reverses its order every layer, that is also two per layer. 20 layers × 3 tiers × 2 swaps = 120, the same as claude -p’s prediction. I did not count where the gap to the actual 124 comes from, and I did not check how the slicer actually ordered colors within each layer.
The swap count alone, however, does not decide the wasted material. As checked in the 2026-11-24 article, the flush volume for a single swap in Bambu Studio is the “from previous color to next color” value in the flush table (flush_volumes_matrix, in mm³) multiplied by the flush multiplier. The setting’s description says: “The actual flushing volumes is equal to the flush multiplier multiplied by the flushing volumes in the table.” Even with the same 42 swaps, the amount per swap changes with which color goes to which. On the H3C in this run, that difference added up to 10.16 g.
The AI prompt did not include this table. On the H3C, claude -p sent the low-volume colors to the swapping tool 1. But when every valid plan ends up with the same number of swaps, cleverness about the count makes no difference. The automatic score, by contrast, includes the flush volume itself. The AI and the automatic mode were working with different information, so this gap cannot be read purely as a difference in how they reason.
What the model got wrong here was context, not counting: the prompt never included the flush table. This book is a practical guide to deciding what information goes into a prompt.
gemma4:12b: close to the baseline without thinking, invalid on the H3C, and no answer with thinking

Without thinking, gemma4:12b at temperature 0 returned the same mapping in all three runs on every printer. Its H2D plan was exactly the hand-made baseline, alternating each tier’s four colors two and two across the nozzles. So material and time matched the baseline at 68.11 g and 4h 6m 53s. Its swap prediction, however, was 6, far from the actual 124.
Its H2C plan put colors 1–7 on nozzles 0–6 in order, then stacked colors 8–12 onto nozzles that already held a color. As a result, the four colors in each tier all ended up on separate nozzles, the same idea as the hand-made baseline. Material came to 21.55 g, less than the baseline (22.4 g). Its swap prediction, though, was 0, missing the point that putting 12 colors on 7 nozzles forces at least some swaps.
Its H3C plan was [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12] in all three runs. It avoided the TPU tool (index 7), but although the prompt said “tools 0-8,” it used tools 9–12, which do not exist. It put only one color on tool 0 and gave each of the other eleven colors its own number, which is more numbers than nine tools allow. Since it fails the constraints, this plan was not sliced.
With thinking enabled, it returned no answer in any of the nine runs (3 printers × 3 runs). The logs show the stop reason as length, with output around 15,700 tokens. With num_ctx set to 16384, the thinking alone used up the context. Ollama’s default context length is 4096 tokens, and this run used a larger value. I did not test whether an even larger num_ctx would have produced an answer.
If you let AI work out filament mapping: what this run suggests

This run covers one shape and three printers, so it cannot be generalized into a procedure. With that in mind, here is what the records do support.
Give it the flush volume for each color pair
The AI in this run knew nothing about the colors except their hex values. With that, claude -p nearly nailed the swap count but used more material than auto (gemma4:12b predicted 6 swaps on the H2D and 0 on the H2C, against actual counts of 124 and 5). This comparison, however, comes with the condition that the AI never got the flush table that sets the amount per swap. The settings section of the G-code that Bambu Studio writes includes the flush table for each color pair (flush_volumes_matrix). If you want an AI to work out the filament mapping, putting this table in the prompt comes first. Whether passing the table would let the AI match auto was not tested in this run.
Use auto as the baseline for comparison
In this run, not a single AI plan used less material than auto. If you want to use an AI plan, slice with auto first and use its estimates as the baseline. Then slice the AI plan in manual mode, compare material and time using the CLI estimates, and keep the better one. Because the automatic search can be cut off by its time limit, it is worth slicing the same input twice or more and checking that the results match.
Write the printer constraints into the prompt, and check the answer with a script
The H3C came out after both AIs’ knowledge cutoffs, so you cannot expect them to know that only tool 1 takes the AMS or that the eighth tool is for TPU. The only option is to write the constraints into the prompt. And even then, as gemma4:12b showed, an AI may return tools that do not exist. Before slicing, use a script to check that each color appears once, that tool numbers are in range and how many colors land on one nozzle. The slicer accepting a plan is not proof that it will print on a real machine.
Decide whether you want to minimize material or time
On the H2C, the hand-made baseline used 1.54 g more material than auto but was 5 min 50 s faster in estimated time. The Auto For Flush score centers on flush volume and estimated tool change time, and by default leaves print time out. For prints where time matters more, compare against a faster plan instead of taking the automatic result as is. I did not test how results change with the setting that adds print time to the score (group_algo_with_time).
CLI auto and interface auto are not necessarily the same
The CLI’s automatic plan is matched to the colors of an AMS it assumes. If the colors in your real AMS differ, the mapping chosen in the interface may differ too. When you carry a result compared on the CLI over to a real printer, check the mapping shown in the interface again.
Scoring an AI plan against a baseline result is exactly how you evaluate LLM output in general. To go further with that, this book covers evaluation in depth.
What this run cannot tell you

- Nothing was printed on real hardware: every value is an estimate from the Bambu Studio 2.9.1 CLI, and no wasted material was weighed. The estimated times cannot be called actual times either
- Few runs: three per AI condition, two per printer for auto, one each for the hand-made baseline. Whether an AI does better or worse than the slicer is a result of this run only and cannot be generalized
- One shape: only a self-made cylinder split into three tiers of four colors, while real multicolor models each arrange their colors differently. There was only one set of color hex values, and changing colors changes the flush table too
- The flush table was not given to the AI: I did not test what the AI would plan with it
- The CLI’s assumed AMS: the automatic mappings assume an AMS the CLI made up and may not match the mapping in the interface on a real printer
- The breakdown is a tally of slicer paths: flush and prime tower amounts are sums of extrusion per G-code section (with flush taken from the
;VG1accounting lines), not weights measured from a print - AI conditions:
claude -pused only Claude Sonnet 5.5, and gemma4:12b only temperature 0 and num_ctx 16384; no other models or settings were tried - Profile scope: every printer used its 0.4 mm nozzle profile, the 0.20mm Standard process and Bambu PLA Basic only
- The first H3C results: the first run, with all nine tools as normal nozzles, does not match the real configuration and was not used
- Other slicers: OrcaSlicer 2.5.1 has the same mode values, but I did not slice with it in this article
Summary: use auto as the baseline for filament mapping and compare AI plans against it

- I sliced a self-made 12-color model with the Bambu Studio 2.9.1 CLI using the H2D, H2C and H3C profiles and compared four filament mapping approaches. The values are slicer estimates; nothing was printed
- In this run, auto (Auto For Flush) used the least material on all three printers: 61.92 g on the H2D, 20.86 g on the H2C and 27.32 g on the H3C. Only on the H2C was the hand-made baseline faster
- What Auto For Flush minimizes is the flush volume converted into time plus the estimated tool change time, not the minimum grams or the minimum number of swaps
claude -pnearly nailed the swap count but used more material than auto. On the H3C every mapping had 42 swaps, yet material differed by 10.16 g. The fact that the AI was not given the flush volume for each color pair is the key premise for reading this- Without thinking, gemma4:12b gave plans equal or close to the hand-made baseline on the H2D and H2C, and a plan using nonexistent tools on the H3C. With thinking, it returned no answer in all nine runs
- If you want AI to work out the mapping, give it the flush table, use the estimates from an automatic slice as the baseline, and check plans with a script before slicing
Step-by-step settings for purge, supports and material boundaries are collected in Multi-Material Slicing in Practice 2026: Purge, Supports and Material Boundaries (published 2026-07-04). The mapping is decided one step before those settings. An example of having AI check combinations of slicer settings is in Getting AI to Catch Slicer Setting Mix-ups: Testing Material, Temperature and Plate Combinations With Official Profiles (published 2026-10-14). Whether it is mapping or settings, if you do not take the AI’s answer as is and instead set it up so it can be compared side by side with the slicer output, you can judge plans by the numbers.
Sources
- Bambu Studio, “2.9.1 Public Release” (GitHub, tag v02.09.01.70)
- Bambu Studio, “2.0.0 Public Release” (GitHub, tag v02.00.00.95)
- Bambu Studio source, PrintConfig.cpp (commit for tag v02.09.01.70)
- Bambu Studio source, FilamentGroup.cpp (same commit)
- Bambu Studio source, ToolOrdering.cpp (same commit)
- Bambu Studio source, BambuStudio.cpp (same commit; CLI and result.json)
- Bambu Studio Japanese translation, BambuStudio_ja.po (same commit)
- Bambu Studio printer profile, “Bambu Lab H3C 0.4 nozzle” (same commit)
- Bambu Studio printer profile, “Bambu Lab H2C 0.4 nozzle” (same commit)
- OrcaSlicer source, PrintConfig.cpp (commit for tag v2.5.1)
- PR Newswire, “Tool changer. Game changer. Bambu Lab presents H3C” (2026-11-03)
- Bambu Lab Blog, “Bambu Lab H2C: where Multi-Material Vortek System meets engineering precision”
- Anthropic, “Models overview”
- Anthropic, “Pricing”
- Claude Code documentation, “headless” (
-poutput and cost) - Ollama, “gemma4:12b”
- Hugging Face, README for “google/gemma-4-12B-it”
- Google, “Apache License 2.0 | Gemma”
- Ollama, “Thinking”
- Ollama, “FAQ”





