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

相关推荐
用户51914958484510 小时前
使用CSS和GSAP创建3D滚动驱动文本动画
人工智能·aigc
Mintopia10 小时前
🚀 共绩算力:让 AI 创造力驶上“光速通道”
云计算·aigc·ai编程
Mintopia12 小时前
🌱 AIGC 技术的轻量化趋势:Web 端“小而美”模型的崛起
前端·javascript·aigc
墨风如雪1 天前
“音”你而变:Step-Audio-EditX,音频编辑的“魔法”新纪元!
aigc
短视频矩阵源码定制1 天前
矩阵系统哪个好?2025年全方位选型指南与品牌深度解析
java·人工智能·矩阵·架构·aigc
芝士AI吃鱼1 天前
我为什么做了 Cogniflow?一个开发者关于“信息流”的思考与实践
人工智能·后端·aigc
程序员X小鹿1 天前
完全免费!被这款国产AI漫画工具惊艳了,3步生成连载漫画!手机可用(附保姆级教程)
aigc
安思派Anspire1 天前
构建一个自主深度思考的RAG管道以解决复杂查询--分析最终的高质量答案(8)
aigc·openai·agent
慕云紫英1 天前
人工智能在全球多领域的应用潜力及当前技术面临的挑战
人工智能·aigc
Mintopia2 天前
🤖 具身智能与 WebAIGC 的融合:未来交互技术的奇点漫谈
前端·javascript·aigc