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() if not p.get("prompt"): print("ERROR: prompt is required — describe the edit you want") sys.exit(1) stem = Path(a.input[0]).stem if a.input else "image" fal_common.run( endpoint="fal-ai/nano-banana/edit", arguments={"prompt": p["prompt"]}, outdir=a.outdir, image_path=a.input[0] if a.input else None, image_arg="image_urls", image_as_list=True, extra_args=p.get("extra_args"), out_stem=f"{stem}_edited", collect="images", )