Fix stale UI cache, BEN2 edge quality, and fresh-install permissions
- Serve /dist and /src with Cache-Control: no-cache so browsers always revalidate the webpack bundle (it has a fixed filename with no content hash, so a stale browser cache was hiding the new Remove Background model dropdown after the rebuild). - Enable BEN2's refine_foreground pass by default - it's the model's own documented option for preserving fine/semi-transparent edge detail (text borders, light rays) instead of a harder cutout, at a small speed cost. - Make install-local-gpu.sh and bring-up-local-gpu.sh pre-create ./data as the invoking non-root user before Docker ever runs, so its daemon never gets a chance to auto-create those bind-mount dirs as root. - Make prefetch-models.sh self-heal a root-owned ./data automatically (sudo chown) instead of erroring out with a manual fix-it command. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ro4PwQKvSc3CH19LSN21Ht
This commit is contained in:
@@ -369,7 +369,10 @@ async def _remove_background_ben2(img: Image.Image) -> bytes:
|
||||
_ben2_model.to(device).eval()
|
||||
print("BEN2_Base model loaded")
|
||||
|
||||
result = _ben2_model.inference(img.convert('RGB'), refine_foreground=False)
|
||||
# refine_foreground=True runs BEN2's extra foreground-color refinement pass
|
||||
# (slower, but recovers fine/semi-transparent edge detail instead of a hard
|
||||
# cutout — matters for things like lace, light rays, or fine text borders).
|
||||
result = _ben2_model.inference(img.convert('RGB'), refine_foreground=True)
|
||||
|
||||
buffer = BytesIO()
|
||||
result.save(buffer, format='PNG')
|
||||
|
||||
Reference in New Issue
Block a user