🚀 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
許可證,詳情請見 許可證鏈接。