Add optional BiRefNet-gated intersection for the dropout-fill
Add seg_fill_intersect (default off) and seg_fill_gate_min to AlphaPostSettings, plus a gate_mask arg to fill_seg_dropouts. When enabled, the anime-seg dropout-fill is intersected with the reliable BiRefNet mask (>= gate_min): anime-seg proposes wisps at a low seg_fill_seg_min, but only rescues BiRefNet also endorses survive, trimming anime-seg's over-inclusive fringe while keeping its smooth value. Default off, so the shipped Option B (union) output is byte-identical. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,13 @@ class AlphaPostSettings:
|
||||
seg_fill_seg_min: float = 0.10
|
||||
seg_fill_strength: float = 0.70
|
||||
seg_fill_min_area_ratio: float = 0.00002 # drop rescued specks below this area
|
||||
# Intersection fill: gate the (anime-seg) dropout-fill by a second, reliable
|
||||
# mask (BiRefNet). anime-seg proposes freely at a low seg_fill_seg_min; only
|
||||
# rescues BiRefNet also endorses (>= seg_fill_gate_min, its threshold left
|
||||
# unchanged) survive. Trims anime-seg's over-inclusive halo to the structure
|
||||
# both backends agree on, without reintroducing BiRefNet's grainy value.
|
||||
seg_fill_intersect: bool = False
|
||||
seg_fill_gate_min: float = 0.10
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
Reference in New Issue
Block a user