1 post on SAM.
Generate the foreground and background separately, use Segment Anything to cut out the subject, and pick the sharpest mask by Laplacian variance. A one-commit pipeline of a couple thousand lines.