  While electron-phonon coupling (EPC) is crucial for Cooper pairing in
conventional superconductors, its role in high-$T_c$ superconducting cuprates
is debated. Using resonant inelastic x-ray scattering at the oxygen $K$-edge,
we studied the EPC in Bi$_2$Sr$_2$CaCu$_2$O$_{8+\delta}$ (Bi2212) and
Nd$_{1+x}$Ba$_{2-x}$Cu$_3$O$_{7-\delta}$ (NBCO) at different doping levels
ranging from heavily underdoped ($p =0.07$) to overdoped ($p=0.21$). We analyze
the data with a localized Lang-Firsov model that allows for the coherent
excitations of two phonon modes. While electronic band dispersion effects are
non-negligible, we are able to perform a study of the relative values of EPC
matrix elements in these cuprate families. In the case of NBCO, the choice of
the excitation energy allows us to disentangle modes related to the CuO$_3$
chains and the CuO$_2$ planes. Combining the results from the two families, we
find the EPC strength decreases with doping at $\mathbf{q_\parallel}=(-0.25,
0)$ r.l.u., but has a non-monotonic trend as a function of doping at smaller
momenta. This behavior is attributed to the screening effect of charge
carriers. We also find that the phonon intensity is enhanced in the vicinity of
the charge-density-wave (CDW) excitations while the extracted EPC strength
appears to be less sensitive to their proximity. By performing a comparative
study of two cuprate families, we are able to identify general trends in the
EPC for the cuprates and provide experimental input to theories invoking a
synergistic role for this interaction in $d$-wave pairing.
