Advanced accelerator-based light sources such as free electron lasers (FEL) accelerate highly relativistic electron beams to generate incredibly short (10s of femtoseconds) coherent flashes of light for dynamic imaging, whose brightness exceeds that of traditional synchrotron-based light sources by orders of magnitude. FEL operation requires precise control of the shape and energy of the extremely short electron bunches whose characteristics directly translate into the properties of the produced light. Control of short intense beams is difficult due to beam characteristics drifting with time and complex collective effects such as space charge and coherent synchrotron radiation. Detailed diagnostics of beam properties are therefore essential for precise beam control. Such measurements typically rely on a destructive approach based on a combination of a transverse deflecting resonant cavity followed by a dipole magnet in order to measure a beam’s 2D time vs energy longitudinal phase-space distribution. In this paper, we develop a non-invasive virtual diagnostic of an electron beam’s longitudinal phase space at megapixel resolution (1024 × 1024) based on a generative conditional diffusion model. We demonstrate the model’s generative ability on experimental data from the European X-ray FEL.