You need 2 8x3mm magnets. Glue them on the back of the pumpkin with superglue.
Pumpkin: https://www.kindpng.com/imgv/TxhbRJ_pumpkin-calabaza-jack-o-and-white-gourd-clip/
The author remixed this model.