Skip to content

Andoray-30/Pygmalion

Repository files navigation

Pygmalion - AI 图像生成系统

基于 Stable Diffusion 的自适应图像生成系统,使用 Qwen3-VL 多模态理解 + Optuna TPE 贝叶斯优化快速收敛到高质量结果。


✨ 核心特性

  • 🧠 Qwen3-VL 多模态大脑:真正"看懂"参考图,智能推荐 LoRA/模型/参数
  • 🎨 智能优化:Optuna TPE 贝叶斯优化,5-10 次试验快速收敛
  • 🔒 参考图约束:ControlNet + IP-Adapter + FaceID 保持人物一致性
  • 🤖 智能体协作:创意构思 + 多模态评分 + 动态优化
  • 自动剪枝:智能过滤低质量结果,节省 50% 时间

🚀 快速开始

# 1. 安装依赖
pip install -r requirements.txt

# 2. 配置环境变量
cp .env.example .env  # 填入 API 密钥

# 3. 启动系统 (Windows)
run_system.bat

访问 http://localhost:5000 使用 Web UI

详细教程:QUICKSTART.md


📖 文档

文档 说明
快速入门 5分钟上手教程
系统架构 技术架构与设计
PID迁移指南 Optuna TPE 升级说明

💡 使用示例

基础生成(纯文本)

from pkg.system.engine import DiffuServoV4

engine = DiffuServoV4(theme="动漫女孩,粉色头发")
result = engine.run_with_optuna(n_trials=8, target_score=0.90)

print(f"最优分数: {result['best_score']}")
# Qwen3-VL 自动分析主题并推荐 ANIME 模型 + ANIME_LINEART LoRA

参考图智能生成(Qwen3-VL 深度理解)

engine = DiffuServoV4(
    theme="保持人物不变,修改为兔女郎装",
    reference_image_path="reference.jpg"
)
result = engine.run_with_optuna(n_trials=8, target_score=0.90)
# Qwen3-VL 分析参考图风格/色彩/构图,推荐最佳 LoRA 组合
# 自动应用 ControlNet + IP-Adapter 保持人脸一致性

📊 性能

配置 耗时 质量
快速模式 (3 trials) ~20秒 0.70-0.80
平衡模式 (8 trials) ~40秒 0.85-0.92
精细模式 (15 trials) ~60秒 0.90+

🤝 贡献

欢迎提交 Issue 和 Pull Request!

git clone https://github.com/yourusername/Pygmalion.git
cd Pygmalion
pip install -r requirements.txt
pytest tests/

📄 许可证

MIT License - 详见 LICENSE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors