  We present a new, publicly available library of dust spectral energy
distributions (SEDs). These SEDs are characterized by only three parameters:
the dust mass (Mdust), the dust temperature (Tdust), and the mid-to-total
infrared color (IR8=LIR/L8). The latter measures the relative contribution of
PAH molecules to the LIR. We used this library to model star-forming galaxies
at 0.5<z<4 in the CANDELS fields, using both individual detections and stacks
of Herschel and ALMA imaging, and extending this sample to z=0 using the
Herschel Reference Survey. At first order, the dust SED of a galaxy was found
independent of stellar mass, but evolving with redshift. We found trends of
increasing Tdust and IR8 with redshift and distance from the SFR--Mstar main
sequence (MS), and quantified for the first time their intrinsic scatter. Half
of the observed variation of these parameters was captured by these empirical
relations, with residual scatters of 12% and 0.18 dex, respectively. Second
order variations with stellar mass are discussed. Building on these results, we
constructed high-fidelity mock galaxy catalogs to predict the accuracy of LIR
and Mdust determined from a single flux measurement. Using a single JWST MIRI
band, we found that LIR is typically uncertain by 0.15 dex, with a maximum of
0.25 dex when probing the rest-frame 8 um, and this is not significantly
impacted by typical redshift uncertainties. On the other hand, we found that
ALMA bands 8-to-7 and 6-to-3 measure Mdust at better than 0.2 and 0.15 dex,
respectively, and independently of redshift, while bands 9-to-6 only measure
LIR at better than 0.2 dex at z>1, 3.2, 3.8, and 5.7, respectively. Starburst
galaxies above the MS have LIR significantly underestimated and Mdust
overestimated. These results can be used immediately to interpret more
accurately the large amount of archival data from Spitzer, Herschel and ALMA.
[abridged]
