import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) from _lib import fal_common # noqa: E402 a, p = fal_common.parse_args() stem = Path(a.input[0]).stem if a.input else "cutout" fal_common.run( endpoint="fal-ai/birefnet/v2", arguments={"operating_resolution": p.get("operating_resolution")}, outdir=a.outdir, image_path=a.input[0] if a.input else None, extra_args=p.get("extra_args"), out_stem=f"{stem}_cutout", collect="images", )