Implement BiRefNet and HAT Sharper models with background removal capabilities

- Added validation documentation for AI model tiers.
- Introduced `background.py` for background removal logic, including inference functions for alpha and foreground extraction.
- Created `onnx_birefnet.py` to handle BiRefNet model sessions and alpha inference.
- Developed tests for background models, ensuring proper dispatch and session reuse.
- Added tests for BiRefNet ONNX model to validate alpha output and error handling for invalid values.
- Implemented model export scripts for BiRefNet and HAT Sharper, ensuring proper weight compression and licensing.
- Created `deform_sampling.py` for deformable convolution operations used in BiRefNet.
- Added utility functions for compressing ONNX weights without altering graph arithmetic.
- Introduced a reference plane node for depth field adjustments in geometry processing.
This commit is contained in:
2026-09-10 20:50:44 +08:00
parent 8ae3c1d5b7
commit e8129fe495
70 changed files with 1890 additions and 1208 deletions

16
uv.lock generated
View File

@@ -41,7 +41,7 @@ dev = [
[package.metadata]
requires-dist = [
{ name = "blendjob", specifier = "==0.1.16" },
{ name = "blendjob", path = "src/anyimage/wheels/blendjob-0.1.17-py3-none-any.whl" },
{ name = "numpy", specifier = ">=1.26,<2.0" },
{ name = "scipy", specifier = "==1.15.3" },
]
@@ -114,13 +114,19 @@ wheels = [
[[package]]
name = "blendjob"
version = "0.1.16"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/33/97/bcbf9be2effd238a3caaa647fc202d7e29ff7370c1ca22d6a78e48fa4134/blendjob-0.1.16.tar.gz", hash = "sha256:16ead42a046f9c8eb91bc4c3d4803af366f2b56b63bd16f302190ec60ef23a99", size = 21571, upload-time = "2026-09-02T02:50:03.715Z" }
version = "0.1.17"
source = { path = "src/anyimage/wheels/blendjob-0.1.17-py3-none-any.whl" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/db/ac/142988a33d0a2df6335a0e08f5e9a0a9215996810a77f9724325f9174301/blendjob-0.1.16-py3-none-any.whl", hash = "sha256:39fb736f0c2b77321a672b2b023e4b1d0d49c2d567bdd8f6095b6efe5080f982", size = 26931, upload-time = "2026-09-02T02:50:02.777Z" },
{ filename = "blendjob-0.1.17-py3-none-any.whl", hash = "sha256:9173320611ae77ce8852c6f9e96ddcec1b455ac1e2c0d1f886041e5a33e0cc86" },
]
[package.metadata]
requires-dist = [
{ name = "fastapi", marker = "extra == 'server'", specifier = "==0.139.2" },
{ name = "uvicorn", marker = "extra == 'server'", specifier = "==0.51.0" },
]
provides-extras = ["server"]
[[package]]
name = "bpy"
version = "4.5.3"