The paper introduces a novel diffusion-based framework called DiAD (Diffusion-based Anomaly Detection) for multi-class anomaly detection. DiAD addresses the challenges of category and semantic loss in existing diffusion models, which often fail to accurately reconstruct anomalous regions while preserving the original image's semantic information. The framework consists of three main components: a pixel-space autoencoder, a latent-space Semantic-Guided (SG) network connected to a stable diffusion denoising network, and a feature-space pre-trained feature extractor. The SG network is designed to maintain the semantic information of the original image while reconstructing anomalous regions. The Spatial-Aware Feature Fusion (SFF) block further enhances the reconstruction by integrating features from different scales. Experiments on the MVTec-AD and VisA datasets demonstrate that DiAD outperforms state-of-the-art methods, achieving high AUROC and AP scores for both image-level and pixel-level anomaly detection and localization. The code for DiAD is available at https://lewandofkee.github.io/projects/diad.The paper introduces a novel diffusion-based framework called DiAD (Diffusion-based Anomaly Detection) for multi-class anomaly detection. DiAD addresses the challenges of category and semantic loss in existing diffusion models, which often fail to accurately reconstruct anomalous regions while preserving the original image's semantic information. The framework consists of three main components: a pixel-space autoencoder, a latent-space Semantic-Guided (SG) network connected to a stable diffusion denoising network, and a feature-space pre-trained feature extractor. The SG network is designed to maintain the semantic information of the original image while reconstructing anomalous regions. The Spatial-Aware Feature Fusion (SFF) block further enhances the reconstruction by integrating features from different scales. Experiments on the MVTec-AD and VisA datasets demonstrate that DiAD outperforms state-of-the-art methods, achieving high AUROC and AP scores for both image-level and pixel-level anomaly detection and localization. The code for DiAD is available at https://lewandofkee.github.io/projects/diad.