🚀 Thread-of-Art-Flux
Thread-of-Art-Flux是一个文本到图像的模型,基于特定的基础模型进行微调,能够根据特定的触发词生成高质量的黑白素描图像。该模型在图像生成领域具有一定的应用价值,可用于艺术创作、设计等场景。
🚀 快速开始
环境设置
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 = "strangerzonehf/Thread-of-Art-Flux"
trigger_word = "Thread of Art"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
触发词使用
你应该使用 Thread of Art
来触发图像生成。
模型下载
此模型的权重以Safetensors格式提供。
点击下载,可在 “Files & versions” 标签中获取。
✨ 主要特性
- 能够根据特定的文本描述生成高质量的黑白素描图像。
- 提供了详细的图像生成参数设置,可根据需求进行调整。
- 支持特定的触发词,方便用户触发特定风格的图像生成。
📦 安装指南
安装步骤在代码示例中已体现,主要是导入必要的库、加载基础模型和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 = "strangerzonehf/Thread-of-Art-Flux"
trigger_word = "Thread of Art"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
prompt = f"{trigger_word}, A black and white sketch of a woman smoking a cigarette. The woman is wearing a white button up shirt, a black tie, and white pants. Her hair is pulled back in a ponytail, and she is wearing a pair of white gloves. Her left hand is raised in the air, while her right hand is resting on her hip. Her mouth is slightly open, as if she is smoking. She has a black belt around her waist, and a white jacket on her right. The background is a plain white."
image = pipe(prompt).images[0]
image.save("output.png")
高级用法
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 = "strangerzonehf/Thread-of-Art-Flux"
trigger_word = "Thread of Art"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
inference_steps = 35
noise_offset = 0.03
prompt = f"{trigger_word}, A black and white sketch of a man sitting at a café table, a coffee cup in front of him. He is wearing a fitted black suit, a white shirt, and a black tie. His hand is resting against his cheek as he looks off to the side. His neatly styled hair adds to his polished appearance. The background is plain white."
image = pipe(prompt, num_inference_steps=inference_steps, noise_offset=noise_offset).images[0]
image.save("output_advanced.png")
📚 详细文档
模型描述

图像生成参数
属性 |
详情 |
LR Scheduler |
恒定 |
优化器 |
AdamW |
网络维度 |
64 |
网络Alpha |
32 |
训练轮数 |
25 |
噪声偏移 |
0.03 |
多分辨率噪声折扣 |
0.1 |
多分辨率噪声迭代次数 |
10 |
重复次数与步数 |
20 & 3200 |
每N轮保存一次 |
1 |
标注:florence2 - en(自然语言 & 英语)
用于训练的总图像数:26
最佳尺寸与推理
尺寸 |
纵横比 |
推荐情况 |
1280 x 832 |
3:2 |
最佳 |
1024 x 1024 |
1:1 |
默认 |
推理范围
📄 许可证
此模型使用 flux-1-dev-non-commercial-license
许可证,详情请见 许可证链接。