stable diffusion的微调和lora微调代码版本

目前业界主流的sd训练基本都是基于diffusers和ldm的,这是huggingface的训练库,后者是stability ai在compvis等机构的基础上完善的,我目前工作上推理一般采用webui架构,训练采用diffusers,因此需要把webui的ckpt或者safetensors转成huggingface形式,在基于diffusers的lora训练,很多都是基于kohya_ss的,一般就是添加一些新的lora方法,另一种就是基于kohya_ss封装套个壳,方便训练。目前主流看来,还是关注diffusers官方的训练脚本,整个流程比较简洁,对比其他三方的脚本。

safetensors版本->convert->huggingface版本

huggingface版本->diffusers训练->huggingface版本lora权重bin文件->convert->safetensors

1.diffusers版本

GitHub - huggingface/diffusers: 🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch

这个版本是我训练的主要版本,基本上很多的sd训练都是在这个版本上改的,我也是以这个版本为基础,基本的fine-tune和lora finetune都有,训练的版本也比较丰富,包括unet和text encoder的训练等等,但是这里面有个文生图和图生图的区分,即inpaint的训练是否需要抽出来单独写,我看dreambooth是单独抽出来的版本,其他text_to_image目前没有提供inpaint的lora训练。

1.1 txt2img+lora

1.1 img2img_inpaint+lora ?

2.kohya-ss版本,也是很流行的lora训练脚本

GitHub - kohya-ss/sd-scripts

基于diffusers做了二次封装,提供了不少工具和不同类别的lora,不过也没有提供inpaint模型的训练,issues中有人提了,作者说后续会考虑跟进,这个版本的模型可以直接是webui形式,不需要先转成huggingface格式。

https://github.com/kohya-ss/sd-scripts/issues/502

3.lora

GitHub - cloneofsimo/lora: Using Low-rank adaptation to quickly fine-tune diffusion models.

这个版本支持inpaint版本,也是基于diffusers做二次封装

4.lora-scripts

https://github.com/Akegarasu/lora-scripts

秋叶,继承自sd-scripts,做了封装,有了webui。

5.LyCORIS

https://github.com/KohakuBlueleaf/LyCORIS

支持各种各样的lora,而且有专门的lora加载器,可以添加到kohya版本中,训练方法可以嵌入在

GitHub - derrian-distro/LoRA_Easy_Training_Scripts: A UI made in Pyside6 to make training LoRA/LoCon and other LoRA type models in sd-scripts easy

GitHub - Linaqruf/kohya-trainer: Adapted from https://note.com/kohya_ss/n/nbf7ce8d80f29 for easier cloning

GitHub - bmaltais/kohya_ss

相关推荐
leafff1235 天前
Stable Diffusion在进行AI 创作时对算力的要求
人工智能·stable diffusion
leafff1235 天前
Stable Diffusion进行AIGC创作时的算力优化方案
人工智能·stable diffusion·aigc
ding_zhikai6 天前
stable-diffusion试验2-像素人物帧动画2(含 AnimeEffects 简易教程 等)
stable diffusion
ding_zhikai6 天前
SD:在一个 Ubuntu 系统安装 stable diffusion ComfyUI
linux·ubuntu·stable diffusion
ding_zhikai7 天前
stable-diffusion试验2-像素人物帧动画1
stable diffusion
wg26277 天前
Stable Diffusion 安装教程(详细)_stable diffusion安装
stable diffusion
weiwei228447 天前
ControlNet——AI图像生成的“精准操控工具”
stable diffusion·controlnet
RanceGru9 天前
LLM学习笔记5——本地部署ComfyUI和Wan2.1-T2V-1.3B文生视频模型
笔记·学习·stable diffusion·transformer
ding_zhikai10 天前
stable-diffusion试验1-静态人物
stable diffusion
love530love12 天前
【笔记】 Podman Desktop 中部署 Stable Diffusion WebUI (GPU 支持)
人工智能·windows·笔记·python·容器·stable diffusion·podman