3D model animated demo of Stirling engine cycle with magnets. Such engine should work on verly low temperatue difference like few °C
Videos of actual models with magnets: Magnet LTD Ringbom Stirling engine, Low Temperature Stirling Motor with neodym magnet.
Magnets shift phase of big piston to about 90° and alternate between 2 positions in off/on "switching" mode, a better thermal cycle with less moving parts.
Magnet stroke must be larger than big piston stroke. When magnet and big piston are in topmost position then big piston should be able to "detach" from magnetic attraction and fall down with its own weight. This is possible if distance from magnet to big piston at top position is a bit larger than distance at bottom position.
How A Stirling Engine Works is here explained with small mechanical model (no magnets).