🚀 simpletuner-lora-screenprinting
這是一個基於 stabilityai/stable-diffusion-3.5-large 的標準PEFT LoRA模型。它能夠將文本描述轉化為適合絲網印刷工藝的圖像,在文本到圖像的生成領域具有獨特的應用價值。
🚀 快速開始
你可以參考以下代碼示例進行推理:
import torch
from diffusers import DiffusionPipeline
model_id = 'stabilityai/stable-diffusion-3.5-large'
adapter_id = 'DovahChikiin72/simpletuner-lora-screenprinting'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipeline.load_lora_weights(adapter_id)
prompt = "an image apt for screenprinting process."
negative_prompt = 'blurry, cropped, ugly'
from optimum.quanto import quantize, freeze, qint8
quantize(pipeline.transformer, weights=qint8)
freeze(pipeline.transformer)
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
model_output = pipeline(
prompt=prompt,
negative_prompt=negative_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(42),
width=512,
height=512,
guidance_scale=5.0,
).images[0]
model_output.save("output.png", format="PNG")
✨ 主要特性
🔧 技術細節
驗證設置
- CFG:
5.0
- CFG Rescale:
0.0
- 步數:
20
- 採樣器:
FlowMatchEulerDiscreteScheduler
- 隨機種子:
42
- 分辨率:
512x512
- 跳過層引導:無
注意:驗證設置不一定與訓練設置相同。
訓練設置
- 訓練輪數:0
- 訓練步數:10000
- 學習率:8e-05
- 最大梯度值:2.0
- 有效批次大小:1
- 梯度檢查點:啟用
- 預測類型:流匹配(額外參數=['shift=3'])
- 優化器:adamw_bf16
- 可訓練參數精度:Pure BF16
- 基礎模型精度:
int8-quanto
- 字幕丟棄概率:5.0%
- LoRA秩:64
- LoRA Alpha:無
- LoRA丟棄率:0.1
- LoRA初始化風格:默認
數據集
my-dataset-512
- 重複次數:10
- 圖像總數:735
- 縱橫比桶總數:1
- 分辨率:0.262144兆像素
- 裁剪:否
- 裁剪風格:無
- 裁剪縱橫比:無
- 用於正則化數據:否
my-dataset-crop-512
- 重複次數:10
- 圖像總數:732
- 縱橫比桶總數:1
- 分辨率:0.262144兆像素
- 裁剪:是
- 裁剪風格:居中
- 裁剪縱橫比:方形
- 用於正則化數據:否
📄 許可證
許可證類型:其他