Here's one way that almost always works.
Run saline through the lines and filter until clear ... the foam will dissipate. About 200-300cc should work.
The foam is caused by air mixing with blood in the dializer. Usually that happens when someone fails to purge the air out of the lines and/or the filter when priming. When you introduce saline into the mixture, the foam becomes diluted and just breaks down.
Yes, you'll receive some saline which you'll have to account for by re-adjusting the UF, but it's better that losing all that blood.