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

相关推荐
layneyao6 小时前
AI艺术创作:Midjourney、Stable Diffusion与商业变现
人工智能·stable diffusion·midjourney
孙先生1487 小时前
AIGC重构元宇宙:从内容生成到沉浸式体验的技术革命
人工智能·aigc
Want5957 小时前
DeepSeek破界而来:重构大规模深度检索的算力与边界
人工智能·重构·aigc
VI8664956I2613 小时前
基于AIGC的3D场景生成实战:从文本描述到虚拟世界构建
3d·aigc
潘达斯奈基~18 小时前
沐曦玩转 LMDeploy、XTuner 和 InternLM3
aigc
win4r21 小时前
🚀企业级最强开源大模型Qwen3震撼发布!本地部署+全面客观测评!Qwen3-235B-A22B+Qwen3-32B+Qwen3-14B谁是王者?ollama
llm·aigc·openai
ImAlex1 天前
深入解析模型上下文协议(MCP):AI与数据源无缝集成的标准化之道
aigc·mcp
Blossom.1181 天前
可解释人工智能(XAI):让机器决策透明化
人工智能·驱动开发·深度学习·目标检测·机器学习·aigc·硬件架构
康斯坦丁师傅1 天前
深夜突袭,阿里Qwen3登顶全球开源王座!暴击DeepSeek-R1
aigc·openai
渭雨轻尘_学习计算机ing1 天前
手把手玩转MCP:从入门到实战,解锁AI的“万能插头”
aigc·mcp