🚀 Flux-Sketch-Paint-LoRA模型
Flux-Sketch-Paint-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 = "strangerzonehf/Sketch-paint"
trigger_word = "Sketch paint"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
触发词使用
你需要使用 Sketch paint
来触发图像生成。
模型下载
该模型的权重以Safetensors格式提供。
点击下载,可在 “Files & versions” 标签中获取。
✨ 主要特性
- 文本到图像转换:根据输入的文本描述,生成相应的素描风格图像。
- 多场景适用:可生成人物、动物、物品等多种不同场景的图像。
- 高质量输出:生成的图像细节丰富,色彩搭配协调。
📦 安装指南
此部分文档未提供具体安装命令,跳过该章节。
💻 使用示例
基础用法
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/Sketch-paint"
trigger_word = "Sketch paint"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
text = 'Sketch paint, An eye-level perspective, a medium-sized portrait of a woman, is depicted in a blue and white monochromatic fashion. The womans head is adorned with a large, fluffy, fuzzy hat, adorned with white flowers. Her hair is pulled back, framing her face, adding a touch of depth to the composition. She is wearing a black dress with a white scarf draped over her shoulders. Her dress is draped in a low-angle pattern, adding texture to the overall composition. The background is a dark blue, creating a stark contrast to the womans face.'
image = pipe(prompt=text).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/Sketch-paint"
trigger_word = "Sketch paint"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
text = 'Sketch paint, An eye-level perspective, a medium-sized portrait of a woman, is depicted in a blue and white monochromatic fashion. The womans head is adorned with a large, fluffy, fuzzy hat, adorned with white flowers. Her hair is pulled back, framing her face, adding a touch of depth to the composition. She is wearing a black dress with a white scarf draped over her shoulders. Her dress is draped in a low-angle pattern, adding texture to the overall composition. The background is a dark blue, creating a stark contrast to the womans face.'
image = pipe(prompt=text, num_inference_steps=35).images[0]
image.save("output_advanced.png")
📚 详细文档
模型描述

图像处理参数
属性 |
详情 |
LR Scheduler |
常数 |
Optimizer |
AdamW |
Network Dim |
64 |
Network Alpha |
32 |
Epoch |
17 |
Noise Offset |
0.03 |
Multires Noise Discount |
0.1 |
Multires Noise Iterations |
10 |
Repeat & Steps |
25 & 3070 |
Save Every N Epochs |
1 |
标注方式:florence2 - en(自然语言 & 英语)
用于训练的总图像数:19
最佳尺寸与推理
尺寸 |
宽高比 |
推荐情况 |
1280 x 832 |
3:2 |
最佳 |
1024 x 1024 |
1:1 |
默认 |
推理范围
🔧 技术细节
此部分文档未提供具体的技术说明,跳过该章节。
📄 许可证
本模型使用的许可证为 creativeml - openrail - m。