🚀 圖像生成模型:Flux-C4C-Design-LoRA
本項目是一個文本到圖像的生成模型,藉助LoRA技術,基於black-forest-labs/FLUX.1-dev
基礎模型進行微調。它能依據特定提示詞生成獨特的圖像,適用於藝術創作、設計等領域。
🚀 快速開始
環境搭建
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/Flux-C4C-Design-LoRA"
trigger_word = "Smiley C4C"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
觸發詞使用
你需要使用Smiley C4C
來觸發圖像生成。
模型下載
該模型的權重以Safetensors格式提供。
點擊下載,可在Files & versions選項卡中獲取。
✨ 主要特性
- 文本到圖像生成:根據輸入的文本提示生成對應的圖像。
- LoRA微調:基於基礎模型進行高效微調,提升特定場景的生成效果。
- 多場景適用:適用於藝術創作、設計等多個領域。
📦 安裝指南
安裝所需依賴庫:
import torch
from pipelines import DiffusionPipeline
💻 使用示例
基礎用法
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/Flux-C4C-Design-LoRA"
trigger_word = "Smiley C4C"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
prompt = f"{trigger_word}, a close-up of a persons head is visible. The person is wearing a gray sweater, adorned with a silver chain around their neck, and a silver helmet on their head. The helmet is adorned with two cork-like objects, each with a light shining on it, adding a touch of warmth to the scene. The background is a dark blue, creating a stark contrast to the silver helmet."
image = pipe(prompt).images[0]
image.save("output.png")
📚 詳細文檔
圖像生成示例
輸入文本 |
輸出圖像 |
Smiley C4C, a close-up of a persons head is visible. The person is wearing a gray sweater, adorned with a silver chain around their neck, and a silver helmet on their head. The helmet is adorned with two cork-like objects, each with a light shining on it, adding a touch of warmth to the scene. The background is a dark blue, creating a stark contrast to the silver helmet. |
點擊查看 |
Smiley C4C, a cartoon character is seen wearing a black t-shirt with an orange and yellow graphic on the front. The character is wearing a helmet that is shaped like a face, with two small round objects sticking out of the helmet. The helmet is adorned with two circular objects on top of it, one of which is a light brown color and the other is a darker brown color. The background is a dark brown. |
點擊查看 |
Smiley C4C, Captured from a low-angle perspective on a vibrant blue backdrop, a man dressed in a white Adidas t-shirt, adorned with a bright yellow helmet and goggles. The helmet is adorned with two white knobs on the top of the helmet, adding a pop of color to the scene. The mans shirt is adorned in a blue collar with a blue adidas logo and a green tennis racket hanging from the bottom right corner of the frame. |
點擊查看 |
Smiley C4C, Captured from a low-angle perspective on a vibrant blue backdrop, a vibrant yellow helmet adorned with a smiley face and a gold chain around the eyes. The helmet is adorned with two handles on either side of the helmet, adorned with gold chains, adding a pop of color to the otherwise monochromatic scene. The shirt below the helmet is a plain yellow t-shirt adorned with the word "Smile" in bold white letters. |
點擊查看 |
圖像生成參數
屬性 |
詳情 |
基礎模型 |
black-forest-labs/FLUX.1-dev |
實例提示詞 |
Smiley C4C |
標籤方式 |
florence2-en(自然語言 & 英語) |
訓練使用的總圖像數 |
14 |
LR調度器 |
constant |
噪聲偏移 |
0.03 |
優化器 |
AdamW |
多分辨率噪聲折扣 |
0.1 |
網絡維度 |
64 |
多分辨率噪聲迭代次數 |
10 |
重複次數 & 步數 |
25 & 3100 |
訓練輪數 |
15 |
每N輪保存一次 |
1 |
最佳尺寸與推理
尺寸 |
長寬比 |
推薦情況 |
1280 x 832 |
3:2 |
最佳 |
1024 x 1024 |
1:1 |
默認 |
推理範圍
📄 許可證
本模型採用creativeml-openrail-m
許可證。