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训练

相关推荐
智界前沿1 小时前
告别随机生成!AIGC 视频广告级精度为工业视频注入可视化新动能
人工智能·aigc
DO_Community1 天前
技术解码:Character.ai 如何实现大模型实时推理性能 2 倍提升
人工智能·算法·llm·aigc·moe·aiter
2401_841495641 天前
AIGC:重塑内容生产,开启智能创作新纪元
人工智能·aigc·元宇宙·智能赋能·虚拟现实·生成式人工智能·智能创作
智算菩萨1 天前
国内Claude编程完全指南:利用镜像站合法使用Opus、Sonnet与Haiku模型
人工智能·aigc
快降重1 天前
效率与安全的平衡:面向毕业季的论文“降AI”应急方案对比研究
人工智能·安全·aigc·ai写作·降重·降ai
aitoolhub1 天前
AI设计重构创作逻辑:从技能执行到创意表达
人工智能·aigc·视觉传达
小程故事多_802 天前
攻克RAG系统最后一公里 图文混排PDF解析的挑战与实战方案
人工智能·架构·pdf·aigc
EdisonZhou2 天前
MAF快速入门(12)主工作流+子工作流
llm·aigc·agent·.net core
程序员果子2 天前
GraphRAG:让大模型在知识图谱中精准导航
人工智能·git·语言模型·aigc·知识图谱
Rolei_zl2 天前
AIGC(生成式AI)试用 44 -- 个人知识库 DocsGpt
aigc