The fidelity of continuous-variable teleportation can be optimized by changing the gain in the modulation of the output field. We discuss the gain dependence of fidelity for coherent, vacuum, and one-photon inputs and propose optimal gain tuning strategies for corresponding input selections.