Hair is difficult to cut out because its edge is not a solid line. Fine strands, motion blur and gaps can mix foreground and background within the same pixel. A harsh silhouette may remove the background neatly while also making the person look as if they were cut out with scissors.
Before changing settings, identify the failure: is the mask missing real hair, retaining background, or simply showing a colored fringe? Each problem calls for a different adjustment.
Begin with portrait matting
In the background remover, MODNet is a reasonable first test for a person. The upstream MODNet project is specifically a portrait-matting model. That purpose does not guarantee a perfect result on every hairstyle or lighting condition.
Image Batch defaults to a 512-pixel MODNet input policy aligned with its desktop workflow. The optional 768-pixel setting is worth comparing, but a larger input is not automatically an improvement. Scaling and preprocessing affect what the network sees, so judge the output rather than the setting’s number.
Use the original photo for each comparison. Reprocessing a transparent export has already discarded background information that could influence a fresh estimate.
Diagnose the edge before applying a fix
| What you see | Likely type of problem | What to try first |
|---|---|---|
| Fine strands disappear | Mask too aggressive or failed prediction | Natural/soft edges, cleanup at 0%, then another model |
| Solid background patches remain | Subject/background classification error | Compare another model or a clearer source |
| A green or blue outline remains | Background color in edge RGB | Increase spill reduction gradually |
| Hair looks cut into a solid helmet | Edge treatment too hard | Return to soft treatment and recheck alpha |
These are diagnostic starting points, not guaranteed explanations. A dark outline might come from the original lighting or compression, not just from the removal model.
Adjust one setting at a time
Start with cleanup at 0% so the model’s soft edge remains visible. Compare Natural, Clean and Hard treatments on a small portion of the outline. For flyaway hair, Natural is usually the least destructive trial; reserve harder treatments for subjects with genuinely hard contours.
Try modest spill reduction, for example 25%, when a background-colored halo remains. Increase only if the result improves. Spill reduction changes edge colors rather than the alpha mask, so it cannot bring back a missing lock of hair.
If the mask itself is wrong, compare U2NetP or optional BEN2 Base. They offer different general-segmentation behavior, but neither is a promised upgrade for every portrait. BEN2 Base requires a much larger model download and more processing resources.
Review on light and dark backgrounds
A pale fringe can disappear on white and become obvious on black. A dark fringe can do the reverse. Use a temporary replacement background color to inspect the cutout against both light and dark surfaces, then return to Transparent if that is your final output.
Inspect at 100% to find edge defects, and also at the size the image will actually be used. Extreme magnification can make harmless antialiasing seem like an error. On the other hand, a small preview can conceal missing strands that become obvious in a large layout.
Know when settings cannot solve it
Low contrast between hair and background, strong blur, transparent veils and severe JPEG artifacts can leave the model without enough information. No cleanup slider can reliably reconstruct a strand that is indistinguishable from its surroundings.
Use a better-lit or higher-quality original if available. Otherwise, choose the most natural acceptable result rather than the hardest mask. Export PNG or supported WebP to retain soft transparency; JPEG flattens it against a color. The complete transparent PNG workflow covers export checks and the large-image working-size limit.