Small PrusaSlicer helper to apply extra flow on layer 1 only, then restore normal flow.
- In
Printer Settings -> Custom G-code -> Start G-code, append contents ofgcode/start.gcode. - In
Printer Settings -> Custom G-code -> Before layer change G-code, append contents ofgcode/before-layer-change.gcode. - In your active filament profile (
Filament Settings -> Custom G-code -> Custom parameters), add:
{
"first_layer_extrusion_multiplier": 1.02
}- Slice and verify your output G-code contains:
; FIRST_LAYER_FLOW_APPLYnear start, followed byM221 S...; FIRST_LAYER_FLOW_RESETafter first layer, followed by baselineM221 S...
python3 scripts/validate-gcode.py /path/to/output.gcode --expect-first-layer 102 --expect-reset 100For one-layer prints:
python3 scripts/validate-gcode.py /path/to/output.gcode --expect-first-layer 102 --expect-reset 100 --allow-missing-reset| code | meaning |
|---|---|
0 |
verified — the markers are present and the values are the expected ones |
1 |
wrong — the markers are present and a value is not what was expected |
2 |
could not tell — no FIRST_LAYER_FLOW_APPLY marker, so the feature never ran and nothing was validated |
4 |
could not read the file named on the command line |
2 is not a finding about the print. It means the custom G-code did not run at all,
so the remedy is to check the printer profile's Custom G-code and re-slice — not to change
a flow value. It exists because the validator used to report this case as 0: with the
markers absent it fell back to "the first M221 in the file" and "the second", and M221
appears routinely in ordinary G-code, so an uninstalled feature could match by coincidence
and pass.
Regression tests: ./scripts/test-validate-gcode.sh.
- Custom parameter key:
first_layer_extrusion_multiplier - Start logic:
Parameter exists ->
M221 S{custom * 100}Parameter missing ->M221 S{extrusion_multiplier * 100} - Before-layer-change logic:
At
layer_num == 1-> restore baselineM221 S{extrusion_multiplier * 100}
If you prefer patching an exported config instead of manual copy/paste:
- In PrusaSlicer:
File -> Export -> Export Config - Run:
python3 scripts/patch-config.py --input /path/to/exported.ini --output /path/to/exported.patched.ini- Import the patched file.
Most users can ignore this section.
presets/vendor/FirstLayerFlow.ini+presets/vendor/FirstLayerFlow.idxVendor-bundle style packaging with a generic Marlin baseline (250x210).presets/simple/first-layer-flow-config.iniMinimal patch asset (start_gcode+before_layer_gcodeonly). Depending on import flow, direct import may replace active config state.
- PrusaSlicer:
>= 2.9.3 - Uses official custom parameter placeholders introduced in 2.9.3
- Assumes firmware supports
M221(Marlin/Klipper style) - v1 support target: single-extruder profiles
- No apply marker in G-code: start snippet is not active on the current printer profile.
- Apply value stays baseline: custom parameter JSON missing/invalid in the active filament profile.
- Reset missing on multi-layer print: before-layer-change snippet missing/overridden.
- Release notes (custom parameters): https://github.com/prusa3d/PrusaSlicer/releases
- Macro docs: https://help.prusa3d.com/article/macros_1775
- Placeholder list: https://help.prusa3d.com/article/list-of-placeholders_205643
- Vendor bundle/index semantics: https://github.com/prusa3d/PrusaSlicer/wiki/Vendor-bundles-and-updating-process