Let R be a semiprime ring with extended centroid C and with maximal right ring of quotients Q(mr)(R). Let d: R -> Q(mr)(R) be an additive map and b is an element of Q(mr)(R). An additive map delta: R -> Q(mr)(R) is called a (left) b-generalized derivation with associated map d if delta(xy) = delta(x)y + bxd(y) for all x, y is an element of R. This gives a unified viewpoint of derivations, generalized derivations and generalized sigma-derivations with an X-inner automorphism sigma. We give a complete characterization of b-generalized derivations of R having nilpotent values of bounded index. This extends several known results in the literature.