This Gist shows a working example of Gemini 2.5 image segmentation working in Genkit JS.
The actual code for the image segmentation in indext.ts
is small, most of the code is sample code using the sharp
library to generate an image with segmented overlays.