This article introduces a method for automatically generating object detection datasets using Stable Diffusion image restoration. Initially, image segmentation is employed to create masks, followed by fine-tuning the image restoration model. Finally, combining the masks with input prompt text, custom scene data is generated. This approach is computationally intensive and requires high-end hardware, making it suitable for special scenarios where image capture is difficult. For ordinary scenes, traditional manual annotation is more advisable.