Context. LB-1 (alias ALS 8775) has been proposed as either an X-ray dim B-type star plus black hole (B+BH) binary or a Be star plus an inflated stripped star (Be+Bstr) binary. The latter hypothesis contingent upon the detection and characterization of the hidden broad-lined star in a composite optical spectrum. Aims. Our study is aimed at testing the published B+BH (single star) and Be+Bstr (binary star) models using a flux-calibrated UV-optical-IR spectrum. Methods. The Space Telescope Imaging Spectrograph (STIS) on board the Hubble Space Telescope (HST) was used to obtain a flux-calibrated spectrum with an accuracy of ∼1%. We compared these data with non-local thermal equilibrium (non-LTE) spectral energy distributions (SED) and line profiles for the proposed models. The Hubble data, together with the Gaia EDR3 parallax and a well-determined extinction, were used to provide tight constraints on the properties and stellar luminosities of the LB-1 system. In the case of the Be+Bstr model we adopted the published flux ratio for the Be and Bstr stars, re-determined the Teff of the Bstr using the silicon ionization balance, and inferred Teff for the Be star from the fit to the SED. Results. The UV data strongly constrain the microturbulence velocity to ≲2 km s−1 for the stellar components of both models. We also find stellar parameters consistent with previous results, but with greater precision enabled by the Hubble SED. For the B+BH single-star model, we find the parameters (Teff, log(L/L⊙), Mspec/M⊙) of the B-type star to be (15 300 ± 300 K, 3.23−0.10+0.09, 5.2−1.4+1.8). For the Bstr star we obtain (12 500 ± 100 K, 2.70−0.09+0.09, 0.8−0.3+0.5), and for the Be star (18 900 ± 200 K, 3.04−0.09+0.09, 3.4−1.8+3.5). While the Be+Bstr model is a better fit to the He I lines and cores of the Balmer lines in the optical, the B+BH model provides a better fit to the Si IV resonance lines in the UV. The analysis also implies that the Bstr star has roughly twice the solar silicon abundance, which is difficult to reconcile with a stripped star origin. The Be star, on the other hand, has a rather low luminosity and a spectroscopic mass that is inconsistent with its possible dynamical mass. Conclusions. We provide tight constraints on the stellar luminosities of the Be+Bstr and B+BH models. For the former, the Bstr star appears to be silicon-rich, while the notional Be star appears to be sub-luminous for a classical Be star of its temperature and the predicted UV spectrum is inconsistent with the data. This latter issue can be significantly improved by reducing the Teff and radius of the Be star, at the cost, however, of a different mass ratio as a result. In the B+BH model, the single B-type spectrum is a good match to the UV spectrum. Adopting a mass ratio of 5.1 ± 0.1, from the literature, implies a BH mass of ∼21−8+9 M⊙.