🚀 Flux-Actors-Face-Inset_Cig-Cards-LoKr
这是一个基于 black-forest-labs/FLUX.1-dev 的 LyCORIS 适配器,可用于文本到图像的转换任务。
🚀 快速开始
本项目是一个 LyCORIS 适配器,基于 black-forest-labs/FLUX.1-dev 开发。以下是使用本适配器进行推理的示例代码:
import torch
from diffusers import DiffusionPipeline
from lycoris import create_lycoris_from_weights
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'pytorch_lora_weights.safetensors'
lora_scale = 1.0
wrapper, _ = create_lycoris_from_weights(lora_scale, adapter_id, pipeline.transformer)
wrapper.merge_to()
prompt = "An astronaut is riding a horse through the jungles of Thailand."
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
image = pipeline(
prompt=prompt,
num_inference_steps=20,
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
width=1024,
height=1024,
guidance_scale=3.0,
).images[0]
image.save("output.png", format="PNG")
✨ 主要特性
- 基于
black-forest-labs/FLUX.1-dev
模型开发的 LyCORIS 适配器。
- 可用于文本到图像的转换任务。
- 提供了验证设置和训练设置的详细信息。
📚 详细文档
验证设置
- CFG:
3.0
- CFG 重缩放:
0.0
- 步数:
20
- 采样器:
None
- 种子:
42
- 分辨率:
1024x1024
注意:验证设置不一定与训练设置相同。
你可以在以下图库中找到一些示例图像:
文本编码器未进行训练,你可以重用基础模型的文本编码器进行推理。
训练设置
- 训练轮数:0
- 训练步数:600
- 学习率:0.0008
- 最大梯度范数:2.0
- 有效批量大小:4
- 微批量大小:4
- 梯度累积步数:1
- GPU 数量:1
- 预测类型:流匹配(通量参数=['flux_guidance_value=1.0'])
- 重缩放的贝塔零信噪比:False
- 优化器:adamw_bf16
- 精度:纯 BF16
- 量化:是:int8-quanto
- Xformers:未使用
- LyCORIS 配置:
{
"algo": "lokr",
"multiplier": 1.0,
"linear_dim": 10000,
"linear_alpha": 1,
"factor": 16,
"apply_preset": {
"target_module": [
"Attention",
"FeedForward"
],
"module_algo_map": {
"Attention": {
"factor": 16
},
"FeedForward": {
"factor": 8
}
}
}
}
数据集
actors-natural-512
- 重复次数:17
- 图像总数:68
- 纵横比桶总数:1
- 分辨率:0.262144 兆像素
- 裁剪:False
- 裁剪样式:None
- 裁剪纵横比:None
- 是否用于正则化数据:No
actors-natural-768
- 重复次数:17
- 图像总数:68
- 纵横比桶总数:1
- 分辨率:0.589824 兆像素
- 裁剪:False
- 裁剪样式:None
- 裁剪纵横比:None
- 是否用于正则化数据:No
actors-natural-1024
- 重复次数:5
- 图像总数:68
- 纵横比桶总数:1
- 分辨率:1.048576 兆像素
- 裁剪:False
- 裁剪样式:None
- 裁剪纵横比:None
- 是否用于正则化数据:No
📄 许可证
本项目使用其他许可证。