数据集:
FredZhang7/stable-diffusion-prompts-2.47M
综合来自以下文本数据集
有关预处理方法,请参见 Fast GPT2 PromptGen .
下载并将数据集保存到 all_prompts.txt 本地。
pip install datasets
import datasets dataset = datasets.load_dataset("FredZhang7/stable-diffusion-prompts-2.47M") train = dataset["train"] prompts = train["text"] with open("all_prompts.txt", "w") as f: for prompt in prompts: f.write(prompt + "\n")