首先调一下tutorial_train.py 里的batch_size,训练过程中如果出现out of memory 的情况可以调小。...训练出的结果可以在image_log 中看到
推理
原作者没有给出怎么推理代码的方式,但是有人给出了一个脚本 GitHub 将你训练出来的模型转换成diffusers,接着你就可以中下面diffusers...74行
def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx, dataloader_idx):
删除...dataloader_idx,改为
def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx):
Diffusers...训练
Diffusers 是一个huggingface 推出的扩散模型的封装库,同时也对ControlNet做了封装,https://github.com/huggingface/diffusers/