Layer Rescue: resume failed prints from any layer, even after a power loss

Hi all,

“Resume from layer” has been requested here quite a few times (this thread, and this one). Until there’s an official option, I wrote a tool that does it, and I wanted to share it here in case it saves someone’s print.

rocket

What it is

Layer Rescue is a free, open-source (MIT) post-processing script for Bambu Studio. You slice the complete model as usual. Studio runs the script, a small window asks a few questions, and the G-code gets rewritten to continue from where the print stopped. Since it runs as a post-processing step, the result shows up in Studio’s preview before you send anything.

What it can do

  • Resume with the printer still on. For a clog, a runout or a manual stop. You pick the last good layer, and it skips everything below. Z is never homed, and the startup routine runs without the bed leveling and the purge/wipe moves that would hit the part.
  • Resume after a power loss or restart. The printer has lost its Z position, so you jog the nozzle down until it just touches the top of the part. It continues from there using relative Z.
  • Insert mode (beta), for a part that came off the plate or broke. It prints a low holding wall that follows the part’s sliced outline, then pauses. You place the part back in the wall, press resume, and it prints the missing section on top. If the upper section needs supports, it rebuilds them from the bed first, skipping the ones that would be in the part’s way.

Tested

Five real tests, all written up with videos:

  • an LW-PLA plane part with a jam,
  • a dragon with a power cut mid-print,
  • a Benchy that detached,
  • a drone body I broke on purpose (the GIF above),
  • a multi-object plate where two of five parts got knocked off.

The write-ups also cover what went wrong. For example, I entered the wrong layer on the dragon, and the Benchy slipped without glue.

Limits, so nobody gets surprised

  • I’ve only tested on a P1S. Other printers and AMS/multi-filament prints may well work, but they’re untested. The app tells you this and makes you accept the risk before continuing.
  • You’ll always see a seam line where the print resumes. With the correct layer it’s strong enough in my tests, but entering a layer that’s 2–3 off is clearly visible.
  • In insert mode, how well a part sits in the wall depends a lot on its shape. Parts that widen towards the top may need a bit of hot glue on the outer side.

Getting it

Windows and macOS installers are on the releases page, or you can install with pipx install layer-rescue. The README explains how to add it to Studio’s post-processing scripts.

GitHub: GitHub - EmirhanSyl/layer-rescue: Resume a failed Bambu Lab P1S (or any other printer) print from any layer. A Bambu Studio post-processing script that rewrites the G-code to continue on top of the part rather it still on the plate or not, even after a power cycle. · GitHub

Feedback is very welcome, especially from X1, A1 and H2D owners, and from anyone using AMS. If something breaks, please open an issue with the sliced file, and I’ll take a look.

benchy

I installed this with an H2C and had some problems with it. I ended up splitting the original model and just printed the lost half. Nice attempt tho! I would think a modification for the different print chamber sizes wouldn’t be too much of a problem to fix but I am not a programmer. Also, is there a layer number I can identify from the LCD screen on the printer somewhere for the last one laid? You seem to ask that for input data (I did go with my measured height instead).

Thanks a lot for trying it! H2C isn’t tested yet, and you’re probably right about the cause: the start, park and purge moves were tested for the P1S, so a printer with a different chamber and layout can trip them up. If you still have it, could you tell me what went wrong (which mode, what the printer did, any error message)? A sliced file would help even more. A GitHub issue is perfect, but replying here works too. And if you’d be up for testing H2C support with me, I’d be happy to credit you in the README as a contributor.

About the layer number: as far as I know, the P1S screen doesn’t show it, at least not in a way you can read after the print has stopped. You’re right that the app asks for a layer number, though. You can work it out from your measured height: divide it by the layer height. For example, 12.8 mm measured with 0.2 mm layers gives layer 64 (12.8 / 0.2 = 64). If your first layer is thicker than the rest, subtract the first layer first and add 1: with a 0.2 mm first layer and 0.16 mm layers, 10.12 mm gives (10.12 − 0.2) / 0.16 + 1 = layer 63. I’m working on letting the app do this for you, so you’ll just enter the measured height.

I needed to resume a “successfully failed” print on a P1S. After 16 hours in a 18 hour print, the nozzle blocked and didn’t print the last 150+ layers. I saw your post on reddit this week and had to try this out. Layer Rescue worked perfectly. The print is currently resumed and will finish shortly saving me time and material. Great Job!

That’s awesome, thanks for sharing! 16 hours in and a clog ruins the last 150 layers… that’s exactly the kind of print I built this for, so it’s really great to hear it worked on your P1S. If you get a chance, I’d love to see a photo of how the resume line turned out.Also, I’m planning to make a place on GitHub for community test results. And if you’re okay with it, I’d be happy to add your print to there. Thanks for giving it a try :heart:

Quick update on the H2C: I went through the G-code it produces line by line, and you were right that the P1S moves were the problem. I compared it against a real H2C slice and Bambu’s own H2C start G-code. Here’s what I found:

  • The purge station is in a different place. Layer Rescue drove to where the P1S purge chute is, and on the H2C that spot is on the bed itself, so the purged filament would have landed on the plate.
  • It also moved to where the P1S filament cutter is, which doesn’t exist on the H2C.
  • The H2C selects a hotend together with the filament, and its two-nozzle temperature commands have to name the extruder. Layer Rescue did neither.
  • The purge ran faster than a 0.2 mm nozzle can actually push filament.

All of that is fixed now. The H2C has its own sequence built from Bambu’s own moves: purge and wipe with the printer’s built-in commands, and the job’s own filament/hotend selection lines copied from your file. I then went through every printer in the current Bambu Studio the same way (H2D, H2D Pro, H2S, X2D, P2S, A1, A1 mini, A2L, X1 series, P1P), using a real slice and Bambu’s templates for each.

It’s in version 1.1.0. On every printer except the P1S it’s still marked untested until someone actually prints with it. If you’re still up for it, an H2C test print would be the most useful thing right now, and the contributor credit offer stands.