AIGC文生图lora微调训练案例;SD-Train界面训练stable Diffusion lora模型

lora仓库(1000多个lora微调模型分享):

https://lorastudio.co/models

1、命令代码方式:文生图lora微调训练案例

主要用huggingface相关包:peft、accelerate、diffusers

参考:

https://huggingface.co/blog/lora

https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_lora.py ##官方案例代码

https://civitai.com/articles/3105/essential-to-advanced-guide-to-training-a-lora

https://github.com/PixArt-alpha/PixArt-alpha?tab=readme-ov-file (微调脚本基本也是上面官方diffusers的例子)

cpp 复制代码
#下载
git clone https://github.com/PixArt-alpha/PixArt-alpha.git 

#运行
一张4090(更改num_processes=1即可)
accelerate launch --num_processes=1 --main_process_port=36667 train_scripts/train_pixart_lora_hf.py --mixed_precision="fp16" --pretrained_model_name_or_path=/ai/PixArt-XL-2-1024-MS --dataset_name=reach-vb/pokemon-blip-captions --caption_column="text" --resolution=1024 --random_flip --train_batch_size=6 --num_train_epochs=200 --checkpointing_steps=100 --learning_rate=1e-06 --lr_scheduler="constant" --lr_warmup_steps=0 --seed=42 --output_dir="pixart-pokemon-model" --validation_prompt="cute dragon creature" --report_to="tensorboard" --gradient_checkpointing --checkpoints_total_limit=10 --validation_epochs=5 --rank=16
两张4090
accelerate launch --num_processes=2 --main_process_port=36667 train_scripts/train_pixart_lora_hf.py --mixed_precision="fp16" --pretrained_model_name_or_path=/ai/PixArt-XL-2-1024-MS --dataset_name=reach-vb/pokemon-blip-captions --caption_column="text" --resolution=1024 --random_flip --train_batch_size=6 --num_train_epochs=200 --checkpointing_steps=100 --learning_rate=1e-06 --lr_scheduler="constant" --lr_warmup_steps=0 --seed=42 --output_dir="pixart-pokemon-model" --validation_prompt="cute dragon creature" --report_to="tensorboard" --gradient_checkpointing --checkpoints_total_limit=10 --validation_epochs=5 --rank=16

训练时间有点久,200轮

2、可视化界面操作:SD-Train lora

工具相对局限于stable Diffusion 模型才可以微调,其他模型不大支持

参考:

https://github.com/Akegarasu/lora-scripts/blob/main/README-zh.md

https://www.bilibili.com/video/BV15E421G7Qb/

https://www.bilibili.com/video/BV1CA4m1w7zh/

一般使用步骤:

WD标签器与标签编辑器:主要是对图片进行文案prompt反推和编辑文案内容

Lora训练:进行lora训练

相关推荐
Lemo爱吃鱼7 小时前
Lemo 的 AGI 应用实战博文导航
ai·aigc·agi
ShowMeAI8 小时前
我们严重低估了MiniMax;扎克伯格站在了奥特曼的对面;欧洲最强大模型的天才创始人;Notion AI在LLM来临时快速转身奔跑 | ShowMeAI
人工智能·llm·aigc
OpenPie|拓数派10 小时前
拥抱 AGI:PieDataCS 引领云原生数据计算系统新范式
云原生·aigc·agi·pieclouddb·openpie·拓数派·piedatacs
程序员三木10 小时前
[AIGC] ClickHouse的表引擎介绍
clickhouse·aigc
Wincyfu11 小时前
FuTalk设计周刊-Vol.064
人工智能·ui·aigc
KompasAI17 小时前
数据驱动的内容优化:Kompas.ai如何提升内容表现
大数据·人工智能·aigc·语音识别·ai写作
EdisonZhou17 小时前
ChatGPT学习之旅 (8) 单元测试助手
aigc·.net core
李加号pluuuus21 小时前
【扩散模型】LCM LoRA:一个通用的Stable Diffusion加速模块
人工智能·stable diffusion
布吉岛呀~1 天前
AIGC笔记--Stable Diffusion源码剖析之DDIM
aigc
小和尚同志1 天前
18.2k 的 fabric,一款超强 AI Prompt 辅助
人工智能·aigc