🚀 Flux.1-Dev-Sketch-Card-LoRA
本项目是一个基于LoRA技术的文本到图像生成模型,可根据输入的文本描述生成相应的草图卡片图像。目前模型仍在训练阶段,后续会不断优化。
🚀 快速开始
环境设置
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "prithivMLmods/Flux.1-Dev-Sketch-Card-LoRA"
trigger_word = "sketch card"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
触发词使用
你应该使用 sketch card
来触发图像生成。
模型下载
此模型的权重以Safetensors格式提供。
点击下载,可在“Files & versions” 标签中找到。
✨ 主要特性
- 文本到图像生成:根据输入的文本描述生成对应的草图卡片图像。
- LoRA技术:使用低秩自适应(LoRA)技术进行模型微调,提高生成效率。
📦 安装指南
暂未提供具体安装步骤,可参考上述快速开始部分的代码示例进行环境设置。
💻 使用示例
基础用法
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "prithivMLmods/Flux.1-Dev-Sketch-Card-LoRA"
trigger_word = "sketch card"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
text = 'sketch card, a close-up of a hand holding a card with a cartoon image of Mario on it. The card has a yellow background with a red cap and a red M on it, and the character is wearing blue overalls with a yellow button on the left side of his chest. The character is waving his left hand and has a big smile on his face. To the right of the card is a small cartoon character with a blue outfit and red hat. They are standing on a table with a white tablecloth. The table is adorned with small lights, adding a pop of color to the scene.'
image = pipe(text).images[0]
image.save("output.png")
📚 详细文档
模型描述
prithivMLmods/Flux.1-Dev-Sketch-Card-LoRA
属性 |
详情 |
基础模型 |
black-forest-labs/FLUX.1-dev |
实例提示词 |
sketch card |
许可证 |
creativeml-openrail-m |
图像处理参数
参数 |
值 |
参数 |
值 |
学习率调度器 |
constant |
噪声偏移 |
0.03 |
优化器 |
AdamW |
多分辨率噪声折扣 |
0.1 |
网络维度 |
64 |
多分辨率噪声迭代次数 |
10 |
网络阿尔法 |
32 |
重复次数与步数 |
14 & 1990 |
训练轮数 |
16 |
每N轮保存一次 |
1 |
标注信息
标注使用的是florence2-en(自然语言 & 英语)。
训练使用的总图像数
13
最佳尺寸
- 768 x 1024(最佳)
- 1024 x 1024(默认)
📄 许可证
本模型使用的许可证为 creativeml-openrail-m。
⚠️ 重要提示
该模型仍处于训练阶段,这不是最终版本,可能会存在伪影,并且在某些情况下表现不佳。