As a rule of thumb, you fuel pipe should be 2x sizes larger than the ports on the engine. For example, if they use -8 JIC ports, use 1" pipe.
For stack sizing, the engine manufacturers or generator supplier will able to provide you with an exhaust mass flow and temperature. The will also have a maximum back pressure. You will also need total length of pipe, elbows, and muffler back pressure to calculate the minimum pipe diameter. To give room for error run one pipe size above minimum. I don't have the formula handy as it has been awhile since I have used it.
Finally, it you want it to be quiet size your exit pipe so that velocity is below 9000 feet per minute.