How center any node with model.commit

I don’t understand what you want. You already put the new node in the center of the viewport: Insert shape in center of canvas with click of an HTML btn - #5 by kaushal722

Maybe you have a situation where the middle of the viewport is at a document point that cannot be centered because the diagram cannot be scrolled far enough? You can either increase the Diagram.padding (which increases the document bounds) or the Diagram.scrollMargin (which increases how far one can scroll) or you can turn off scrolling limitations entirely by setting Diagram.scrollMode to go.Diagram.InfiniteScroll.

Please read GoJS Coordinate Systems-- Northwoods Software and what follows.